diff --git a/application/helpers/custom_helper.php b/application/helpers/custom_helper.php
index e254012..76bda5f 100644
--- a/application/helpers/custom_helper.php
+++ b/application/helpers/custom_helper.php
@@ -95,6 +95,91 @@ function employee()
}
}
+ if(!function_exists('modules'))
+ {
+ function modules()
+ {
+ $ci =& get_instance();
+ $module_id = $ci->auth_model->modules();
+
+ $ModuleData = [];
+ foreach($module_id as $key => $val){
+ array_push($ModuleData,$val->module_id);
+ }
+ return $ModuleData;
+
+ }
+
+ }
+
+ if(!function_exists('Asset_module'))
+ {
+ function Asset_module()
+ {
+ $myArray = modules();
+ $elementToCheck = '1';
+ return in_array($elementToCheck, $myArray);
+ }
+ }
+
+ if(!function_exists('Employee_module'))
+ {
+ function Employee_module()
+ {
+ $myArray = modules();
+ $elementToCheck = '2';
+
+ return in_array($elementToCheck, $myArray);
+ }
+ }
+
+
+if(!function_exists('group_membership'))
+ {
+ function group_membership()
+ {
+ $ci =& get_instance();
+ $group_id = $ci->auth_model->group_membership();
+
+ $GroupData = [];
+ foreach($group_id as $key => $val){
+ array_push($GroupData,$val->group_id,$val->module_id);
+ }
+ return $GroupData;
+ }
+
+}
+
+if(!function_exists('Employee_group'))
+ {
+ function Employee_group()
+ {
+ $myArray = group_membership();
+ // $ci =& get_instance();
+ // return $Employee_group = $ci->auth_model->Employee_group($myArray);
+
+ $elementToCheck = '4';
+ $elementToCheck = '1';
+ return in_array($elementToCheck, $myArray);
+ }
+ }
+
+ if(!function_exists('HR_group'))
+ {
+ function HR_group()
+ {
+ $myArray = group_membership();
+ // $ci =& get_instance();
+ // return $Employee_group = $ci->auth_model->Employee_group($myArray);
+
+ $elementToCheck = '6';
+ $elementToCheck = '2';
+ return in_array($elementToCheck, $myArray);
+ }
+ }
+
+if(!function_exists(''))
+
if (!function_exists('hash_password')) {
function hash_password($password)
{
diff --git a/application/modules/Auth/models/Auth_model.php b/application/modules/Auth/models/Auth_model.php
index a14d13b..d75b091 100644
--- a/application/modules/Auth/models/Auth_model.php
+++ b/application/modules/Auth/models/Auth_model.php
@@ -46,6 +46,46 @@ public function get_logged_employee()
}
}
+ public function modules()
+ {
+ $this->db->select('module_id');
+ $this->db->from('permit_modules');
+ $this->db->where('uid', $this->session->userdata('business_id'));
+ $this->db->where('is_active', 1);
+ $query = $this->db->get();
+ return $query->result();
+ }
+
+ public function group_membership()
+ {
+
+ $this->db->select('group_permisssion.group_id, group_permisssion.module_id');
+ $this->db->from('group_permisssion');
+ $this->db->join('group_membership', 'group_membership.group_id = group_permisssion.group_id');
+ $this->db->where('group_membership.emp_id', $this->session->userdata('id'));
+ $this->db->where('group_membership.business_id', $this->session->userdata('business_id'));
+ $this->db->where('group_permisssion.is_active', '1');
+ $query = $this->db->get();
+ return $query->result();
+
+
+ }
+
+
+ public function Employee_group($myArray)
+ {
+ //$this->db->select('group_permisssion.group_id, group_permisssion.module_id');
+ $this->db->from('group_permisssion');
+ $this->db->join('group_membership', 'group_membership.group_id = group_permisssion.group_id');
+ $this->db->where('group_membership.group_id', $myArray[0]);
+ $this->db->where('group_membership.emp_id', $this->session->userdata('id'));
+ $this->db->where('group_permisssion.module_id', $myArray[1]);
+ $this->db->where('group_permisssion.is_active', '1');
+ $query = $this->db->get();
+ return true;
+ }
+
+
//get user by id
public function get_user($id)
{
@@ -106,6 +146,8 @@ public function is_user()
}
+
+
//is pro user
public function is_pro_user()
{
diff --git a/application/modules/Business/controllers/Business.php b/application/modules/Business/controllers/Business.php
index 43ecd53..af8f29b 100644
--- a/application/modules/Business/controllers/Business.php
+++ b/application/modules/Business/controllers/Business.php
@@ -87,18 +87,17 @@ public function create_business()
$add_admin = $this->input->post('add_admin');
unset($data['add_admin']);
}
-
- $mtable = "permit_modules";
- $mdata['module_id'] = $this->input->post('module_id');
- $mdata['uid'] = $this->input->post('uid');
- $mdata['is_active'] = 1;
-
- $add_module = $this->MY_Model->insert($mdata,$mtable);
- unset($data['module_id']);
-
+ $count = count($this->input->post('module_id'));
+ 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;
+ $add_module = $this->MY_Model->insert($mdata, "permit_modules");
+ }
+ unset($data['module_id']);
$create_business = $this->MY_Model->insert($data,$table);
-
// audit history
if($create_business)
{
@@ -122,17 +121,21 @@ public function create_business()
}
- public function get_business($id)
+ public function get_business($id, $uid)
{
- //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);
-
- $this->layout->set('businessData', $businessData);
- $this->layout->buffer('main_content', 'Business/edit_business');
- $this->layout->render('default_layout');
+
+ //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);
+ $businessModuleData = $this->Business_model->get_business_modules($uid);
+ $this->layout->set('ModuleData', $this->MY_Model->select('modules'));
+ $this->layout->set('businessModuleData', $businessModuleData);
+ $this->layout->set('businessData', $businessData);
+ $this->layout->buffer('main_content', 'Business/edit_business');
+ $this->layout->render('default_layout');
}
@@ -164,16 +167,82 @@ public function edit_business()
//fetch old_data before new_data update
$this->audit->fetch('old_data');
- //insert new data
- $mtable = "permit_modules";
- $mdata['module_id'] = $this->input->post('module_id');
- $mdata['uid'] = $this->input->post('uid');
- $mdata['is_active'] = 1;
+ //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)
+ {
+ $DbData = [];
+ foreach($get_business_module_is_active as $key => $val){
+ array_push($DbData,$val->module_id);
+ }
- $businessData = $this->MY_Model->edit_option($action, $id, $table);
- unset($data['module_id']);
+ if($this->input->post('module_id') == null)
+ {
+ $module_id_array = [];
+ }else{
+ $module_id_array = $this->input->post('module_id');
+ }
+
+ $differentValues1 = array_diff($module_id_array , $DbData);
+ $differentValues2 = array_diff($DbData , $module_id_array);
+ $final_array = array_merge($differentValues1, $differentValues2);
+ // echo "
";
+ // print_r($DbData); print_r($this->input->post('module_id')); print_r($final_array);
+ // echo "";
+
+ // die;
+
+ 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);
+ if($check_if_exist)
+ {
+ $this->Business_model->delete_group_module_data_by_id($this->input->post('uid') , $value);
+ $data['is_active'] = 0;
+ $this->Business_model->diable_module_in_group_permisssion($value, $data);
+ //$group_id=$this->Business_model->get_group_id_by_module_id($value);
+ //$GroupIdData = [];
+ // foreach($group_id as $key => $val){
+ // array_push($GroupIdData,$val->group_id);
+ // }
+ // $this->Business_model->diable_group_in_group_membership($value, $data);
+
+ }else{
+ $mdata['module_id'] = $value;
+ $mdata['uid'] = $this->input->post('uid');
+ $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);
+ // $group_id=$this->Business_model->get_group_id_by_module_id($value);
+ // $GroupIdData = [];
+ // foreach($group_id as $key => $val){
+ // array_push($GroupIdData,$val->group_id);
+ // }
+
+
+ }
+
+ }
+ }
+ }
+ else
+ { for($i=0;$iinput->post('module_id'));$i++)
+ {
+ $mdata['module_id'] = $this->input->post('module_id')[$i];
+ $mdata['uid'] = $this->input->post('uid');
+ $mdata['is_active'] = 1;
+ $add_module = $this->MY_Model->insert($mdata, "permit_modules");
+ }
+ }
+
+
+
+ unset($action['module_id']);
$businessData = $this->MY_Model->edit_option($action, $id, $table);
if($businessData)
{
@@ -236,7 +305,15 @@ public function edit_module_data()
$action['is_active'] = 1;
$add_module = $this->MY_Model->edit_option($action, $id, $table);
redirect('Business/module_list');
- }
+ }
+
+ public function getDeleteConfirmationPopup()
+ {
+ $data = array();
+ $htmlPage = $this->load->view('confirmation_popup.php',$data,true);
+ echo json_encode($htmlPage);
+ }
+
}
diff --git a/application/modules/Business/models/Business_model.php b/application/modules/Business/models/Business_model.php
index 266d135..3a61c2f 100644
--- a/application/modules/Business/models/Business_model.php
+++ b/application/modules/Business/models/Business_model.php
@@ -34,4 +34,73 @@ public function delete_by_md5_id($id,$business_id,$table)
return;
}
+ public function get_business_modules($business_id)
+ {
+ $this->db->select('permit_modules.*,modules.modules');
+ $this->db->from('permit_modules');
+ $this->db->join('modules', 'permit_modules.module_id = modules.id and modules.is_active = 1', 'left');
+ $this->db->where('uid', $business_id);
+ $this->db->where('permit_modules.is_active', 1);
+ $query = $this->db->get();
+ return $query->result();
+ }
+
+ public function get_business_module_is_active($business_id)
+ {
+ $this->db->select('module_id');
+ $this->db->from('permit_modules');
+ $this->db->where('uid', $business_id);
+ $this->db->where('is_active', 1);
+ $query = $this->db->get();
+ return $query->result();
+
+ }
+
+ public function get_group_module_data_by_id($id , $module_id = null)
+ {
+ $this->db->select('module_id');
+ $this->db->from('permit_modules');
+ $this->db->where('uid', $id);
+ if($module_id != null){ $this->db->where('module_id', $module_id); }
+ $this->db->where('is_active', 1);
+ $query = $this->db->get();
+ return $query->result();
+ }
+ public function delete_group_module_data_by_id($id , $module_id )
+ {
+ $this->db->where('uid', $id);
+ $this->db->where('module_id', $module_id);
+ $this->db->delete('permit_modules');
+ return;
+
+ }
+
+ public function diable_module_in_group_permisssion($module_id, $data)
+ {
+ $this->db->where('module_id', $module_id);
+ $this->db->update('group_permisssion', $data);
+ return;
+
+ }
+
+ public function Enable_module_in_group_permisssion($module_id, $mdata)
+ {
+ $this->db->where('module_id', $module_id);
+ $this->db->update('group_permisssion', $mdata);
+ return;
+
+ }
+
+ public function get_group_id_by_module_id($module_id)
+ {
+ $this->db->select('group_membership.group_id');
+ $this->db->from('group_membership');
+ $this->db->join('group_permisssion', 'group_permisssion.group_id = group_membership.group_id');
+ $this->db->where('module_id', $module_id);
+ $query = $this->db->get();
+ return $query->result();
+
+
+ }
+
}
\ No newline at end of file
diff --git a/application/modules/Business/views/add_business.php b/application/modules/Business/views/add_business.php
index dbaa85b..46c9c78 100644
--- a/application/modules/Business/views/add_business.php
+++ b/application/modules/Business/views/add_business.php
@@ -1,6 +1,128 @@
+
+
+
+
+
@@ -56,8 +178,7 @@
-
-
-
-
-
-
+
+
+
+
+
\ No newline at end of file
diff --git a/application/modules/Employee/controllers/Employee.php b/application/modules/Employee/controllers/Employee.php
index 55bd4cf..9a8d122 100644
--- a/application/modules/Employee/controllers/Employee.php
+++ b/application/modules/Employee/controllers/Employee.php
@@ -49,7 +49,7 @@ public function index()
public function empList()
- {
+ {
$emp_list = $this->Emp_model->get_employee(user()->business_id);
$this->layout->set('tableData', $emp_list);
$this->layout->buffer('main_content', 'Employee/emp_list');
@@ -57,10 +57,12 @@ public function empList()
}
public function addEmployee($businessId = 0)
- {
+ {
+ $get_group_list = $this->Emp_model->get_group_list(user()->business_id);
$manager = $this->Emp_model->get_employee(user()->business_id);
$ModuleData = $this->Emp_model->get_modules(user()->business_id);
- $this->layout->set('ModuleData', $ModuleData);
+ $this->layout->set('get_group_list', $get_group_list);
+ $this->layout->set('ModuleData', $ModuleData);
$this->layout->set('manager', $manager);
$this->layout->set('departmentData', $this->MY_Model->select_by_department_data('department_master',user()->business_id));
$this->layout->buffer('main_content', 'Employee/add_emp');
@@ -173,6 +175,7 @@ public function createEmp()
unset($data['mobile']);
unset($data['password']);
unset($data['confirm_password']);
+ unset($data['group_id']);
$data['user_id'] = $create_user;
$data['profile_pic'] = $upload_image['file_name'];
$data['business_id'] = user()->business_id;
@@ -185,7 +188,7 @@ public function createEmp()
$joining_month = date('m', strtotime($this->input->post('j_date')));
$all_leave_count = $this->Emp_model->get_leave_type(user()->business_id);
$joining_month_total = (12 - $joining_month) + 1 ;
- //echo $joining_month_total; die();
+
foreach ($all_leave_count as $key => $value) {
$remaining_days = ceil(((int)$value->days / 12) * $joining_month_total);
@@ -204,6 +207,22 @@ public function createEmp()
}
}
+ if($create_user == true)
+ {
+ for($i=0;$i
input->post('group_id'));$i++)
+ {
+ $group['emp_id']=$create_user;
+ $group['business_id']=user()->business_id;
+ $group['group_id']=$this->input->post('group_id')[$i];
+ $group['is_active']=1;
+ $this->MY_Model->insert($group,'group_membership');
+
+ }
+ }
+
+
+
+
//audit
if($create_emp_details)
{
@@ -263,7 +282,8 @@ public function add_employee_file()
public function editEmployee($id)
- {
+ {
+
$images = $this->Emp_model->get_data(user()->business_id , $id , 'employee_doc'); //984647 , 1
$add_education = $this->Emp_model->get_data(user()->business_id , $id , 'employee_qualification');
$employee_history = $this->Emp_model->get_data(user()->business_id , $id , 'employee_history');
@@ -281,6 +301,13 @@ public function editEmployee($id)
);
$emp_sub_list_htmlPage = $this->load->view('emp_sub_list.php',$data,true);
+ $get_group_list = $this->Emp_model->get_group_list(user()->business_id);
+ $get_members_list = $this->Emp_model->get_members_list($id,user()->business_id);
+ // print_r($get_group_list);
+ // echo"";
+ // print_r($get_members_list); die;
+ $this->layout->set('get_members_list', $get_members_list);
+ $this->layout->set('get_group_list', $get_group_list);
$this->layout->set('manager', $manager);
$this->layout->set('manager_name', $manager_name);
$this->layout->set('departmentData', $this->MY_Model->select_by_department_data('department_master',user()->business_id));
@@ -329,6 +356,7 @@ public function editEmployees()
unset($action['name']);
unset($action['email']);
unset($action['mobile']);
+ unset($action['group_id']);
//file upload confic
$config['upload_path'] = APPPATH. '../assets/uploads/';
@@ -349,6 +377,72 @@ public function editEmployees()
}
$id = $this->input->post('id');
+ $get_membership = $this->Emp_model->get_members_details($this->input->post('user_id'), user()->business_id);
+ // print_r($get_membership); die();
+ if(count($get_membership) != 0)
+ {
+ $DbData = [];
+ foreach($get_membership as $key => $val){
+ array_push($DbData,$val->group_id);
+ }
+
+ if($this->input->post('group_id') == null)
+ {
+ $module_id_array = [];
+ }else{
+ $module_id_array = $this->input->post('group_id');
+ }
+
+ // Find the values unique to array1 (not in array2)
+ $differentValues1 = array_diff($module_id_array , $DbData);
+
+ // Find the values unique to array2 (not in array1)
+ $differentValues2 = array_diff($DbData , $module_id_array);
+
+ // Merge the two results to get all the different values from both arrays
+ $final_array = array_merge($differentValues1, $differentValues2);
+ // echo "";
+ // print_r($DbData); print_r($this->input->post('group_id')); print_r($final_array);
+ // echo "";
+ // die;
+
+ if(count($final_array) != 0)
+ {
+ foreach($final_array as $key => $value){
+ $check_if_exist = $this->Emp_model->get_group_module_data_by_id($this->input->post('user_id') , $value);
+ if($check_if_exist)
+ {
+ $this->Emp_model->delete_group_module_data_by_id($this->input->post('user_id') , $value);
+ }else{
+ $group['emp_id']=$this->input->post('user_id');
+ $group['business_id']=user()->business_id;
+ $group['group_id']=$value;
+ $group['is_active']=1;
+ $this->MY_Model->insert($group,'group_membership');
+ }
+
+ }
+ }
+ }
+ else
+ { for($i=0;$iinput->post('group_id'));$i++)
+ {
+ $group['emp_id']=$this->input->post('user_id');
+ $group['business_id']=user()->business_id;
+ $group['group_id']=$this->input->post('group_id')[$i];
+ $group['is_active']=1;
+ $this->MY_Model->insert($group,'group_membership');
+ }
+ }
+
+
+
+
+
+
+
+
+
//set id $ table name for audit history
$this->audit->set('id',$this->input->post('id'));
$this->audit->set('table',$table);
@@ -429,158 +523,5 @@ public function editEmp_history($id)
}
-
- // public function expence_form()
- // {
-
- // $this->layout->buffer('main_content', 'Employee/expence_form');
- // $this->layout->render('Employee_Layout');
- // }
-
- // public function get_emp_name()
- // {
- // $emp = $this->Emp_model->get_employee_name(user()->business_id);
- // $html = '';
- // foreach($emp as $val)
- // {
- // if($val->user_id != user()->id)
- // {
- // $html .='';
- // }
- // }
- // echo json_encode($html);
- // }
-
- // public function rise_expence_request()
- // {
-
- // $data = $this->input->post();
- // unset($data['bill']);
-
-
- // //file upload confic
- // $config['upload_path'] = APPPATH. '../assets/uploads/Expence_Bill/';
- // $config['allowed_types'] = 'gif|jpg|png|jpeg|pdf';
- // $config['file_name'] = time();
- // $config['max_size'] = 80000;
- // //upload
- // $this->load->library('upload', $config);
- // $this->upload->initialize($config);
- // $this->upload->do_upload('bill');
- // if ( ! $this->upload->do_upload('bill'))
- // {
- // $error = array('error' => $this->upload->display_errors());
- // //print_r($error);
-
- // } else{
- // $upload_image = $this->upload->data();
- // $data['bill'] = $upload_image['file_name'];
-
- // }
-
-
- // if(isset($data['emp_id'])){
- // $emp_id =$this->input->post('emp_id');
- // }else{
- // $emp_id = user()->id;
- // }
- // $data['emp_id'] = $emp_id;
- // $data['business_id'] = user()->business_id;
- // $data['status'] = 'pending';
- // $data['created_at'] = date('Y-m-d H:i:s');
- // $data['is_active'] = 1;
- // // echo '';
- // // print_r($data); die();
-
-
- // $table="expence_list";
- // $create_leave = $this->MY_Model->insert($data,$table);
-
- // redirect('Employee/expence_form');
-
- // }
-
-
- // public function expence_list()
- // {
- // $business_id = user()->business_id;
- // $expence_list = $this->Emp_model->get_expence_list($business_id);
- // // echo '';
- // // print_r($expence_list); die();
- // $decline_dropdown = $this->Emp_model->decline_dropdown($business_id);
- // $this->layout->set('tableData', $expence_list);
- // $this->layout->set('dropdown', $decline_dropdown);
- // $this->layout->buffer('main_content', 'Employee/expence_list');
- // $this->layout->render('Employee_Layout');
- // }
-
-
- // public function Approve_Expence()
- // {
- // $id=$this->input->get('id');
- // $action['status'] = 'Approved';
- // $action['approved_by']= user()->name;
- // $action['approved_at'] = date('d-m-Y H:i:s');
- // $table = "expence_list";
- // $this->MY_Model->edit_option($action, $id, $table);
- // redirect('Employee/expence_list');
- // }
-
- // public function Manager_Approvel()
- // {
- // $id=$this->input->get('id');
- // $action['status'] = 'Approved';
- // $action['approved_by']= user()->name;
- // $action['approved_at'] = date('d-m-Y H:i:s');
- // $table = "expence_list";
- // $this->MY_Model->edit_option($action, $id, $table);
- // redirect('Employee/expence_list');
- // }
-
- // public function Decline_expence()
- // {
- // $id=$this->input->get('id');
- // $data['status'] = 'Declined';
- // $data['declined_at'] = date('d-m-Y H:i:s');
- // $data['DReason'] = $this->input->get('reason');
- // $this->Leave_model->LeaveDecline($id, $data);
- // return true;
- // }
-
- // public function cancled_expence()
- // {
- // $id=$this->input->get('id');
- // $data['status'] = 'canceled';
- // $data['cancled_at'] = date('d-m-Y H:i:s');
- // $this->Leave_model->Leavecancle($id, $data);
- // redirect('Leave/LeaveHistory');
- // }
-
- // public function expence_emp_list()
- // {
- // $expence_emp_list = $this->Leave_model->get_leave_with_emp_name(user()->business_id);
- // $this->layout->set('tableData', $expence_emp_list);
- // $this->layout->buffer('main_content', 'Leave/leavehistory');
- // $this->layout->render('Employee_Layout');
- // }
-
-
- // public function manager_approvel_list()
- // {
- // $business_id = user()->business_id;
- // $user_id = user()->id;
- // $manager = $this->Leave_model->under_emp_manager($user_id, $business_id);
- // $decline_dropdown = $this->Leave_model->decline_dropdown($business_id);
- // $leave_list = $this->Leave_model->get_with_emp_name(user()->business_id);
- // $this->layout->set('tableData', $leave_list);
- // $this->layout->set('manager', $manager);
- // $this->layout->buffer('main_content', 'Leave/manager_approvel');
- // $this->layout->render('Employee_Layout');
- // }
-
-
-
-
-
}
diff --git a/application/modules/Employee/models/Employee_model.php b/application/modules/Employee/models/Employee_model.php
index 71f2751..3716ac3 100644
--- a/application/modules/Employee/models/Employee_model.php
+++ b/application/modules/Employee/models/Employee_model.php
@@ -112,4 +112,55 @@ public function get_modules($business_id)
}
+ public function get_group_list($business_id)
+ {
+ $this->db->select('*');
+ $this->db->from('groups');
+ $this->db->where('business_id', $business_id);
+ $query = $this->db->get();
+ return $query->result();
+
+ }
+
+ public function get_members_details($user_id, $business_id)
+ {
+ $this->db->select('group_id');
+ $this->db->from('group_membership');
+ $this->db->where('emp_id', $user_id);
+ $this->db->where('business_id', $business_id);
+ $query = $this->db->get();
+ return $query->result();
+ }
+
+ public function get_members_list($id, $business_id)
+ {
+ $this->db->select('group_membership.*,groups.group_name');
+ $this->db->from('group_membership');
+ $this->db->join('groups', 'group_membership.group_id = groups.id and groups.is_active = 1', 'left');
+ $this->db->where('md5(emp_id)', $id);
+ $this->db->where('group_membership.business_id', $business_id);
+ $this->db->where('group_membership.is_active', 1);
+ $query = $this->db->get();
+ return $query->result();
+ }
+
+ public function get_group_module_data_by_id($id , $group_id = null)
+ {
+ $this->db->select('group_id');
+ $this->db->from('group_membership');
+ $this->db->where('emp_id', $id);
+ if($group_id != null){ $this->db->where('group_id', $group_id); }
+ $this->db->where('is_active', 1);
+ $query = $this->db->get();
+ return $query->result();
+ }
+ public function delete_group_module_data_by_id($user_id , $group_id )
+ {
+ $this->db->where('group_id', $group_id);
+ $this->db->where('emp_id', $user_id);
+ $this->db->delete('group_membership');
+ return;
+
+ }
+
}
\ No newline at end of file
diff --git a/application/modules/Employee/views/add_emp.php b/application/modules/Employee/views/add_emp.php
index 7ecdbba..26de719 100644
--- a/application/modules/Employee/views/add_emp.php
+++ b/application/modules/Employee/views/add_emp.php
@@ -10,6 +10,128 @@
+
+
+
+
+
Add Employee
@@ -17,7 +139,7 @@
-
+
+
-
+
Emergency Contact
@@ -176,12 +285,12 @@
+
+
-
+
Address Details
+
@@ -212,16 +321,17 @@
+
-
Additional Information
+
Additional Information
-
+
+
+
+
+
@@ -383,3 +512,14 @@ function validateFile(input) {
}
+
+
diff --git a/application/modules/Employee/views/edit_emp.php b/application/modules/Employee/views/edit_emp.php
index 754dd41..1706315 100644
--- a/application/modules/Employee/views/edit_emp.php
+++ b/application/modules/Employee/views/edit_emp.php
@@ -6,6 +6,126 @@
+
+
+
@@ -40,12 +160,11 @@
-
Personal Information*
+
Personal Information*
-