-
Notifications
You must be signed in to change notification settings - Fork 0
/
return_book.php
37 lines (31 loc) · 924 Bytes
/
return_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
<?php
session_start();
$name=$_SESSION['sname'];
$roll=$_SESSION['rn'];
$email=$_SESSION['email'];
$str1=$_SESSION['string'];
$bookno = $_GET['book'];
include("connection.php");
$str1=strtolower($str1);
$query ="DELETE FROM $str1 WHERE bookno='$bookno'";
$run=mysqli_query($con,$query);
$temp=strval($_SESSION['lid']);
$temp1=$_SESSION['lname'];
$str2="t".$temp1."".$temp;
$variable="Return";
$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="DELETE FROM $str3 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>";
}
?>