-
Notifications
You must be signed in to change notification settings - Fork 0
/
Smyord.php
222 lines (178 loc) · 4.91 KB
/
Smyord.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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<?php
session_start();
if(!isset($_SESSION['login_user']))
{
echo "login first";
}
else
{
require_once 'include/DB_Functions.php';
include_once("Student.html");
require_once 'include/nonlistedItems.php';
$db = new DB_Functions();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="slider.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
function goback()
{
alert("hi");
history.go(-1);
}
</script>
<title>My Orders</title>
</head>
<body>
<div id="header">
<!-- Stores and Purchase Management -->
</div>
<div>
<div id="sidebar">
<?php
if(isset($_POST['Repair']) || isset($_POST['Return']) || isset($_POST['nRepair']))
{
$_SESSION['item1']=$_POST['name'];
if(isset($_POST['Return']))
{
$_SESSION["status"] = "return";
}
else if(isset($_POST['Repair']))
{
$_SESSION["status"] = "repair";
}
else if(isset($_POST['nRepair']))
{
$_SESSION["status"] = "nrepair";
}
header("Location:try.php");
}
?>
</div>
<!-- InstanceBeginEditable name="EditRegion1" -->
<div>
<br><br>
<?php
$username = $_SESSION['login_user'];
$query="SELECT * FROM LI_Orders WHERE stakeholder='$username'";
$result=mysql_query($query) or die("query error");
$num_rows = mysql_num_rows($result);
//$query_data=mysql_fetch_array($result);
if (mysql_num_rows($result) > 0) {
// output data of each row
?>
<br><br><br>
<table table-layout: fixed; >
<tr>
<!-- <td width= 20% > <?php echo "SNo"; ?> </td> -->
<td width =2%> </td>
<td width= 20% > <b>Item Name </b> </td>
<td width= 25% > <b>Consumability </b> </td>
<td width= 25% > <b>Quantity </b> </td>
<!-- <td width= 25% > <b>Stakeholder </b> </td> -->
<td width= 25% > <b>Return</b> </td>
<td width= 25% > <b>Repair </b> </td>
</tr>
</table>
<?php
while($row = mysql_fetch_assoc($result)) {
//$_SESSION['item1'] = $row['name'];
$consumability = $row['consumability'];
?>
<form action="" method="post" name="frm">
<input type="hidden" name="name" value="<?php echo $row['name']; ?>">
<table class="table" >
<tr>
<td > </td>
<td width = 25% > <?php echo $row['name']; ?> </td>
<td width = 25% > <?php echo $row['consumability']; ?> </td>
<td width = 25% > <?php echo $row['quantity']; ?> </td>
<td width = 25% > <button type = "submit" name="Return" class="btn btn-success">Return</button></td>
<td width = 25% > <button name = "Repair" type = "submit" class="btn btn-success">Repair</button></td>
</tr>
</table>
</form>
<?php } ?>
<br>
<?php
}
else {
// echo "0 results";
}?>
<!-- <br><br>
<?php
echo "NON-LISTED PRODUCTS";
?>
<br><br>
<?php
$username = $_SESSION['login_user'];
$query="SELECT * FROM NLI_Orders WHERE stakeholder='$username'";
$result=mysql_query($query) or die("query error");
$num_rows = mysql_num_rows($result);
//$query_data=mysql_fetch_array($result);
if (mysql_num_rows($result) > 0) {
// output data of each row
?>
Item Name
<?php
while($row = mysql_fetch_assoc($result)) {
//$_SESSION['item1'] = $row['name'];
//$consumability = $row['consumability'];
?>
<form action="" method="post" name="frm">
<table>
<tr><td><input name="name" type="text" value="<?php echo $row['name']; ?>" size="10" readonly/></td><td><button name = "nRepair" type = "submit" class="btn btn-success">Repair</button></td></tr>
</table>
</form>
<?php } ?>
<br>
<?php
}
else {
echo "0 results";
}?>
<br><br>
<?php
echo "APPROVAL PENDING";
?>
<br><br>
<?php
$username = $_SESSION['login_user'];
$query="SELECT * FROM Approval_requests WHERE User = '$username'";
//echo "1";
$result=mysql_query($query) or die("query error");
//echo "2";
$num_rows = mysql_num_rows($result);
//$query_data=mysql_fetch_array($result);
if (mysql_num_rows($result) > 0) {
// output data of each row
?>
Item Name
<?php
while($row = mysql_fetch_assoc($result)) {
//$_SESSION['item1'] = $row['name'];
//$item_1 = $row[''];
?>
<form action="" method="post" name="frm">
<table>
<tr><td><input name="name" type="text" value="<?php echo $row['itemName']; ?>" size="10" readonly/></td></tr>
</table>
</form>
<?php } ?>
<br>
<?php
}
else {
echo "0 results";
}?>
-->
</div>
</body>
</html>
<?php
}
?>