Commit f4ee07e0 by Tobin

daily commit

parent 7b82c1ff
......@@ -308,6 +308,17 @@ class Api extends CI_Controller {
}
}
public function save_organizer(){
$data = (array) json_decode(file_get_contents('php://input'));
$res = $this->Api_model->save_organizer($data);
if($res['status']!=0){
$this->response($res['status']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function payNow($auth_token='',$amount=0,$booking_id='',$event_id=''){
if(empty($auth_token) || empty($amount) || empty($booking_id)){
redirect('https://projects.nuvento.com/failure');
......
......@@ -42,7 +42,7 @@ class Provider extends CI_Controller {
!is_numeric($provider_id = decode_param($_POST['provider_id']))){
echo json_encode($resArr);exit;
}
$view_all = (isset($_POST['view_all']) && $_POST['view_all'] == 1)?1:0;
$view_all = (isset($_POST['view_all']) && $_POST['view_all'] == 1)?1:'0,1';
$mechData = $this->Provider_model->getProviderData($provider_id,$view_all);
if(empty($mechData)){
......@@ -230,7 +230,6 @@ class Provider extends CI_Controller {
$provider_id = $this->session->userdata('id');
}
}
$template['page'] = 'Provider/providerPayDetails';
$template['page_desc'] = "Payment Details";
......
......@@ -922,5 +922,23 @@ class Api_model extends CI_Model {
}
return $res;
}
public function save_organizer($data){
try{
$count=$this->db->get_where('users',array('username'=>$data['email_id']))->num_rows();
if($count > 0){
$res = array('status'=>0,'message'=>'Email Id Already Exist','code'=>'ER06');
}else{
$this->db->insert('users',array('username'=>$data['email_id'],'password'=>md5($data['password']),'display_name'=>$data['name'],'status'=>'0'));
$last_id = $this->db->insert_id();
if($this->db->insert('provider',array('provider_id'=>$last_id,'name'=>$data['name'],'email'=>$data['email_id'],'phone'=>$data['phone']))){
$res = array('status'=>1);
}
}
}catch(Exception $e){
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
}
return $res;
}
}
?>
......@@ -262,6 +262,40 @@ class Validation_model extends CI_Model {
)
) ,
) ,
'save_organizer' => array(
'name' => array(
'required' => array(
'code' => 'ER27',
'message' => 'Name is null or empty'
)
) ,
'phone' => array(
'required' => array(
'code' => 'ER08',
'message' => 'Phone Number is null or empty'
),
'phone' => array(
'code' => 'ER08',
'message' => 'Invalid Phone no'
) ,
),
'email_id' => array(
'required' => array(
'code' => 'ER02',
'message' => 'Email Id is null or empty'
),
'email' => array(
'code' => 'ER03',
'message' => 'Invalid Email id'
)
),
'password' => array(
'required' => array(
'code' => 'ER04',
'message' => 'Password is null or empty'
)
)
) ,
'payNow' => array(),
'searchEvent' => array()
);
......
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