-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathacceptreturn.php
More file actions
42 lines (28 loc) · 1.15 KB
/
acceptreturn.php
File metadata and controls
42 lines (28 loc) · 1.15 KB
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
<?php
require('dbconn.php');
$bookid=$_GET['id1'];
$rollno=$_GET['id2'];
$dues=$_GET['id3'];
$sql="select Category from LMS.user where RollNo='$rollno'";
$result=$conn->query($sql);
$row=$result->fetch_assoc();
$category=$row['Category'];
$sql1="update LMS.record set Date_of_Return=curdate(),Dues='$dues' where BookId='$bookid' and RollNo='$rollno'";
if($conn->query($sql1) === TRUE)
{$sql3="update LMS.book set Availability=Availability+1 where BookId='$bookid'";
$result=$conn->query($sql3);
$sql4="delete from LMS.return where BookId='$bookid' and RollNo='$rollno'";
$result=$conn->query($sql4);
$sql6="delete from LMS.renew where BookId='$bookid' and RollNo='$rollno'";
$result=$conn->query($sql6);
$sql5="insert into LMS.message (RollNo,Msg,Date,Time) values ('$rollno','Your request for return of BookId: $bookid has been accepted',curdate(),curtime())";
$result=$conn->query($sql5);
echo "<script type='text/javascript'>alert('Success')</script>";
header( "Refresh:0.01; url=return_requests.php", true, 303);
}
else
{
echo "<script type='text/javascript'>alert('Error')</script>";
header( "Refresh:1; url=return_requests.php", true, 303);
}
?>