/var/www/aa-lam.org/admin/pageindex.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
<?
//require 'db_connect.php';
require 'check_login.php';
if (
$logged_in <> 1) {
    
header('Location: login.php');
    return;
}
else
{
?>
<?php 
require("configure.php"); 
$pagecontentid    $_GET['pagecontentid']; ?>
<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="100%">
<tr><td class='headertext' align="left"><b>Page Content</b>
<select name="pagecontentid" onChange="MM_jumpMenu('self',this,0)">
      <option value="pageindex.php?pagecontentid=0" <? if (($pagecontentid=='0') || ($pagecontentid=='')) echo 'selected'?>>All</option>
              <?php
              $sql 
"SELECT * from pagecontent order by pagecontentid desc ";
            
$result1 mysql_query($sql) or die(mysql_error());
            while (
$row1 mysql_fetch_array($result1,MYSQL_ASSOC))
            {
            
?>
        <option value="pageindex.php?pagecontentid=<?=$row1{'pagecontentid'}?><? if ($pagecontentid==$row1{'pagecontentid'}) echo 'selected'?> ><?=$row1{'pagecontenttitle'}?></option>
        <? ?>
      </select></td>
<td class='headertext' align="right"><a href="pageaddform.php"><img src="images/button_insert.png" alt="Add" border="0">&nbsp;Add</a></td>
</tr>
</table>
<?
echo "<p class='content'>"$_GET['msg'] ."</p>";
?>
<table border="0" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
<tr><td class="contentsearch" bgcolor="#FFFFFF" width="50" align="center">Delete</td>    
    <td class="contentsearch" bgcolor="#FFFFFF" width="200" align="center">Page Title</td>
    <td class="contentsearch" bgcolor="#FFFFFF" width="300" align="center">Description</td>
    <td class="contentsearch" bgcolor="#FFFFFF" width="50" align="center">Action</td>
</tr>

<?php

if (($pagecontentid <> "0") && ($pagecontentid <> "")) {
$sql "SELECT * FROM pagecontent where pagecontentid = $pagecontentid order by pagecontentid desc ";
$result mysql_query($sql);
} else {
$result mysql_query("SELECT * FROM pagecontent order by pagecontentid desc ");
}
while (
$row mysql_fetch_array($result,MYSQL_ASSOC))
{

    print 
"<tr>";
    print 
"<td class='content' bgcolor=#DDDDDD valign='top' align='center'>";
    print 
"<a href='pagedeleteconfirm.php?pagecontentid=".$row{'pagecontentid'}."' border='0'>";
    print 
"<img src='images/btnRemove.gif' border='0' alt='Remove'></a></td>";    
    print 
"<td class='content' bgcolor=#DDDDDD valign='top' style='padding-left:5'>".$row{'pagecontenttitle'}."</td>";
    print 
"<td class='content' bgcolor=#DDDDDD valign='top' style='padding-left:5'>";
    
?>
    <?=str_replace("\r"''preg_replace"/\n/"""$row{'pagecontentdesc'}))?>
    <?    
    
print "</td>";
    print 
"<td class='content' bgcolor=#DDDDDD valign='top' align='center'>";
    print 
"<a href='pagemodifyform.php?pagecontentid=".$row{'pagecontentid'}."'>";
    print 
"<img src='images/button_properties.png' border='0' alt='Modify'></a>";
    print 
"</td>";
    print 
"</tr>";
}
mysql_close($dbh);
?>
</table>
</body>
</html>
<?
}
?>