-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAcceptedcancel.php
More file actions
71 lines (55 loc) · 1.76 KB
/
Acceptedcancel.php
File metadata and controls
71 lines (55 loc) · 1.76 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
session_start();
if(!isset($_SESSION['ID']))
header("location:index.html");
if(isset($_GET['usrid'])&&isset($_GET['bkrid']))
{
require 'DBconnect.php';
$usrid=$_GET['usrid'];
$bkrid=$_GET['bkrid'];
$sql="CALL Accepted_Cancel('$bkrid','$usrid',@fuser)";
$result=mysqli_query($con,$sql);
if(!$result )
die('Could not call Accepted Cancel check1: ' . mysqli_error($con));
$result2=mysqli_query($con,"SELECT @fuser");
if(!$result2 )
die('Could not call Accepted Cancel check2: ' . mysqli_error($con));
$row = mysqli_fetch_assoc($result2);
if($row['@fuser']!='-1')
{
$fuser=$row['@fuser'];
$sql2="SELECT email,mobno FROM staffandstudent WHERE ID='$fuser'";
$result2=mysqli_query($con,$sql2);
if(!$result2)
die('Could not get data: ' . mysqli_error($con));
else
{
$row2 = mysqli_fetch_assoc($result2);
$to=$row2['email'];
$mobno=$row2['mobno'];
$sql3="SELECT name FROM books WHERE mainid='$bkrid'";
$result3=mysqli_query($con,$sql3);
if(!$result3)
die('Could not get data: ' . mysqli_error($con));
else
{
$row3= mysqli_fetch_assoc($result3);
$bkname=$row3['name'];
}
include ('way2sms-api.php');
include ('email.php');
$subject='Book Request Accepted';
$message='Hey...The request for the book "'.$bkname.'"('.$bkrid.')is accepeted,
Therefore come to library to take it';
sendemail("JuBinAyoob","JuB123",$to,$subject,$message);
echo "<br>message send to ".$mobno.' : ';
$res = sendWay2SMS("8129062800","JuB321",$mobno,$message);
if(is_array($res)) echo $res[0]['result'] ? 'true' : 'false';
else echo $res;
}
}
header("location:Notification.php");
}
else
header("location:Notification.php");
?>