Commit 41e538fc by Tobin

add venue issue fix

parent b7dba332
......@@ -28,7 +28,9 @@ class OrganizerServices extends CI_Controller {
$this->load->model('Validation_organizer_model');
$method = $this->router->fetch_method();
$data = (array) json_decode(file_get_contents('php://input'));
if($method == 'addEvent' || $method == 'addCategory' || $method == 'addCity' || $method == 'editOrganizerCityDetails' || $method == 'editOrganizerCategoryDetails' || $method == "AddVenue" || $method == 'editOrganizerVenueDetails') {
if($method == 'addEvent' || $method == 'addCategory' || $method == 'addCity' ||
$method == 'editOrganizerCityDetails' || $method == 'editOrganizerCategoryDetails' ||
$method == 'editOrganizerVenueDetails') {
$data = $_POST;
}
if (isset(apache_request_headers()['Auth'])) {
......@@ -603,7 +605,7 @@ class OrganizerServices extends CI_Controller {
}
public function AddVenue(){
$data = $_POST;
$data = (array)json_decode(file_get_contents('php://input'));
$res = $this->Organizer_model->AddVenue($data);
if($res['status'] != 0){
$this->successResponse($res);
......
......@@ -1553,7 +1553,7 @@ class Organizer_model extends CI_Model {
if(!$this->upload->do_upload('layout_image')){
$err = 1;
return array('status'=>0,'code'=>'ER980','message'=>$this->upload->display_errors());exit;
}else{
} else {
$upload_data = $this->upload->data();
$data['layout'] = $config['upload_path']."/".$upload_data['file_name'];
}
......@@ -1575,7 +1575,7 @@ class Organizer_model extends CI_Model {
return array('status'=>0,'code'=>'ER958','message'=>'Provide a valid Location');exit;
}
if(isset($data['locality_name']) && (!empty($data['locality_name']) || count($data['locality_name']) > 0)){
$locArr = json_decode(json_encode(json_decode($data['locality_name'])),true);
$locArr = json_decode(json_encode($data['locality_name']),true);
$key = array_search('EN', array_column($locArr, 'lang'));
$status = $this->db->insert('locality',array('locality'=>$locArr[$key]['locality_name'],
'region_id'=>$data['region_id']));
......@@ -1607,7 +1607,7 @@ class Organizer_model extends CI_Model {
if($status){
$venue_id = $this->db->insert_id();
$insertArr = array();
foreach (json_decode($data['venue_name']) AS $key => $value) {
foreach ($data['venue_name'] AS $key => $value) {
$insertArr[] = array('venue_id'=>$venue_id,
'venue_name'=>$value->venue_name,
'language_code'=>$value->lang);
......
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