Skip to content

Commit 52bc49f

Browse files
fixing date return book popup
1 parent 681bc72 commit 52bc49f

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

returnbookpopup.php

+8-17
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ function printDiv(divID) {
309309
Date Borrowed:</td><td><input type="text" readonly="readonly" value="
310310
<?php //echo $name['dateborrow'];
311311

312-
echo date_format(date_create($name['dateborrow']), 'F j, Y');
312+
echo date_format(date_create($name['date_out']), 'F j, Y');
313313
?>
314314
<?php //echo $name['dateborrow']; ?>" style="padding:4px; width:226px;">
315315
</tr></tr>
@@ -325,14 +325,14 @@ function printDiv(divID) {
325325
</td></tr>
326326
<tr><td>
327327
Date Due:</td><td><input style="padding:4px; width:226px;" readonly="readonly" name="datedue" type="text"
328-
value="<?php echo date_format(date_create($name['duedate']), 'F j, Y'); ?>
328+
value="<?php echo date_format(date_create($name['due_date']), 'F j, Y'); ?>
329329
">
330330
</td></tr>
331331
<tr><td>
332332
<?php
333333

334334
//echo date('Y-m-d');
335-
switch (date_format(date_create($name['dateborrow']), 'm')) {
335+
switch (date_format(date_create($name['date_out']), 'm')) {
336336
case '01':
337337
$bmonth1 = "selected"; break;
338338
case '02':
@@ -401,11 +401,11 @@ function printDiv(divID) {
401401

402402
$id=$_GET['borrowid'];
403403
//$datedue=$name['duedate'];
404-
$datedue=date_format(date_create($name['duedate']), 'm j, Y');
404+
$datedue=date_format(date_create($name['due_date']), 'm j, Y');
405405
$sig=$_POST['sig'];
406406
$bookid=$_POST['bookid'];
407407

408-
$borrowed=date_format(date_create($name['dateborrow']), 'm j, Y');
408+
$borrowed=date_format(date_create($name['date_out']), 'm j, Y');
409409
$theDate = isset($_REQUEST["date5"]) ? $_REQUEST["date5"] : "";
410410
$format=date_format(date_create(date("m/d/y")), 'm j, Y');
411411

@@ -465,20 +465,11 @@ function printDiv(divID) {
465465
$accNo=$_POST['accNo'];
466466
$bid=$_POST['bid'];
467467

468-
$sql="insert into tblreciept (studentid,accNo,borrowid,datedue,datereturn,totaldays,totalpay) values(
469-
'".$bor."',
470-
'".$accNo."',
471-
'".$bid."',
472-
'".$dat."',
473-
'".$dater."',
474-
'".$tota."',
475-
'".$tot."'
476-
)";
477-
478-
$pay=mysql_query($sql) or die (mysql_error());
468+
469+
$pay=true;
479470
if($pay){
480471

481-
$update2="update tblborrow set datereturn='$re',item='0', status='Signed' where borrowid='$id'";
472+
$update2="update book_loans set date_in='$re' where loan_id='$id'";
482473
$objExec2 = mysql_query($update2)or die(mysql_error());
483474

484475
?>

0 commit comments

Comments
 (0)