forked from cyklokoalicia/OpenSourceBikeShare
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.php
174 lines (163 loc) · 9.83 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
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
<?php
require("config.php");
require("db.class.php");
require('actions-web.php');
$db=new Database($dbserver,$dbuser,$dbpassword,$dbname);
$db->connect();
checksession();
if (getprivileges($_COOKIE["loguserid"])<=0) exit(_('You need admin privileges to access this page.'));
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title><? echo $systemname; ?> <?php echo _('administration'); ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/bootstrapValidator.min.js"></script>
<script type="text/javascript" src="js/translations.php"></script>
<script type="text/javascript" src="js/admin.js"></script>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="css/bootstrap-theme.min.css" />
<link rel="stylesheet" type="text/css" href="css/bootstrapValidator.min.css" />
<?php if (file_exists("analytics.php")) require("analytics.php"); ?>
<script>
<?php
if (iscreditenabled())
{
echo 'var creditenabled=1;',"\n";
echo 'var creditcurrency="',$credit["currency"],'"',";\n";
$requiredcredit=$credit["min"]+$credit["rent"]+$credit["longrental"];
}
else
{
echo 'var creditenabled=0;',"\n";
}
?>
</script>
</head>
<body>
<!-- Fixed navbar -->
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only"><?php echo _('Toggle navigation'); ?></span>
</button>
<a class="navbar-brand" href="<?php echo $systemURL; ?>"><?php echo $systemname; ?></a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="<?php echo $systemURL; ?>"><?php echo _('Map'); ?></a></li>
<li class="active"><a href="<?php echo $systemURL; ?>admin.php"><?php echo _('Admin'); ?></a></li>
<?php if (isloggedin()): ?>
<li><a href="command.php?action=logout" id="logout"><?php echo _('Log out'); ?></a></li>
<?php endif; ?>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<br />
<div class="container">
<div class="page-header">
<h1><?php echo _('Administration'); ?></h1>
</div>
<?php
if (isloggedin()):
?>
<div role="tabpanel">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#fleet" aria-controls="fleet" role="tab" data-toggle="tab"><span class="glyphicon glyphicon-lock" aria-hidden="true"></span> <?php echo _('Fleet'); ?></a></li>
<li role="presentation"><a href="#stands" aria-controls="stands" role="tab" data-toggle="tab"><span class="glyphicon glyphicon-map-marker" aria-hidden="true"></span> <?php echo _('Stands'); ?></a></li>
<li role="presentation"><a href="#users" aria-controls="users" role="tab" data-toggle="tab"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> <?php echo _('Users'); ?></a></li>
<?php
if (iscreditenabled()):
?>
<li role="presentation"><a href="#credit" aria-controls="credit" role="tab" data-toggle="tab"><span class="glyphicon glyphicon-euro" aria-hidden="true"></span> <?php echo _('Credit system'); ?></a></li>
<?php endif; ?>
<li role="presentation"><a href="#reports" aria-controls="reports" role="tab" data-toggle="tab"><span class="glyphicon glyphicon-stats" aria-hidden="true"></span> <?php echo _('Reports'); ?></a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="fleet">
<div class="row">
<div class="col-lg-12">
<input type="text" name="adminparam" id="adminparam" class="form-control">
<button class="btn btn-default" type="button" id="where" title="<?php echo _('Display the bike stand location or name of person using it.'); ?>"><span class="glyphicon glyphicon-screenshot"></span> <?php echo _('Where is?'); ?></button>
<button type="button" id="revert" class="btn btn-default" title="<?php echo _('Be careful! Revert accidentaly rented bike in case of mistake or misread bike number.'); ?>"><span class="glyphicon glyphicon-fast-backward"></span> <?php echo _('Revert'); ?></button>
<button type="button" id="last" class="btn btn-default" title="<?php echo _('Display network usage (blank) or history of bike usage (number entered).'); ?>"><span class="glyphicon glyphicon-stats"></span> <?php echo _('Last usage'); ?></button>
<div id="fleetconsole"></div>
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="stands">
<div class="row">
<div class="col-lg-12">
<!-- button type="button" id="stands" class="btn btn-default" title="Show stand situation."><span class="glyphicon glyphicon-map-marker"></span> <?php echo _('Stand situation'); ?></button -->
<div id="standsconsole"></div>
</div>
</div>
</div>
<?php
if (iscreditenabled()):
?>
<div role="tabpanel" class="tab-pane" id="credit">
<div class="row">
<div class="col-lg-12">
<button type="button" id="listcoupons" class="btn btn-default" title="<?php echo _('Display existing coupons.'); ?>"><span class="glyphicon glyphicon-list-alt"></span> <?php echo _('List coupons'); ?></button>
<button type="button" id="generatecoupons1" class="btn btn-success" title="<?php echo _('Generate new coupons.'); ?>"><span class="glyphicon glyphicon-plus"></span> <?php echo _('Generate'); echo ' ',$requiredcredit,$credit["currency"],' '; echo _('coupons'); ?></button>
<button type="button" id="generatecoupons2" class="btn btn-success" title="<?php echo _('Generate new coupons.'); ?>"><span class="glyphicon glyphicon-plus"></span> <?php echo _('Generate'); echo ' ',$requiredcredit*5,$credit["currency"],' '; echo _('coupons'); ?></button>
<button type="button" id="generatecoupons3" class="btn btn-success" title="<?php echo _('Generate new coupons.'); ?>"><span class="glyphicon glyphicon-plus"></span> <?php echo _('Generate'); echo ' ',$requiredcredit*10,$credit["currency"],' '; echo _('coupons'); ?></button>
<div id="creditconsole"></div>
</div>
</div>
</div>
<?php endif; ?>
<div role="tabpanel" class="tab-pane" id="users">
<div class="row">
<div class="col-lg-12">
<button type="button" id="userlist" class="btn btn-default" title="<?php echo _('Show list of users.'); ?>"><span class="glyphicon glyphicon-user"></span> <?php echo _('User list'); ?></button>
</div>
</div>
<form class="container" id="edituser">
<div class="form-group"><label for="username" class="control-label"><?php echo _('Fullname:'); ?></label> <input type="text" name="username" id="username" class="form-control" /></div>
<div class="form-group"><label for="email"><?php echo _('Email:'); ?></label> <input type="text" name="email" id="email" class="form-control" /></div>
<?php if ($connectors["sms"]): ?>
<div class="form-group"><label for="phone"><?php echo _('Phone number:'); ?></label> <input type="text" name="phone" id="phone" class="form-control" /></div>
<? endif; ?>
<div class="form-group"><label for="privileges"><?php echo _('Privileges:'); ?></label> <input type="text" name="privileges" id="privileges" class="form-control" /></div>
<div class="form-group"><label for="limit"><?php echo _('Bike limit:'); ?></label> <input type="text" name="limit" id="limit" class="form-control" /></div>
<input type="hidden" name="userid" id="userid" value="" />
<button type="button" id="saveuser" class="btn btn-primary"><?php echo _('Save'); ?></button>
or <button type="button" id="addcredit" class="btn btn-success"><?php echo _('Add'); echo ' ',$requiredcredit,$credit["currency"]; ?></button>
<button type="button" id="addcredit2" class="btn btn-success"><?php echo _('Add'); echo ' ',$requiredcredit*5,$credit["currency"]; ?></button>
<button type="button" id="addcredit3" class="btn btn-success"><?php echo _('Add'); echo ' ',$requiredcredit*10,$credit["currency"]; ?></button>
</form>
<div id="userconsole"></div>
</div>
<div role="tabpanel" class="tab-pane" id="reports">
<div class="row">
<div class="col-lg-12">
<button type="button" id="usagestats" class="btn btn-default" title="<?php echo _('Show usage stats by day.'); ?>"><span class="glyphicon glyphicon-road"></span> <?php echo _('Daily stats'); ?></button>
<button type="button" id="userstats" class="btn btn-default" title="<?php echo _('Show user stats.'); ?>"><span class="glyphicon glyphicon-road"></span> <?php echo _('User stats'); ?></button>
<!-- button type="button" id="trips" class="btn btn-default" title="<?php echo _('Show history of stand to stand bike trips as lines.'); ?>"><span class="glyphicon glyphicon-road"></span> <?php echo _('Trips overlay'); ?></button -->
<div id="reportsconsole"></div>
</div>
</div>
</div>
</div>
</div>
<?php endif; ?>
<br />
<div class="panel panel-default">
<div class="panel-body">
<i class="glyphicon glyphicon-copyright-mark"></i> <? echo date("Y"); ?> <a href="<?php echo $systemURL; ?>"><?php echo $systemname; ?></a>
</div>
<div class="panel-footer"><strong><?php echo _('Privacy policy:'); ?></strong> <?php echo _('We will use your details for'); echo $systemname,'-'; echo _('related activities only'); ?>.</div>
</div>
</div><!-- /.container -->
</body>
</html>