/var/www/(Del)tsolpv.com/2013/webadmin/aboutus_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"); 

$abopagemodule    htmlspecialchars($_POST["abopagemodule"],ENT_QUOTES);
$abotitleen        htmlspecialchars($_POST["abotitleen"],ENT_QUOTES);
$abotitlesc        htmlspecialchars($_POST["abotitlesc"],ENT_QUOTES);
$abodescen        preg_replace("/'/","\'",$_POST["abodescen"]);
$abodescsc        preg_replace("/'/","\'",$_POST["abodescsc"]);
$abobannerlinken        htmlspecialchars($_POST["abobannerlinken"],ENT_QUOTES);
$abobannerlinksc        htmlspecialchars($_POST["abobannerlinksc"],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);
$abosort        $_POST["abosort"];
$nowdate             date("Y-m-d H:i:s");
//print_r($_POST); 

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

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

}
else
{
    
$abobanneren "";
}

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

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

$sql "insert into aboutus (aboid, abopagemodule, abotitleen, abotitlesc, abodescen, abodescsc, abobanneren, abobannersc, abobannerlinken, abobannerlinksc, abosort, abostatus, metatitleen, metatitlesc, metakeyworden, metakeywordsc, metadescen, metadescsc, creationday, modifyday, cmsloginid) values ('$aboid', '$abopagemodule', '$abotitleen', '$abotitlesc', '$abodescen', '$abodescsc', '$abobanneren', '$abobannersc', '$abobannerlinken', '$abobannerlinksc', '$abosort', '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: aboutus_index.php?msg=建立成功");
?>