-
Notifications
You must be signed in to change notification settings - Fork 0
/
bar_new.php
726 lines (626 loc) · 26.4 KB
/
bar_new.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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
<?php
session_start();
if (!isset($_SESSION["username"])) {
header("location:admin_login.php");
exit;
}
//SELECT ADDDATE(CURDATE( ), 1);
//SELECT ADDTIME(NOW(),' 18:11:1') as deadline;
include "include/connect.php";
include "include/gensettings.php";
include "include/oras.php";
include "user.php";
//echo $uri;
$op = 0;
//authorized
if ($borrow_book == "on") {
//auto generate the title output
$book_title = "auto generate.";
//set the deadline
$sql = "SELECT ADDTIME(NOW(), '$hour_allow:0:0') as deadline,now() as ngaun";
$result = mysql_query($sql, $connect) or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
$input_deadline = $row['deadline'];
$deadline = $row['deadline'];
$ngaun = $row['ngaun'];
}
//if auto deadline set to ON
if ($auto_deadline == 0) {
$input_deadline = '<input name="deadline" type="text" id="deadline" class="dilaw"/>';
}
$op = 0;
//show borrower's detail
if (isset($_POST['show'])) {
//get the value from form submitted
$search = $_POST['bar_id'];
$sql = "SELECT * from barrower where bar_id ='$search'";
$result = mysql_query($sql, $connect) or die("cant execute query!....3." . mysql_error());
while ($row = mysql_fetch_array($result)) {
$id = $row['id'];
$bar_id = $row['bar_id'];
$name = $row['name'];
$last = $row['last1'];
$first = $row['first1'];
$usertype = $row['type'];
$course = $row['course'];
$taon = $row['year1'];
$add = $row['address'];
$number = $row['contact'];
$mail = $row['email'];
$ex_date = $row['ex_date'];
$adviser = $row['adviser'];
}
$row = mysql_num_rows($result);
$op = 2;
$show = 1;
if ($row == 0) {
$message = "<strong>The borrower ID does not exists!</strong>";
$bgcolor = 'bgcolor="#FFCC00"';
$op = 0;}
}
//show book detail
if (isset($_POST['detail'])) {
//get the value from form submitted
$search = $_POST['bar_id'];
$sql = "SELECT * from barrower where bar_id ='$search'";
$result = mysql_query($sql, $connect) or die("cant execute query!....3." . mysql_error());
while ($row = mysql_fetch_array($result)) {
$id = $row['id'];
$bar_id = $row['bar_id'];
$name = $row['name'];
$last = $row['last1'];
$first = $row['first1'];
$usertype = $row['type'];
$course = $row['course'];
$taon = $row['year1'];
$add = $row['address'];
$number = $row['contact'];
$mail = $row['email'];
$ex_date = $row['ex_date'];
$adviser = $row['adviser'];
}
$row = mysql_num_rows($result);
$op = 2;
$show = 1;
if ($row == 0) {
$message = "<strong>The borrower ID does not exists!</strong>";
$bgcolor = 'bgcolor="#FFCC00"';
$op = 0;}
$search = $_POST['access_no'];
$sql = "SELECT * FROM card_cat WHERE access_no='$search'";
$result = mysql_query($sql, $connect) or die("cant execute query!.....3");
while ($row = mysql_fetch_array($result)) {
$title = $row['title'];
$author_sname = $row['author_sname'];
$author_fname = $row['author_fname'];
$author_mname = $row['author_mname'];
$author = $author_fname . ' ' . $author_mname{0} . '.' . ' ' . $author_sname;
$subject1 = $row['subject1'];
$type = $row['gmd'];
//$call_num = $row['call_num'];
$classification_no = $row['classification_no'];
$book_no = $row['book_no'];
$access_no = $row['access_no'];
$qty = $row['qty'];
}
$row = mysql_num_rows($result);
$op = 2;
$detail = 1;
$show = 1;
if ($row == 0) {
$message = "<strong>The Access Number does not exists!</strong>";
$bgcolor = 'bgcolor="#FFCC00"';
$op = 3;
$show = 1;}
}
//if the borrow this book has been clicked
if ($_GET['access_no_from']) {
$access_no_from = $_GET['access_no_from'];
$sql = "SELECT * from card_cat where access_no='$access_no_from'";
$result = mysql_query($sql, $connect) or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
$book_title = $row['title'];
$book_author = $row['author_fname'] . ' ' . $row['author_sname'];
}
}
//if submit button has been clicked
if (isset($_POST['submit'])) {
if ($_POST['deadline']) {
$deadline = $_POST['deadline'];
}
if (($_POST['bar_id'] == "") || ($_POST['access_no'] == "")) {
$error = "<strong>Please complete the fields!</strong>";
$bgcolor = 'bgcolor="#FFCC00"';
$access_no = $_POST['access_no'];
$sql = "SELECT * from card_cat where access_no='$access_no'";
$result = mysql_query($sql, $connect) or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
$book_title = $row['title'];
$book_author = $row['author'];
}
} else {
//get the value from form submitted
$bar_id = $_POST['bar_id'];
$access_no = $_POST['access_no'];
//search the borrower is in the table
$sql_po = "SELECT * FROM barrower WHERE bar_id='$bar_id'";
$result10 = mysql_query($sql_po, $connect) or die("cant execute query!.....1");
$row11 = mysql_fetch_array($result10);
$row10 = mysql_num_rows($result10);
$school_code = $row11['school_code'];
$act = $row11['active'];
//search if the accession number is in the table
$sql = "SELECT * FROM card_cat WHERE access_no='$access_no'&& qty=1";
$result = mysql_query($sql, $connect) or die("cant execute query!.....2");
$row1 = mysql_num_rows($result);
//search if the borrower is in the table
$sql = "SELECT * FROM books_bar where bar_id='$bar_id'";
$result = mysql_query($sql, $connect) or die("cant execute query!.....2");
$row2 = mysql_num_rows($result);
//number of books borrowed by borrower
$the_book_limit = $row2;
//if first time borrower
if ($the_book_limit == 0) {
$row2 = 1;
}
//limit of books
$sql = "SELECT * from usergroup WHERE type='$usertype'";
$result = mysql_query($sql, $connect) or die("cant execute query!.....");
$rows = mysql_num_rows($result);
while ($ano = mysql_fetch_array($result)) {
$add_book = $ano['add_book'];
$edit_book = $ano['edit_book'];
$del_book = $ano['del_book'];
$borrow_book = $ano['borrow_book'];
$add_borrower = $ano['add_borrower'];
$edit_borrower = $ano['edit_borrower'];
$del_borrower = $ano['del_borrower'];
$show_borrower = $ano['show_borrower'];
$upload_file = $ano['upload'];
$remove_file = $ano['remove'];
$max_no = $ano['max_no'];
}
//if the borrower does not exists;
if ($row10 == 0) {
$message = "<strong>The borrower ID does not exist!</strong>";
$bgcolor = 'bgcolor="#FFCC00"';
$op = 0;
}
if ($act == 0) {
$message = "<strong>Borrowers Card has expired!</strong>";
$bgcolor = 'bgcolor="#FFCC00"';
$op = 0;
} else {
$act = 1;}
//if the book unavailable
if ($row1 == 0) {
$message = "<strong>This book doesn't exists or unavailable!</strong>";
$bgcolor = 'bgcolor="#FFCC00"';
$op = 0;
}
//if borrower reach the limit of books
if ($the_book_limit >= $max_no) {
$message = "<strong>You reach the limit of books!</strong>";
$bgcolor = 'bgcolor="#FFCC00"';
$row2 = 0;
$op = 0;
}
//if the borrower passed the valid requirements
if (($row10 >= 1) && ($row1 >= 1) && ($row2 >= 1) && ($act == 1)) {
/**create query to know the
*title of books by its
*accession number
**/
$sql = "SELECT * FROM card_cat WHERE access_no='$access_no'";
$result = mysql_query($sql, $connect) or die("cant execute query!.....3");
while ($row = mysql_fetch_array($result)) {
$title = $row['title'];
$title2 = $row['title'];
$author_sname = $row['author_sname'];
$author_fname = $row['author_fname'];
$author_mname = $row['author_mname'];
$author = $author_fname . ' ' . $author_mname{0} . '.' . ' ' . $author_sname;
$qty1 = $row['qty'];
//$call_num_final=$row['call_num'];
$classification_no_final = $row['classfication_no'];
$book_no_final = $row['book_no'];
$call_num_to_table = $row['access_no'];
}
$title = str_replace("'", "", $title);
$sql2 = "select * from titles where title_proper='$title2'";
$result2 = mysql_query($sql2, $connect) or die("cant execute query!" . mysql_error());
$row3 = mysql_fetch_array($result2);
$quantity = $row3['quantity'];
//echo $quantity;
//set the quantity of the book to 0
$sql3 = "UPDATE card_cat SET qty=0 WHERE access_no='$access_no'";
$result = mysql_query($sql3, $connect) or die("cant execute query!.....4");
//decrement 1 in the quantity of the quanity field in the titles table
$quan = $quantity - 1;
$sql = "UPDATE titles SET quantity='$quan' WHERE title_proper='$title2'";
$result = mysql_query($sql, $connect) or die("cant execute query!.....4");
//put to database all final values
$sql = "INSERT INTO books_bar (books, access_no, author,bar_id, qty, deadline,date_borrow,school_code) VALUES ( '$title', '$call_num_to_table', '$author','$bar_id','$qty','$deadline', '$ngaun','$school_code')";
$result = mysql_query($sql, $connect) or die("cant execute query!....51." . mysql_error());
//put to history table
$sql = "INSERT INTO history (`title`, `access_no`,`classification_no`,`book_no`,`author`, `bar_id`,`date_borrow`,`deadline`,`school_code`)
VALUES ( '$title', '$access_no', '$classification_no_final','$book_no_final','$author','$bar_id','$ngaun','$deadline','$school_code')";
mysql_query($sql, $connect) or die("cant execute query!....6.");
//display success inserting to table
$message = "<strong><font color=#339900>Successfully added to your account!
</font></strong>";
$op = 1;
//create query here to mark the books as out of lib.
//or mark status as out or in
} else {
//$error= "<strong><font color=#339900>Please enter correct ID or call number!
// </font></strong>";
}
}
}
} // borrow_book is on
else {
$msg_mo = "You are not allowed to borrow book/s!";
$op = 4;}
?>
<!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=iso-8859-1" />
<title><?php echo $system_title . "--" . $footer; ?></title>
<link rel="stylesheet" type="text/css" href="css/<?php echo $css; ?>" />
<script type="text/JavaScript">
<!--
function FormValidate1(){
if (document.myform.bar_id.value == ""){
alert("Enter the Borrower's ID!");
document.myform.bar_id.focus();
return false;}
//if(isNaN(document.myform.bar_id.value) == true){
//alert("The Borrower's id must be numeric type!");
//document.myform.bar_id.focus();
//return false;}
if (document.myform.bar_id.value.length <= 4){
alert("The Borrower's id must be of length 5 or more!");
document.myform.bar_id.focus();
return false;}
}
</script>
<script type="text/JavaScript">
<!--
function FormValidate2(){
if (document.myform.bar_id.value == ""){
alert("Enter the Borrower's ID!");
document.myform.bar_id.focus();
return false;}
//if(isNaN(document.myform.bar_id.value) == true){
//alert("The Borrower's id must be numeric type!");
//document.myform.bar_id.focus();
//return false;}
if (document.myform.bar_id.value.length <= 4){
alert("The Borrower's id must be of length 5 or more!");
document.myform.bar_id.focus();
return false;}
if (document.myform.access_no.value == ""){
alert("Enter the Access Number!");
document.myform.access_no.focus();
return false;}
//if(isNaN(document.myform.access_no.value) == true){
//alert("The Access Number must be numeric type!");
//document.myform.access_no.focus();
//return false;}
}
</SCRIPT>
<SCRIPT language=javascript>
function numbersOnly(el){
el.value = el.value.replace(/[^0-9]/g, "");
}
</SCRIPT>
<script type="text/javascript" src="js/quickstart.js"></script>
<SCRIPT language=javascript>
function alert1(){
}
</SCRIPT>
</head>
<body >
<div class="header">
<div class="logo"><?php echo " " . $header_title; ?> </div>
<div id="Layer1"><img src="images/<?php echo $logo; ?>" width="117" height="110" />
<div id="Layer2"></div>
</div>
</div>
<div class="navbg">
<div id="navcontainer">
<ul id="navlist">
<li id="active"><a href="home.php" id="current" title="Home">Home</a></li>
<li><a href="admin.php" title="Search">Search</a></li>
<li><a href="admin_add_new.php" title="Add book">Add book</a></li>
<li><a href="barrower.php" title="Borrower">Borrower</a></li>
<li><a href="inventory.php" title="Inventory">Inventory</a></li>
<li><a href="settings.php" title="Settings">Settings</a></li>
<li><a href="help1.php" title="Help">Help</a></li>
<li><a href="logout.php" title="Logout">Logout</a></li>
</ul>
</div>
</div>
<div class="maincontent">
<div class="floatelft">
<h2><a href="barrower.php">Search borrower</a> | <?php if ($borrow_book == "on") {
echo '<a href="bar_new.php">Borrow books </a>';
} else {
echo "Borrow Book";
}
?> | <?php if ($add_borrower == "on") {
echo '<a href="create_borrower.php">Add borrower</a>';
} else {
echo "Add Borrower";
}
?> |<?php if ($show_borrower == "on") {
echo '<a href="show_borrower.php">Show borrower</a>';
} else {
echo "Show Borrower";
}
?>|<?php if (($upload_file == "on") || ($remove_file == "on")) {
echo '<a href="load_file.php">Update borrower photo</a>';
} else {
echo "Update borrower photo";
}
?>|<?php if ($uri == "admin") {
echo '<a href="pay_fee.php">Return books</a>';
} else {
echo "Return Books";
}
?>
</h2>
<?php if ($op == 0) {?>
<form action="bar_new.php" method="post" name="myform">
<table width="100%" border="0" cellpadding="5" cellspacing="5">
<tr bgcolor="#339900">
<td align="left" bgcolor="#000000" ><span class="style1">Borrower's ID </span></td>
<td align="center" colspan="3" bgcolor="#000000" ><span class="style1">Borrower's Info </span></td>
<td align="center" bgcolor="#000000" class="style1" > </td>
</tr>
<tr>
<td width="212" height="45"><strong>
<input name="bar_id" type="text" class="dilaw" id="bar_id" size="10"/>
<input name="show" id="show" type="submit" class="btn" value=" Show" onclick="return FormValidate1()"/>
<br/>
</strong></td>
<td colspan="3" valign="top"></td>
<td width="254" rowspan="2" align="center" ></td>
</tr>
<tr>
<td colspan="2" align="left" bgcolor="#FFFFFF"> </td>
<td colspan="2" align="left" bgcolor="#FFFFFF"> </td>
</tr>
<tr bgcolor="#339900">
<td align="left" bgcolor="#000000" ><span class="style1">Accession number </span></td>
<td align="center" colspan="3" bgcolor="#000000" ><span class="style1">Book/Material Information </span></td>
<td align="center" bgcolor="#000000" class="style1" >Due date(yyyy-mm-dd hh:mm:ss)</td>
</tr>
<tr>
<td colspan="2" align="left" bgcolor="#FFFFFF"><input name="access_no" type="text" class="dilaw" id="access_no" value="<?php echo $access_no_from; ?>" size="10"/>
<input name="detail" id="detail" type="submit" class="btn" value=" Detail" onclick="return FormValidate2()"/>
<div id="div" /></td>
<td align="center" rowspan="3" colspan="2"bgcolor="#FFFFFF"><?php //echo $message;?></td>
<td align="center" bgcolor="#FFFFFF"><?php echo $input_deadline; ?></td>
</tr>
<tr>
<td colspan="2" align="left" bgcolor="#FFFFFF"><input name="submit" type="submit" class="btn" value=" Checkout " onclick="return FormValidate2()"/></td>
<td align="center" bgcolor="#FFFFFF"></td>
</tr>
<tr>
<td colspan="2" align="left" bgcolor="#FFFFFF"> </td>
<td align="center" bgcolor="#FFFFFF"> </td>
</tr>
</table>
</form>
<?php }?>
<?php if ($op == 2) {?>
<form action="bar_new.php" method="post" name="myform">
<table width="100%" border="0" cellpadding="5" cellspacing="5">
<tr bgcolor="#339900">
<td align="left" bgcolor="#000000" ><span class="style1">Borrower's ID </span></td>
<td align="center" colspan="3" bgcolor="#000000" ><span class="style1">Borrower's Info </span></td>
<td align="center" bgcolor="#000000" class="style1" > </td>
</tr>
<tr>
<td width="187" height="45"><strong>
<input name="bar_id" type="text" class="dilaw" id="bar_id" size="15" value="<?php echo $bar_id; ?>"/>
<input name="show" id="show" type="submit" class="btn" value=" Show" onclick="return FormValidate1()"/> <br/>
</strong></td>
<td colspan="3" valign="top" rowspan="2" ><?php if ($show == 1) {echo "<strong>Name:" . $last . ", " . $first . " <br>
Type: " . $usertype . " <br/>
Year: " . $taon . "<br />
Contact Num: " . $number . "</strong>";}?></td>
<td width="221" rowspan="2" valign="top"><?php if ($show == 1) {echo "<strong>Email: " . $mail . " <br>
Address: " . $add . "<br />
Expiration Date: " . $ex_date . "</strong>";}?></td>
</tr>
<tr>
<td align="left" bgcolor="#FFFFFF"> </td>
</tr>
<tr bgcolor="#339900">
<td align="left" bgcolor="#000000" ><span class="style1">Accession number </span></td>
<td colspan="3" align="center" bgcolor="#000000" ><span class="style1">Book/Material Information </span></td>
<td align="center" bgcolor="#000000" class="style1" >Due date(yyyy-mm-dd hh:mm:ss)</td>
</tr>
<tr>
<td align="left" bgcolor="#FFFFFF"><input name="access_no" type="text" class="dilaw" id="access_no" value="<?php echo $access_no; ?>" size="15"/>
<input name="detail" id="detail" type="submit" class="btn" value=" Detail" onclick="return FormValidate2()"/> <br/>
<div id="divMessage" /></td>
<td valign="top" colspan="3" rowspan="3" bgcolor="#FFFFFF">
<?php if ($detail == 1) {echo "<strong>Book Title:" . $title . "<br>
Main Author:" . $author . "<br>Subject:" . $subject1 . "<br>
Classification No:" . $classification_no . "<br>
Book No:" . $book_no . "<br>
Type:" . $type . "</strong>";}?></td>
<td align="center" bgcolor="#FFFFFF"><?php echo $input_deadline; ?></td>
</tr>
<tr>
<td align="left" bgcolor="#FFFFFF"><input name="submit" type="submit" class="btn" onclick="return FormValidate2()" value=" Checkout "/></td>
<td align="center" bgcolor="#FFFFFF"><input name="show" type="hidden" id="show" value="1" /></td>
</tr>
<tr>
<td align="left" bgcolor="#FFFFFF"> </td>
<td align="center" bgcolor="#FFFFFF"> </td>
</tr>
</table>
</form>
<?php }?>
<?php if ($op == 3) {?>
<form action="bar_new.php" method="post" name="myform">
<table width="100%" border="0" cellpadding="5" cellspacing="5">
<tr bgcolor="#339900">
<td align="left" bgcolor="#000000" ><span class="style1">Borrower's ID </span></td>
<td align="center" colspan="3" bgcolor="#000000" ><span class="style1">Borrower's Info </span></td>
<td align="center" bgcolor="#000000" class="style1" > </td>
</tr>
<tr>
<td width="196" height="45" valign="top"><strong>
<input name="bar_id" type="text" class="dilaw" id="bar_id" size="15" value="<?php echo $bar_id; ?>"/>
<input name="show" id="show" type="submit" class="btn" value=" Show" onclick="return FormValidate1()"/> <br/>
</strong></td>
<td colspan="3" valign="top" rowspan="2" ><?php if ($show == 1) {echo "<strong>Name:" . $last . ", " . $first . " <br>
Type: " . $usertype . " <br/>
Year: " . $taon . "<br />
Contact Num: " . $number . "</strong>";}?></td>
<td width="221" rowspan="2" valign="top"><?php if ($show == 1) {echo "<strong>Email: " . $mail . " <br>
Address: " . $add . "<br />
Expiration Date: " . $ex_date . "</strong>";}?></td>
</tr>
<tr>
<td align="left" bgcolor="#FFFFFF"> </td>
</tr>
<tr bgcolor="#339900">
<td align="left" bgcolor="#000000" ><span class="style1">Accession number </span></td>
<td colspan="3" align="center" bgcolor="#000000" ><span class="style1">Book/Material Information </span></td>
<td align="center" bgcolor="#000000" class="style1" >Due date(yyyy-mm-dd hh:mm:ss)</td>
</tr>
<tr>
<td align="left" bgcolor="#FFFFFF"><input name="access_no" type="text" class="dilaw" id="myName" value="<?php echo $access_no; ?>" size="15"/>
<input name="detail" id="detail" type="submit" class="btn" value=" Detail" onclick="return FormValidate2()"/> <br/>
<div id="divMessage" /></td>
<td valign="top" colspan="3" rowspan="3" bgcolor="#FFFFFF">
<?php echo $message; ?></td>
<td align="center" bgcolor="#FFFFFF"><?php echo $input_deadline; ?></td>
</tr>
<tr>
<td align="left" bgcolor="#FFFFFF"><input name="submit" type="submit" class="btn" onclick="return FormValidate2()" value=" Checkout "/></td>
<td align="center" bgcolor="#FFFFFF"><input name="show" type="hidden" id="show" value="1" /></td>
</tr>
<tr>
<td align="left" bgcolor="#FFFFFF"> </td>
<td align="center" bgcolor="#FFFFFF"> </td>
</tr>
</table>
</form>
<?php }?>
<?php if ($op == 1) {?>
<table width="100%" border="0">
<tr>
<td colspan="4">New record added to <?php
//output the name of the borrower
$sql = "SELECT concat(first1,' ',last1 ) as name FROM barrower where bar_id='$bar_id' ";
$result = mysql_query($sql, $connect) or die("cant execute query!.....5");
while ($row = mysql_fetch_array($result)) {
$name = $row['name'];
}
echo $name;?> account. </td>
<td> </td>
</tr>
<tr>
<td width="22%"><a href="bar_new.php">back</a></td>
<td width="3%"> </td>
<td width="23%"> </td>
<td width="19%"> </td>
<td width="33%"> </td>
</tr>
<tr>
<td align="right"><strong>Borrower's ID:</strong></td>
<td> </td>
<td><?php echo $bar_id; ?></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td align="right"><strong>Accession no.: </strong></td>
<td> </td>
<td><?php echo $access_no; ?></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td align="right"><strong>Classification No. : </strong></td>
<td> </td>
<td><?php echo $classification_no_final; ?></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td align="right"><strong>Book No.: </strong></td>
<td> </td>
<td><?php echo $book_no_final; ?></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td align="right"><strong>Title:</strong></td>
<td> </td>
<td><?php echo $title; ?></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td align="right"><strong>Author</strong></td>
<td> </td>
<td><?php echo $author; ?></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td align="right"><strong>Deadline:</strong></td>
<td> </td>
<td><?php echo $deadline; ?></td>
<td> </td>
<td> </td>
</tr>
</table>
<?php }?>
<?php if ($op == 4) {
?>
<table width="100%" border="0" cellpadding="5" cellspacing="5">
<tr>
<td align="right"><a href="home.php">back to Home Page</a></td>
<td colspan="2" align="left"><?php echo $msg_mo; ?></td>
<td align="center"> </td>
</tr>
<tr>
<td align="left" bgcolor="#FFFFFF"> </td>
<td align="center" bgcolor="#FFFFFF"> </td>
<td align="center" bgcolor="#FFFFFF"> </td>
<td align="center" bgcolor="#FFFFFF"> </td>
</tr>
</table>
<?php }?>
<hr />
<p>
</p>
<p> </p>
</div>
</div>
<div class="lowercontent"></div>
<div class="footer1">
<table align="center">
<tr>
<td><img src="logo/anilag systems logo 300x155 trnsparent.png" /></td>
<td> </td>
<td><img src="images/isch.gif" width="200" height="70"/></td>
</tr>
</table></div>
<div class="footer">
<?php echo $system_title; ?><br /><?php echo $footer; ?>
</div>
</body>
</html>