-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmenu.php
More file actions
98 lines (92 loc) · 2.55 KB
/
menu.php
File metadata and controls
98 lines (92 loc) · 2.55 KB
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
<?php
require_once(dirname(__FILE__)."/include/config_base.php");
require_once(dirname(__FILE__)."/include/config_rglobals.php");
require_once(dirname(__FILE__)."/include/pub_db_mysql.php");
require_once(dirname(__FILE__)."/include/checklogin.php");
?>
<!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/2019/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
<head>
<title>WEB ERP SYSTEM MENU</title>
<style type="text/css">
body {background-color:#3179bd;}
</style>
<link href="style/menu.css" rel="stylesheet" type="text/css" />
</head>
<script language="javascript">
function getObject(objectId) {
if(document.getElementById && document.getElementById(objectId)) {
// W3C DOM
return document.getElementById(objectId);
}
else if (document.all && document.all(objectId)) {
// MSIE 4 DOM
return document.all(objectId);
}
else if (document.layers && document.layers[objectId]) {
// NN 4 DOM.. note: this won't find nested layers
return document.layers[objectId];
}
else {
return false;
}
}
function showHide(objname){
var obj = getObject(objname);
if(obj.style.display == "none"){
obj.style.display = "block";
}else{
obj.style.display = "none";
}
}
</script>
<base target="main">
<body>
<div class="menu">
<?php
/**if($c=='')$c=1; */
$csql=new Dedesql(false);
$countSql = "SELECT COUNT(*) As num FROM #@__menu WHERE reid = 0";
$total=$csql->getOne($countSql);
$total = $total[0]['num'];
$csql->close();
$total<1 && ($total=1);
$endmenus = "
";
for($c = 1; $c <= $total; $c ++) {
$iteminfo ="";
$msql=new Dedesql(false);
$query="select name from #@__menu where id='$c'";
$menuinfo=$msql->GetOne($query);
$menus="
<dl>
<dt><a href='###' onclick=showHide('items".$c."') target='_self' class='top'>".$menuinfo['name']."</a></dt>
<dd id='items".$c."' style='display:none;'>
<ul>
~Item~
</ul>
</dd>
</dl>
";
$msql->Setquery("select * from #@__menu where reid='$c'");
$msql->Execute();
while($row=$msql->GetArray())
{
$s=new Dedesql(false);
$q="select * from #@__usertype where rank='".GetCookie('rank')."'";
$rs1=$s->getone($q);
$tmparray = explode($rs1['content'],$row['rank']);
if(count($tmparray)>1)
$iteminfo=$iteminfo."<li><a href='".$row['url']."' target='main'>".$row['name']."</a></li>";
$s->close();
}
$menus=str_replace("~Item~",$iteminfo,$menus);
echo $menus.$endmenus;
$msql->close();
}
?>
</div>
</body>
</html>