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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
|
<?php session_start(); if(!isset($_SESSION['adminID'])){ session_destroy(); ?><script language="javascript"> window.location.href='index.php'; </script> <?php }else{ require_once("config.inc.php"); include("function.inc.php"); $link = mysql_connect($cfgServers['host'],$cfgServers['stduser'],$cfgServers['stdpass'])or die("Can't connect Server"); mysql_select_db($cfgServers['selectdb']) or die("Can't connect databases"); //////----------------------config path-------------------------- $path_product='../uploadfile/'; $path_product_thb='../uploadfile/thb/'; //------------------------query menu----------------------// if(($_SESSION['admin_type']==1)||($_SESSION['admin_type']=='999')){ $queryMenu="SELECT a.id CID, a.cate_name, a.mainCateId, b.mainCateID AS mainSubCID, a.number, b.txt_get , b.id AS subCID, b.cate_name AS SubCateName, b.number Subnumber " ." FROM tbl_menu_admin a LEFT JOIN tbl_menu_admin b ON b.mainCateId = a.id WHERE a.mainCateID = '0' ORDER BY a.number ASC , b.number ASC "; $resultMenu=mysql_query($queryMenu); }else{ $queryMenu="SELECT a.id CID, a.cate_name, a.mainCateId, b.mainCateID AS mainSubCID, a.number , b.txt_get , b.id AS subCID, b.cate_name AS SubCateName, b.number Subnumber , c.user_id UID " ." FROM tbl_menu_admin a " ." LEFT JOIN tbl_menu_admin b ON b.mainCateId = a.id " ." LEFT JOIN tbl_menu_grant c ON c.menu_id = a.id " ." WHERE c.user_id='".$_SESSION['adminID']."' ORDER BY a.number ASC , b.number ASC "; $resultMenu=mysql_query($queryMenu);
} ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>::: BENJABHORN ::: ADMIN :::</title> <link href="style.css" rel="stylesheet" type="text/css" /> <script language="javascript"> function windowOpener(windowHeight, windowWidth, windowName, windowUri) { var centerWidth = (window.screen.width - windowWidth) / 2; var centerHeight = (window.screen.height - windowHeight) / 2; newWindow = window.open(windowUri, windowName, 'resizable=1 ,scrollbars=1,width=' + windowWidth + ',height=' + windowHeight + ',left=' +centerWidth + ',top=' + centerHeight); newWindow.focus(); return newWindow.name; } </script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="ddaccordion.js"> /*********************************************** * Accordion Content script- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com) * Visit http://www.dynamicDrive.com for hundreds of DHTML scripts * This notice must stay intact for legal use ***********************************************/ </script> <script type="text/javascript"> ddaccordion.init({ headerclass: "expandable", //Shared CSS class name of headers group that are expandable contentclass: "categoryitems", //Shared CSS class name of contents group revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover" mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover collapseprev: true, //Collapse previous content (so only one open at any time)? true/false defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc]. [] denotes no content onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed) animatedefault: false, //Should contents open by default be animated into view? persiststate: true, //persist state of opened contents within browser session? toggleclass: ["", "openheader"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"] togglehtml: ["prefix", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively ["position", "html1", "html2"] (see docs) animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow" oninit:function(headers, expandedindices){ //custom code to run when headers have initalized //do nothing }, onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed //do nothing } })
</script>
<style type="text/css">
.arrowlistmenu{ width: 180px; /*width of accordion menu*/ }
.arrowlistmenu .menuheader{ /*CSS class for menu headers in general (expanding or not!)*/ font: bold 14px Arial; color: white; background: black url(titlebar.png) repeat-x center left; margin-bottom: 10px; /*bottom spacing between header and rest of content*/ text-transform: uppercase; padding: 4px 0 4px 10px; /*header text is indented 10px*/ cursor: hand; cursor: pointer; }
.arrowlistmenu .openheader{ /*CSS class to apply to expandable header when it's expanded*/ background-image: url(titlebar-active.png); }
.arrowlistmenu ul{ /*CSS for UL of each sub menu*/ list-style-type: none; margin: 0; padding: 0; margin-bottom: 8px; /*bottom spacing between each UL and rest of content*/ }
.arrowlistmenu ul li{ padding-bottom: 2px; /*bottom spacing between menu items*/ }
.arrowlistmenu ul li a{ color: #A70303; background: url(arrowbullet.png) no-repeat center left; /*custom bullet list image*/ display: block; padding: 2px 0; padding-left: 19px; /*link text is indented 19px*/ text-decoration: none; font-weight: bold; border-bottom: 1px solid #dadada; font-size: 90%; }
.arrowlistmenu ul li a:visited{ color: #A70303; }
.arrowlistmenu ul li a:hover{ /*hover state CSS*/ color: #A70303; background-color: #F3F3F3; }
</style><script language="JavaScript" type="text/javascript" src="wysiwyg2.js"></script> <script language="Javascript1.2"><!-- // load htmlarea //_editor_url = "http://localhost/cv4/citymall/lib/htmlarea/"; // URL to htmlarea files _editor_url = 'htmlarea/'; var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]); if (navigator.userAgent.indexOf('Mac') >= 0) { win_ie_ver = 0; } if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; } if (navigator.userAgent.indexOf('Opera') >= 0) { win_ie_ver = 0; } if (win_ie_ver >= 5.5) { document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"'); document.write(' language="Javascript1.2"></scr' + 'ipt>'); } else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); } // --></script>
</head> </head>
<body onLoad="show_clock()"> <table width="959" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td bgcolor="#E3E3E3"><table width="945" height="99" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01"> <tr> <td width="429"><img src="images/admi_head_01.jpg" width="429" height="99" alt="" /></td> <td width="397" height="99" valign="bottom" background="images/bg_x.jpg"><table width="100%" border="0" cellspacing="3" cellpadding="3"> <tr> <td width="65%" align="right"> </td> </tr> <tr> <td align="right" class="txt10-brown">Hello : <?php echo $_SESSION['admin_name']?> </td> </tr> <tr> <td align="right"><script language="JavaScript" src="liveclock.js" type="text/javascript">
/* Live Clock Script- By Mark Plachetta (astro@bigpond.net.au?) based on code from DynamicDrive.com For full source code, 100's more DHTML scripts, and Terms Of Use, visit http://www.dynamicdrive.com */
</script> </td> </tr> </table></td> <td width="119" height="99" align="right" valign="bottom" background="images/bg_x.jpg"> <a href="logout.php">Log out</a> <img src="images/sign-out.png" alt="Logout" width="32" height="32" align="absmiddle" /> </td> </tr> </table></td> </tr> <tr> <td bgcolor="#e3e3e3"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="206" align="left" valign="top"> <img src="images/main/spacer.gif" width="1" height="10" alt="" /> <div class="arrowlistmenu"> <?php $n=1; $chekMainID='';$firstCateID=''; while($menu=mysql_fetch_assoc($resultMenu)){ if( $chekMainID!=$menu['CID']){ if($n > 1){ echo "</ul>"; } ?> <h3 class="menuheader expandable"><img src="images/black_icon/16x16/brackets2.png" width="16" height="16" hspace="5" align="absmiddle" /><?php echo $menu['cate_name']?></h3> <ul class="categoryitems"> <?php } if($menu['SubCateName']){ ?> <li><a href="<?php $_SERVER['PHP_SELF']?>?work=<?php echo $menu['txt_get']?>&MenuID=<?php echo $menu['subCID']?>"> <?php echo $menu['SubCateName']?></a></li> <?php } $chekMainID=$menu['CID']; $n++; } ?> </ul> <h3 class="menuheader expandable"><img src="images/black_icon/16x16/brackets2.png" width="16" height="16" hspace="5" align="absmiddle" />Admin User</h3> <ul class="categoryitems"> <?php if(($_SESSION['admin_type']==1)||($_SESSION['admin_type']=='999')){ ?> <li><a href="main.php?work=User">เพิ่ม admin</a></li> <li><a href="main.php?work=UserGrant">กำหนดสิทธิ user</a></li> <?php }?> <li><a href="main.php?work=chpass">เปลียนรหัสผ่าน</a></li> <?php if($_SESSION['admin_type']=='999'){ ?> <li><a href="main.php?work=addMenu">เพิ่มเมนู</a></li> <?php }?> </ul> </div> </td> <td width="754" valign="top"><table id="Table_" width="745" border="0" cellpadding="0" cellspacing="0"> <tr> <td colspan="3"><img src="images/main/center_main_01.png" width="745" height="14" alt="" /></td> </tr> <tr> <td width="10" bgcolor="#E3E3E3"> </td> <td width="727" height="550" valign="top" bgcolor="#FFFFFF" class="copyRight"> <?php if(($_SESSION['admin_type']!=1)&&($_SESSION['admin_type']!='999')){ if($_GET['MenuID']){ $query="SELECT * FROM tbl_menu_admin WHERE id='".$_GET['MenuID']."' "; $resultInc=mysql_query($query); $dataInc=mysql_fetch_assoc($resultInc); include($dataInc['file_include']); } }else{ if($_GET['MenuID']){ $query="SELECT * FROM tbl_menu_admin WHERE id='".$_GET['MenuID']."' "; $resultInc=mysql_query($query); $dataInc=mysql_fetch_assoc($resultInc); include($dataInc['file_include']); } } switch($_GET['work']) { //-----------------user & menu---------------// case 'UserGrant' : include("UserGrant.php"); break; case 'addMenu' : include("addMenu.php"); break; case 'addSubMenu' : include("addSubMenu.php"); break; case 'userToMenu' : include("userToMenu.php"); break; case 'articleAdd' : include("newsAdd.php"); break; case 'addProduct' : include("productAdd.php"); break; case 'project_Add' : include("project_add.php"); break; case 'blockDetail' : include("blockDetail.php"); break; case 'blockListDetail' : include("blockListDetail.php"); break; case 'hotNewsAdd' : include("hot_newsAdd.php"); break; case 'Hot_newsList' : include("hot_newsList.php"); break; case 'project_home_type' : include("project_home_type.php"); break; case 'project_home_list' : include("project_home_list.php"); break; case 'project_plan' : include("project_plan.php"); break; case 'project_gallery' : include("project_gallery.php"); break; case 'progress' : include("progress.php"); break; case 'knowledgeAddd' : include("knowledge.php"); break; case 'carreerAdd.' : include("carreer_add.php"); break; //-----------------user---------------// case 'User' : include("user.php"); break; case 'chpass' : include("chpass.php"); break; } ?></td> <td bgcolor="#E3E3E3" width="8"> </td> </tr> <tr> <td colspan="3"><img src="images/main/center_main_05.png" width="745" height="15" alt="" /></td> </tr> </table></td> </tr> </table> </td> </tr> <tr> <td> </td> </tr> <tr> <td height="40" align="center" bgcolor="#36454C" class="txt-8"><a href="http://www.me-fi.com" target="_blank">Developed by ME-FI dot com</a></td> </tr> </table> </body> </html> <?php mysql_close()?> <?php } ?>
|