-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinsert.php
53 lines (47 loc) · 1.68 KB
/
insert.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
<?php
//insert.php
include 'classes.php';
$notification = new Notification();
if (isset($_POST["lat"])) {
echo "<script>alert('gdsgd')</script>";
echo "<script>console.log('gdsgd')</script>";
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'];
}
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($sender_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>";
$notification->hireNow($notificationString, $receiver_id, $sender_id , "accept_decline" ,$service_id);
}else{
echo "jgfjfhjdgfhfd";
}
?>