-
Notifications
You must be signed in to change notification settings - Fork 0
/
giveBack.php
94 lines (80 loc) · 1.69 KB
/
giveBack.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
<html>
<head>
<style type="text/css">
.auto-style1 {
font-size: large;
}
</style>
</head>
<body>
<h1> RETURN STUFF I HAVE BORROWED</h1>
<FORM><INPUT TYPE="button" VALUE="Back" onClick="history.go(-1);return true;"><br>
<br><span class="auto-style1">Please click on the item you want to return:</span></FORM>
<?php $mylocalvar = $_GET['myperson'];
;?>
<?php
if ($db_conn=OCILogon("ora_i0r7", "a41671785", "ug")){
$cmdstr = "select i.i_number, i.value, i.description, i.available from
makestransaction m, item i where i.i_number=m.item_number and m.email = '$mylocalvar' and type = 'Borrow'";
//and i.available = 'F'
$parsed = OCIParse($db_conn,$cmdstr);
if (!$parsed){
$err = OCIError($db_conn);
echo htmlentities($err['message']);
exit;
}
$r=OCIExecute($parsed, OCI_DEFAULT);
if(!$r){
$err = oci_error($parsed);
echo htmlentities($err['message']);
exit;
}
echo "<br /> Data Retrieved <br />";
?>
<TABLE border="1">
<tr>
<td>
Item
</td>
<td>
Value
</td>
<td>
Description
</td>
<td>
Avail
</td>
</tr>
<?php
while($row = OCI_Fetch_Array($parsed, OCI_BOTH)){
echo "<TR>";
echo "<TD>";
echo "<a href=\"returnStuff.php?item=$row[0]&myperson=$mylocalvar\">";
echo $row[0];
echo "</a>";
echo "</TD><TD>";
echo $row[1];
echo "</TD><TD>";
echo $row[2];
echo "</TD><TD>";
echo $row[3];
echo "</TD>>";
echo "<tr />";
}
echo "</TABLE>";
OCILogoff($db_conn);
}
?>
<hr />
<?php echo $_GET['myperson'];?>
<?php echo $_GET['item'];?>
<?php
echo "<br/>";
echo "mylocalvar for using with queries = $mylocalvar";
echo "<br/>";
echo "<br/>";
echo "$cmdstr \n";
?>
</body>
</html>