forked from JB4u3r/JMT-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify.php
More file actions
executable file
·152 lines (127 loc) · 5.9 KB
/
verify.php
File metadata and controls
executable file
·152 lines (127 loc) · 5.9 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<title>JMT VEHICLE LICENSE</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/navbar-fixed-top1.css" rel="stylesheet">
</head>
<body>
<!-- Fixed navbar -->
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#" style="margin-top:-15px" ><img src="images/jmt_logo.png" /></a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="index.php">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="active"><a href="registration.php">Register <span class="sr-only">(current)</span></a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<!-- Page Content -->
<div class="container">
<div class="row">
<div class="col-lg-12">
<?php
$servername = "localhost";
$username = "root";
$password = "root";
$dbname = "license";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
$id=$_GET['id'];
$sql = "SELECT * FROM details WHERE id=$id";
$result = mysqli_query($conn, $sql);
?>
<?php if (mysqli_num_rows($result) > 0) {
// output data of each row
while($row = mysqli_fetch_assoc($result)) { ?>
<form action="" method="post">
<div class="form-group">
<label for="exampleInputPassword1">ID</label>
<input type="text" name="id" class="form-control" value="<?php echo $row['id'];?>" readonly>
<label for="exampleInputEmail1">First Name</label>
<input type="text" name="name" class="form-control" value="<?php echo $row['name'];?>">
</div>
<div class="form-group">
<label for="exampleInputPassword1">Last Name</label>
<input type="text" name="surname" class="form-control" value="<?php echo $row['surname'];?>">
</div>
<div class="form-group">
<label for="exampleInputPassword1">Vehicle Book No</label>
<input type="text" name="book" class="form-control" value="<?php echo $row['book'];?>">
</div>
<div class="form-group">
<label for="exampleInputPassword1">Vehicle Reg No.</label>
<input type="text" name="plate" class="form-control" value="<?php echo $row['plate'];?>">
</div>
<div class="form-group">
<label for="exampleInputPassword1">Payment Duration</label>
<input type="text" name="month" class="form-control" value="<?php echo $row['month'];?>">
</div>
<div class="form-group">
<label for="comment">Address:</label>
<input type="text" name="address" class="form-control" value="<?php echo $row['address']; ?>">
</div>
<button type="submit" name="update" class="btn btn-primary">Update Details</button>
<a href="payment.php?id=<? echo $row['id']; ?>" class="btn btn-danger" role="button">Proceed To Payment</a>
</form>
<?php }
} else {
echo "0 results";
};?>
<?php
$id= $_POST["id"];
$name = $_POST["name"];
$surname = $_POST["surname"];
$book = $_POST["book"];
$plate = $_POST["plate"];
$month = $_POST["month"];
$address = $_POST["address"];
if (isset($_POST["update"])){
$sql = "UPDATE details SET name='$name', surname='$surname', book='$book', plate='$plate', month='$month', address='$address' WHERE id='$id'";
if (mysqli_query($conn, $sql)) {
echo "Update was successful <br><br>";
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
}
?>
<?php
mysqli_close($conn);
?>
</div>
</div>
<!-- /.row -->
</div>
<!-- /.container -->
<!-- jQuery Version 1.11.1 -->
<script src="js/jquery.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>