-
Notifications
You must be signed in to change notification settings - Fork 1
/
insertHirenow.php
58 lines (52 loc) · 1.92 KB
/
insertHirenow.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
//insert.php
// session_start();
include 'classes.php';
$notification = new Notification();
if (isset($_POST["lat"])) {
echo "<script>alert('gdsgd')</script>";
echo "<script>console.log('gdsgd')</script>";
$customerID = $_POST["sender_id"] ;
if (isset($_POST['radio'])) {
if (isset($_POST['radioAddress'])) {
$address;
$lat;
$lng;
if ($_POST['radioAddress'] == "Use default Address") {
$result = QueryHandler::query("SELECT * from customer WHERE customer_id='$customerID'");
$data = mysqli_fetch_assoc($result);
$address = $data['address'];
$lat = $data['latitude'];
$lng = $data['longitude'];
} else {
$address = $_POST['address'];
$lat = $_POST['lat'];
$lng = $_POST['lng'];
}
$_SESSION['HirespecificLat'] = $lat;
echo "insertHirenowpage";
echo $_SESSION['HirespecificLat'];
// echo $address;
// echo $lat;
// echo $lng;
// echo $_POST['radioAddress'];
// echo $_POST['radio'];
}
}
$receiver_id = $_POST["receiver_id"] ;
$sender_id = $_POST["sender_id"] ;
// $receiver_id = 1;
// $sender_id = 2;
$service_id = $_POST['radio'];
$service = new Service();
$service->read($service_id);
$service_name = $service->getService_name();
$customer = new Customer();
$customer->read($sender_id);
$name_customer = $customer->getUsername();
$notificationString = "Hire Now request <br> Service - : <strong>".$service_name." </strong><br> Customer : <strong>".$name_customer."</strong><br> From: ".$address;
$notification->hireNow($notificationString, $receiver_id, $sender_id , "accept_decline" ,$service_id , $lat, $lng);
}else{
echo "jgfjfhjdgfhfd";
}
?>