asset issue
This commit is contained in:
parent
fb781ab722
commit
73dcc84b80
@ -31,41 +31,41 @@ public function __construct()
|
||||
$this->load->model('Business_model','Business_model');
|
||||
$this->load->helper(array('form', 'url'));
|
||||
}
|
||||
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function business_list()
|
||||
{
|
||||
|
||||
|
||||
$business_list = $this->Business_model->get_business_details();
|
||||
// echo '<pre>';
|
||||
// print_r($business_list); die;
|
||||
$this->layout->set('tableData', $business_list);
|
||||
$this->layout->buffer('main_content', 'Business/business_list');
|
||||
$this->layout->render('default_layout');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function add_business()
|
||||
{
|
||||
|
||||
|
||||
$this->layout->set('stateData', $this->MY_Model->select('state'));
|
||||
$this->layout->set('ModuleData', $this->MY_Model->select('modules'));
|
||||
$this->layout->buffer('main_content', 'Business/add_business');
|
||||
$this->layout->render('default_layout');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function create_business()
|
||||
{
|
||||
$data = $this->input->post();
|
||||
|
||||
|
||||
$data['created_by'] = user()->id;
|
||||
//file upload confic
|
||||
$logo_file['upload_path'] = APPPATH. '../assets/uploads/logo';
|
||||
@ -81,29 +81,29 @@ public function create_business()
|
||||
$upload_logo = $this->upload->data();
|
||||
$data['logo'] = $upload_logo['file_name'];
|
||||
}
|
||||
|
||||
|
||||
$table="business";
|
||||
$add_admin = 0;
|
||||
if($this->input->post('add_admin'))
|
||||
{
|
||||
$add_admin = $this->input->post('add_admin');
|
||||
unset($data['add_admin']);
|
||||
}
|
||||
}
|
||||
|
||||
$modules = $this->input->post('module_id');
|
||||
if($modules !== NULL && $modules !== ''){
|
||||
|
||||
$count = count($modules);
|
||||
|
||||
for($i=0;$i<$count;$i++)
|
||||
$count = count($modules);
|
||||
|
||||
for($i=0;$i<$count;$i++)
|
||||
{
|
||||
$mdata['module_id'] = $this->input->post('module_id')[$i];
|
||||
$mdata['uid'] = $this->input->post('uid');
|
||||
$mdata['is_active'] = 1;
|
||||
$mdata['is_active'] = 1;
|
||||
$add_module = $this->MY_Model->insert($mdata, "permit_modules");
|
||||
}
|
||||
}
|
||||
unset($data['module_id']);
|
||||
unset($data['module_id']);
|
||||
$create_business = $this->MY_Model->insert($data,$table);
|
||||
|
||||
if($create_business){
|
||||
@ -133,7 +133,7 @@ public function create_business()
|
||||
$this->audit->set('table',$table);
|
||||
//fetch new_data after post data insert
|
||||
$this->audit->fetch('new_data');
|
||||
//audit history generation for insert
|
||||
//audit history generation for insert
|
||||
$test = $this->audit->create_history('insert');
|
||||
}
|
||||
//print_r($create_business); die();
|
||||
@ -144,16 +144,16 @@ public function create_business()
|
||||
}else{
|
||||
redirect('Business/business_list');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function get_business($id)
|
||||
{
|
||||
|
||||
{
|
||||
|
||||
//select dropdown values
|
||||
$this->layout->set('stateData', $this->MY_Model->select('state'));
|
||||
|
||||
|
||||
// select business value by id
|
||||
$table="business";
|
||||
$businessData = $this->Business_model->get_business_by_md5_id($id);
|
||||
@ -163,14 +163,14 @@ public function get_business($id)
|
||||
$this->layout->set('businessData', $businessData);
|
||||
$this->layout->buffer('main_content', 'Business/edit_business');
|
||||
$this->layout->render('default_layout');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function edit_business()
|
||||
{
|
||||
$action = $this->input->post();
|
||||
$id = $this->input->post('id');
|
||||
|
||||
|
||||
//file upload confic
|
||||
$logo_file['upload_path'] = APPPATH. '../assets/uploads/logo';
|
||||
$logo_file['allowed_types'] = 'gif|jpg|png|jpeg';
|
||||
@ -186,7 +186,7 @@ public function edit_business()
|
||||
$upload_logo = $this->upload->data();
|
||||
$action['logo'] = $upload_logo['file_name'];
|
||||
}
|
||||
|
||||
|
||||
$table="business";
|
||||
//set id $ table name for audit history
|
||||
$this->audit->set('id',$this->input->post('id'));
|
||||
@ -196,8 +196,8 @@ public function edit_business()
|
||||
|
||||
//insert new data
|
||||
$get_business_module_is_active = $this->Business_model->get_business_module_is_active($this->input->post('uid'));
|
||||
|
||||
if(count($get_business_module_is_active) != 0)
|
||||
|
||||
if(count($get_business_module_is_active) != 0)
|
||||
{
|
||||
$DbData = [];
|
||||
foreach($get_business_module_is_active as $key => $val){
|
||||
@ -214,43 +214,45 @@ public function edit_business()
|
||||
$differentValues1 = array_diff($module_id_array , $DbData);
|
||||
$differentValues2 = array_diff($DbData , $module_id_array);
|
||||
$final_array = array_merge($differentValues1, $differentValues2);
|
||||
|
||||
|
||||
if(count($final_array) != 0)
|
||||
{
|
||||
foreach($final_array as $key => $value){
|
||||
$check_if_exist = $this->Business_model->get_group_module_data_by_id($this->input->post('uid'), $value);
|
||||
$check_if_exist = $this->Business_model->get_group_module_data_by_id($this->input->post('uid'), $value);
|
||||
if($check_if_exist)
|
||||
{
|
||||
$this->Business_model->delete_group_module_data_by_id($this->input->post('uid') , $value);
|
||||
$data['is_active'] = 0;
|
||||
$data['is_active'] = 0;
|
||||
$this->Business_model->diable_module_in_group_permisssion($value, $data);
|
||||
|
||||
|
||||
|
||||
}else{
|
||||
$mdata['module_id'] = $value;
|
||||
$mdata['uid'] = $this->input->post('uid');
|
||||
$mdata['is_active'] = 1;
|
||||
$mdata['is_active'] = 1;
|
||||
$add_module = $this->MY_Model->insert($mdata, "permit_modules");
|
||||
$data['is_active'] = 1;
|
||||
$this->Business_model->Enable_module_in_group_permisssion($value, $data);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
if ($this->input->post('module_id') !== null) {
|
||||
{ for($i=0;$i<count($this->input->post('module_id'));$i++)
|
||||
{
|
||||
$mdata['module_id'] = $this->input->post('module_id')[$i];
|
||||
$mdata['uid'] = $this->input->post('uid');
|
||||
$mdata['is_active'] = 1;
|
||||
$mdata['is_active'] = 1;
|
||||
$add_module = $this->MY_Model->insert($mdata, "permit_modules");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -260,23 +262,23 @@ public function edit_business()
|
||||
{
|
||||
//fetch new_data after post data update
|
||||
$this->audit->fetch('new_data');
|
||||
//audit history generation for update
|
||||
//audit history generation for update
|
||||
$test = $this->audit->create_history('update');
|
||||
}
|
||||
if(is_superadmin()){ redirect('Business/business_list');}
|
||||
else if(is_admin()){ redirect('User/businessProfile/'.md5(user()->business_id)); }
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function delete_business($id)
|
||||
{
|
||||
{
|
||||
$data['is_active'] = 0;
|
||||
$Data = $this->Business_model->delete_by_md5_id($id,$data);
|
||||
redirect('Business/business_list');
|
||||
}
|
||||
|
||||
public function activate_business($id)
|
||||
{
|
||||
{
|
||||
$data['is_active'] = 1;
|
||||
$Data = $this->Business_model->delete_by_md5_id($id,$data);
|
||||
redirect('Business/business_list');
|
||||
@ -290,13 +292,13 @@ public function checkUniqueBusinessData()
|
||||
$result = $this->MY_Model->checkUniqueValueInDataBase($table, $where, $data);
|
||||
if(count($result)){
|
||||
$this->output->set_output(true);
|
||||
}else{
|
||||
}else{
|
||||
$this->output->set_output(false);
|
||||
}
|
||||
}
|
||||
|
||||
//===================== MODULES =================================================
|
||||
|
||||
|
||||
public function add_module()
|
||||
{
|
||||
$this->layout->buffer('main_content', 'Business/add_module_form');
|
||||
@ -304,7 +306,7 @@ public function add_module()
|
||||
}
|
||||
|
||||
public function create_add_module()
|
||||
{
|
||||
{
|
||||
$table = 'modules';
|
||||
$data = $this->input->post();
|
||||
$data['is_active'] = 1;
|
||||
@ -313,25 +315,25 @@ public function create_add_module()
|
||||
}
|
||||
|
||||
public function module_list()
|
||||
{
|
||||
{
|
||||
$table = 'modules';
|
||||
$module_list = $this->MY_Model->select($table);
|
||||
$module_list = $this->MY_Model->select($table);
|
||||
$this->layout->set('module_list', $module_list);
|
||||
$this->layout->buffer('main_content', 'Business/module_list');
|
||||
$this->layout->render('default_layout');
|
||||
}
|
||||
|
||||
public function edit_module($id)
|
||||
{
|
||||
{
|
||||
$table = 'modules';
|
||||
$module_data = $this->MY_Model->get_by_md5_id($id, $table);
|
||||
$this->layout->set('module_data', $module_data);
|
||||
$module_data = $this->MY_Model->get_by_md5_id($id, $table);
|
||||
$this->layout->set('module_data', $module_data);
|
||||
$this->layout->buffer('main_content', 'Business/edit_modules');
|
||||
$this->layout->render('default_layout');
|
||||
}
|
||||
|
||||
|
||||
public function edit_module_data()
|
||||
{
|
||||
{
|
||||
$table = 'modules';
|
||||
$id = $this->input->post('id');
|
||||
$action = $this->input->post();
|
||||
@ -348,4 +350,4 @@ public function getDeleteConfirmationPopup()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user