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
|
<?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");
$footpageid = $_GET['footpageid']; $sort = $_GET['sort']; $status = $_GET['status']; $nowdate = date("Y-m-d H:i:s");
if ($status == 'up') { $s_sign="+1"; $footpagesort = $sort-1; if ($footpagesort <=0) { $footpagesort = 1; } } else { $s_sign="-1"; $footpagesort = $sort+1; }
$sql = "update footpage set footpagesort='$footpagesort', modifyday='$nowdate', cmsloginid = '".$_SESSION['cmsloginid']."' "; $sql .= "where footpageid='". $footpageid ."' ";
//echo $sql; //exit; if( mysql_num_rows(mysql_query("SELECT footpageid FROM footpage WHERE footpagesort=$footpagesort AND footpageid!='$footpageid' ")) > 0){ mysql_query("UPDATE footpage SET footpagesort= footpagesort".$s_sign ." WHERE footpagesort = $footpagesort "); } mysql_query($sql); mysql_close($dbh);
header("Location: footpage_index.php?msg=Update Successful"); ?>
|