-
Notifications
You must be signed in to change notification settings - Fork 0
/
re_issue_book.php
39 lines (33 loc) · 1 KB
/
re_issue_book.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
<?php
session_start();
$str1=$_SESSION['string'];
$bookno = $_GET['book'];
$name=$_SESSION['sname'];
$roll=$_SESSION['rn'];
$email=$_SESSION['email'];
include("connection.php");
date_default_timezone_set("Asia/Kolkata");
$var=date("Y-m-d H:i:s");
$str1=strtolower($str1);
$query ="UPDATE $str1 SET reg_date='$var' WHERE bookno='$bookno'";
$run=mysqli_query($con,$query);
$temp=strval($_SESSION['lid']);
$temp1=$_SESSION['lname'];
$str2="t".$temp1."".$temp;
$variable="Re-issue";
$str2=strtolower($str2);
$query2="INSERT INTO `$str2`(`bookno`, `name`, `roll`, `email` ,`request_type`) VALUES ('$bookno','$name','$roll','$email','$variable')";
$run2=mysqli_query($con,$query2);
$str3="ti".$temp1."".$temp;
$str3=strtolower($str3);
$query3="UPDATE $str3 SET reg_date='$var' WHERE bookno='$bookno' AND email='$email'";
$run3=mysqli_query($con,$query3);
if($run==TRUE && $run2==TRUE && $run3==TRUE)
{
header('location:lp.php');
}
else
{
echo "<center><h2 style='color:red;'>Something Went Wrong !!!</h2></center>";
}
?>