-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpoints.php
More file actions
137 lines (118 loc) · 5.18 KB
/
points.php
File metadata and controls
137 lines (118 loc) · 5.18 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
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
<?php header('Content-Type: text/html; charset=utf-8');?><html>
<head>
<title>Точки приёма</title>
<?php require_once "templates/scripts.tpl";?>
</head>
<body>
<div class="wrapper">
<div class="sidebar" data-color="azure" data-image="assets/img/sidebar-4.jpg">
<div class="sidebar-wrapper">
<?php require_once "templates/menu.tpl" ;?>
</div>
</div>
<div class="main-panel">
<nav class="navbar navbar-default navbar-fixed">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="/points">Точки приёма</a>
</div>
</div>
</nav>
<button type="button" class="btn" data-toggle="modal" data-target="#addclient">Новый точка приёма</button>
<?php
$mongo = new MongoClient("mongodb://localhost");
// Choose the database and collection
$db = $mongo->rcrm;
$coll = $db->points;
$points = $coll->find();
$status = array('Работает', 'Не работает');
?>
<div class="content">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<?php if (count($points) > 0): ?>
<table class="table table-striped">
<thead>
<th>
Название
</th>
<th>
Адрес
</th>
<th>
Время работы
</th>
<th>
Статус
</th>
</thead>
<tbody>
<?php foreach ($points as $key => $point): ?>
<tr>
<td><?=$point['title'];?></td>
<td><?=$point['address'];?></td>
<td><?=$point['worktime'];?></td>
<td><?=$status[$point['status']];?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php else:?>
<p class="text-center">Пока отсутствуют</p>
<?php endif;?>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="addclient" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Новый работник</h4>
</div>
<div class="modal-body">
<form class="ajax-submit" action="/ajax">
<input type="hidden" name="module" value="points">
<div class="form-group">
<label for="fio">Название</label>
<input type="text" class="form-control" name="title" id="fio" placeholder="Название" /><br/>
<label for="tel">Адрес</label>
<input type="address" class="form-control" id="tel" name="address" placeholder="Адрес" /><br/>
<label for="email">Время работы</label>
<input type="title" class="form-control" id="email" name="worktime" placeholder="Время работы" /><br/>
<label>Работает</label><br/>
<select class="form-control" name="status">
<?php foreach ($status as $sk => $s):?>
<option value="<?=$sk?>"><?=$s?></option>
<?php endforeach;?>
</select>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Закрыть</button>
<button type="button" class="btn btn-success btn-ajax-submit">Добавить</button>
</div>
</div>
</div>
</div>
</body>
<!-- Core JS Files -->
<script src="assets/js/jquery-1.10.2.js" type="text/javascript"></script>
<script src="assets/js/bootstrap.min.js" type="text/javascript"></script>
<!-- Checkbox, Radio & Switch Plugins -->
<script src="assets/js/bootstrap-checkbox-radio-switch.js"></script>
<!-- Charts Plugin -->
<script src="assets/js/chartist.min.js"></script>
<!-- Notifications Plugin -->
<script src="assets/js/bootstrap-notify.js"></script>
<!-- Light Bootstrap Table Core javascript and methods for Demo purpose -->
<script src="assets/js/light-bootstrap-dashboard.js"></script>
<script src="assets/js/scripts.js"></script>
</body>
</html>