GOOGLE
<?php
include('dbcon.php');
$id=$_POST['selector'];
$member_id = $_POST['member_id'];
$due_date = $_POST['due_date'];
date_default_timezone_set('Asia/Kolkata');
$dates = date("d-m-Y");
$datetime = date('d-m-Y H:i');
$start_date = date('d-m-Y');
$start_time = date('H:i:s');
$end_date = date('d-m-Y');
$end_time = "17:59";
if ($id == '' ){
?>
<script>
alert("Please Select Book");
window.location.href='oneday_borrow.php';
</script>
<?php }else{
mysql_query ("insert into borrow (member_id,date_borrow,due_date) values ('".addslashes($member_id)."','".$dates."','".addslashes($due_date)."')");
$query = mysql_query("select * from borrow order by borrow_id DESC");
$row = mysql_fetch_array($query);
$borrow_id = $row['borrow_id'];
$N = count($id);
for($i=0; $i < $N; $i++)
{
mysql_query("INSERT INTO `one_day_borrow`(`book_id`,`start_date`,`start_time`,`end_date`,`end_time`,`borrow_status`,`date_time`,`member_id`) values('".$id[$i]."','".$start_date."','".$start_time."','".$end_date."','".$end_time."','borrow','".$datetime."','".$member_id."')");
//mysql_query("insert borrowdetails (book_id,borrow_id,member_id,borrow_status,date_borrow,due_date,request_date) values('".$id[$i]."','$borrow_id','".addslashes($member_id)."','borrow','".$dates."','".addslashes($end_date)."','".$dates."')");
$bookUpdate = mysql_query("UPDATE `book` SET `member_id`='".$member_id."',`book_status`='borrow' WHERE `book_id`='".$id[$i]."'");
}
//header("location: borrow.php");
?>
<?php if($_GET['flag']=="Teacher"){ ?>
<script>
window.location.href='teacher_borrow.php';
</script>
<?php }else{?>
<script>
window.location.href='oneday_borrow.php';
</script>
<?php } }
?>
Copyright © 1945 -