-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstore_access.php
121 lines (115 loc) · 6.12 KB
/
store_access.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
<html dir="rtl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="ar-eg">
</head>
<?php
include('system_load.php');
//This loads system.
//user Authentication.
authenticate_user('admin');
//creating store object.
if(isset($_POST['user_id']) && isset($_POST['store_id'])) {
if($_POST['user_id'] == '' && $_POST['store_id'] == '') {
$message = 'Store id and user id required. Please select.';
} else {
$message = $store_access->add_store_access($_POST['user_id'], $_POST['store_id'], $_POST['access_to']);
}
}//add store access ends here.
//delete access
if(isset($_POST['delete_access']) && $_POST['delete_access'] != '') {
$message = $store_access->delete_access($_POST['delete_access']);
}
//delete access ends here.
$page_title = "أذونات الحسابات في المتاجر من مشرفين او محاسبين او بائعين الخ"; //You can edit this to change your page title.
require_once("includes/header.php"); //including header file.
//display message if exist.
if(isset($message) && $message != '') {
echo '<div class="alert alert-success">';
echo $message;
echo '</div>';
}
?>
<h3>أذونات الحسابات في المتاجر من مشرفين او محاسبين او
بائعين الخ</h3>
<form name="grand_access" id="grand_access" action="" method="post">
<table cellpadding="10" style="padding:10px;" border="0">
<tr>
<th style="padding:10px;"><span lang="ar-eg">أختر
الحساب للموظف من هنا</span></th>
<th style="padding:10px;"><span lang="ar-eg">اختر
النظام او المتجر</span></th>
</tr>
<tr>
<td style="padding:10px;">
<select class="form-control" name="user_id" required="required">
<option value="">أختر الحساب</option>
<?php $new_user->subscriber_options(); ?>
</select>
</td>
<td style="padding:10px;">
<select class="form-control" name="store_id" required="required">
<option value="">اختر المتجر من الثائمة هنا</option>
<?php $new_store->store_options(); ?>
</select>
</td>
</tr>
<tr>
<td colspan="2" style="padding:10px;">
<strong><span lang="ar-eg">ادراج بأداره ومسؤلية</span>:
</strong>
<input type="checkbox" name="access_to[]" value="sales" />
<span lang="ar-eg">المبيعات</span>
<input type="checkbox" name="access_to[]" value="purchase" />
<span lang="ar-eg">المشتريات</span>
<input type="checkbox" name="access_to[]" value="vendors" />
<span lang="ar-eg">البائعين</span>
<input type="checkbox" name="access_to[]" value="clients" />
<span lang="ar-eg">الحسابات</span>
<input type="checkbox" name="access_to[]" value="products" />
<span lang="ar-eg">المنتجات والخدمات</span>
<input type="checkbox" name="access_to[]" value="warehouse" />
<span lang="ar-eg">المخازن</span>
<input type="checkbox" name="access_to[]" value="returns" />
<span lang="ar-eg">المسترجعات</span>
<input type="checkbox" name="access_to[]" value="price_level" />
<span lang="ar-eg">درجات الاسعار</span>
<input type="checkbox" name="access_to[]" value="reports" />
<span lang="ar-eg">التقارير</span>
<input type="checkbox" name="access_to[]" value="expenses" />
<span lang="ar-eg">النفقات</span>
</td>
</tr>
<tr>
<td style="padding:10px;"><input type="submit" class="btn btn-primary btn-sm" value="Grant Access" /></td>
<td> </td>
</tr>
</tr>
</table>
</form>
<br />
<br />
<table cellpadding="0" cellspacing="0" border="0" class="table-responsive table-hover table display table-bordered" id="wc_table" width="100%">
<thead>
<tr>
<th>Id</th>
<th><span lang="ar-eg">اسم الحساب</span> </th>
<th><span lang="ar-eg">البريد</span></th>
<th><span lang="ar-eg">اذونات الدخول</span></th>
<th><span lang="ar-eg">موديل</span></th>
<th><span lang="ar-eg">حذف</span></th>
</tr>
</thead>
<tbody>
<?php $store_access->list_store_access(); ?>
</tbody>
</table>
<script type="text/javascript">
$(document).ready(function() {
// validate the register form
$("#grand_access").validate();
});
</script>
<?php
require_once("includes/footer.php");
?>