-
Notifications
You must be signed in to change notification settings - Fork 1
/
product2.php
86 lines (77 loc) · 2.94 KB
/
product2.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
<!doctype html>
<html>
<head>
<!-- App Title -->
<title>Grocery store</title>
<!-- App Description -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
<link rel="stylesheet" type="text/css" href="css/bootstrap.css"/>
<link rel="stylesheet" type="text/css" href="css/animate.css"/>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/wow.js"></script>
<script type="text/javascript" src="js/main.js"></script>
<style type="text/css">
body{
background-color: #FF6600;
padding: 0px;
margin: 0px;
}
table{border-radius: 25px;
background-color: rgb(51, 51, 255);}
th{border-radius: 25px;
background-color:rgb(102, 102, 255);
color: white; }
td{border-radius: 25px;
background-color:#CCFFFF; }
h1{font-size:24;font-family:Copperplate Gothic Light;color: #3333FF}
</style>
</head>
<?php
session_start(); //starts the session
if($_SESSION['employee']){ //checks if user is logged in
}
else{
header("location:index.php"); // redirects if user is not logged in
}
$emp = $_SESSION['employee']; //assigns user value
?>
<body>
<div class="container">
<div class="row text-center">
<form action="product2.php" method="post">
<label style="color:black">Enter date:</label><input type="date" name="alp" required="required" style="border-radius: 25px;"/><br/>
<button type="submit" value="Register" style="font-size:24;font-family:Copperplate Gothic Light;color: #FF6600">Ok</button>
</form>
<table class="table table-condensed" border="1px" width="100%">
<tr>
<th>ProductId</th>
<th>ProductName</th>
<th>category Id</th>
<th>DateofMANU</th>
<th>DateOfExp</th>
<th>Price</th>
</tr>
<?php
if($_SERVER["REQUEST_METHOD"] == "POST"){
$k=$_POST['alp'];
mysql_connect("localhost", "root","") or die(mysql_error()); //Connect to server
mysql_select_db("dbms") or die("Cannot connect to database"); //connect to database
$query = mysql_query("Select * from products where doe < '$k' order by doe ");
while($row = mysql_fetch_array($query))
{ {Print "<tr>";
Print '<td align="center">'. $row['pro_id'] . "</td>";
Print '<td align="center">'. $row['pro_name'] . "</td>";
Print '<td align="center">'. $row['cat_id']. "</td>";
Print '<td align="center">'. $row['dom']."</td>";
Print '<td align="center">'. $row['doe']."</td>";
Print '<td align="center">'. $row['price']."</td>";
Print "</tr>";}}
}
?>
</table>
</div>
</div>
</body>
</html>