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