/var/www/(Del)tsolpv.com/2013/webadmin/footerpage_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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?php
include 'config.php';

// Check if the user is logged in

if ((!isSet($_SESSION['loginname'])) || ($loggin <> '1'))
{
header("Location: login.php");
exit;
}
require(
"configure.php"); 

$fpagepagemodule    htmlspecialchars($_POST["fpagepagemodule"],ENT_QUOTES);
$fpagetitleen        htmlspecialchars($_POST["fpagetitleen"],ENT_QUOTES);
$fpagetitlesc        htmlspecialchars($_POST["fpagetitlesc"],ENT_QUOTES);
$fpagedescen        preg_replace("/'/","\'",$_POST["fpagedescen"]);
$fpagedescsc        preg_replace("/'/","\'",$_POST["fpagedescsc"]);
$fpagebannerlinken        htmlspecialchars($_POST["fpagebannerlinken"],ENT_QUOTES);
$fpagebannerlinksc        htmlspecialchars($_POST["fpagebannerlinksc"],ENT_QUOTES);
$metatitleen        htmlspecialchars($_POST["metatitleen"],ENT_QUOTES);
$metakeyworden        htmlspecialchars($_POST["metakeyworden"],ENT_QUOTES);
$metadescen            htmlspecialchars($_POST["metadescen"],ENT_QUOTES);
$metatitlesc        htmlspecialchars($_POST["metatitlesc"],ENT_QUOTES);
$metakeywordsc        htmlspecialchars($_POST["metakeywordsc"],ENT_QUOTES);
$metadescsc            htmlspecialchars($_POST["metadescsc"],ENT_QUOTES);
$fpagesort        $_POST["fpagesort"];
$nowdate             date("Y-m-d H:i:s");
//print_r($_POST); 

$sql "select max(fpageid) as maxid ";
$sql .= "from footerpage ";
$result=mysql_query($sql);
$row mysql_fetch_array($result,MYSQL_ASSOC);
$fpageid $row{maxid}+1;

if (
$_FILES['fpagebanneren']['name'] <> '')
{
    if ((
$_FILES["fpagebanneren"]["type"] == "image/bmp") || ($_FILES["fpagebanneren"]["type"] == "image/BMP") || ($_FILES["fpagebanneren"]["type"] == "image/gif") || ($_FILES["fpagebanneren"]["type"] == "image/GIF") || ($_FILES["fpagebanneren"]["type"] == "image/jpg") || ($_FILES["fpagebanneren"]["type"] == "image/JPG") || ($_FILES["fpagebanneren"]["type"] == "image/jpeg") || ($_FILES["fpagebanneren"]["type"] == "image/JPEG") || ($_FILES["fpagebanneren"]["type"] == "image/pjpeg") || ($_FILES["fpagebanneren"]["type"] == "image/PJEG") || ($_FILES["fpagebanneren"]["type"] == "image/png") || ($_FILES["fpagebanneren"]["type"] == "image/x-png") || ($_FILES["fpagebanneren"]["type"] == "image/PNG") || ($_FILES["fpagebanneren"]["type"] == "image/X-PNG"))
    {
        
$filename=$_FILES['fpagebanneren']['name'];
        
preg_match("/\.([^\.]+)$/"$filename$file_ext);
        
        
copy ($_FILES['fpagebanneren']['tmp_name'], "../pagebanner/fpageid_".$fpageid."_en.".$file_ext[1]) 
                or die (
"Could not copy the file: 页底 Banner(EN)"); 
        
        
$fpagebanneren     "fpageid_".$fpageid."_en.".$file_ext[1];
        
$fpagebanneren    htmlspecialchars($fpagebanneren,ENT_QUOTES);
      }
    else
      {
      
// upload error
      
?>
        <script language="javascript">
        alert("Files must be BMP, JPEG, GIF, or PNG");
        history.back();
        </script>
     <?php
     
exit;
     }

}
else
{
    
$fpagebanneren "";
}

if (
$_FILES['fpagebannersc']['name'] <> '')
{
    if ((
$_FILES["fpagebannersc"]["type"] == "image/bmp") || ($_FILES["fpagebannersc"]["type"] == "image/BMP") || ($_FILES["fpagebannersc"]["type"] == "image/gif") || ($_FILES["fpagebannersc"]["type"] == "image/GIF") || ($_FILES["fpagebannersc"]["type"] == "image/jpg") || ($_FILES["fpagebannersc"]["type"] == "image/JPG") || ($_FILES["fpagebannersc"]["type"] == "image/jpeg") || ($_FILES["fpagebannersc"]["type"] == "image/JPEG") || ($_FILES["fpagebannersc"]["type"] == "image/pjpeg") || ($_FILES["fpagebannersc"]["type"] == "image/PJEG") || ($_FILES["fpagebannersc"]["type"] == "image/png") || ($_FILES["fpagebannersc"]["type"] == "image/x-png") || ($_FILES["fpagebannersc"]["type"] == "image/PNG") || ($_FILES["fpagebannersc"]["type"] == "image/X-PNG"))
    {
        
$filename=$_FILES['fpagebannersc']['name'];
        
preg_match("/\.([^\.]+)$/"$filename$file_ext);
        
        
copy ($_FILES['fpagebannersc']['tmp_name'], "../pagebanner/fpageid_".$fpageid."_sc.".$file_ext[1]) 
                or die (
"Could not copy the file: 页底 Banner(EN)"); 
        
        
$fpagebannersc     "fpageid_".$fpageid."_sc.".$file_ext[1];
        
$fpagebannersc    htmlspecialchars($fpagebannersc,ENT_QUOTES);
      }
    else
      {
      
// upload error
      
?>
        <script language="javascript">
        alert("Files must be BMP, JPEG, GIF, or PNG");
        history.back();
        </script>
     <?php
     
exit;
     }

}
else
{
    
$fpagebannersc "";
}
// Sort
if ($fpagesort == '' || $fpagesort == '0') {
    
$sql "select max(fpagesort) as maxid ";
    
$sql .= "from footerpage ";
    
$result=mysql_query($sql);
    
$row mysql_fetch_array($result,MYSQL_ASSOC);
    
$fpagesort $row{maxid}+1;
}
if( 
mysql_num_rows(mysql_query("SELECT fpageid FROM footerpage WHERE fpagesort=$fpagesort ")) > 0){
    
mysql_query("UPDATE footerpage SET fpagesort= fpagesort+1 WHERE fpagesort >=$fpagesort ");
}

$sql "insert into footerpage (fpageid, fpagepagemodule, fpagetitleen, fpagetitlesc, fpagedescen, fpagedescsc, fpagebanneren, fpagebannersc, fpagebannerlinken, fpagebannerlinksc, fpagesort, fpagestatus, metatitleen, metatitlesc, metakeyworden, metakeywordsc, metadescen, metadescsc, creationday, modifyday, cmsloginid) values ('$fpageid', '$fpagepagemodule', '$fpagetitleen', '$fpagetitlesc', '$fpagedescen', '$fpagedescsc', '$fpagebanneren', '$fpagebannersc', '$fpagebannerlinken', '$fpagebannerlinksc', '$fpagesort', '1', '$metatitleen', '$metatitlesc', '$metakeyworden', '$metakeywordsc', '$metadescen', '$metadescsc', '$nowdate', '$nowdate', '".$_SESSION['cmsloginid']."')";
mysql_query($sql);
if( 
mysql_errno() > ){
    echo 
'Add 页底 Error:<br />'mysql_error() .'<br />SQL: '$sql;
    exit;
}

mysql_close($dbh);

header("Location: footerpage_index.php?msg=建立成功");
?>