-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedit_driver.php
111 lines (110 loc) · 4.62 KB
/
edit_driver.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
<?php
$id=$_GET['id'];
$driver_name=$_GET['driver_name'];
$phone=$_GET['phone'];
$street_id=$_GET['street_id'];
$quarter_id=$_GET['quarter_id'];
echo $id,$driver_name,$phone,$street_id,$quarter_id;
?>
<?php
include "check_auth.php";
include "backend_config.php";
$b=new Backend();
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>My Taxi | Edit Drivers</title>
<link href="bootstrap/css/bootstrap.css" rel="stylesheet">
<link href="bootstrap/css/dataTables.bootstrap.min.css" rel="stylesheet">
<style>
.alert{
position: absolute;
top: 80px;
right: 10px;
}
</style>
</head>
<body>
<?php include "navbar.php";?>
<div class="container">
<?php include "message.php"?>
<div class="page-header">
<h4>Edit Drivers</h4>
</div>
<div class="row">
<div class="col-sm-4 col-sm-offset-4">
<div class="panel panel-default">
<div class="panel-body">
<form method="post" enctype="multipart/form-data" action="update_driver.php">
<input type="hidden" name="id" value="<?php echo $id?>">
<div class="form-group">
<label for="photo">Photo</label>
<input type="file" name="photo" id="photo">
</div>
<div class="form-group">
<label for="driver_name">Driver Name</label>
<input value="<?php echo $driver_name?>" type="text" name="driver_name" id="driver_name" class="form-control">
</div>
<div class="form-group">
<label for="phone">Phone</label>
<input value="<?php echo $phone?>" type="tel" name="phone" id="phone" class="form-control" required>
</div>
<div class="form-group">
<label for="street_id">Street</label>
<select id="street_id" name="street_id" class="form-control">
<?php
$streets=$b->getStreets();
foreach ($streets as $st):
?>
<option <?php if($st['id']==$street_id){echo "selected";}?> value="<?php echo $st['id']?>">
<?php echo $st['quarter_name']?>,<?php echo $st['street_name']?>
</option>
<?php
endforeach;
?>
</select>
</div>
<div class="form-group">
<label for="quarter_id">Quarter</label>
<select name="quarter_id" id="quarter_id" class="form-control" required>
<?php
$qtrs=$b->getQuarters();
foreach ($qtrs as $q){
?>
<option <?php if($q['id']==$quarter_id){echo "selected";}?> value="<?php echo $q['id']?>">
<?php echo $q['quarter_name']?>
</option>
<?php
}
?>
</select>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary btn-block">Save</button>
</div>
</form>
<a href="drivers.php" class="btn btn-default btn-block">Close</a>
</div>
</div>
</div>
</div>
</div>
<script src="bootstrap/js/jquery.js"></script>
<script src="bootstrap/js/bootstrap.js"></script>
<script src="bootstrap/js/jquery.dataTables.min.js"></script>
<script src="bootstrap/js/dataTables.bootstrap.min.js"></script>
<script>
$(function () {
$("#driver_table").dataTable();
setTimeout(function () {
$(".alert").fadeOut();
},2000)
})
</script>
</body>
</html>