Commit fd75db61 by Jansa Jose

checker delete

parent 734aac41
......@@ -210,6 +210,16 @@ class OrganizerServices extends CI_Controller {
}
}
public function checkerDelete(){
$data = (array) json_decode(file_get_contents('php://input'));
$res = $this->Organizer_model->checkerDelete($data);
if($res['status'] != 0){
$this->successResponse($res);
}else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function getTagList(){
$data = (array) json_decode(file_get_contents('php://input'));
$res = $this->Organizer_model->getTagList($data);
......
......@@ -222,7 +222,7 @@ class Organizer_model extends CI_Model {
$this->db->insert_batch('event_tags',$insertTag);
}
}
$res = array('status'=>1,'message'=>'Event Added Successfully');
$res = array('status'=>1,'message'=>'Event Updated Successfully');
} catch (Exception $e){
$res = array('status'=>0,'message'=>'Ohh No!! Something Went South!!','code'=>'ER08');
}
......@@ -947,6 +947,21 @@ class Organizer_model extends CI_Model {
return $res;
}
public function checkerDelete($data){
try{
$count = $this->db->get_where('checker',array('id'=>$data['checker_id'],'provider_id'=>$data['organiser_id']))->num_rows();
if($count < 1){
$res = array('status'=>0,'message'=>'No Data Found','code'=>'ER06');
return $res;
}
$this->db->update('checker',array('status'=>2),array('id'=>$data['checker_id'],'provider_id'=>$data['organiser_id']));
$res = array('status'=>1,'message'=>'Checker Deleted Successfully');
} catch (Exception $e){
$res = array('status'=>0,'message'=>'Ohh No!! Something Went South!!','code'=>'ER08');
}
return $res;
}
}
?>
......@@ -363,6 +363,20 @@ class Validation_organizer_model extends CI_Model {
)
),
),
'checkerDelete'=>array(
'organiser_id'=>array(
'required'=>array(
'code'=>'ER30',
'message'=>'Organizer Id is null or empty'
)
),
'checker_id'=>array(
'required'=>array(
'code'=>'ER30',
'message'=>'Checker Id is null or empty'
)
),
),
);
public function _consruct(){
......
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