/var/www/hkosl.com/innoutstorage/webadmin/otherspage_add.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
    
require_once ("check_login.php");

    
$nowdate date("Y-m-d H:i:s");
    
$page_category $_POST["page_category"];
    
$link_or_page $_POST["link_or_page"];

    
$sql1 "select max(sort) as maxsort from otherspage where page_category = ? and deleted = ? ";
    
$parameters = array($page_category"0");
    
$row bind_pdo($sql$parameters"selectone");
    
$sort $row{"maxsort"} + 1;

    if(
$link_or_page == "link"){
        
$link_to $_POST["link_to"];
        foreach (
$arraylangcode as $langcode => $langname) {
            
$page_title[$langcode] = $_POST["page_".$langcode];
        }
        
$sql "insert into otherspage (link_or_page, page_tc, link_to,page_category, sort, lastupdate, lastupby) values (?, ?, ?, ?, ?, ?, ?) ";
        
$parameters = array($link_or_page$page_title["tc"],$link_to,$page_category$sort$nowdate$_SESSION['cmsloginid']);

    }

    if(
$link_or_page == "page"){
        foreach (
$arraylangcode as $langcode => $langname) {
            
$page_title[$langcode] = $_POST["page_".$langcode];
            
$ospagedesc[$langcode]  = $_POST["ospagedesc_".$langcode];
        }

        
$sql "insert into otherspage (link_or_page, page_tc,ospagedesc_tc,page_category, sort, lastupdate, lastupby) values (?, ?, ?, ?, ?, ?, ?) ";
        
$parameters = array($link_or_page$page_title["tc"], $ospagedesc["tc"],$page_category$sort$nowdate$_SESSION['cmsloginid']);
    }

    
bind_pdo($sql$parameters);

    
$dbh null;

    
header("Location: otherspage_index.php?page_category=$page_category&msg=Modify Successfully");

?>