forked from dtsai14/lunch-order
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.php
98 lines (91 loc) · 3.78 KB
/
admin.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
<?php
include_once './authenticate.php';
include_once './mysql.php';
?>
<!DOCTYPE html>
<head lang="en">
<?php include_once './sources.php';
?>
</head>
<body>
<div class="container">
<?php include './header/header.php';
?>
<table id="lunch-options" class="table table-hover table-striped">
<thead>
<tr>
<th></th>
<th>Restaurant</th>
<th>Food Type</th>
<th>Menu</th>
<th>Phone</th>
</tr>
</thead>
<tbody id="admin-table">
</tbody>
</table>
<!-- Button trigger modal -->
<a data-toggle="modal" href="#add_restaurant" class="btn btn-primary btn-sm">Add Restaurant</a>
<br><br>
<div class="panel-group" id="taken-orders"></div>
<br><br>
</div>
<?php include './admin/restaurantModal.php';
include './admin/menuModal.php';
?>
<script id="admin-table-template" type="text/x-handlebars-template">
{{#restaurants}}
<tr id='{{id}}'>
<td>
<button data-restaurant-id='{{id}}' class='delete-button btn btn-danger btn-xs'>
<span class='glyphicon glyphicon-remove'></span>
</button>
</td>
<td>{{name}}</td>
<td>{{food_type}}</td>
<td class='restaurant-actions' data-taking-orders='{{taking_orders}}' data-auth-close='{{auth_close}}' data-menu-url='{{menu_url}}'>
<button class='view-menu-button btn btn-info btn-xs' data-menu-url='{{menu_url}}'>View Menu</button>
<button class='add-menu-button btn btn-default btn-xs' data-restaurant-id='{{id}}'>Add Menu</button>
<button class='take-orders-button btn btn-success btn-xs' data-restaurant-id='{{id}}'>Take Orders</button>
<button class='order-in-progress-button btn btn-success btn-xs' disabled=true>Taking Orders...</button>
<button class='close-orders-button btn btn-danger btn-xs pull-right' data-restaurant-id='{{id}}'>Close Orders</button>
</td>
<td class='restaurant-phone' data-phone-num='{{phone_num}}'>
<div class='call-link'>{{phone_num}}</div>
<button class='add-phone-button btn btn-default btn-xs' data-restaurant-id='{{id}}'>Add Phone</button>
<form class="form-inline add-phone-form" role="form">
<div class="form-group">
<label class="sr-only" for="phone-input">Phone Number</label>
<input type="text" class="form-control" id="phone-input" placeholder="(425) 555-5555">
</div>
<button type="submit" class="btn btn-primary btn-xs">Add</button>
</form>
</td>
</tr>
{{/restaurants}}
</script>
<script id="taken-orders-template" type="text/x-handlebars-template">
<h3>Orders Taken By You Today</h3>
{{#takenOrders}}
<div class='panel panel-default'>
<div class='panel-heading'>
<h4 class='panel-title'>
<a class='accordion-toggle' data-toggle='collapse' data-parent='#accordion' href='#collapse{{id}}'>{{name}}
</a>
</h4>
</div>
<div id='collapse{{id}}' class='panel-collapse collapse in'>
<div class='panel-body'>
<dl class='dl-horizontal'>
{{#orders}}
<dt>{{first_name}} {{last_name}}</dt>
<dd>{{text}}</dd>
{{/orders}}
</dl>
</div>
</div>
</div>
{{/takenOrders}}
</script>
<script src="./js/admin.js"></script>
</body>