-
Notifications
You must be signed in to change notification settings - Fork 1
/
categorydetail.php
71 lines (62 loc) · 2.11 KB
/
categorydetail.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
<!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">
<table border="1px" width="100%">
<tr>
<th>Category Id</th>
<th>Category Name</th>
</tr>
<?php
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 categories ");
while($row = mysql_fetch_array($query))
{ {Print "<tr>";
Print '<td align="center">'. $row['cat_id'] . "</td>";
Print '<td align="center">'. $row['cat_name'] . "</td>";
Print "</tr>";}}
?>
</table>
</div>
</div>
</body>
</html>