forked from kalyanm72/Online-Bus-Booking
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_reserves.php
More file actions
25 lines (21 loc) · 778 Bytes
/
Copy pathcreate_reserves.php
File metadata and controls
25 lines (21 loc) · 778 Bytes
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
<?php
header('Access-Control-Allow-Origin: *' );
header('Content-Type:application/json' );
header('Access-Control-Allow-Methods: POST ' );
header('Access-Control-Allow-Headers: Access-Control-Allow-Headers,Content-Type,
Access-Control-Allow-Methods,Autherization,X-Requested-with');
include_once 'Database.php';
include_once 'Post_reserves.php';
$database=new Database();
$db=$database->connect();
$routes=new Post_reserves($db);
$data=json_decode(file_get_contents("php://input"));
$routes->rid=$data->rid;
$routes->pid=$data->pid;
$routes->status=$data->status;
if($routes->create()){
echo json_encode(array('message'=>'Reservation added successfully'));
}
else{
echo json_encode(array('message'=>'Reservation Not added'));
}