-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreated_items.php
More file actions
95 lines (76 loc) · 2.92 KB
/
created_items.php
File metadata and controls
95 lines (76 loc) · 2.92 KB
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
<?php
require_once('inc/startsession.php');
/////////////////////////////////////////////////////////////////////
//
// Written by Jim Garbe-- Dynamic Checksheet
//
/////////////////////////////////////////////////////////////////////
require_once('inc/appvars.php');
$Title="Viewing Created Items";
require_once('inc/title.php');
require_once("inc/functions.php.inc");
require_once('inc/connectvars.php');
// Generate the navigation menu
if (isset($_SESSION['username']) && ($_SESSION['status'] == 1)) {
// Connect to the database
$dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
// Retrieve the user data from MySQL
$query = "SELECT user_id, first_name FROM _user WHERE first_name IS NOT NULL ORDER BY join_date DESC LIMIT 5";
$data = mysqli_query($dbc, $query);
mysqli_close($dbc);
?>
</div>
<?php
print("<div class='scrollTableContainer'>");
print(" <center><INPUT TYPE=\"button\" VALUE=\"Back to Item Creation.\" onclick= \"location = 'create_items.php';\" > \n");
print ("\"✓\"=Expiration Date on Item");
print("<table class=dataTable style=color:white; cellspacing=0>");
print("\t<thead>\n");
print("\t<tr>\n");
print("\t\t<th bgcolor='#662A03' colspan='6'>\n");
print("\t\t\tItems\n");
print("\t\t</th>\n");
print("\t</tr>\n");
print("\t</thead>\n");
/////////////////////////////////////////////////////////////////
print("\t<tbody>\n");
print("\t<tr>\n");
$name=Items; // Name of the menu table
$tr=0;
// Connect to the database
$dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
$sql="SELECT * FROM $name ORDER BY item_name";
$result=mysqli_query($dbc, $sql);
while ($row = mysqli_fetch_array($result, MYSQL_NUM)) {
$item_id=$row[0];
$ItemName = $row[1];
$Perishable = $row[2];
if ($Perishable == 1) { $printcheck="✓";}
else {$printcheck = '';}
//print("\t\t<td align=right style='border-color:#433C33;border-left-style:dotted;border-bottom-style:dotted;'>$CatName</td>\n");
//print("<td align=center style='border-color:#433C33;border-bottom-style:dotted;'>$SubName</td>\n");
//print("<td align=center style='border-color:#433C33;border-bottom-style:dotted;'>$ParName</td>\n");
print("<td align=center style='border-color:#433C33;border-bottom-style:dotted;'>$ItemName</td>\n");
print("<td align=center style='border-color:#433C33;border-right-style:dotted;border-bottom-style:dotted;'>".$printcheck."</td>\n");
$tr++;
if ($tr==3) {
print("\t</tr>\n\t<tr>\n");
$tr=0;}
}
print("\t</tr>");
print("\t</tbody>\n");
print("</table>");
print("</div>");
mysqli_close($dbc);
}
else {
echo ' <a href="login.php">Log In As An Administrator(' . $_SESSION['username'] . ').</a><br />';
//echo ' <a href="signup.php">Sign Up</a>';
}
?>
<center><INPUT TYPE="button" VALUE="Back to Item Creation." onclick= "location = 'create_items.php';" >
<div class="push"></div>
</div>
<? require("inc/footer.inc"); ?>
</body>
</html>