/var/www/(Del)asld.org.hk/webadmin/districtindex.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
<?
//require 'db_connect.php';
require 'check_login.php';
if (
$logged_in <> 1) {
    
header('Location: login.php');
    return;
}
else
{
?>
<?php 
require("configure.php");
$discatid    $_GET['discatid']; ?>
<html>
<head>
<link rel="stylesheet" href="main.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Admin Page</title>
<script type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>
<body>
<table border="0" cellpadding="1" cellspacing="1" width="800">
<tr><td class='pageheader' align="left"><p><b>分區活動(內容)</b></p>
  <p><select name="discatid" onChange="MM_jumpMenu('self',this,0)">
      <option value="districtindex.php?discatid=0" <? if (($discatid=='0') || ($discatid=='')) echo 'selected'?>>All</option>
              <?php
              $sql 
"SELECT * from districtcat order by discatid desc ";
            
$result1 mysql_query($sql) or die(mysql_error());
            while (
$row1 mysql_fetch_array($result1,MYSQL_ASSOC))
            {
            
?>
        <option value="districtindex.php?discatid=<?=$row1{'discatid'}?><? if ($discatid==$row1{'discatid'}) echo 'selected'?> ><?=$row1{'discatname'}?></option>
        <? ?>
      </select></p></td>
<td align="right" valign="top" class='pageheader'><a href="districtaddform.php"><img src="images/iconNew.jpg" alt="Add" width="32" height="32" border="0" align="absmiddle">&nbsp;新增</a></td>
</tr>
</table>
<?
echo "<p class='msg'>"$_GET['msg'] ."</p>";
?>
<table width="800" border="0" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF">
<tr><td class="contentsearch" bgcolor="#FFFFFF" width="20" align="center">刪除</td>
    <td class="contentsearch" bgcolor="#FFFFFF" width="80" align="center">分區</td>
    <td class="contentsearch" bgcolor="#FFFFFF" width="10" align="center">次序</td>
    <td class="contentsearch" bgcolor="#FFFFFF" width="180" align="center">活動主題</td>    
    <td class="contentsearch" bgcolor="#FFFFFF" width="50" align="center">修改</td>
</tr>
<?php
if (($discatid <> "0") && ($discatid <> "")) {
$sql "SELECT * FROM district INNER JOIN districtcat on district.discatid = districtcat.discatid where districtcat.discatid = $discatid order by districtcat.discatsort ASC, districtcat.discatid ASC, district.dissort ASC, district.disid DESC ";
$result mysql_query($sql);
} else {
$result mysql_query("SELECT * FROM district INNER JOIN districtcat on district.discatid = districtcat.discatid order by districtcat.discatsort ASC, districtcat.discatid ASC, district.dissort ASC, district.disid DESC ");
}
while (
$row mysql_fetch_array($result,MYSQL_ASSOC))
{
    if (
$x ==1)    {
        
$color "bgcolor=#DDDDDD";
    } else {
        
$color "bgcolor=#EAEAEA";
    }
    print 
"<tr>";
    print 
"<td class='content' $color valign='top' align='center'>";
    print 
"<a href='districtdeleteconfirm.php?discatid=".$row{'discatid'}."&disid=".$row{'disid'}."' border='0'>";
    print 
"<img src='images/btnRemove.gif' border='0' alt='Remove'></a></td>";
    print 
"<td class='content' $color valign='top' style='padding-left:5'>"$row{'discatname'} ."</td>";
    print 
"<td class='content' $color valign='top' align='center' style='padding-left:5'>"$row{'dissort'} ."</td>";
    print 
"<td class='content' $color valign='top' style='padding-left:5'>"$row{'distopic'} ."</td>";
    print 
"<td class='content' $color valign='top' align='center'>";
    print 
"<a href='districtmodifyform.php?discatid=".$row{'discatid'}."&disid=".$row{'disid'}."'>";
    print 
"<img src='images/button_properties.gif' border='0' alt='Modify'></a>";
    print 
"</td>";
    print 
"</tr>";
    
$x $x +1;
}
mysql_close($dbh);
?>
</table>
</body>
</html>
<?
}
?>