Commit 1a3b5ab6 by Jansa Jose

J: accept booking API in organizer app

parent 09db3cdb
......@@ -352,6 +352,16 @@ class OrganizerServices extends CI_Controller {
}
}
public function acceptBooking(){
$data = (array) json_decode(file_get_contents('php://input'));
$res = $this->Organizer_model->acceptBooking($data);
if($res['status'] != 0){
$this->successResponse($res);
}else{
$this->errorResponse($res['code'],$res['message']);
}
}
/*================ END : Organizer API ================*/
}
?>
......@@ -176,6 +176,7 @@ class Organizer_model extends CI_Model {
'has_payment'=>(!empty($postData['payment_mode']))?$postData['payment_mode']:'',
'seat_pricing'=>(!empty($postData['seat_pricing']))?json_encode($postData['seat_pricing']):'',
'custom_seat_layout'=>(!empty($postData['custom_seat_layout']))?json_encode($postData['custom_seat_layout']):'',
'approve_booking'=>$postData['approve_booking'],
'status'=>3);
$evtName = (!empty($postData['event_name']))?$postData['event_name']:'';
$evtDesc = (!empty($postData['event_desc']))?$postData['event_desc']:'';
......@@ -565,6 +566,7 @@ class Organizer_model extends CI_Model {
'has_payment'=>$postData['payment_mode'],
'seat_pricing'=>$postData['seat_pricing'],
'custom_seat_layout'=>$postData['custom_seat_layout'],
'approve_booking'=>$postData['approve_booking'],
'status'=>3);
$evtName = json_decode($postData['event_name'],true);
$evtDesc = json_decode($postData['event_desc'],true);
......@@ -1113,5 +1115,16 @@ class Organizer_model extends CI_Model {
}
return $res;
}
public function acceptBooking($data){
$res = array('status'=>0,'message'=>'Ohh No!! Something Went South','code'=>'ER06');
try{
$this->db->update('booking',array('status'=>'1'),array('bookId'=>$data['booking_id']));
$res = array('status'=>1,'message'=>'Booking Accepted Successfully');
}catch(Exception $e){
$res = array('status'=>0,'message'=>'Ohh No!! Something Went South','code'=>'ER06');
}
return $res;
}
}
?>
......@@ -392,6 +392,14 @@ class Validation_organizer_model extends CI_Model {
'message' => 'checker ID is null or empty'
)
)
),
'acceptBooking'=>array(
'booking_id' => array(
'required' => array(
'code' => 'ER04',
'message' => 'Booking Id is null or empty'
)
)
)
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment