/var/www/(Del)asld.org.hk/webadmin/sldindex.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
<?
//require 'db_connect.php';
require 'check_login.php';
if (
$logged_in <> 1) {
    
header('Location: login.php');
    return;
}
else
{
?>
<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>
</head>
<body>
<table border="0" cellpadding="1" cellspacing="1" width="800">
<tr><td class='pageheader' align="left"><b>學障小百科</b></td>
<td class='pageheader' align="right"><a href="sldaddform.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 border="0" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF">
<tr><td class="contentsearch" bgcolor="#FFFFFF" width="50" align="center">刪除</td>
    <td class="contentsearch" bgcolor="#FFFFFF" width="10" align="center">&nbsp;</td>
    <td class="contentsearch" bgcolor="#FFFFFF" width="300" align="center">標題</td>
    <td class="contentsearch" bgcolor="#FFFFFF" width="50" align="center">修改</td>
</tr>
<?php require("configure.php"); ?>
<?php

$result 
mysql_query("SELECT * FROM sld order by sldid ASC");
//$a = mysql_num_rows($result);
$a 1;
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='slddeleteconfirm.php?sldid=".$row{'sldid'}."' 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'>"$a ."</td>";
    print 
"<td class='content' $color valign='top' style='padding-left:5'>"$row{'sldtitle'} ."</td>";
    print 
"<td class='content' $color valign='top' align='center'>";
    print 
"<a href='sldmodifyform.php?sldid=".$row{'sldid'}."'>";
    print 
"<img src='images/button_properties.gif' border='0' alt='Modify'></a>";
    print 
"</td>";
    print 
"</tr>";
    
$x $x +1;
    
$a++;
}
mysql_close($dbh);
?>
</table>
</body>
</html>
<?
}
?>