diff --git a/.gitignore b/.gitignore index 900895f..f821c84 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ application/logs/* !application/logs/index.html !application/logs/.htaccess vendor +assets/uploads diff --git a/application/modules/Asset/controllers/Asset.php b/application/modules/Asset/controllers/Asset.php index de1beeb..1b78633 100644 --- a/application/modules/Asset/controllers/Asset.php +++ b/application/modules/Asset/controllers/Asset.php @@ -35,7 +35,7 @@ public function __construct() $this->load->model('Asset_model','Asset_model'); $this->load->model('Audit/audit_model','Audit_model'); $this->load->helper(array('form', 'url')); - // print_r($business);die(); + //print_r($business);die(); } @@ -896,8 +896,8 @@ public function add_or_edit_ThirdPartyForm() redirect('Asset/masterDataList'); } else { $userData = $this->MY_Model->insert($action, $table); - if($business->is_master_data_entered == 0){ $this->MY_Model->editBusiness(); } - $this->session->set_flashdata('msg', $type); + // if($business->is_master_data_entered == 0){ $this->MY_Model->editBusiness(); } + // $this->session->set_flashdata('msg', $type); redirect('Asset/masterDataList'); } @@ -932,8 +932,8 @@ public function add_or_edit_LocationForm() redirect('Asset/masterDataList'); } else { $userData = $this->MY_Model->insert($action, $table); - if($business->is_master_data_entered == 0){ $this->MY_Model->editBusiness(); } - $this->session->set_flashdata('msg', "location"); + // if($business->is_master_data_entered == 0){ $this->MY_Model->editBusiness(); } + // $this->session->set_flashdata('msg', "location"); redirect('Asset/masterDataList'); } @@ -971,8 +971,8 @@ public function add_or_edit_CategoriesForm() redirect('Asset/masterDataList'); } else { $userData = $this->MY_Model->insert($action, $table); - if($business->is_master_data_entered == 0){ $this->MY_Model->editBusiness(); } - $this->session->set_flashdata('msg', "categories"); + // if($business->is_master_data_entered == 0){ $this->MY_Model->editBusiness(); } + // $this->session->set_flashdata('msg', "categories"); redirect('Asset/masterDataList'); } @@ -1009,8 +1009,8 @@ public function add_or_edit_DepartmentForm() redirect('Asset/masterDataList'); } else { $userData = $this->MY_Model->insert($action, $table); - if($business->is_master_data_entered == 0){ $this->MY_Model->editBusiness(); } - $this->session->set_flashdata('msg', "department"); + // if($business->is_master_data_entered == 0){ $this->MY_Model->editBusiness(); } + // $this->session->set_flashdata('msg', "department"); redirect('Asset/masterDataList'); } @@ -1059,8 +1059,8 @@ public function add_or_edit_LeaveForm() redirect('Asset/masterDataList'); } else { $userData = $this->MY_Model->insert($action, $table); - if($business->is_master_data_entered == 0){ $this->MY_Model->editBusiness(); } - $this->session->set_flashdata('msg', "leave"); + // if($business->is_master_data_entered == 0){ $this->MY_Model->editBusiness(); } + // $this->session->set_flashdata('msg', "leave"); redirect('Asset/masterDataList'); } @@ -1108,8 +1108,8 @@ public function add_or_edit_DeclineForm() redirect('Asset/masterDataList'); } else { $userData = $this->MY_Model->insert($action, $table); - if($business->is_master_data_entered == 0){ $this->MY_Model->editBusiness(); } - $this->session->set_flashdata('msg', "decline"); + // if($business->is_master_data_entered == 0){ $this->MY_Model->editBusiness(); } + // $this->session->set_flashdata('msg', "decline"); redirect('Asset/masterDataList'); } diff --git a/application/modules/Asset/views/leave_master_form.php b/application/modules/Asset/views/leave_master_form.php index b3cccaf..89212bb 100644 --- a/application/modules/Asset/views/leave_master_form.php +++ b/application/modules/Asset/views/leave_master_form.php @@ -26,7 +26,7 @@
- +
@@ -37,6 +37,18 @@ + + + diff --git a/application/modules/Asset/views/master_list.php b/application/modules/Asset/views/master_list.php index a82b84d..b10cf8b 100644 --- a/application/modules/Asset/views/master_list.php +++ b/application/modules/Asset/views/master_list.php @@ -496,6 +496,7 @@ + + diff --git a/application/modules/Delegation/views/edit_delegation_form.php b/application/modules/Delegation/views/edit_delegation_form.php index 674cc6c..1460feb 100644 --- a/application/modules/Delegation/views/edit_delegation_form.php +++ b/application/modules/Delegation/views/edit_delegation_form.php @@ -62,7 +62,7 @@
- +
@@ -70,7 +70,7 @@
- +
@@ -131,6 +131,8 @@ fromDateInput.datepicker({ dateFormat: dateFormat, + changeYear: true, + changeMonth: true, onSelect: function (dateText, inst) { toDateInput.datepicker("option", "minDate", dateText); validateDateRange(); @@ -139,6 +141,8 @@ toDateInput.datepicker({ dateFormat: dateFormat, + changeYear: true, + changeMonth: true, onSelect: function (dateText, inst) { validateDateRange(); } diff --git a/application/modules/Employee/controllers/Employee.php b/application/modules/Employee/controllers/Employee.php index e9e3c21..f9bdbf6 100644 --- a/application/modules/Employee/controllers/Employee.php +++ b/application/modules/Employee/controllers/Employee.php @@ -123,12 +123,15 @@ public function createEmp() 'email' => $this->input->post('email'), 'user_name' => $this->input->post('user_name'), 'mobile' => $this->input->post('mobile'), + 'is_active'=> 1, 'password' => hash_password($this->input->post('password')) ); $table="users"; $create_user = $this->MY_Model->insert($data,$table); + $user_insert_id = $this->db->insert_id(); + //audit if($create_user) @@ -174,7 +177,31 @@ public function createEmp() $table="employees"; $create_emp_details = $this->MY_Model->insert($data,$table); - } + //print_r($this->db->last_query()); + $emp_insert_id = $this->db->insert_id(); + $joining_year = date('Y', strtotime($this->input->post('j_date'))); + $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); + + if($value->id != '9'){ + + $days['remaining_days'] = $remaining_days; + $days['business_id'] = user()->business_id; + $days['emp_id'] = $user_insert_id; + $days['total_days'] = $remaining_days; + $days['type'] = $value->id; + $days['year'] = $joining_year; + $this->MY_Model->insert($days,'emp_leave_days'); + } + + } + } + //audit if($create_emp_details) { @@ -186,7 +213,7 @@ public function createEmp() //audit history generation for insert $test = $this->audit->create_history('insert'); } - redirect('Employee/addEmployee'); + redirect('Employee/empList'); } diff --git a/application/modules/Employee/models/Employee_model.php b/application/modules/Employee/models/Employee_model.php index b3edab7..f043c22 100644 --- a/application/modules/Employee/models/Employee_model.php +++ b/application/modules/Employee/models/Employee_model.php @@ -10,6 +10,7 @@ public function get_employee($business_id) $this->db->where('users.business_id', $business_id); $this->db->where('users.is_active', 1); $this->db->where('employees.is_active', 1); + $this->db->order_by('users.id', 'desc'); $query = $this->db->get(); if ($query->num_rows() > 0) { @@ -76,5 +77,26 @@ public function get_manager_name($manager_id) return $query->result(); } + public function get_user_data_by_insert_id($insert_id) + { + $this->db->select('*'); + $this->db->from('users'); + $this->db->join('employees', 'users.id = employees.user_id'); + $this->db->where('users.id', $insert_id); + $query = $this->db->get(); + $result = $query->result(); + + } + + public function get_leave_type($business_id) + { + $this->db->select('*'); + $this->db->from('leave_master'); + $this->db->where('business_id', $business_id); + $query = $this->db->get(); + return $query->result(); + + } + } \ 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 42ba38b..5983a07 100644 --- a/application/modules/Employee/views/add_emp.php +++ b/application/modules/Employee/views/add_emp.php @@ -1,6 +1,13 @@ + + + + + + +
@@ -56,6 +63,7 @@
+
+ + +
+ +
+ + +
+
- +
Male Female @@ -81,8 +112,7 @@ -
- +
@@ -102,7 +132,7 @@
-
+
@@ -137,7 +167,7 @@
- +
@@ -189,11 +219,6 @@
- - -
- -
@@ -215,19 +240,9 @@
- +
- - -
- -
@@ -237,7 +252,6 @@
Cancel -
@@ -290,4 +304,70 @@ function validateKeyPress(event) { reader.readAsDataURL(file); } }); - \ No newline at end of file + + + + + + diff --git a/application/modules/Employee/views/confirmation_popup.php b/application/modules/Employee/views/confirmation_popup.php index d6f94c0..cf002c5 100644 --- a/application/modules/Employee/views/confirmation_popup.php +++ b/application/modules/Employee/views/confirmation_popup.php @@ -1,8 +1,5 @@ - - - - + + + + + + + diff --git a/application/modules/Employee/views/emp_list.php b/application/modules/Employee/views/emp_list.php index 6f3d93f..99409c2 100644 --- a/application/modules/Employee/views/emp_list.php +++ b/application/modules/Employee/views/emp_list.php @@ -1,4 +1,9 @@ +
@@ -13,9 +18,10 @@
- +
- + + @@ -28,6 +34,7 @@ $value) { ?> + --> + \ No newline at end of file diff --git a/application/modules/Expence/views/expence_list.php b/application/modules/Expence/views/expence_list.php index c8b970b..c86c911 100644 --- a/application/modules/Expence/views/expence_list.php +++ b/application/modules/Expence/views/expence_list.php @@ -7,7 +7,7 @@ + @@ -74,9 +96,10 @@
-
Name Email Mobile
name; ?>
+
- + + @@ -94,7 +117,7 @@ id == $value->manager){ ?> - + @@ -126,7 +149,7 @@ status == 'pending') { ?> -   +  
Claim Date Employee Name Description
created_date; ?>
created_time;?>
name; ?> (emp_id; ?>) comments; ?>
created_date; ?>
created_time;?>
name; ?> (emp_id; ?>) comments; ?>
Created Date/Time Employee Name Note
created_date; ?>
created_time; ?>
name; ?> (emp_id; ?>) comments; ?> from_date); echo ' to ';?> to_date);?> type; ?>type; ?>risedby; ?> ---