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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
<?php require("configure.php"); ?> <html> <head> <link rel="stylesheet" href="main.css" type="text/css"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>oneCMS - Content Management System</title> </head> <body> <table border="0" cellpadding="1" cellspacing="1" width="100%"> <tr> <td class='pageheader' align="left" valign="middle" height="100"><b>About Us Menu (English)</b></td> </tr> </table> <? $pid = $_GET['pid']; require("fckeditor/fckeditor.php") ; ?> <? echo "<p class='content'><a href='aboutuscatindex.php?pid=0'>Categories</a> / ". getLevel($pid) ."</p>"; ?> <table width="800"> <tr><td valign="top" width="450"> <? echo "<p class='content'>". $_GET['msg'] ."</p>"; ?> <table border="0" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF" width="430"> <tr><td class="contentsearch" bgcolor="#FFFFFF" width="10" align="center">Delete</td> <td class="contentsearch" bgcolor="#FFFFFF" width="10" align="center">Sortby</td> <td class="contentsearch" bgcolor="#FFFFFF" width="420" align="center">Categories</td> <td class="contentsearch" bgcolor="#FFFFFF" width="10" align="center">Action</td></tr> <?php $result = mysql_query("select * from aboutus where parentId = ". $pid ." order by sortby");
while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) { print "<tr>"; print "<td class='content' bgcolor=#DDDDDD valign='top' align='center'>"; print "<a href='aboutuscatdeleteform.php?pid=".$row{'parentId'}."&aboutusId=".$row{'aboutusId'}."' 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{'sortby'}."</td>"; print "<td class='content' bgcolor=#DDDDDD valign='top' style='padding-left:5'><img src='images/icon_folder.gif'> ".$row{'aboutusname'}."</td>"; print "<td class='content' bgcolor=#DDDDDD valign='top' align='center'>"; print "<a href='aboutuscatindex.php?pid=".$row{'aboutusId'}."'>"; print "<img src='images/button_properties.gif' border='0' alt='Modify'></a>"; print "</td></tr>"; } //mysql_close($dbh); ?> </table> </td><td valign="top" align="right"> <form action="aboutuscatadd.php" method="post" enctype="multipart/form-data"> <input type="hidden" name="pid" value="<?=$pid?>"> <table border="0" cellpadding="0" cellspacing="0" width="350"> <tr><td height="20" colspan="3" bgcolor=#DDDDDD class='content' style='padding-left:5'><strong>New Category</strong></td> </tr> <tr><td height="20" align="right" class='content'>Category Name</td><td height="20" class='content'>: </td> <td height="20" class='content'><input type="text" class="content" name="aboutusname" size="30" maxlength="50"></td></tr> <tr><td class='content' align="right" valign="top">Sort</td><td class='content' valign="top">: </td> <td class='content'><input type="text" class="content" name="sortby" size="2" maxlength="2"></td></tr> <tr><td colspan="2"></td><td> <input type="submit" value=" Add " class='content'> <input type="reset" value="Reset" class='content'> </td></tr> </table> </form>
</td></tr> <? if ($pid <> 0) { ?> <tr><td colspan="2"><br><br></td></tr>
<tr><td colspan="2"> <? $result = mysql_query("select * from aboutus where aboutusId = ". $pid ." "); $row = mysql_fetch_array($result,MYSQL_ASSOC); ?> <form action="aboutuscatmodify.php" method="post" enctype="multipart/form-data"> <input type="hidden" name="aboutusId" value="<?=$row{'aboutusId'}?>"> <table border="0" cellpadding="0" cellspacing="0" width="800"> <tr><td height="20" colspan="3" bgcolor=#DDDDDD class='content' style='padding-left:5'><strong>Edit Category</strong></td></tr> <tr><td height="20" align="right" class='content'>Category Name</td><td height="20" class='content'>: </td> <td height="20" class='content'><input type="text" class="content" name="aboutusname" size="30" maxlength="50" value="<?=$row{'aboutusname'}?>"></td></tr> <tr><td class='content' align="right">Sort</td><td class='content'>: </td> <td class='content'><input type="text" class="content" name="sortby" value="<?=$row{'sortby'}?>" size="2" maxlength="2"></td></tr> <tr><td align="right" valign="top" class='content'>Description</td><td valign="top" class='content'>: </td> <td class='content'> Dimension: must be 735px (width) <br><br> <?php $sBasePath = $_SERVER['PHP_SELF'] ; $sBasePath = "fckeditor/"; $oFCKeditor = new FCKeditor('aboutusdesc') ; $oFCKeditor->BasePath = $sBasePath ; $oFCKeditor->Value = str_replace("\r", '', preg_replace( "/\n/", "", $row{'aboutusdesc'} )); $oFCKeditor->Width = 740; $oFCKeditor->Height = 500; $oFCKeditor->Create() ; ?> </td></tr> <tr><td colspan="2"></td><td> <input type="submit" value=" Modify " class='content'> <input type="reset" value="Reset" class='content'> </td></tr> </table> </form> </td></tr> <? } ?> </table> </body> </html> <? function getSelect($field1, $field2) { if ($field1 == $field2) { return "selected"; } else { return ""; } } ?> <? function getLevel($p) { $sql1 = "select * from aboutus where aboutusId = ". $p; $result1 = mysql_query($sql1); while ($row1 = mysql_fetch_array($result1,MYSQL_ASSOC)) { if ($row1{parentId} <> 0) { $n = $n . getLevel($row1{'parentId'}) ." / <a href='aboutuscatindex.php?pid=". $row1{'aboutusId'} ."'>". $row1{'aboutusname'} ."</a>"; } else { $n = "<a href='aboutuscatindex.php?pid=". $row1{'aboutusId'} ."'>". $row1{'aboutusname'} ."</a>"; } } return $n; } ?>
|