-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathborrowersform.php
executable file
·254 lines (206 loc) · 7.21 KB
/
borrowersform.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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
<?php
$timezone = "America/Chicago";
if(function_exists('date_default_timezone_set')) date_default_timezone_set($timezone);
?>
<script language="JavaScript">
<!--
function clock(){
var time = new Date()
var hr = time.getHours()
var min = time.getMinutes()
var sec = time.getSeconds()
var ampm = " PM "
if (hr < 12){
ampm = " AM "
}
if (hr > 12){
hr -= 12
}
if (hr < 10){
hr = " " + hr
}
if (min < 10){
min = "0" + min
}
if (sec < 10){
sec = "0" + sec
}
document.clockForm.clockButton.value = hr + ":" + min + ":" + sec + ampm
setTimeout("clock()", 1000)
}
function showDate(){
var date = new Date()
var year = date.getYear()
if(year < 1000){
year += 1900
}
var monthArray = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")
alert( monthArray[date.getMonth()] + " " + date.getDate() + ", " + year)
}
window.onload=clock;
//-->
</script>
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script>
$(document).ready(function(){
$("#close").click(function(){
$("#ok").fadeOut("slow");
});
});
</script>
<style>
.form{ width:700px; margin:auto;}
.ts{ padding:2px; width:200px;}
</style>
<div id="ok" style=" z-index:20; position:absolute; background:url(images/trans_bg.png); width:100%;height:100%;display:none;">
<div class="boxaction" style="margin-top:19px;">
<div class="headbox">
<img src="icons/check-big.png" height="25" style="margin-top:8px; float:left; margin-left:10px;"/>
<div style=" margin-left:7px; margin-top:13px; color:#030; font-size:15px; font-family:Verdana, Geneva, sans-serif; font-weight:bold;float:left">Success</div>
</div>
<div style="font-size:15px; padding-top:40px; margin-left:30px; font-family:Arial, Helvetica, sans-serif;">Your Borrow has been Reserved
</div>
<a href="out.php">
<div class="btnbox" id="close">
<div style="font:14px; font-family:Verdana, Geneva, sans-serif; color:#FFF; font-weight:bold; text-align:center; margin-top:5px;">OK</div>
</div>
</a>
</div>
</div><!--succes box-->
<div class="form">
<table border="0">
<tr>
<td><img src="icons/1.png" height="50" /></td><td style="font-size:30px; font-family:Verdana, Geneva, sans-serif;">Reservation Form</td>
</tr>
</table>
<?php
include('config.php');
$get="select * from books where accNo='".$_GET['accNo']."'";
$result=mysql_query($get) or die(mysql_error());
$res=mysql_fetch_array($result);
?>
<table width="" border="0" style="margin-top:30px;font-size:13px;font-family:Verdana, Geneva, sans-serif; ">
<tr>
<td>Acc. No.</td>
<td><input type="text" readonly="readonly" value="<?php echo $_GET['accNo']; ?>" class="ts" /></td>
</tr>
<tr>
<td>Book Title</td>
<td><input type="text" readonly="readonly" value="<?php echo $res['booktitle']; ?>" class="ts" /></td>
</tr>
<tr>
<td>Book Author</td>
<td><input type="text" readonly="readonly" value="<?php echo $res['author1']; ?>" class="ts" /></td>
</tr>
</table>
<?php if (!isset($_SESSION['studentid'])){ ?>
<form action="" method="post">
<table width="" border="0" style="margin-top:30px;">
<tr >
<td colspan="2" height="40" style="font-size:15px; font-family:Verdana, Geneva, sans-serif; font-weight:bold;">Personal Information</td>
</tr>
<tr style="font-size:13px;font-family:Verdana, Geneva, sans-serif; ">
<td>First Name</td>
<td><input type="text" value="" name="fname" class="ts" /></td>
</tr>
<tr style="font-size:13px;font-family:Verdana, Geneva, sans-serif; ">
<td>Last Name</td>
<td><input type="text" value="" name="lname" class="ts" /></td>
</tr>
<tr>
<td colspan="2" align="right"><input type="submit" name="next" value="Next Step" /></td>
</tr>
</table>
</form>
<?php }
else{
?>
<?php
$get="select * from tblborrower where studentid='".$_SESSION['studentid']."'";
$id=mysql_query($get) or die(mysql_error());
$get=mysql_fetch_array($id);
$get1="select * from tbltype where id='".$get['type']."'";
$jade=mysql_query($get1) or die(mysql_error());
$a=mysql_fetch_array($jade);
?>
<form action="" method="post" name="clockForm">
<table width="700" border="0" style="margin-top:30px;">
<tr >
<td colspan="2" height="40" style="font-size:15px; font-family:Verdana, Geneva, sans-serif; font-weight:bold;">Personal Information</td>
</tr>
<tr>
<td height="150" colspan="2">
<img style="" src="borrowersphoto/<?php if($get['photo']==true){
echo $get['photo'];}else{
echo "default.jpg";
} ?>
" height="100" width="100"></td>
</tr>
<tr>
<td>Full Name</td>
<td>
<input type="hidden" readonly="readonly" value="<?php echo $_GET['accNo']; ?>" name="accNo" class="ts" />
<input type="hidden" readonly="readonly" value="<?php echo $_SESSION['studentid']; ?>" name="studentid" class="ts" />
<input type="text" readonly="readonly" value="<?php echo $get['fname']." ".$get['mi'].". ".$get['lname']; ?>" name="lname" class="ts" /></td>
<td>Time Reserve</td>
<td>Time Reserve</td>
</tr>
<tr>
<td>Gender</td>
<td><input type="text" readonly="readonly" value="<?php echo $get['gender']; ?>" name="lname" class="ts" /></td>
<td rowspan="2">
<input type="button" style="width:155px; font-size:25px; padding:6px" name="clockButton" value="Loading..." onClick="showDate()" />
</td>
<td rowspan="2">
<?php
// for($=date('H:i'))
?>
<!--<input align="center" value="<?php ?>" type="text" style="width:155px; font-size:32px; padding:6px" name="get" size="8">-->
<select style='width:190px; font-size:15px; padding:12px;' name='get' onchange='return timeSchedvalue(this.value)'>
<?php
for ($i = 0; $i <= 960; $i+=30) {
$time1 = date('h:i a', mktime(date('H:i:s'), $i, 0, 0, 0, 0));
$time2 = date('h:i a', mktime(date('H:i:s'), $i+30, 0, 0, 0, 0));
$time3 = date('h:i:s', mktime(date('H:i:s'), $i+30, 0, 0, 0, 0));
echo "<option value='" .$time3 . "'>".$time2 . "</option>";
}
?>
</select>
<?php ?>
</td>
</tr>
<tr>
<td>Type</td>
<td><input type="text" readonly="readonly" value="<?php echo $get['type']; ?>" name="lname" class="ts" /></td>
</tr>
</table>
<table border="0" align="center" style="margin-top:30px;">
<tr>
<td colspan="2" align="right" height="50"><input style="padding:11px; font-size:30px; width:200px;" type="submit" value="Reserve" name="res" class="ts" /></td>
</tr>
</table>
</form>
<?php }?>
<?php
if($_POST['next']){
require_once('config.php');
$login1="SELECT * FROM tblborrower WHERE (fname = '" .$_POST['fname']. "') and (lname = '" .$_POST['lname']. "')";
$r=mysql_query($login1);
$row=mysql_fetch_array($r);
if($row){
$_SESSION['studentid']=$row['studentid'];
echo "<script>window.location='?accNo=$_GET[accNo]&choosepassword'</script>";
// echo "<script>window.location='?accNo=$_GET[accNo]&studentid=$row[studentid]'</script>";
}
else{
echo $_POST['fname']." ".$_POST['lname']." Not found in the database";
}
}
?>
<?php
if(isset($_SESSION['studentid'])){
echo "choose";
}
?>
<a href="out.php">out</a>
</div>