/var/www/(Del)wah-tung.com/html/admin/aboutuscatindexsc.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
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
<?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 (簡體)</b></td>
</tr>
</table>
<?
$pid 
$_GET['pid'];
require(
"fckeditor/fckeditor.php") ;
?>
<?
echo "<p class='content'><a href='aboutuscatindexsc.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">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' 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'>&nbsp;&nbsp;".$row{'aboutusnamesc'}."</td>";
        print 
"<td class='content' bgcolor=#DDDDDD valign='top' align='center'>";
        print 
"<a href='aboutuscatindexsc.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="aboutuscataddsc.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'>:&nbsp;</td>
            <td height="20" class='content'><input type="text" class="content" name="aboutusnamesc" size="30" maxlength="50"></td></tr>
        <tr><td class='content' align="right" valign="top">Sort</td><td class='content' valign="top">:&nbsp;</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="aboutuscatmodifysc.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'>:&nbsp;</td>
        <td height="20" class='content'><input type="text" class="content" name="aboutusnamesc" size="30" maxlength="50" value="<?=$row{'aboutusnamesc'}?>"></td></tr>            
    <tr><td class='content' align="right">Sort</td><td class='content'>:&nbsp;</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'>:&nbsp;</td>
            <td class='content'>&nbsp; Dimension: must be 735px (width) <br><br>
          <?php
            $sBasePath 
$_SERVER['PHP_SELF'] ;
            
$sBasePath "fckeditor/";
            
            
$oFCKeditor = new FCKeditor('aboutusdescsc') ;
            
$oFCKeditor->BasePath    $sBasePath ;
            
$oFCKeditor->Value        str_replace("\r"''preg_replace"/\n/"""$row{'aboutusdescsc'} ));
            
$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='aboutuscatindexsc.php?pid="$row1{'aboutusId'} ."'>"$row1{'aboutusnamesc'} ."</a>";
        }
        else
        {
            
$n "<a href='aboutuscatindexsc.php?pid="$row1{'aboutusId'} ."'>"$row1{'aboutusnamesc'} ."</a>";
        }
    }
    return 
$n;
}
?>