-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckout.php
155 lines (105 loc) · 5.32 KB
/
checkout.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Entry Management</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>
<body style="background-image: url(data/img1.jpg) ; background-repeat: no-repeat; height: 100%; font-family: 'Ibarra Real Nova', serif;
/* Center and scale the image nicely */
background-position: center;
background-repeat: no-repeat;
background-size: cover;
background-attachment: fixed; "><b>
<nav class="navbar navbar-default" style="background-color:rgb(256,256,256,1);" ;>
<div class="container-fluid">
<div class="navbar-header">
<h1>Innovaccer</h1>
</div>
<ul class="nav navbar-nav">
<li><a href="index.html">Checkin</a></li>
<li><a href="checkout.php">Checkout</a></li>
<li><a href="list.php"> List of all customers </a></li>
</ul>
</div>
</nav>
<head>
<title>Entry Management</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
</head>
<div class="container" style="background-color:rgb(256,256,256,1);">
<form action="out.php" method="post">
<center>
<div class="form-group">
<h3> ------- Select Person to checkout-----------------</h3>
<br>
<h4>
</center>
<table class="table table-hover">
<thead>
<tr>
<th> </th>
<th>Name </th>
<th>Phone</th>
<th> Check-in time </th>
<th> Host Name </th>
<th>
</tr>
<?php
$servername = "";
$username = "root";
$password = "";
$dbname = "entry";
$conn = mysqli_connect($servername, $username, $password, $dbname) or die(" can't connect to server");
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "";
$sql = "SELECT name, phone,checkout,checkin,nameh FROM entry ";
// echo $sql2 ;
$result = mysqli_query($conn, $sql);
// echo mysqli_num_rows($result);
$count = 0;
$result = $conn->query($sql);
if ($row = $result->fetch_assoc()) {
$count++;
if ($row["checkout"] == '0') {
echo '<tr> <td><input type="radio" name="phone" value=' . $row["phone"] . ' checked > </td>'
. '<td>' . $row["name"] . "</td> <td> " . $row['phone'] . "</td> <td> " . $row['checkin'] . "</td> <td> " . $row['nameh'];
echo "<br>";
}
while ($row = $result->fetch_assoc()) {
$count++;
if ($row["checkout"] == '0') {
echo '<tr> <td><input type="radio" name="phone" value=' . $row["phone"] . ' > </td>'
. '<td>' . $row["name"] . "</td> <td> " . $row['phone'] . "</td> <td> " . $row['checkin'] . "</td> <td> " . $row['nameh'];
echo "<br>";
}
}
} //else echo 'No Entries Found';
echo '</table>';
if (($count) == 0) {
echo " No Check-ins found....first check-in a visiter";
}
?> </h4>
</div>
<center>
<!-- <div class="form-group">
<label for="datetime"><h3><b>Checkout time:<b></label>
<input type="datetime" class="form-control" name="checkout" id="checkout">
</div> -->
<button type="submit" class="btn btn-default">Submit</button>
</center>
</form>
</div>
</body>
</html>