-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathitem_group_manage.php
167 lines (166 loc) · 6.96 KB
/
item_group_manage.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
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
<?php
include("include/db.php");
include("include/utility.php");
include("include/session.php");
include("include/paging.php");
define("APP_START", 1);
$filename = 'items_manage.php';
if(isset($_GET["parent_id"])){
$_SESSION["item_group"]["group_item_id"]=slash($_GET["parent_id"]);
}
if( isset( $_SESSION["item_group"]["group_item_id"] ) ) {
$parent_group_item_id = $_SESSION["item_group"]["group_item_id"];
}
else {
die( 'Select Parent Item Group' );
}
$parent_group_item = doquery( "select * from items where id='".$parent_group_item_id."'", $dblink );
if( numrows( $parent_group_item ) ) {
$parent_group_item = dofetch( $parent_group_item );
}
else{
die( "Parent Item does not exists" );
}
$tab_array=array("list", "add", "edit", "delete", "bulk_action");
if(isset($_REQUEST["tab"]) && in_array($_REQUEST["tab"], $tab_array)){
$tab=$_REQUEST["tab"];
}
else{
$tab="list";
}
switch($tab){
case 'add':
include("modules/item_group/add_do.php");
break;
case 'edit':
include("modules/item_group/edit_do.php");
break;
case 'delete':
include("modules/item_group/delete_do.php");
break;
case 'bulk_action':
include("modules/item_group/bulkactions.php");
break;
}
?>
<!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 name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="favi.ico" />
<title><?php echo $site_title?> - Admin Panel</title>
<link type="text/css" rel="stylesheet" href="css/font-awesome.min.css" />
<link type="text/css" rel="stylesheet" href="css/font-awesome.css" />
<link type="text/css" rel="stylesheet" href="css/bootstrap.css" />
<link rel="stylesheet" href="css/bootstrap-datetimepicker.min.css" />
<link type="text/css" rel="stylesheet" href="css/awesome-bootstrap-checkbox.css" />
<link href="css/general.css" type="text/css" rel="stylesheet" />
<link type="text/css" rel="stylesheet" href="css/style.css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src='js/tinymce/tinymce.js'></script>
<?php include("js/initialize.php");?>
<script type="text/javascript" src="js/popup.js"></script>
</head>
<body>
<div id="wrapper" class="round_corners">
<div id="top" class="clearfix">
<div class="applogo">
<a href="index.php" class="logo"><?php $admin_logo=get_config("admin_logo"); if(empty($admin_logo)) echo $site_title; else { ?><img src="<?php echo $file_upload_root;?>config/<?php echo $admin_logo?>" /><?php }?></a>
</div>
<a class="sidebar-open-button" href="#"><i class="fa fa-bars"></i></a>
<ul class="top-right">
<li class="dropdown link">
<a class="dropdown-toggle profilebox" data-toggle="dropdown" href="#">
<img alt="img" src="images/profileimg-default.png">
<b><?php echo ucfirst((isset($_SESSION["logged_in_admin"]) && $_SESSION["logged_in_admin"]!="")?$_SESSION["logged_in_admin"]["name"]:"Guest");?></b>
<span class="caret"></span>
</a>
<ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
<li class="dropdown-header" role="presentation">Profile</li>
<li><a href="admin_manage.php?tab=edit&id=<?php echo $_SESSION["logged_in_admin"]["id"]?>"><i class="fa falist fa-file-o"></i>Edit Profile</a></li>
<li><a href="config_manage.php"><i class="fa falist fa-wrench"></i>Settings</a></li>
<li class="divider"></li>
<li><a href="logout.php"><i class="fa falist fa-power-off"></i> Logout</a></li>
</ul>
</li>
</ul>
<div class="clr"></div>
</div>
<div class="sidebar clearfix">
<ul class="sidebar-panel nav">
<li class="sidetitle">MAIN</li>
<?php
$parents=doquery("select * from menu where parent_id=0 order by sortorder",$dblink);
if(numrows($parents)>0){
while($parent=dofetch($parents)){
?>
<li>
<a href="<?php echo unslash($parent["url"])?>"><span class="icon color5"><i class="fa fa-<?php echo unslash($parent["small_icon"])?>"></i></span><?php echo unslash($parent["title"])?>
<?php
$submenus=doquery("select * from menu where parent_id='".$parent["id"]."' order by sortorder",$dblink);
if(numrows($submenus)>0){
?>
<span class="caret"></span></a>
<ul>
<?php
while($submenu=dofetch($submenus)){
?>
<li><a href="<?php echo unslash($submenu["url"])?>"><span class="icon color5"><i class="fa fa-<?php echo unslash($submenu["small_icon"])?>"></i></span><?php echo unslash($submenu["title"])?></a></li>
<?php
}
?>
</ul>
<?php
}
else{
echo "</a>";
}
?>
</li>
<?php
}
}
?>
</ul>
<ul class="sidebar-panel nav">
<li class="sidetitle">Account</li>
<li><a href="admin_manage.php?tab=edit&id=<?php echo $_SESSION["logged_in_admin"]["id"]?>"><span class="icon color15"><i class="fa fa-columns"></i></span>Edit Profile</a></li>
<li><a href="logout.php"><span class="icon color12"><i class="fa falist fa-power-off"></i></span>Logout</a></li>
</ul>
</div>
<div class="content">
<div class="page-header page-header-hidden">
<?php
if(isset($_REQUEST["msg"])){
?>
<div align="center" class="msg"><?php echo url_decode($_REQUEST["msg"]);?></div>
<?php
}
if(isset($_REQUEST["err"])){
?>
<div align="center" class="err"><?php echo url_decode($_REQUEST["err"])?></div>
<?php
}
?>
</div>
<div class="container-widget row">
<div class="col-md-12">
<?php
switch($tab){
case 'list':
include("modules/item_group/list.php");
break;
case 'add':
include("modules/item_group/add.php");
break;
case 'edit':
include("modules/item_group/edit.php");
break;
}
?>
</div>
</div>
</div>
</div>
<?php include("include/footer.php");?>