-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathorderlist.php
200 lines (194 loc) · 9.44 KB
/
orderlist.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
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
<?php require_once ("dbconnect.php"); ?>
<?php require_once ('includes/admin_header.php'); ?>
<!-- Main Menu -->
<div class="side-menu-container">
<ul class="nav navbar-nav">
<li><a href="admin.php"><span class="glyphicon glyphicon-home"></span> Home</a></li>
<li><a href="employeeList.php"><span class="glyphicon glyphicon-user"></span>Employee List</a></li>
<li class="active"><a href="orderlist.php"><span class="glyphicon glyphicon-th-list"></span> Order List </a></li>
<li><a href="clientlist.php"><span class="glyphicon glyphicon-briefcase"></span> Client List </a></li>
<li><a href="adminsetting.php"><span class="glyphicon glyphicon-cog"></span> Profile Setting </a></li>
<li><a href="logout.php"><span class="glyphicon glyphicon-log-out"></span> Logout</a></li>
</ul>
</div><!-- /.navbar-collapse -->
</nav>
</div>
<div class="container-fluid">
<div class="side-body">
<br>
<pre style="text-align:center"> <b>Order List based on Priority</b> </pre>
<br>
<select id="order" class="form-control">
<option value="">Select Option</option>
<option value="neworder">New Order</option>
<option value="approved">Approved</option>
</select>
<br>
<br>
<div id="tableinfo">
</div>
</div>
</div>
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header" style="background-color:#003366; color:white;">
<h5 class="modal-title" id="exampleModalLabel" style="font-weight:bold; font-size:17px;">New message</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span style="color:white;" aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form action="#" method="post">
<div class="form-group">
<label for="recipient-name" class="form-control-label">Recipient:</label>
<input type="text" value="" class="form-control" id="recipient-name" disabled>
</div>
<div class="form-group">
<label for="message-text" class="form-control-label">Message:</label>
<textarea class="form-control" id="message-text" required></textarea>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" id="submit">Send message</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="exampleModal2" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header" style="background-color:#003366; color:white;">
<h5 class="modal-title" id="exampleModalLabel" style="font-weight:bold; font-size:17px;">New message</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span style="color:white;" aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form action="#" method="post">
<div class="form-group">
<label for="recipient-name" class="form-control-label">Recipient:</label>
<input type="text" value="" class="form-control" id="recipient-name2" disabled>
</div>
<div class="form-group">
<label for="message-text" class="form-control-label">Assign Manager:</label>
<select id="manager" class="form-control">
<option value="">Select Option</option>
<?php
$query = $connect->query("SELECT * FROM employee WHERE job_type='manager'");
while($row = $query->fetch_assoc()){ ?>
<option value="<?php echo $row['username']; ?>"><?php echo $row['fullname']; ?></option>
<?php
}
?>
</select>
</div>
<div class="form-group">
<label for="message-text" class="form-control-label">Message:</label>
<textarea class="form-control" id="message-text2" required></textarea>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" id="approvesubmit">Send message</button>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var dataType = "";
var type = "";
var orderid = "";
$(document).ready(function() {
$("#order").change(function() {
var order = $(this).val();
dataType = "type=" + order;
$.ajax({
type: "post",
url: "get_select_order.php",
data: dataType,
cache: false,
success: function(result) {
$("#tableinfo").html(result);
}
});
});
});
$('#exampleModal').on('show.bs.modal', function(event) {
var button = $(event.relatedTarget) // Button that triggered the modal
var recipient = button.data('whatever') // Extract info from data-* attributes
// If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
// Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
var modal = $(this)
var client = recipient.split(" ")
type = client[1]
orderid = client[2]
modal.find('.modal-title').text('New message to ' + client[0])
modal.find('.modal-body input').val(client[0])
});
$('#exampleModal2').on('show.bs.modal', function(event) {
var button = $(event.relatedTarget) // Button that triggered the modal
var recipient = button.data('whatever') // Extract info from data-* attributes
// If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
// Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
var modal = $(this)
var client = recipient.split(" ")
type = client[1]
orderid = client[2]
modal.find('.modal-title').text('New message to ' + client[0])
modal.find('.modal-body input').val(client[0])
});
$(document).ready(function (){
$(document).on('click', '#submit', function (){
var client = $('#recipient-name').val();
var body = $('#message-text').val();
$.ajax({
type: "post",
url: "sendmail.php",
data: "client="+client+"&body="+body+"&type="+type+"&order="+orderid,
cache: false,
success: function(result){
alert(result);
$.ajax({
type: "post",
url: "get_select_order.php",
data: dataType,
cache: false,
success: function(result) {
$("#tableinfo").html(result);
}
});
}
});
});
});
$(document).ready(function (){
$(document).on('click', '#approvesubmit', function (){
var client = $('#recipient-name2').val();
var body = $('#message-text2').val();
var manager = $('#manager').val();
$.ajax({
type: "post",
url: "sendmail.php",
data: "client="+client+"&body="+body+"&type="+type+"&order="+orderid+"&manager="+manager,
cache: false,
success: function(result){
alert(result);
$.ajax({
type: "post",
url: "get_select_order.php",
data: dataType,
cache: false,
success: function(result) {
$("#tableinfo").html(result);
}
});
}
});
});
});
</script>
<?php require_once ('includes/admin_footer.php'); ?>