index.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  1. <?php
  2. require_once('conn.php');
  3. checkLogin("");
  4. $iframe = $_GET['iframe'] ?? '';
  5. // Common HTML header
  6. $html_header = <<<HTML
  7. <!DOCTYPE html>
  8. <html xmlns="http://www.w3.org/1999/xhtml">
  9. <head>
  10. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  11. <link rel="stylesheet" href="css/common.css" type="text/css" />
  12. HTML;
  13. switch($iframe) {
  14. case 'top':
  15. echo $html_header;
  16. ?>
  17. <title><?php echo $webname; ?> - 网站后台管理</title>
  18. </head>
  19. <body>
  20. <h1 style="padding:0;margin:0;height:50px;line-height:50px;text-indent:20px;font-size:20px;font-family:Arial;color:#0099CC"><?php echo $webname; ?></h1>
  21. </body>
  22. <?php
  23. break;
  24. case 'left':
  25. echo $html_header;
  26. ?>
  27. <title>左侧导航栏</title>
  28. </head>
  29. <script type="text/javascript">
  30. var preClassName = "";
  31. function list_sub_detail(Id, item)
  32. {
  33. if(preClassName != "")
  34. {
  35. getObject(preClassName).className = "left_back"
  36. }
  37. if(getObject(Id).className == "left_back")
  38. {
  39. getObject(Id).className = "left_back_onclick";
  40. outlookbar.getbyitem(item);
  41. preClassName = Id
  42. }
  43. }
  44. function getObject(objectId)
  45. {
  46. if(document.getElementById && document.getElementById(objectId))
  47. {
  48. return document.getElementById(objectId)
  49. }
  50. else if(document.all && document.all(objectId))
  51. {
  52. return document.all(objectId)
  53. }
  54. else if(document.layers && document.layers[objectId])
  55. {
  56. return document.layers[objectId]
  57. }
  58. else
  59. {
  60. return false
  61. }
  62. }
  63. function outlook()
  64. {
  65. this.titlelist = new Array();
  66. this.itemlist = new Array();
  67. this.addtitle = addtitle;
  68. this.additem = additem;
  69. this.getbytitle = getbytitle;
  70. this.getbyitem = getbyitem;
  71. this.getdefaultnav = getdefaultnav
  72. }
  73. function theitem(intitle, insort, inkey, inisdefault)
  74. {
  75. this.sortname = insort;
  76. this.key = inkey;
  77. this.title = intitle;
  78. this.isdefault = inisdefault
  79. }
  80. function addtitle(intitle, sortname, inisdefault)
  81. {
  82. outlookbar.itemlist[outlookbar.titlelist.length] = new Array();
  83. outlookbar.titlelist[outlookbar.titlelist.length] = new theitem(intitle, sortname, 0, inisdefault);
  84. return(outlookbar.titlelist.length - 1)
  85. }
  86. function additem(intitle, parentid, inkey)
  87. {
  88. if(parentid >= 0 && parentid <= outlookbar.titlelist.length)
  89. {
  90. insort = "item_" + parentid;
  91. outlookbar.itemlist[parentid][outlookbar.itemlist[parentid].length] = new theitem(intitle, insort, inkey, 0);
  92. return(outlookbar.itemlist[parentid].length - 1)
  93. }
  94. else additem = - 1
  95. }
  96. function getdefaultnav(sortname)
  97. {
  98. var output = "";
  99. for(i = 0; i < outlookbar.titlelist.length; i ++ )
  100. {
  101. if(outlookbar.titlelist[i].isdefault == 1 && outlookbar.titlelist[i].sortname == sortname)
  102. {
  103. output += "<div class=list_tilte id=sub_sort_" + i + " onclick=\"hideorshow('sub_detail_"+i+"')\">";
  104. output += "<span>" + outlookbar.titlelist[i].title + "</span>";
  105. output += "</div>";
  106. output += "<div class=list_detail id=sub_detail_" + i + "><ul>";
  107. for(j = 0; j < outlookbar.itemlist[i].length; j ++ )
  108. {
  109. output += "<li id=" + outlookbar.itemlist[i][j].sortname + j + " onclick=\"changeframe('"+outlookbar.itemlist[i][j].title+"', '"+outlookbar.titlelist[i].title+"', '"+outlookbar.itemlist[i][j].key+"')\"><a href=#>" + outlookbar.itemlist[i][j].title + "</a></li>"
  110. }
  111. output += "</ul></div>"
  112. }
  113. }
  114. getObject('right_main_nav').innerHTML = output
  115. }
  116. function getbytitle(sortname)
  117. {
  118. var output = "<ul>";
  119. for(i = 0; i < outlookbar.titlelist.length; i ++ )
  120. {
  121. if(outlookbar.titlelist[i].sortname == sortname)
  122. {
  123. output += "<li id=left_nav_" + i + " onclick=\"list_sub_detail(id, '"+outlookbar.titlelist[i].title+"')\" class=left_back>" + outlookbar.titlelist[i].title + "</li>"
  124. }
  125. }
  126. output += "</ul>";
  127. getObject('left_main_nav').innerHTML = output
  128. }
  129. function getbyitem(item)
  130. {
  131. var output = "";
  132. for(i = 0; i < outlookbar.titlelist.length; i ++ )
  133. {
  134. if(outlookbar.titlelist[i].title == item)
  135. {
  136. output = "<div class=list_tilte id=sub_sort_" + i + " onclick=\"hideorshow('sub_detail_"+i+"')\">";
  137. output += "<span>" + outlookbar.titlelist[i].title + "</span>";
  138. output += "</div>";
  139. output += "<div class=list_detail id=sub_detail_" + i + " style='display:block;'><ul>";
  140. for(j = 0; j < outlookbar.itemlist[i].length; j ++ )
  141. {
  142. output += "<li id=" + outlookbar.itemlist[i][j].sortname + "_" + j + " onclick=\"changeframe('"+outlookbar.itemlist[i][j].title+"', '"+outlookbar.titlelist[i].title+"', '"+outlookbar.itemlist[i][j].key+"')\"><a href=#>" + outlookbar.itemlist[i][j].title + "</a></li>"
  143. }
  144. output += "</ul></div>"
  145. }
  146. }
  147. getObject('right_main_nav').innerHTML = output
  148. }
  149. function changeframe(item, sortname, src)
  150. {
  151. if(item != "" && sortname != "")
  152. {
  153. window.top.frames['mainFrame'].getObject('show_text').innerHTML = sortname + " <img src=images/slide.gif broder=0 /> " + item
  154. }
  155. if(src != "")
  156. {
  157. window.top.frames['manFrame'].location = src
  158. }
  159. }
  160. function hideorshow(divid)
  161. {
  162. subsortid = "sub_sort_" + divid.substring(11);
  163. if(getObject(divid).style.display == "none")
  164. {
  165. getObject(divid).style.display = "block";
  166. getObject(subsortid).className = "list_tilte"
  167. }
  168. else
  169. {
  170. getObject(divid).style.display = "none";
  171. getObject(subsortid).className = "list_tilte_onclick"
  172. }
  173. }
  174. function initinav(sortname)
  175. {
  176. outlookbar.getdefaultnav(sortname);
  177. outlookbar.getbytitle(sortname);
  178. }
  179. var outlookbar = new outlook();
  180. var t;
  181. t = outlookbar.addtitle('信息管理','信息管理',1);
  182. <?php if(chkLogin("信息管理")): ?>
  183. outlookbar.additem('来源管理',t,'qudao.php');
  184. outlookbar.additem('客户列表',t,'customers.php');
  185. outlookbar.additem('数据看板',t,'dashboard.php');
  186. outlookbar.additem('登录日志',t,'log.php');
  187. <?php endif; ?>
  188. t = outlookbar.addtitle('报价管理','信息管理',1);
  189. <?php if(chkLogin("信息管理")): ?>
  190. outlookbar.additem('添加产品',t,'products.php');
  191. outlookbar.additem('报价管理',t,'country.php');
  192. <?php endif; ?>
  193. t = outlookbar.addtitle('系统管理','其它管理',1);
  194. <?php if(chkLogin("系统管理")): ?>
  195. outlookbar.additem('查看系统设置',t,'inc.php');
  196. <?php endif; ?>
  197. t = outlookbar.addtitle('权限管理','其它管理',1);
  198. <?php if(chkLogin("权限管理")): ?>
  199. outlookbar.additem('员工管理',t,'employee.php');
  200. <?php endif; ?>
  201. </script>
  202. <body onload="initinav('信息管理')">
  203. <div id="left_content">
  204. <div id="user_info">欢迎您,<strong><?php echo loadSession("loginname"); ?></strong><br />[<a href="pwd.php" target="manFrame">个人中心</a>,<a href="login.php?act=logout" target="_top" onClick="if(!confirm('确认要退出吗?'))return false;">退出管理</a>]</div>
  205. <div id="main_nav">
  206. <div id="left_main_nav"></div>
  207. <div id="right_main_nav"></div>
  208. </div>
  209. </div>
  210. </body>
  211. <?php
  212. break;
  213. case 'switch':
  214. echo $html_header;
  215. ?>
  216. <title>显示/隐藏左侧导航栏</title>
  217. </head>
  218. <script language="JavaScript">
  219. function Submit_onclick(){
  220. if(parent.myFrame.cols == "199,7,*") {
  221. parent.myFrame.cols="0,7,*";
  222. document.getElementById("ImgArrow").src="images/switch_right.gif";
  223. document.getElementById("ImgArrow").alt="打开左侧导航栏";
  224. } else {
  225. parent.myFrame.cols="199,7,*";
  226. document.getElementById("ImgArrow").src="images/switch_left.gif";
  227. document.getElementById("ImgArrow").alt="隐藏左侧导航栏";
  228. }
  229. }
  230. function MyLoad() {
  231. if(window.parent.location.href.indexOf("MainUrl")>0) {
  232. window.top.midFrame.document.getElementById("ImgArrow").src="images/switch_right.gif";
  233. }
  234. }
  235. </script>
  236. <body onload="MyLoad()">
  237. <div id="switchpic"><a href="javascript:Submit_onclick()"><img src="images/switch_left.gif" alt="隐藏左侧导航栏" id="ImgArrow" /></a></div>
  238. </body>
  239. <?php
  240. break;
  241. case 'main':
  242. echo $html_header;
  243. ?>
  244. <title>管理导航区域</title>
  245. <script type="text/javascript">
  246. var preClassName = "man_nav_1";
  247. function list_sub_nav(Id,sortname){
  248. if(preClassName != ""){
  249. getObject(preClassName).className="bg_image";
  250. }
  251. if(getObject(Id).className == "bg_image"){
  252. getObject(Id).className="bg_image_onclick";
  253. preClassName = Id;
  254. showInnerText(Id);
  255. window.top.frames['leftFrame'].outlookbar.getbytitle(sortname);
  256. window.top.frames['leftFrame'].outlookbar.getdefaultnav(sortname);
  257. }
  258. }
  259. function showInnerText(Id){
  260. var switchId = parseInt(Id.substring(8));
  261. var showText = "对不起没有信息!";
  262. switch(switchId){
  263. case 1:
  264. showText = "请点击左侧菜单进行网站信息管理";
  265. break;
  266. case 2:
  267. showText = "请点击左侧菜单进行其它信息管理";
  268. break;
  269. }
  270. getObject('show_text').innerHTML = showText;
  271. }
  272. function getObject(objectId) {
  273. if(document.getElementById && document.getElementById(objectId)) {
  274. return document.getElementById(objectId);
  275. } else if (document.all && document.all(objectId)) {
  276. return document.all(objectId);
  277. } else if (document.layers && document.layers[objectId]) {
  278. return document.layers[objectId];
  279. } else {
  280. return false;
  281. }
  282. }
  283. </script>
  284. </head>
  285. <body>
  286. <div id="nav">
  287. <ul>
  288. <li id="man_nav_1" onclick="list_sub_nav(id,'信息管理')" class="bg_image_onclick">信息管理</li>
  289. <li id="man_nav_2" onclick="list_sub_nav(id,'其它管理')" class="bg_image">其它管理</li>
  290. <li class="bg_image"><a href="index.php?iframe=man" target="manFrame">回到桌面</a></li>
  291. <li class="bg_image"><a href="../index.html" target="_blank">打开前台</a></li>
  292. </ul>
  293. </div>
  294. <div id="sub_info">&nbsp;&nbsp;<img src="images/hi.gif" />&nbsp;<span id="show_text">请点击左侧或下面菜单进行网站信息管理</span></div>
  295. </body>
  296. <?php
  297. break;
  298. case 'man':
  299. echo $html_header;
  300. ?>
  301. <title>管理区域</title>
  302. <script type="text/javascript">
  303. function golink(t){
  304. window.top.frames['mainFrame'].getObject('show_text').innerHTML = t;
  305. }
  306. function getObject(objectId) {
  307. if(document.getElementById && document.getElementById(objectId)) {
  308. return document.getElementById(objectId);
  309. } else if (document.all && document.all(objectId)) {
  310. return document.all(objectId);
  311. } else if (document.layers && document.layers[objectId]) {
  312. return document.layers[objectId);
  313. } else {
  314. return false;
  315. }
  316. }
  317. </script>
  318. <style>
  319. .menulist li{float:left;width:92px;height:132px;}
  320. .menulist li a{display:block;padding:10px 0;padding-top:50px;width:80px;height:15px;color:#A1B5B3;border:1px solid #B4C9C6;margin:5px;text-align:center}
  321. .menulist li a img{margin-bottom:5px}
  322. .menulist li a:hover{border:2px solid #B4C9C6;width:78px;height:13px;color:#A1B5B3}
  323. .png01{background:url(menu/01.png) center 8px no-repeat}
  324. .png02{background:url(menu/02.png) center 8px no-repeat}
  325. .png03{background:url(menu/03.png) center 8px no-repeat}
  326. .png04{background:url(menu/04.png) center 8px no-repeat}
  327. .png05{background:url(menu/05.png) center 8px no-repeat}
  328. .png06{background:url(menu/06.png) center 8px no-repeat}
  329. </style>
  330. </head>
  331. <body>
  332. <div id="man_zone">
  333. <ul class="menulist">
  334. <li><a href="customers.php" onClick="golink('打开信息列表')" class="png03">客户管理</a></li>
  335. </ul>
  336. </div>
  337. </body>
  338. <?php
  339. break;
  340. default:
  341. echo $html_header;
  342. ?>
  343. <title><?php echo $webname; ?> - 网站后台管理</title>
  344. </head>
  345. <frameset rows="50,*" cols="*" frameborder="no" border="0" framespacing="0">
  346. <frame src="?iframe=top" name="topFrame" frameborder="no" scrolling="No" noresize="noresize" id="topFrame" title="topFrame" />
  347. <frameset name="myFrame" cols="199,7,*" frameborder="no" border="0" framespacing="0">
  348. <frame src="?iframe=left" name="leftFrame" frameborder="no" scrolling="No" noresize="noresize" id="leftFrame" title="leftFrame" />
  349. <frame src="?iframe=switch" name="midFrame" frameborder="no" scrolling="No" noresize="noresize" id="midFrame" title="midFrame" />
  350. <frameset rows="59,*" cols="*" frameborder="no" border="0" framespacing="0">
  351. <frame src="?iframe=main" name="mainFrame" frameborder="no" scrolling="No" noresize="noresize" id="mainFrame" title="mainFrame" />
  352. <frame src="?iframe=man" name="manFrame" frameborder="no" id="manFrame" title="manFrame" />
  353. </frameset>
  354. </frameset>
  355. </frameset>
  356. <noframes><body></body></noframes>
  357. <?php
  358. }
  359. ?>