forked from GulshanKataria/farmer_logisticsapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnlprequest.php
127 lines (96 loc) · 2.74 KB
/
nlprequest.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
<?php
session_start();
error_reporting(0);
include("connection.php");
?>
<html>
<head>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<title>Table with database</title>
<style>
table {
border-collapse: collapse;
width: 100%;
color: #588c7e;
font-family: monospace;
font-size: 20px;
text-align: left;
}
th {
background-color: #5b6e2e;
color: white;
}
button{
background-color: #C7DBE1
}
.jumbotron{
background-color: #5b6e2e;
color: white;
}
.name{
text-align: center;
}
tr:nth-child(even) {background-color: #f2f2f2}
</style>
</head>
<title> Customer Requests</title></head>
<body>
<?php
$b=$_SESSION['Email'];
$a=$_SESSION['name'];
define('DB_SERVER', 'localhost:3306');
define('DB_USERNAME', 'root');
define('DB_PASSWORD', '');
define('DB_DATABASE', 'nlp'); //where customers is the database
$db = mysqli_connect(DB_SERVER,DB_USERNAME,DB_PASSWORD,DB_DATABASE);
$query="SELECT * from customer_detail WHERE nlp = '$a' "; // Fetch all the records from the table address
$result=mysqli_query($db,$query);
?>
<section class="jumbotron-section-1">
<div class="jumbotron no-margin jumbotron-section-1-bg">
<div class="container-fluid introduction">
<h2 class="name">REQUEST FROM CUSTOMERS</h2>
<a href="#" class="visible-xs btn call-me"></a>
</div>
</div>
</section>
<table border="1">
<tr>
<th> NAME </th>
<th> EMAIL</th>
<th> PHONE</th>
<th> TRACKING(YES/NO)</th>
<th>TYPE OF SERVICE</th>
<th> TRUCK NAME</th>
<th> PICK UP CITY NAME</th>
<th>PICK UP LOCATION</th>
<th>DROP CITY</th>
<th>DROP LOCATION</th>
<th>DATE</th>
<th>HOUR</th>
<th>MINUTE</th>
<th>TIME</th>
</tr>
<?php
$sql = "SELECT * from customer_detail where nlp='$a' ";
$result = $conn->query($sql);
if ($result && $result->num_rows) {
while($row = $result->fetch_assoc()) {
echo "<tr> <td>".$row["name"]."</td><td>".$row["email"]."</td><td>".$row["phone"]."</td><td>".$row["tracking"]."</td><td>".$row["typeofservice"]."</td><td>".$row["truck"]."</td><td>".$row["city"]."</td><td>".$row["location"]."</td><td>".$row["city1"]."</td><td>".$row["location1"]."</td><td>".$row["date"]."</td><td>".$row["hour"]."</td><td>".$row["minute"]."</td><td>".$row["time"]."</td> ";
$e=$row["name"];
$_SESSION['nlp']=$e;
}
echo "</table>";
} else {
echo "0 results";
}
$conn->close();
?>
</table>
</body>
</html>