forked from GulshanKataria/farmer_logisticsapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproviders_nlp.php
151 lines (109 loc) · 2.94 KB
/
providers_nlp.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
<?php
session_start();
include("connection.php");
error_reporting(0);
?>
<!DOCTYPE html>
<html>
<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>
<body>
<body>
<section class="jumbotron-section-1">
<div class="jumbotron no-margin jumbotron-section-1-bg">
<div class="container-fluid introduction">
<h2 class="name">NLP IN YOUR LOCATION</h2>
<a href="#" class="visible-xs btn call-me"></a>
</div>
</div>
</section>
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<table id="mytable" class="table table-bordered table-hover">
<tr>
<th>NLPNAME</th>
<th>CONTACT</th>
<th>PRICE</th>
<th>OVERALL REVIEW</th>
<th>TRACKING</th>
<th>COLD STORAGE</th>
<th>ONLINE FACILITY</th>
<th>Booking</th>
</tr>
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "nlp";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$first=$_REQUEST['source'];
$second=$_REQUEST['destination'];
$a=$_REQUEST['tracking'];
$b=$_REQUEST['typeofservice'];
$c=$_REQUEST['truck'];
$d=$_REQUEST['material'];
$_SESSION['tracking'] = $a;
$_SESSION['typeofservice'] = $b;
$_SESSION['truck'] = $c;
$_SESSION['material'] = $d;
$sql = "SELECT name,contact,price,reviews,tracking,coldstorage,online FROM providers where source='$first' and destination='$second' ";
$result = $conn->query($sql);
if ($result && $result->num_rows) {
while($row = $result->fetch_assoc()) {
echo "<tr> <td>".$row["name"]."</td><td>".$row["contact"]."</td><td>".$row["price"]."</td><td>".$row["reviews"]."</td><td>".$row["tracking"]."</td><td>".$row["coldstorage"]."</td><td>".$row["online"]."</td><td><form action='book.php'>
<input type='submit' value='Submit' class='btn btn-success' />
</form></td>";
$e=$row["name"];
$_SESSION['nlp']=$e;
}
echo "</table>";
} else {
echo "0 results";
}
$conn->close();
?>
</table>
</div>
</div>
</div>
</div>
</body>
</body>
</body>
</html>