new change in ams : Venkateshwaran
@ -78,7 +78,7 @@
|
||||
'hostname' => 'localhost',
|
||||
'username' => 'root',
|
||||
'password' => '',
|
||||
'database' => 'ams',
|
||||
'database' => 'test',
|
||||
'dbdriver' => 'mysqli',
|
||||
'dbprefix' => '',
|
||||
'pconnect' => FALSE,
|
||||
|
||||
@ -54,5 +54,5 @@
|
||||
$route['translate_uri_dashes'] = FALSE;
|
||||
|
||||
//modules routes
|
||||
$route['logout'] = 'auth/logout';
|
||||
$route['login'] = 'auth';
|
||||
$route['logout'] = 'Auth/logout';
|
||||
$route['login'] = 'Auth';
|
||||
|
||||
@ -29,6 +29,7 @@ public function __construct()
|
||||
}
|
||||
$global_data['settings'] = $this->auth_model->get_settings();
|
||||
$global_data['business'] = $this->auth_model->get_business(0);
|
||||
// print_r($global_data['business']);
|
||||
$this->load->vars($global_data);
|
||||
$this->load->library('user_agent');
|
||||
|
||||
|
||||
@ -47,8 +47,9 @@ public function __construct()
|
||||
// Copyright
|
||||
// $this->global_data['copyright_from_mycontroller'] = $date;
|
||||
// $this->load->vars($this->global_data);
|
||||
$this->load->module('layout');
|
||||
$this->load->module('audit');
|
||||
### Syntax : $this->load->module('module_name', $params, $object_name);
|
||||
$this->load->module('Layout');
|
||||
$this->load->module('Audit');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,6 +34,8 @@ function edit_option_md5($action, $id, $table){
|
||||
function update($action,$id,$table){
|
||||
$this->db->where('id',$id);
|
||||
$this->db->update($table,$action);
|
||||
|
||||
|
||||
}
|
||||
|
||||
// update function
|
||||
@ -120,11 +122,38 @@ function select_by_business_id($table,$business_id)
|
||||
$this->db->select();
|
||||
$this->db->from($table);
|
||||
$this->db->where('business_id', $business_id);
|
||||
// $this->db->where('is_active ', 1);
|
||||
$this->db->order_by('id','ASC');
|
||||
$query = $this->db->get();
|
||||
$query = $query->result();
|
||||
return $query;
|
||||
}
|
||||
|
||||
// select category data
|
||||
function select_by_category_data($table,$business_id)
|
||||
{
|
||||
$this->db->select();
|
||||
$this->db->from($table);
|
||||
$this->db->where('business_id', $business_id);
|
||||
$this->db->where('is_active ', 1);
|
||||
$this->db->order_by('id','ASC');
|
||||
$query = $this->db->get();
|
||||
$query = $query->result();
|
||||
return $query;
|
||||
}
|
||||
|
||||
// select department data
|
||||
function select_by_department_data($table,$business_id)
|
||||
{
|
||||
$this->db->select();
|
||||
$this->db->from($table);
|
||||
$this->db->where('business_id', $business_id);
|
||||
$this->db->where('is_active ', 1);
|
||||
$this->db->order_by('id','ASC');
|
||||
$query = $this->db->get();
|
||||
$query = $query->result();
|
||||
return $query;
|
||||
}
|
||||
|
||||
// select by business_id and type
|
||||
function select_by_business_id_and_type($table,$business_id,$type)
|
||||
|
||||
@ -78,6 +78,23 @@ function user()
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('employee'))
|
||||
{
|
||||
function employee()
|
||||
{
|
||||
// Get a reference to the controller object
|
||||
$ci =& get_instance();
|
||||
$emp = $ci->auth_model->get_logged_employee();
|
||||
if (empty($emp))
|
||||
{
|
||||
$ci->auth_model->logout();
|
||||
} else {
|
||||
return $emp;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('hash_password')) {
|
||||
function hash_password($password)
|
||||
{
|
||||
@ -151,6 +168,23 @@ function show_year($date){
|
||||
}
|
||||
}
|
||||
|
||||
if(!function_exists('dateFormat'))
|
||||
{
|
||||
function dateFormat($format='d-m-Y', $givenDate=null)
|
||||
{
|
||||
return date($format, strtotime($givenDate));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(!function_exists('timeFormat'))
|
||||
{
|
||||
function timeFormat($format='h:i:s a', $givenTime=null)
|
||||
{
|
||||
return date($format, strtotime($givenTime));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//get days
|
||||
if (!function_exists('get_days')) {
|
||||
|
||||
@ -29,22 +29,21 @@ public function __construct()
|
||||
{
|
||||
// To inherit directly the attributes of the parent class.
|
||||
parent::__construct();
|
||||
$this->load->model('MY_Model');
|
||||
$this->load->model('Asset_model');
|
||||
$this->load->model('Audit_model');
|
||||
### Syntax : $this->load->model('Model Path' , 'Alias name');
|
||||
### The second parameter (optional) is used to call the method.
|
||||
$this->load->model('MY_Model','MY_Model');
|
||||
$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();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
$this->layout->set('users', "gowtham");
|
||||
$this->layout->buffer('main_content', 'Asset/index');
|
||||
$this->layout->render('default_layout');
|
||||
|
||||
|
||||
$this->layout->render('default_layout');
|
||||
}
|
||||
|
||||
public function addAsset($id='empty')
|
||||
@ -64,19 +63,133 @@ public function addAsset($id='empty')
|
||||
$this->layout->render('default_layout');
|
||||
|
||||
}
|
||||
|
||||
public function assetList()
|
||||
|
||||
public function assetLandingPage()
|
||||
{
|
||||
|
||||
$assets_list = $this->Asset_model->get_assets(user()->business_id);
|
||||
$assets_list = $this->Asset_model->get_category_wise_assets(user()->business_id);
|
||||
$this->layout->set('tableData', $assets_list);
|
||||
$this->layout->buffer('main_content', 'Asset/asset_landing_page');
|
||||
$this->layout->render('default_layout');
|
||||
|
||||
}
|
||||
|
||||
public function assetList($category , $purchase_date_from = null , $purchase_date_to = null)
|
||||
{
|
||||
|
||||
$table = 'asset';
|
||||
$assets_list = $this->Asset_model->get_assets(user()->business_id , $category );
|
||||
foreach ($assets_list as $key => $value) {
|
||||
// update yearly once
|
||||
if($value->last_updated_year != date('Y'))
|
||||
{
|
||||
// update last_updated_year in db
|
||||
$year['last_updated_year'] = date('Y');
|
||||
// $editCurrentValue = $this->MY_Model->edit_option($year, $value->id, $table);
|
||||
// find difference between two dates
|
||||
$date1 = new DateTime(date('Y-m-d'));
|
||||
$date2 = new DateTime($value->purchase_date);
|
||||
$interval = $date1->diff($date2);
|
||||
$nxt_year = date('Y-m-d', strtotime("+12 months $value->purchase_date"));
|
||||
// echo $nxt_year;die();
|
||||
// echo $interval->y; die();
|
||||
// year intervel greater than 0
|
||||
if($interval->y > 0)
|
||||
{
|
||||
$curr_month = date('n', strtotime($value->purchase_date));
|
||||
|
||||
// echo $curr_month;die();
|
||||
$month_array_for_50_percentage = array(10 , 11 , 12 , 1 , 2 ,3);
|
||||
if (in_array($curr_month, $month_array_for_50_percentage) && date('Y-m-d') > $nxt_year)
|
||||
{
|
||||
$cost = $value->cost;
|
||||
// get depreciation value
|
||||
$category_percentage = $this->Asset_model->get_by_category_id($value->category);
|
||||
// percentage formula calculation
|
||||
$category_percentage = $category_percentage[0]['depreciation_percentage'] / 2;
|
||||
$depreciate_value = $cost * $category_percentage / 100;
|
||||
$cost = abs($depreciate_value - $cost);
|
||||
// echo $cost;die();
|
||||
$category_percentage = $this->Asset_model->get_by_category_id($value->category);
|
||||
for ($i=0 ; $i < $interval->y ; $i++)
|
||||
{
|
||||
// $category_percentage = $this->Asset_model->get_by_category_id($value->category);
|
||||
$category_per = $category_percentage[0]['depreciation_percentage'];
|
||||
$depreciate_value = $cost * $category_per / 100;
|
||||
$data['current_cost'] = abs($depreciate_value - $cost);
|
||||
$editCurrentValue = $this->MY_Model->edit_option($data, $value->id, $table);
|
||||
$cost = abs($depreciate_value - $cost);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$cost = $value->cost;
|
||||
// get depreciation value
|
||||
$category_percentage = $this->Asset_model->get_by_category_id($value->category);
|
||||
// percentage formula calculation
|
||||
$category_percentage = $category_percentage[0]['depreciation_percentage'];
|
||||
$depreciate_value = $cost * $category_percentage / 100;
|
||||
$cost = abs($depreciate_value - $cost);
|
||||
|
||||
// $cost = $value->cost;
|
||||
// get depreciation value
|
||||
$category_percentage = $this->Asset_model->get_by_category_id($value->category);
|
||||
for ($i=0 ; $i < $interval->y ; $i++)
|
||||
{
|
||||
$category_per = $category_percentage[0]['depreciation_percentage'];
|
||||
$depreciate_value = $cost * $category_per / 100;
|
||||
// echo $depreciate_value; die();
|
||||
$data['current_cost'] = abs($depreciate_value- $cost);
|
||||
$editCurrentValue = $this->MY_Model->edit_option($data, $value->id, $table);
|
||||
$cost = abs($depreciate_value - $cost);
|
||||
}
|
||||
}
|
||||
}
|
||||
// year intervel less than 0
|
||||
else
|
||||
{
|
||||
$curr_month = date('n', strtotime($value->purchase_date));
|
||||
$month_array_for_50_percentage = array(10 , 11 , 12 , 1 , 2 , 3);
|
||||
if (in_array($curr_month, $month_array_for_50_percentage))
|
||||
{
|
||||
$cost = $value->cost;
|
||||
// get depreciation value
|
||||
$category_percentage = $this->Asset_model->get_by_category_id($value->category);
|
||||
// percentage formula calculation
|
||||
$category_percentage = $category_percentage[0]['depreciation_percentage'] / 2;
|
||||
$depreciate_value = $cost * $category_percentage / 100;
|
||||
$data['current_cost'] = abs($cost - $depreciate_value);
|
||||
$editCurrentValue = $this->MY_Model->edit_option($data, $value->id, $table);
|
||||
}
|
||||
else if(date('Y-m-d') > $nxt_year)
|
||||
{
|
||||
echo $nxt_year;die();
|
||||
$cost = $value->cost;
|
||||
// get depreciation value
|
||||
$category_percentage = $this->Asset_model->get_by_category_id($value->category);
|
||||
// percentage formula calculation
|
||||
$depreciate_value = $cost * $category_percentage[0]['depreciation_percentage'] / 100;
|
||||
$data['current_cost'] = abs($cost - $depreciate_value);
|
||||
$editCurrentValue = $this->MY_Model->edit_option($data, $value->id, $table);
|
||||
}
|
||||
else {
|
||||
$data['current_cost'] = $value->cost;
|
||||
$editCurrentValue = $this->MY_Model->edit_option($data, $value->id, $table);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$assets_list = $this->Asset_model->get_assets(user()->business_id , $category, $purchase_date_from , $purchase_date_to);
|
||||
$this->layout->set('tableData', $assets_list);
|
||||
$this->layout->buffer('main_content', 'Asset/asset_list');
|
||||
$this->layout->render('default_layout');
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function createAssets()
|
||||
{
|
||||
|
||||
$data=$this->input->post();
|
||||
$data['business_id'] = user()->business_id;
|
||||
$data['created_by'] = user()->name;
|
||||
@ -99,6 +212,7 @@ public function createAssets()
|
||||
}
|
||||
|
||||
$table="asset";
|
||||
|
||||
|
||||
//create asset
|
||||
$create_assets = $this->MY_Model->insert($data,$table);
|
||||
@ -106,6 +220,7 @@ public function createAssets()
|
||||
// Qr code
|
||||
$qr_data['qrcode_img'] = (new QRCode)->render(base_url().'Asset/view_asset_details/'.md5($create_assets));
|
||||
$editAssetData = $this->MY_Model->edit_option($qr_data, $create_assets, $table);
|
||||
$editCurrentValue = $this->MY_Model->edit_option($qr_data, $create_assets, $table);
|
||||
|
||||
|
||||
if($create_assets)
|
||||
@ -119,7 +234,7 @@ public function createAssets()
|
||||
$test = $this->audit->create_history('insert');
|
||||
}
|
||||
|
||||
redirect('asset/assetList');
|
||||
redirect('Asset/assetList/'.md5($this->input->post('category')));
|
||||
|
||||
}
|
||||
|
||||
@ -194,14 +309,16 @@ public function editAssets()
|
||||
//audit history generation for update
|
||||
$test = $this->audit->create_history('update');
|
||||
}
|
||||
redirect('asset/assetList');
|
||||
redirect('Asset/assetList/'.md5($this->input->post('category')));
|
||||
|
||||
}
|
||||
|
||||
public function deleteAsset($id)
|
||||
public function deleteAsset()
|
||||
{
|
||||
$id = $this->input->post('id');
|
||||
$assetdata = $this->Asset_model->get_asset__id($id,'asset',user()->business_id);
|
||||
$Data = $this->Asset_model->delete_by_md5_id($id,user()->business_id,'asset');
|
||||
redirect('asset/assetList');
|
||||
redirect('Asset/assetList/'.md5($assetdata->category));
|
||||
}
|
||||
|
||||
|
||||
@ -232,18 +349,6 @@ public function view_qrcode()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function view_asset_details($id)
|
||||
{
|
||||
$tab = $this->session->flashdata();
|
||||
@ -323,16 +428,17 @@ public function add_or_edit_asset_value()
|
||||
}
|
||||
|
||||
$this->session->set_flashdata('msg', "asset_value");
|
||||
redirect('asset/view_asset_details/'.md5($this->input->post('asset_id')));
|
||||
redirect('Asset/view_asset_details/'.md5($this->input->post('asset_id')));
|
||||
}else{
|
||||
$get_latest_asset_value = $this->Asset_model->get_latest_asset_value($this->input->post('asset_id_for_add'),user()->business_id);
|
||||
$pre_current_value = $get_latest_asset_value->current_value;
|
||||
if($this->input->post('type') == 'Upgrade')
|
||||
{
|
||||
$data['current_value'] = $pre_current_value + $this->input->post('value');
|
||||
}else if($this->input->post('type') == 'Depreciation') {
|
||||
$data['current_value'] = $pre_current_value - $this->input->post('value');
|
||||
}
|
||||
// if($this->input->post('type') == 'Upgrade')
|
||||
// {
|
||||
// $data['current_value'] = $pre_current_value * $this->input->post('value');
|
||||
// }else if($this->input->post('type') == 'Depreciation') {
|
||||
// $data['current_value'] = $pre_current_value - $this->input->post('value');
|
||||
// }
|
||||
$data['current_value'] = $pre_current_value * $this->input->post('value');
|
||||
$data['asset_id'] = $this->input->post('asset_id_for_add');
|
||||
$data['business_id'] = user()->business_id;
|
||||
$data['type'] = $this->input->post('type');
|
||||
@ -342,6 +448,7 @@ public function add_or_edit_asset_value()
|
||||
$data['description'] = $this->input->post('description');
|
||||
$data['created_by'] = user()->id;
|
||||
$createAssetValueData = $this->MY_Model->insert($data, 'asset_value');
|
||||
// print_r($createAssetValueData);die();
|
||||
if($createAssetValueData)
|
||||
{
|
||||
//set id $ table name for audit history
|
||||
@ -353,11 +460,11 @@ public function add_or_edit_asset_value()
|
||||
$this->audit->create_history('insert');
|
||||
}
|
||||
$this->session->set_flashdata(1); $this->session->set_flashdata('msg', "asset_value");
|
||||
redirect('asset/view_asset_details/'.md5($this->input->post('asset_id_for_add')));
|
||||
redirect('Asset/view_asset_details/'.md5($this->input->post('asset_id_for_add')));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function getAssetUsageForm($id)
|
||||
@ -423,7 +530,7 @@ public function add_or_edit_asset_usage()
|
||||
$this->audit->create_history('update');
|
||||
}
|
||||
$this->session->set_flashdata('msg', "asset_usage");
|
||||
redirect('asset/view_asset_details/'.md5($this->input->post('asset_id')));
|
||||
redirect('Asset/view_asset_details/'.md5($this->input->post('asset_id')));
|
||||
}else{
|
||||
$data['asset_id'] = $this->input->post('asset_id_for_add');
|
||||
$data['business_id'] = user()->business_id;
|
||||
@ -444,7 +551,7 @@ public function add_or_edit_asset_usage()
|
||||
$this->audit->create_history('insert');
|
||||
}
|
||||
$this->session->set_flashdata('msg', "asset_usage");
|
||||
redirect('asset/view_asset_details/'.md5($this->input->post('asset_id_for_add')));
|
||||
redirect('Asset/view_asset_details/'.md5($this->input->post('asset_id_for_add')));
|
||||
}
|
||||
}
|
||||
|
||||
@ -495,7 +602,7 @@ public function add_or_edit_asset_amc()
|
||||
$this->audit->create_history('update');
|
||||
}
|
||||
$this->session->set_flashdata('msg', "asset_amc");
|
||||
redirect('asset/view_asset_details/'.md5($this->input->post('asset_id')));
|
||||
redirect('Asset/view_asset_details/'.md5($this->input->post('asset_id')));
|
||||
}else{
|
||||
$data['asset_id'] = $this->input->post('asset_id_for_add');
|
||||
$data['business_id'] = user()->business_id;
|
||||
@ -521,7 +628,7 @@ public function add_or_edit_asset_amc()
|
||||
$this->audit->create_history('insert');
|
||||
}
|
||||
$this->session->set_flashdata('msg', "asset_amc");
|
||||
redirect('asset/view_asset_details/'.md5($this->input->post('asset_id_for_add')));
|
||||
redirect('Asset/view_asset_details/'.md5($this->input->post('asset_id_for_add')));
|
||||
}
|
||||
}
|
||||
|
||||
@ -572,7 +679,7 @@ public function add_or_edit_asset_insurance()
|
||||
$this->audit->create_history('update');
|
||||
}
|
||||
$this->session->set_flashdata('msg', "asset_insurance");
|
||||
redirect('asset/view_asset_details/'.md5($this->input->post('asset_id')));
|
||||
redirect('Asset/view_asset_details/'.md5($this->input->post('asset_id')));
|
||||
}else{
|
||||
$data['asset_id'] = $this->input->post('asset_id_for_add');
|
||||
$data['business_id'] = user()->business_id;
|
||||
@ -597,7 +704,7 @@ public function add_or_edit_asset_insurance()
|
||||
$this->audit->create_history('insert');
|
||||
}
|
||||
$this->session->set_flashdata('msg', "asset_insurance");
|
||||
redirect('asset/view_asset_details/'.md5($this->input->post('asset_id_for_add')));
|
||||
redirect('Asset/view_asset_details/'.md5($this->input->post('asset_id_for_add')));
|
||||
}
|
||||
}
|
||||
|
||||
@ -609,7 +716,7 @@ public function add_or_edit_asset_insurance()
|
||||
public function getAssetImageForm($id)
|
||||
{
|
||||
|
||||
$data = array('asset_id'=> $id, 'heading'=>'Add Image' , 'submit_button_title'=>'Submit');
|
||||
$data = array('asset_id'=> $id, 'heading'=>'Add File' , 'submit_button_title'=>'Submit');
|
||||
$htmlPage = $this->load->view('asset_image_form.php',$data,true);
|
||||
echo json_encode($htmlPage);
|
||||
}
|
||||
@ -623,7 +730,7 @@ public function add_asset_image()
|
||||
|
||||
//file upload confic
|
||||
$asset_image['upload_path'] = APPPATH. '../assets/uploads/';
|
||||
$asset_image['allowed_types'] = 'gif|jpg|png|jpeg';
|
||||
$asset_image['allowed_types'] = 'gif|jpg|png|jpeg|pdf';
|
||||
$asset_image['max_size'] = 80000;
|
||||
//upload
|
||||
$this->load->library('upload', $asset_image);
|
||||
@ -639,7 +746,7 @@ public function add_asset_image()
|
||||
$table="asset_images";
|
||||
$create_assets = $this->MY_Model->insert($data,$table);
|
||||
$this->session->set_flashdata('msg', "asset_image");
|
||||
redirect('asset/view_asset_details/'.md5($this->input->post('asset_id')));
|
||||
redirect('Asset/view_asset_details/'.md5($this->input->post('asset_id')));
|
||||
|
||||
}
|
||||
|
||||
@ -650,7 +757,7 @@ public function deleteAssetValue($id)
|
||||
$asset_id = $split[1];
|
||||
$Data = $this->Asset_model->delete_by_md5_id($key,user()->business_id,'asset_value');
|
||||
$this->session->set_flashdata('msg', "asset_value");
|
||||
redirect('asset/view_asset_details/'.md5($asset_id));
|
||||
redirect('Asset/view_asset_details/'.md5($asset_id));
|
||||
}
|
||||
public function deleteAssetUsage($id)
|
||||
{
|
||||
@ -659,34 +766,37 @@ public function deleteAssetUsage($id)
|
||||
$asset_id = $split[1];
|
||||
$Data = $this->Asset_model->delete_by_md5_id($key,user()->business_id,'asset_usage');
|
||||
$this->session->set_flashdata('msg', "asset_usage");
|
||||
redirect('asset/view_asset_details/'.md5($asset_id));
|
||||
redirect('Asset/view_asset_details/'.md5($asset_id));
|
||||
}
|
||||
public function deleteAssetAMC($id)
|
||||
public function deleteAssetAMC()
|
||||
{
|
||||
$id = $this->input->post('id');
|
||||
$split = preg_split('/_/', $id);
|
||||
$key = $split[0];
|
||||
$asset_id = $split[1];
|
||||
$Data = $this->Asset_model->delete_by_md5_id($key,user()->business_id,'amc');
|
||||
$this->session->set_flashdata('msg', "asset_amc");
|
||||
redirect('asset/view_asset_details/'.md5($asset_id));
|
||||
redirect('Asset/view_asset_details/'.md5($asset_id));
|
||||
}
|
||||
public function deleteAssetImage($id)
|
||||
public function deleteAssetImage()
|
||||
{
|
||||
$id = $this->input->post('id');
|
||||
$split = preg_split('/_/', $id);
|
||||
$key = $split[0];
|
||||
$asset_id = $split[1];
|
||||
$Data = $this->Asset_model->delete_by_md5_id($key,user()->business_id,'asset_images');
|
||||
$this->session->set_flashdata('msg', "asset_image");
|
||||
redirect('asset/view_asset_details/'.md5($asset_id));
|
||||
redirect('Asset/view_asset_details/'.md5($asset_id));
|
||||
}
|
||||
public function deleteAssetInsurance($id)
|
||||
public function deleteAssetInsurance()
|
||||
{
|
||||
$id = $this->input->post('id');
|
||||
$split = preg_split('/_/', $id);
|
||||
$key = $split[0];
|
||||
$asset_id = $split[1];
|
||||
$Data = $this->Asset_model->delete_by_md5_id($key,user()->business_id,'amc');
|
||||
$this->session->set_flashdata('msg', "asset_insurance");
|
||||
redirect('asset/view_asset_details/'.md5($asset_id));
|
||||
redirect('Asset/view_asset_details/'.md5($asset_id));
|
||||
}
|
||||
|
||||
public function depreciation_report()
|
||||
@ -727,8 +837,11 @@ public function masterDataList()
|
||||
$this->layout->set('supplierData', $this->Asset_model->get_third_party_value_by_md5_id(user()->business_id,2));
|
||||
$this->layout->set('service_privoder', $this->Asset_model->get_third_party_value_by_md5_id(user()->business_id,3));
|
||||
$this->layout->set('insurence', $this->Asset_model->get_third_party_value_by_md5_id(user()->business_id,4));
|
||||
$this->layout->set('locationsData', $this->MY_Model->select_by_business_id('locations',user()->business_id));
|
||||
$this->layout->set('categoriesData', $this->MY_Model->select_by_business_id('categories',user()->business_id));
|
||||
$this->layout->set('locationsData', $this->MY_Model->select_by_business_id('locations',user()->business_id,1));
|
||||
$this->layout->set('categoriesData', $this->MY_Model->select_by_category_data('categories',user()->business_id));
|
||||
$this->layout->set('departmentData', $this->MY_Model->select_by_department_data('department_master',user()->business_id));
|
||||
$this->layout->set('leaveData', $this->MY_Model->select_by_department_data('leave_master',user()->business_id));
|
||||
$this->layout->set('enum_value', $this->MY_Model->select_by_department_data('enum',user()->business_id));
|
||||
$this->layout->buffer('main_content', 'Asset/master_list');
|
||||
$this->layout->render('default_layout');
|
||||
|
||||
@ -737,6 +850,7 @@ public function masterDataList()
|
||||
|
||||
public function getThirdPartyForm($id)
|
||||
{
|
||||
|
||||
$state = $this->MY_Model->select('state');
|
||||
if ($id == "manufacture") {
|
||||
$data = array('heading'=> "Manufacturer Details", 'type' => 1 , 'states' => $state , 'submit_button_title'=>'Add' );
|
||||
@ -772,7 +886,6 @@ public function getThirdPartyForm($id)
|
||||
|
||||
public function add_or_edit_ThirdPartyForm()
|
||||
{
|
||||
|
||||
$table = 'third_parties';
|
||||
$action = $this->input->post();
|
||||
$id = $this->input->post('id');
|
||||
@ -780,12 +893,12 @@ public function add_or_edit_ThirdPartyForm()
|
||||
if ($id) {
|
||||
$userData = $this->MY_Model->edit_option($action, $id, $table);
|
||||
$this->session->set_flashdata('msg', $type);
|
||||
redirect('asset/masterDataList');
|
||||
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);
|
||||
redirect('asset/masterDataList');
|
||||
redirect('Asset/masterDataList');
|
||||
}
|
||||
|
||||
}
|
||||
@ -816,12 +929,12 @@ public function add_or_edit_LocationForm()
|
||||
if ($id) {
|
||||
$userData = $this->MY_Model->edit_option($action, $id, $table);
|
||||
$this->session->set_flashdata('msg', "location");
|
||||
redirect('asset/masterDataList');
|
||||
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");
|
||||
redirect('asset/masterDataList');
|
||||
redirect('Asset/masterDataList');
|
||||
}
|
||||
|
||||
}
|
||||
@ -837,8 +950,8 @@ public function getCatogaryForm($id)
|
||||
}
|
||||
else {
|
||||
$table = 'categories';
|
||||
$location_data = $this->MY_Model->get_by_md5_id($id, $table);
|
||||
$data = array('heading'=> "Catogary Details", 'catogary_data'=> $location_data , 'submit_button_title'=>'Add' );
|
||||
$catogary_data = $this->MY_Model->get_by_md5_id($id, $table);
|
||||
$data = array('heading'=> "Catogary Details", 'catogary_data'=> $catogary_data , 'submit_button_title'=>'Update' );
|
||||
$htmlPage = $this->load->view('catogary_master_form.php',$data,true);
|
||||
echo json_encode($htmlPage);
|
||||
}
|
||||
@ -851,27 +964,206 @@ public function add_or_edit_CategoriesForm()
|
||||
$table = 'categories';
|
||||
$action = $this->input->post();
|
||||
$id = $this->input->post('id');
|
||||
// print_r($id);die();
|
||||
if ($id) {
|
||||
$userData = $this->MY_Model->edit_option($action, $id, $table);
|
||||
$this->session->set_flashdata('msg', "categories");
|
||||
redirect('asset/masterDataList');
|
||||
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");
|
||||
redirect('asset/masterDataList');
|
||||
redirect('Asset/masterDataList');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function deleteThirdPartyData($id)
|
||||
public function getDepartmentForm($id)
|
||||
{
|
||||
if ($id == "department") {
|
||||
$table = 'department_master';
|
||||
$data = array('heading'=> "Department Details", 'submit_button_title'=>'Add' );
|
||||
$htmlPage = $this->load->view('department_master_form.php',$data,true);
|
||||
echo json_encode($htmlPage);
|
||||
}
|
||||
else {
|
||||
$table = 'department_master';
|
||||
$department_data = $this->MY_Model->get_by_md5_id($id, $table);
|
||||
$data = array('heading'=> "Department Details", 'department_data'=> $department_data , 'submit_button_title'=>'Update' );
|
||||
$htmlPage = $this->load->view('department_master_form.php',$data,true);
|
||||
echo json_encode($htmlPage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function add_or_edit_DepartmentForm()
|
||||
{
|
||||
|
||||
$table = 'department_master';
|
||||
$action = $this->input->post();
|
||||
$id = $this->input->post('id');
|
||||
// print_r($id);die();
|
||||
if ($id) {
|
||||
$userData = $this->MY_Model->edit_option($action, $id, $table);
|
||||
$this->session->set_flashdata('msg', "department");
|
||||
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");
|
||||
redirect('Asset/masterDataList');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function deleteDepartmentFormData()
|
||||
{
|
||||
$id = $this->input->post('id');
|
||||
$table = 'department_master';
|
||||
$user = $this->Asset_model->get_by_id($id , $table);
|
||||
$Data = $this->Asset_model->delete_by_md5_id($id,user()->business_id,$table);
|
||||
$this->session->set_flashdata('msg', "department");
|
||||
redirect('Asset/masterDataList');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function getLeaveForm($id)
|
||||
{
|
||||
if ($id == "leave") {
|
||||
$table = 'leave_master';
|
||||
$data = array('heading'=> "Leave Details", 'submit_button_title'=>'Add' );
|
||||
$htmlPage = $this->load->view('leave_master_form.php',$data,true);
|
||||
echo json_encode($htmlPage);
|
||||
}
|
||||
else {
|
||||
$table = 'leave_master';
|
||||
$leave_data = $this->MY_Model->get_by_md5_id($id, $table);
|
||||
$data = array('heading'=> "Leave Details", 'leave_data'=> $leave_data , 'submit_button_title'=>'Update' );
|
||||
$htmlPage = $this->load->view('leave_master_form.php',$data,true);
|
||||
echo json_encode($htmlPage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function add_or_edit_LeaveForm()
|
||||
{
|
||||
|
||||
$table = 'leave_master';
|
||||
$action = $this->input->post();
|
||||
$id = $this->input->post('id');
|
||||
if ($id) {
|
||||
$userData = $this->MY_Model->edit_option($action, $id, $table);
|
||||
$this->session->set_flashdata('msg', "leave");
|
||||
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");
|
||||
redirect('Asset/masterDataList');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function deleteLeaveFormData()
|
||||
{
|
||||
$id = $this->input->post('id');
|
||||
$table = 'leave_master';
|
||||
$Data = $this->Asset_model->delete_by_md5_id($id,user()->business_id,$table);
|
||||
$this->session->set_flashdata('msg', "leave");
|
||||
redirect('Asset/masterDataList');
|
||||
}
|
||||
|
||||
/// decline reason
|
||||
|
||||
public function getDeclineForm($id)
|
||||
{
|
||||
if ($id == "decline") {
|
||||
$table = 'enum';
|
||||
$data = array('heading'=> "Decline Reason", 'submit_button_title'=>'Add' );
|
||||
$htmlPage = $this->load->view('Decline_Reason_form.php',$data,true);
|
||||
echo json_encode($htmlPage);
|
||||
}
|
||||
else {
|
||||
$table = 'enum';
|
||||
$Decline_data = $this->MY_Model->get_by_md5_id($id, $table);
|
||||
$data = array('heading'=> "Decline Reason", 'Decline_data'=> $Decline_data , 'submit_button_title'=>'Update' );
|
||||
$htmlPage = $this->load->view('Decline_Reason_form.php',$data,true);
|
||||
echo json_encode($htmlPage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function add_or_edit_DeclineForm()
|
||||
{
|
||||
|
||||
$table = 'enum';
|
||||
$action = $this->input->post();
|
||||
$action['is_active'] = 1;
|
||||
$id = $this->input->post('id');
|
||||
if ($id) {
|
||||
$userData = $this->MY_Model->edit_option($action, $id, $table);
|
||||
$this->session->set_flashdata('msg', "decline");
|
||||
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");
|
||||
redirect('Asset/masterDataList');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function deleteDeclineFormData()
|
||||
{
|
||||
$id = $this->input->post('id');
|
||||
$table = 'enum';
|
||||
$Data = $this->Asset_model->delete_by_md5_id($id,user()->business_id,$table);
|
||||
$this->session->set_flashdata('msg', "decline");
|
||||
redirect('Asset/masterDataList');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function deleteThirdPartyData()
|
||||
{
|
||||
$id = $this->input->post('id');
|
||||
$table = 'third_parties';
|
||||
$user = $this->Asset_model->get_by_id($id , $table);
|
||||
$Data = $this->Asset_model->delete_by_md5_id($id,user()->business_id,$table);
|
||||
$this->session->set_flashdata('msg', $user->type);
|
||||
redirect('asset/masterDataList');
|
||||
redirect('Asset/masterDataList');
|
||||
}
|
||||
|
||||
|
||||
public function deleteCategoriesFormData()
|
||||
{
|
||||
$id = $this->input->post('id');
|
||||
$table = 'categories';
|
||||
$user = $this->Asset_model->get_by_id($id , $table);
|
||||
$Data = $this->Asset_model->delete_by_md5_id($id,user()->business_id,$table);
|
||||
$this->session->set_flashdata('msg', "categories");
|
||||
redirect('Asset/masterDataList');
|
||||
}
|
||||
|
||||
public function getDeleteConfirmationPopup()
|
||||
{
|
||||
$data = array();
|
||||
$htmlPage = $this->load->view('confirmation_popup.php',$data,true);
|
||||
echo json_encode($htmlPage);
|
||||
}
|
||||
|
||||
public function filterAssets()
|
||||
{
|
||||
$split = preg_split('/-/', $this->input->post('reservation'));
|
||||
$purchase_date_from = date_format(date_create($split[0]),"Y-m-d");
|
||||
$purchase_date_to = date_format(date_create($split[1]),"Y-m-d");
|
||||
redirect('Asset/assetList/'.md5($this->input->post('category')).'/'.$purchase_date_from.'/'.$purchase_date_to);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,8 +1,25 @@
|
||||
<?php
|
||||
class Asset_model extends MY_Model {
|
||||
|
||||
public function get_assets($business_id)
|
||||
|
||||
public function get_category_wise_assets($business_id)
|
||||
{
|
||||
$this->db->select('A.* , A.category as category_value , SUM(A.cost) as total , SUM(A.current_cost) as total_current_cost , categories.name as category_name ');
|
||||
$this->db->group_by('A.category');
|
||||
$this->db->from('asset A');
|
||||
$this->db->join('categories', 'categories.id = A.category', 'left');
|
||||
$this->db->where('A.business_id', $business_id);
|
||||
$this->db->order_by('A.id','ASC');
|
||||
$this->db->where('A.is_active', 1);
|
||||
$query = $this->db->get();
|
||||
$query = $query->result();
|
||||
return $query;
|
||||
}
|
||||
|
||||
|
||||
public function get_assets($business_id , $category , $purchase_date_from = null , $purchase_date_to = null)
|
||||
{
|
||||
|
||||
$this->db->select('A.* , categories.name as category_name , third_parties.name as manufacturer_name ,tp.name as supplier_name , locations.location as location_name , status.display_name as status_display_name');
|
||||
$this->db->from('asset A');
|
||||
$this->db->join('categories', 'categories.id = A.category', 'left');
|
||||
@ -11,10 +28,17 @@ public function get_assets($business_id)
|
||||
$this->db->join('locations', 'locations.id = A.location', 'left');
|
||||
$this->db->join('status', 'status.id = A.status', 'left');
|
||||
$this->db->where('A.business_id', $business_id);
|
||||
$this->db->where('md5(A.category)', $category);
|
||||
if($purchase_date_from != null && $purchase_date_to != null)
|
||||
{
|
||||
$this->db->where('A.purchase_date >=', $purchase_date_from);
|
||||
$this->db->where('A.purchase_date <=', $purchase_date_to);
|
||||
}
|
||||
$this->db->order_by('A.id','ASC');
|
||||
$this->db->where('A.is_active', 1);
|
||||
$query = $this->db->get();
|
||||
$query = $query->result();
|
||||
$query = $query->result();
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
@ -34,7 +58,16 @@ public function get_asset_by_md5_id($id,$business_id)
|
||||
return $query;
|
||||
}
|
||||
|
||||
|
||||
public function get_by_category_id($id)
|
||||
{
|
||||
$this->db->select();
|
||||
$this->db->from('categories');
|
||||
$this->db->where('id', $id);
|
||||
$this->db->where('is_active', 1);
|
||||
$query = $this->db->get();
|
||||
$query = $query->result_array();
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function get_by_asset_id($id,$table,$business_id)
|
||||
{
|
||||
@ -47,6 +80,19 @@ public function get_by_asset_id($id,$table,$business_id)
|
||||
$query = $query->result();
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function get_asset__id($id,$table,$business_id)
|
||||
{
|
||||
$this->db->select();
|
||||
$this->db->from($table);
|
||||
$this->db->where('business_id', $business_id);
|
||||
$this->db->where('md5(id)', $id);
|
||||
$this->db->where('is_active', 1);
|
||||
$query = $this->db->get();
|
||||
$query = $query->row();
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function get_amc_with_join($id,$business_id)
|
||||
{
|
||||
$this->db->select('A.* , third_parties.name as service_provider_name ');
|
||||
@ -137,7 +183,7 @@ public function get_latest_asset_value($asset_id,$business_id)
|
||||
public function amc_insurance_report($type,$business_id)
|
||||
{
|
||||
$query = $this->db->query("SELECT amc.*,service_provider.name as service_provider_name,insurance_company.name as insurance_company_name,
|
||||
asset.id,asset.name as asset_name,asset.tag,asset.serial,asset.model,asset.purchase_date,asset.cost as purchase_cost,status.name as status , categories.name as category,locations.location as location,manufacturer.name as manufacturer, Supplier.name as Supplier
|
||||
asset.id,asset.name as asset_name,asset.tag,asset.serial,asset.model,asset.purchase_date,asset.cost as purchase_cost,status.display_name as status , categories.name as category,locations.location as location,manufacturer.name as manufacturer, Supplier.name as Supplier
|
||||
FROM asset
|
||||
LEFT JOIN amc ON asset.id = amc.asset_id AND amc.created_at = (SELECT MAX(amc.created_at) FROM amc
|
||||
WHERE asset.id = amc.asset_id and amc.is_active=1 and amc.type=".$type.")
|
||||
@ -157,7 +203,7 @@ public function amc_insurance_report($type,$business_id)
|
||||
public function depreciation_report($business_id)
|
||||
{
|
||||
$query = $this->db->query("SELECT asset_value.*,
|
||||
asset.id,asset.name as asset_name,asset.tag,asset.serial,asset.model,asset.purchase_date,asset.cost as purchase_cost,status.name as status , categories.name as category,locations.location as location,manufacturer.name as manufacturer, Supplier.name as Supplier
|
||||
asset.id,asset.name as asset_name,asset.tag,asset.serial,asset.current_cost,asset.model,asset.purchase_date,asset.cost as purchase_cost,status.display_name as status , categories.name as category,locations.location as location,manufacturer.name as manufacturer, Supplier.name as Supplier
|
||||
FROM asset
|
||||
LEFT JOIN asset_value ON asset.id = asset_value.asset_id AND asset_value.created_at = (SELECT MAX(asset_value.created_at) FROM asset_value WHERE asset.id = asset_value.asset_id and asset_value.is_active=1)
|
||||
LEFT JOIN status ON asset.status = status.id
|
||||
|
||||
39
application/modules/Asset/views/Decline_Reason_form.php
Normal file
@ -0,0 +1,39 @@
|
||||
|
||||
<div class="modal-dialog modal-lm">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myModalLabel2"><?php echo $heading; ?></h4>
|
||||
<button type="button" id="close-form" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<form data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Asset/add_or_edit_DeclineForm">
|
||||
<div class="modal-body">
|
||||
<div class="x_content">
|
||||
<br />
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
<input type="hidden" name="id" value="<?php if(isset($Decline_data)) { echo $Decline_data->id; } ?>">
|
||||
<input type="hidden" name="business_id" value="<?php echo user()->business_id; ?>">
|
||||
|
||||
<input type="hidden" name="enum_type" value="decline">
|
||||
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">Reason<a style="color:red;">*</a></label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<input type="text" class="form-control" name="enum_value" value="<?php if(isset($Decline_data)) { echo $Decline_data->enum_value; } ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal" id="close-form">Close</button>
|
||||
<button type="submit" class="btn btn-primary"><?php echo $submit_button_title; ?></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
<td class=" "> <?php echo $value['serial']; ?> </td>
|
||||
<td class=" "> <?php echo $value['model']; ?> </td>
|
||||
<td class=" "> <?php echo $value['service_provider_name']; ?> </td>
|
||||
<td class=" "> <?php echo $value['cost']; ?> </td>
|
||||
<td class=" " style=" text-align: right;"> <?php echo $value['cost']; ?> </td>
|
||||
<td class=" "> <?php echo my_date_show($value['valid_from']); ?> </td>
|
||||
<td class=" "> <?php echo my_date_show($value['valid_to']); ?> </td>
|
||||
<td class=" "> <?php echo $value['status']; ?> </td>
|
||||
|
||||
55
application/modules/Asset/views/asset_landing_page.php
Normal file
@ -0,0 +1,55 @@
|
||||
|
||||
<form id="otp-form">
|
||||
<input type="hidden" id="csrf" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
</form>
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
<h2>Assets Details </h2>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="x_content">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="card-box table-responsive">
|
||||
|
||||
<table id="datatable-buttons" class="table table-striped table-bordered bulk_action" width="100%">
|
||||
<thead style="white-space: nowrap;">
|
||||
<tr class="headings">
|
||||
<!-- <th><input type="checkbox" id="check_all" ></th> -->
|
||||
<th class="column-title">Asset Category </th>
|
||||
<th class="column-title">Total Purchase Cost </th>
|
||||
<th class="column-title">Total Current Cost </th>
|
||||
<!-- <th class="column-title" style="min-width:120px;">Action </th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($tableData as $key => $value) { ?>
|
||||
<tr class="even pointer" onclick="window.location='<?php echo base_url();?>Asset/assetList/<?php echo md5($value->category) ?>';">
|
||||
<!-- <td><input type="checkbox" id="check-all" value="<?php echo $value->id; ?>" ></td> -->
|
||||
<td class=" "> <?php echo $value->category_name; ?> </td>
|
||||
<td class=" " style=" text-align: right;"> <?php echo $value->total; ?> </td>
|
||||
<td class=" " style=" text-align: right;"> <?php echo $value->total_current_cost; ?> </td>
|
||||
<!-- <td style=" text-align: center; font-size: 16px;">
|
||||
<a href="<?php echo base_url()?>Asset/assetList/<?php echo md5($value->category);?>" > <i class="fa fa-eye" title="View"></i></a>
|
||||
|
||||
</td> -->
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
||||
<div class="modal fade bs-example-modal-lg" id="ItemModal" tabindex="-1" role="dialog" aria-hidden="true"></div>
|
||||
|
||||
<div style="display:none" id="sub-value">
|
||||
|
||||
</div>
|
||||
@ -1,18 +1,20 @@
|
||||
|
||||
|
||||
<form id="otp-form">
|
||||
<input type="hidden" id="csrf" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
</form>
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
<h2>Assets Details </h2>
|
||||
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<a href="<?php echo base_url();?>asset/addAsset" class="btn btn-sm btn-primary">Add Asset</a>
|
||||
<a href="<?php echo base_url();?>Asset/addAsset" class="btn btn-sm btn-primary">Add Asset</a>
|
||||
<?php } ?>
|
||||
<button class="btn btn-sm btn-secondary" onclick="deleteRow();">Remove</button>
|
||||
<button class="btn btn-sm btn-info" onclick="viewQr();">View QR</button>
|
||||
<button class="btn btn-sm btn-secondary" onclick="deleteRow();" hidden>Remove</button>
|
||||
<button class="btn btn-sm btn-info" onclick="viewQr();" hidden>View QR</button>
|
||||
<!-- <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
|
||||
</li> -->
|
||||
</ul>
|
||||
@ -21,18 +23,42 @@
|
||||
<div class="x_content">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="card-box table-responsive">
|
||||
<div class="card-box table-responsive">
|
||||
<form class="" method="post" action="<?php echo base_url()?>Asset/filterAssets">
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>" >
|
||||
<input type="hidden" name="category" value="<?php echo $tableData[0]->category; ?>" >
|
||||
<fieldset>
|
||||
<div class="col-md-5 col-sm-5 " for="first-name"> </div>
|
||||
<div class="col-md-3 col-sm-3 " for="first-name"><h2> Filter with purchase date : </h2> </div>
|
||||
<div class="col-md-3 col-sm-3 ">
|
||||
<div class="control-group ">
|
||||
<div class="controls">
|
||||
<div class="input-prepend input-group">
|
||||
|
||||
<input type="text" style="width: 200px" name="reservation" id="reservation" class="form-control" value="" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1 col-sm-1 ">
|
||||
<button class="btn btn-sm btn-info" type="submit" style="height:37px;">Submit</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
<table id="datatable-buttons" class="table table-striped table-bordered bulk_action" width="100%">
|
||||
<thead style="white-space: nowrap;">
|
||||
<tr class="headings">
|
||||
<th><input type="checkbox" id="check_all" ></th>
|
||||
<th class="column-title">Asset Name </th>
|
||||
<th class="column-title">Manufacturer </th>
|
||||
<th class="column-title">Purchase Date </th>
|
||||
<th class="column-title">Purchase Cost </th>
|
||||
<th class="column-title">Current Value </th>
|
||||
<!-- <th class="column-title">Manufacturer </th>
|
||||
<th class="column-title">Tag </th>
|
||||
<th class="column-title">Serial </th>
|
||||
<th class="column-title">Model </th>
|
||||
<th class="column-title">Category </th>
|
||||
<th class="column-title">Status </th>
|
||||
<th class="column-title">Status </th> -->
|
||||
<!-- <th class="column-title">Notes </th>
|
||||
<th class="column-title">Warranty </th>
|
||||
<th class="column-title">Order No </th>
|
||||
@ -48,12 +74,16 @@
|
||||
<tr class="even pointer">
|
||||
<td><input type="checkbox" id="check-all" value="<?php echo $value->id; ?>" ></td>
|
||||
<td class=" "> <?php echo $value->name; ?> </td>
|
||||
<td class=" "><?php echo $value->manufacturer_name; ?> </td>
|
||||
<td class=" "> <?php echo my_date_show($value->purchase_date); ?> </td>
|
||||
<td class=" " style=" text-align: right;"> <?php echo $value->cost; ?> </td>
|
||||
<td class=" " style=" text-align: right;"> <?php echo $value->current_cost; ?></td>
|
||||
<!-- <td class=" "> <?php echo $value->name; ?> </td> -->
|
||||
<!-- <td class=" "><?php echo $value->manufacturer_name; ?> </td>
|
||||
<td class=" "><?php echo $value->tag; ?></td>
|
||||
<td class=" "><?php echo $value->serial; ?></td>
|
||||
<td class=" "><?php echo $value->model; ?></td>
|
||||
<td class=" "><?php echo $value->category_name; ?></td>
|
||||
<td class=" "><?php echo $value->status_display_name; ?></td>
|
||||
<td class=" "><?php echo $value->status_display_name; ?></td> -->
|
||||
<!--<td class=" "><?php echo $value->notes; ?> </td>
|
||||
<td class=" "><?php echo $value->warranty; ?> </td>
|
||||
<td class=" "><?php echo $value->order_no; ?></td>
|
||||
@ -63,17 +93,20 @@
|
||||
<td class=" "><?php echo $value->location_name; ?></td> -->
|
||||
<td style=" text-align: center; font-size: 16px;">
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<a href="<?php echo base_url()?>Asset/editAsset/<?php echo md5($value->id);?>" ><i class="fa fa-pencil"></i></a>
|
||||
|
||||
|
||||
<a href="<?php echo base_url()?>Asset/editAsset/<?php echo md5($value->id);?>" ><i class="fa fa-pencil" title="Edit"></i></a>
|
||||
|
||||
<a href="<?php echo base_url()?>Asset/addAsset/<?php echo md5($value->id);?>" ><i class="fa fa-copy"></i></a>
|
||||
<a href="<?php echo base_url()?>Asset/addAsset/<?php echo md5($value->id);?>" ><i class="fa fa-copy" title="Copy"></i></a>
|
||||
|
||||
<a href="<?php echo base_url()?>Asset/deleteAsset/<?php echo md5($value->id);?>" ><i class="fa fa-trash"></i></a>
|
||||
<a><i class="fa fa-trash deleteAsset" data-toggle="modal" data-target=".bs-example-modal-sm" id="<?php echo md5($value->id);?>" ></i></a>
|
||||
<!-- <a href="<?php echo base_url()?>Asset/deleteAsset/<?php echo md5($value->id);?>" ><i class="fa fa-trash" title="Delete"></i></a> -->
|
||||
|
||||
<?php } ?>
|
||||
<a href="<?php echo base_url()?>Asset/view_asset_details/<?php echo md5($value->id);?>" > <i class="fa fa-eye"></i></a>
|
||||
<a href="<?php echo base_url()?>Asset/view_asset_details/<?php echo md5($value->id);?>" > <i class="fa fa-eye" title="View"></i></a>
|
||||
|
||||
<!-- <a href="<?php echo base_url()?>Asset/view_qr_code/<?php echo md5($value->id);?>" > <i class="fa fa-qrcode"></i></a> -->
|
||||
<a href="#" class="qr_view" id="<?php echo $value->id; ?>"> <i class="fa fa-qrcode"></i></a>
|
||||
<a href="#" class="qr_view" id="<?php echo $value->id; ?>"> <i class="fa fa-qrcode" title="QR code"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
@ -94,19 +127,51 @@
|
||||
<div style="display:none" id="sub-value">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" id="popup"> </div>
|
||||
<script>
|
||||
|
||||
$("input[type='checkbox']").change(function(){
|
||||
if($('input[type="checkbox"]:not(:checked)').length == $('input[type="checkbox"]').length){
|
||||
console.log('all checked');
|
||||
$('.btn-secondary').attr("hidden",true);
|
||||
$('.btn-info').attr("hidden",true);
|
||||
}
|
||||
});
|
||||
|
||||
$('input:checkbox').click(function() {
|
||||
$('.btn-secondary').removeAttr('hidden');
|
||||
$('.btn-info').removeAttr('hidden');
|
||||
});
|
||||
|
||||
|
||||
$('.deleteAsset').click(function() {
|
||||
var id = $(this).attr('id');
|
||||
var url = "<?php echo base_url()?>Asset/deleteAsset";
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo base_url()?>Asset/getDeleteConfirmationPopup",
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
$('#popup').html(JSON.parse(data));
|
||||
$('.delete_id').attr('value',id);
|
||||
$('.delete_url').attr('action',url);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function deleteRow() {
|
||||
var csrf_data = $("#otp-form").serialize();
|
||||
delete_id = [];
|
||||
document.querySelectorAll('#datatable-buttons #check-all:checked').forEach(e => {
|
||||
delete_id.push(e.value)
|
||||
e.parentNode.parentNode.remove();
|
||||
console.log("tes----"+e.parentNode.parentNode);
|
||||
});
|
||||
console.log(delete_id);
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "<?php echo base_url()?>asset/deleteMultipleAsset",
|
||||
url: "<?php echo base_url()?>Asset/deleteMultipleAsset",
|
||||
data: {data:delete_id,'<?php echo $this->security->get_csrf_token_name(); ?>': $('#csrf').val()},
|
||||
json: true,
|
||||
success: function(response) {
|
||||
@ -128,7 +193,7 @@ function viewQr() {
|
||||
console.log(view_qr_id);
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "<?php echo base_url()?>asset/view_qrcode",
|
||||
url: "<?php echo base_url()?>Asset/view_qrcode",
|
||||
data: {data:view_qr_id,'<?php echo $this->security->get_csrf_token_name(); ?>': $('#csrf').val()},
|
||||
json: true,
|
||||
success: function(response) {
|
||||
@ -150,7 +215,7 @@ function viewQr() {
|
||||
view_qr_id.push(id)
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "<?php echo base_url()?>asset/view_qrcode",
|
||||
url: "<?php echo base_url()?>Asset/view_qrcode",
|
||||
data: {data:view_qr_id,'<?php echo $this->security->get_csrf_token_name(); ?>': $('#csrf').val()},
|
||||
json: true,
|
||||
success: function(response) {
|
||||
|
||||
@ -8,12 +8,12 @@
|
||||
<div class="x_content">
|
||||
|
||||
<ul class="nav nav-tabs bar_tabs" id="myTab" role="tablist">
|
||||
<li class="nav-item">
|
||||
<!-- <li class="nav-item">
|
||||
<a class="nav-link" id="asset_value-tab" data-toggle="tab" href="#asset_value" role="tab" aria-controls="asset_value" aria-selected="true">Asset Values</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="asset_usage-tab" data-toggle="tab" href="#asset_usage" role="tab" aria-controls="asset_usage" aria-selected="false">Asset usage</a>
|
||||
</li>
|
||||
</li> -->
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="asset_amc-tab" data-toggle="tab" href="#asset_amc" role="tab" aria-controls="asset_amc" aria-selected="false">Support</a>
|
||||
</li>
|
||||
@ -21,7 +21,7 @@
|
||||
<a class="nav-link" id="asset_insurance-tab" data-toggle="tab" href="#asset_insurance" role="tab" aria-controls="asset_insurance" aria-selected="false">Insurance</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="asset_image-tab" data-toggle="tab" href="#asset_image" role="tab" aria-controls="asset_image" aria-selected="false">Asset Images</a>
|
||||
<a class="nav-link" id="asset_image-tab" data-toggle="tab" href="#asset_image" role="tab" aria-controls="asset_image" aria-selected="false">Asset Files</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="audit_history-tab" data-toggle="tab" href="#audit_history" role="tab" aria-controls="audit_history" aria-selected="false">Audit History</a>
|
||||
@ -35,7 +35,7 @@
|
||||
|
||||
|
||||
|
||||
<div class="tab-pane fade" id="asset_value" role="tabpanel" aria-labelledby="asset_value-tab">
|
||||
<!-- <div class="tab-pane fade" id="asset_value" role="tabpanel" aria-labelledby="asset_value-tab">
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<a type="button" class="asset_value" id="<?php echo $asset_id."_add"; ?>" data-toggle="modal" data-target=".bs-example-modal-sm" style=" text-align: center; font-size: 25px; color:#2A3F54; ">
|
||||
@ -82,7 +82,7 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
-->
|
||||
|
||||
|
||||
|
||||
@ -118,9 +118,9 @@
|
||||
<td>
|
||||
|
||||
<a class="asset_usage" id="<?php echo md5($value->id); ?>" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;">
|
||||
<i class="fa fa-pencil"></i></a>
|
||||
<i class="fa fa-pencil" title="Edit"></i></a>
|
||||
|
||||
<a href="<?php echo base_url()?>Asset/deleteAssetUsage/<?php echo md5($value->id)."_".$value->asset_id;?>" style="font-size: 16px;" ><i class="fa fa-trash"></i></a>
|
||||
<a href="<?php echo base_url()?>Asset/deleteAssetUsage/<?php echo md5($value->id)."_".$value->asset_id;?>" style="font-size: 16px;" ><i class="fa fa-trash" title="Delete"></i></a>
|
||||
</td> <?php } ?>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
@ -136,7 +136,7 @@
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<a type="button" class="asset_amc" id="<?php echo $asset_id."_add"; ?>" data-toggle="modal" data-target=".bs-example-modal-sm" style=" text-align: center; font-size: 25px; color:#2A3F54; ">
|
||||
<li class="fa fa-plus-circle"></li></a>
|
||||
<li class="fa fa-plus-circle" title="Add New"></li></a>
|
||||
<?php } ?>
|
||||
</ul> </br>
|
||||
<div class="card-box table-responsive">
|
||||
@ -144,31 +144,33 @@
|
||||
<thead>
|
||||
<tr class="headings">
|
||||
<th class="column-title" width="15%">Service Provider </th>
|
||||
<th class="column-title" width="13%">Cost </th>
|
||||
<th class="column-title" width="13.5%">Valid From </th>
|
||||
<th class="column-title" width="13%" >Cost </th>
|
||||
<th class="column-title" width="13.5%">Valid From </th>
|
||||
<th class="column-title" width="13.5%">Valid To </th>
|
||||
<th class="column-title" width="13.5%">Expire on </th>
|
||||
<th class="column-title" width="15%">Description </th>
|
||||
<th class="column-title" width="13.5%">Expire on </th>
|
||||
<th class="column-title" width="15%">Description </th>
|
||||
<th class="column-title" width="10%">Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php foreach ($asset_amc as $key => $value) { ?>
|
||||
<tr class="even pointer">
|
||||
<td class=" "><?php echo $value->service_provider_name; ?></td>
|
||||
<td class=" "><?php echo $value->cost; ?></td>
|
||||
<td class=" "><?php echo my_date_show($value->valid_from); ?></td>
|
||||
<td class=" "><?php echo my_date_show($value->valid_to); ?></td>
|
||||
<td class=" "><?php echo day_different($value->valid_to)." days left"; ?></td>
|
||||
<td class=" "><?php echo $value->description; ?></td>
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<td>
|
||||
<tr class="even pointer">
|
||||
<td class=" "><?php echo $value->service_provider_name; ?></td>
|
||||
<td class=" " style=" text-align: right;"><?php echo $value->cost; ?></td>
|
||||
<td class=" "><?php echo my_date_show($value->valid_from); ?></td>
|
||||
<td class=" "><?php echo my_date_show($value->valid_to); ?></td>
|
||||
<td class=" "><?php echo day_different($value->valid_to)." days left"; ?></td>
|
||||
<td class=" "><?php echo $value->description; ?></td>
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<td>
|
||||
|
||||
<a class="asset_amc" id="<?php echo md5($value->id); ?>" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;">
|
||||
<i class="fa fa-pencil"></i></a>
|
||||
|
||||
<a href="<?php echo base_url()?>Asset/deleteAssetAMC/<?php echo md5($value->id)."_".$value->asset_id;?>" style="font-size: 16px;"><i class="fa fa-trash"></i></a>
|
||||
<i class="fa fa-pencil" title="Edit"></i></a>
|
||||
|
||||
<a class="deleteAssetAMC" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;" id="<?php echo md5($value->id)."_".$value->asset_id;?>">
|
||||
<i class="fa fa-trash " ></i></a>
|
||||
<!-- <a href="<?php echo base_url()?>Asset/deleteAssetAMC/<?php echo md5($value->id)."_".$value->asset_id;?>" style="font-size: 16px;"><i class="fa fa-trash" title="Edit"></i></a> -->
|
||||
</td>
|
||||
<?php }?>
|
||||
</tr>
|
||||
@ -185,7 +187,7 @@
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<a type="button" class="asset_insurance" id="<?php echo $asset_id."_add"; ?>" data-toggle="modal" data-target=".bs-example-modal-sm" style=" text-align: center; font-size: 25px; color:#2A3F54; ">
|
||||
<li class="fa fa-plus-circle"></li></a>
|
||||
<li class="fa fa-plus-circle" title="Add New"></li></a>
|
||||
<?php } ?>
|
||||
</ul> </br>
|
||||
<div class="card-box table-responsive">
|
||||
@ -193,11 +195,11 @@
|
||||
<thead>
|
||||
<tr class="headings">
|
||||
<th class="column-title" width="15%">Insurance Company </th>
|
||||
<th class="column-title" width="13%">Cost </th>
|
||||
<th class="column-title" width="13.5%">Valid From </th>
|
||||
<th class="column-title" width="13%">Cost </th>
|
||||
<th class="column-title" width="13.5%">Valid From </th>
|
||||
<th class="column-title" width="13.5%">Valid To </th>
|
||||
<th class="column-title" width="13.5%">Expire on </th>
|
||||
<th class="column-title" width="15%">Description </th>
|
||||
<th class="column-title" width="13.5%">Expire on </th>
|
||||
<th class="column-title" width="15%">Description </th>
|
||||
<th class="column-title" width="10%">Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -206,7 +208,7 @@
|
||||
<?php foreach ($asset_insurance as $key => $value) { ?>
|
||||
<tr class="even pointer">
|
||||
<td class=" "><?php echo $value->insurance_company_name; ?></td>
|
||||
<td class=" "><?php echo $value->cost; ?></td>
|
||||
<td class=" " style=" text-align: right;"><?php echo $value->cost; ?></td>
|
||||
<td class=" "><?php echo my_date_show($value->valid_from); ?></td>
|
||||
<td class=" "><?php echo my_date_show($value->valid_to); ?></td>
|
||||
<td class=" "><?php echo day_different($value->valid_to)." days left"; ?></td>
|
||||
@ -215,9 +217,11 @@
|
||||
<td>
|
||||
|
||||
<a class="asset_insurance" id="<?php echo md5($value->id); ?>" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;">
|
||||
<i class="fa fa-pencil"></i></a>
|
||||
<i class="fa fa-pencil" title="Edit"></i></a>
|
||||
|
||||
<a href="<?php echo base_url()?>Asset/deleteAssetInsurance/<?php echo md5($value->id)."_".$value->asset_id;?>" style="font-size: 16px;"><i class="fa fa-trash"></i></a>
|
||||
<a class="deleteAssetInsurance" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;" id="<?php echo md5($value->id)."_".$value->asset_id;?>">
|
||||
<i class="fa fa-trash " ></i></a>
|
||||
<!-- <a href="<?php echo base_url()?>Asset/deleteAssetInsurance/<?php echo md5($value->id)."_".$value->asset_id;?>" style="font-size: 16px;"><i class="fa fa-trash" title="Delete"></i></a> -->
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
@ -233,7 +237,7 @@
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<a type="button" class="asset_image" id="<?php echo $asset_id; ?>" data-toggle="modal" data-target=".bs-example-modal-sm" style=" text-align: center; font-size: 25px; color:#2A3F54; ">
|
||||
<li class="fa fa-plus-circle"></li></a>
|
||||
<li class="fa fa-plus-circle" title="Add New"></li></a>
|
||||
<?php } ?>
|
||||
</ul> </br> </br>
|
||||
<div class="row">
|
||||
@ -241,26 +245,37 @@
|
||||
<div class="x_panel">
|
||||
<div class="x_content">
|
||||
<div class="row">
|
||||
<?php foreach ($asset_images as $key => $value) { ?>
|
||||
<?php foreach ($asset_images as $key => $value) { $EXTENSION = pathinfo($value->image, PATHINFO_EXTENSION); ?>
|
||||
|
||||
|
||||
<div class="col-md-55">
|
||||
<div class="thumbnail">
|
||||
<div class="image view view-first">
|
||||
<img style="width: 100%; display: block;" src="<?php echo base_url(); ?>assets/uploads/<?php echo $value->image; ?>" alt="image" />
|
||||
<div class="mask">
|
||||
<p> </p>
|
||||
<div class="tools tools-bottom">
|
||||
<a class="delete_asset_image" href="<?php echo base_url()?>Asset/deleteAssetImage/<?php echo md5($value->id)."_".$value->asset_id;?>" style="font-size: 16px;" >
|
||||
<i class="fa fa-trash"></i>
|
||||
<div class="col-md-55">
|
||||
<div class="thumbnail">
|
||||
<div class="image view view-first">
|
||||
<?php if($EXTENSION == 'pdf') { ?>
|
||||
<embed style="width: 100%; display: block;" src="<?php echo base_url(); ?>assets/uploads/<?php echo $value->image; ?>" alt="image" />
|
||||
<?php } else { ?>
|
||||
<img style="width: 100%; display: block;" src="<?php echo base_url(); ?>assets/uploads/<?php echo $value->image; ?>" alt="image" />
|
||||
<?php } ?>
|
||||
<div class="mask">
|
||||
<p> </p>
|
||||
<div class="tools tools-bottom">
|
||||
<a class="deleteAssetImage" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;" id="<?php echo md5($value->id)."_".$value->asset_id;?>">
|
||||
<i class="fa fa-trash " ></i></a>
|
||||
<!-- <a class="delete_asset_image" href="<?php echo base_url()?>Asset/deleteAssetImage/<?php echo md5($value->id)."_".$value->asset_id;?>" style="font-size: 16px;" >
|
||||
<i class="fa fa-trash" title="Delete"></i> -->
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if($EXTENSION == 'pdf') { ?>
|
||||
<a href="<?php echo base_url()?>/assets/uploads/<?php echo $value->image; ?>" download>
|
||||
<i class="fa fa-download" title="Download"></i>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@ -307,38 +322,84 @@
|
||||
<input type="hidden" class="form-control" id="change_active" value="<?php echo $this->session->flashdata('msg'); ?>" />
|
||||
|
||||
|
||||
|
||||
<div class="modal bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" id="popup"> </div>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
// $(document).ready(function(){
|
||||
$(document).ready(function(){
|
||||
|
||||
// if ($('#change_active').val() == "asset_value") {
|
||||
// $('#asset_value-tab').removeClass('nav-link').addClass('nav-link active');
|
||||
// $('#asset_value').removeClass('tab-pane fade').addClass('tab-pane fade show active');
|
||||
// }
|
||||
// else if ($('#change_active').val() == "asset_usage") {
|
||||
// $('#asset_usage-tab').removeClass('nav-link').addClass('nav-link active');
|
||||
// $('#asset_usage').removeClass('tab-pane fade').addClass('tab-pane fade show active');
|
||||
// }
|
||||
// else if ($('#change_active').val() == "asset_amc") {
|
||||
// $('#asset_amc-tab').removeClass('nav-link').addClass('nav-link active');
|
||||
// $('#asset_amc').removeClass('tab-pane fade').addClass('tab-pane fade show active');
|
||||
// }
|
||||
// else if ($('#change_active').val() == "asset_insurance") {
|
||||
// $('#asset_insurance-tab').removeClass('nav-link').addClass('nav-link active');
|
||||
// $('#asset_insurance').removeClass('tab-pane fade').addClass('tab-pane fade show active');
|
||||
// }
|
||||
// else if ($('#change_active').val() == "asset_image") {
|
||||
// $('#asset_image-tab').removeClass('nav-link').addClass('nav-link active');
|
||||
// $('#asset_image').removeClass('tab-pane fade').addClass('tab-pane fade show active');
|
||||
// }
|
||||
// else{
|
||||
// $('#asset_value-tab').removeClass('nav-link').addClass('nav-link active');
|
||||
// $('#asset_value').removeClass('tab-pane fade').addClass('tab-pane fade show active');
|
||||
// }
|
||||
// });
|
||||
// if ($('#change_active').val() == "asset_value") {
|
||||
// $('#asset_value-tab').removeClass('nav-link').addClass('nav-link active');
|
||||
// $('#asset_value').removeClass('tab-pane fade').addClass('tab-pane fade show active');
|
||||
// }
|
||||
// else if ($('#change_active').val() == "asset_usage") {
|
||||
// $('#asset_usage-tab').removeClass('nav-link').addClass('nav-link active');
|
||||
// $('#asset_usage').removeClass('tab-pane fade').addClass('tab-pane fade show active');
|
||||
// }
|
||||
if ($('#change_active').val() == "asset_amc") {
|
||||
$('#asset_amc-tab').removeClass('nav-link').addClass('nav-link active');
|
||||
$('#asset_amc').removeClass('tab-pane fade').addClass('tab-pane fade show active');
|
||||
}
|
||||
else if ($('#change_active').val() == "asset_insurance") {
|
||||
$('#asset_insurance-tab').removeClass('nav-link').addClass('nav-link active');
|
||||
$('#asset_insurance').removeClass('tab-pane fade').addClass('tab-pane fade show active');
|
||||
}
|
||||
else if ($('#change_active').val() == "asset_image") {
|
||||
$('#asset_image-tab').removeClass('nav-link').addClass('nav-link active');
|
||||
$('#asset_image').removeClass('tab-pane fade').addClass('tab-pane fade show active');
|
||||
}
|
||||
else{
|
||||
$('#asset_value-tab').removeClass('nav-link').addClass('nav-link active');
|
||||
$('#asset_amc').removeClass('tab-pane fade').addClass('tab-pane fade show active');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('.deleteAssetAMC').click(function() {
|
||||
var id = $(this).attr('id');
|
||||
var url = "<?php echo base_url()?>Asset/deleteAssetAMC";
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo base_url()?>Asset/getDeleteConfirmationPopup",
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
$('#edit-form').html(JSON.parse(data));
|
||||
$('.delete_id').attr('value',id);
|
||||
$('.delete_url').attr('action',url);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.deleteAssetInsurance').click(function() {
|
||||
var id = $(this).attr('id');
|
||||
var url = "<?php echo base_url()?>Asset/deleteAssetInsurance";
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo base_url()?>Asset/getDeleteConfirmationPopup",
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
$('#edit-form').html(JSON.parse(data));
|
||||
$('.delete_id').attr('value',id);
|
||||
$('.delete_url').attr('action',url);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.deleteAssetImage').click(function() {
|
||||
var id = $(this).attr('id');
|
||||
var url = "<?php echo base_url()?>Asset/deleteAssetImage";
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo base_url()?>Asset/getDeleteConfirmationPopup",
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
$('#edit-form').html(JSON.parse(data));
|
||||
$('.delete_id').attr('value',id);
|
||||
$('.delete_url').attr('action',url);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
<div class="x_content">
|
||||
<br />
|
||||
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>"
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>" >
|
||||
<input type="hidden" name="id" value="<?php if(isset($assetUsageData)) { echo $assetUsageData->id; } ?>">
|
||||
<input type="hidden" name="asset_id" value="<?php if(isset($assetUsageData)) { echo $assetUsageData->asset_id; } ?>">
|
||||
<input type="hidden" name="business_id" value="<?php if(isset($assetUsageData)) { echo $assetUsageData->business_id; } ?>">
|
||||
|
||||
@ -17,9 +17,16 @@
|
||||
<input type="hidden" name="business_id" value="<?php echo user()->business_id; ?>">
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">Catogary</label>
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">Catogary<a style="color:red;">*</a></label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<input type="text" class="form-control" name="name" value="<?php if(isset($catogary_data)) { echo $catogary_data->name; } ?>">
|
||||
<input type="text" class="form-control" name="name" value="<?php if(isset($catogary_data)) { echo $catogary_data->name; } ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">Depreciation %<a style="color:red;">*</a></label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<input type="number" class="form-control" min="1" max="100" name="depreciation_percentage" value="<?php if(isset($catogary_data)) { echo $catogary_data->depreciation_percentage; } ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
26
application/modules/Asset/views/confirmation_popup.php
Normal file
@ -0,0 +1,26 @@
|
||||
|
||||
|
||||
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<h6 class="modal-title" id="myModalLabel2">Are you sure you want to delete</h6>
|
||||
<button type="button" id="close-form" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
</br>
|
||||
<center>
|
||||
<form class="delete_url" method="post" action="" id="">
|
||||
<button type="button" class="btn btn-sm btn-secondary" id="close-form" data-dismiss="modal" aria-label="Close">No</button>
|
||||
|
||||
<input type="hidden" class="delete_id" name="id" value="">
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>" >
|
||||
<button type="submit" class="btn btn-sm btn-primary" id="">Yes</button>
|
||||
</form>
|
||||
</center>
|
||||
</br>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
36
application/modules/Asset/views/department_master_form.php
Normal file
@ -0,0 +1,36 @@
|
||||
|
||||
<div class="modal-dialog modal-lm">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myModalLabel2"><?php echo $heading; ?></h4>
|
||||
<button type="button" id="close-form" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<form data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Asset/add_or_edit_DepartmentForm" >
|
||||
<div class="modal-body">
|
||||
<div class="x_content">
|
||||
<br />
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
<input type="hidden" name="id" value="<?php if(isset($department_data)) { echo $department_data->id; } ?>">
|
||||
<input type="hidden" name="business_id" value="<?php echo user()->business_id; ?>">
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">Name<a style="color:red;">*</a></label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<input type="text" class="form-control" name="name" value="<?php if(isset($department_data)) { echo $department_data->name; } ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal" id="close-form">Close</button>
|
||||
<button type="submit" class="btn btn-primary"><?php echo $submit_button_title; ?></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -39,9 +39,9 @@
|
||||
<td class=" "> <?php echo $value['tag']; ?> </td>
|
||||
<td class=" "> <?php echo $value['serial']; ?> </td>
|
||||
<td class=" "> <?php echo $value['model']; ?> </td>
|
||||
<td class=" "> <?php echo $value['purchase_date']; ?> </td>
|
||||
<td class=" "> <?php echo $value['purchase_cost']; ?> </td>
|
||||
<td class=" "> <?php echo $value['current_value']; ?> </td>
|
||||
<td class=" "> <?php echo my_date_show($value['purchase_date']); ?> </td>
|
||||
<td class=" " style=" text-align: right;"> <?php echo $value['purchase_cost']; ?> </td>
|
||||
<td class=" " style=" text-align: right;"> <?php echo $value['current_cost']; ?> </td>
|
||||
<td class=" "> <?php echo $value['status']; ?> </td>
|
||||
|
||||
</tr>
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<div class="page-title">
|
||||
<div class="title_left"><h3><?php if(isset($viewData)) { echo "View Asset"; }else{ echo "Edit Asset"; } ?></h3></div>
|
||||
</div>
|
||||
<a class="btn btn-sm btn-primary" style="float: right;" href="<?php echo base_url();?>asset/assetList">Assets List</a>
|
||||
<a class="btn btn-sm btn-primary" style="float: right;" href="<?php echo base_url();?>Asset/assetLandingPage">Assets List</a>
|
||||
<div class="clearfix"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
<td class=" "> <?php echo $value['serial']; ?> </td>
|
||||
<td class=" "> <?php echo $value['model']; ?> </td>
|
||||
<td class=" "> <?php echo $value['insurance_company_name']; ?> </td>
|
||||
<td class=" "> <?php echo $value['cost']; ?> </td>
|
||||
<td class=" " style=" text-align: right;"> <?php echo $value['cost']; ?> </td>
|
||||
<td class=" "> <?php echo my_date_show($value['valid_from']); ?> </td>
|
||||
<td class=" "> <?php echo my_date_show($value['valid_to']); ?> </td>
|
||||
<td class=" "> <?php echo $value['status']; ?> </td>
|
||||
|
||||
43
application/modules/Asset/views/leave_master_form.php
Normal file
@ -0,0 +1,43 @@
|
||||
|
||||
<div class="modal-dialog modal-lm">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myModalLabel2"><?php echo $heading; ?></h4>
|
||||
<button type="button" id="close-form" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<form data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Asset/add_or_edit_LeaveForm">
|
||||
<div class="modal-body">
|
||||
<div class="x_content">
|
||||
<br />
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
<input type="hidden" name="id" value="<?php if(isset($leave_data)) { echo $leave_data->id; } ?>">
|
||||
<input type="hidden" name="business_id" value="<?php echo user()->business_id; ?>">
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">Leave Type<a style="color:red;">*</a></label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<input type="text" class="form-control" name="type" value="<?php if(isset($leave_data)) { echo $leave_data->type; } ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">Days<a style="color:red;">*</a></label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<input type="text" class="form-control" name="days" value="<?php if(isset($leave_data)) { echo $leave_data->days; } ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal" id="close-form">Close</button>
|
||||
<button type="submit" class="btn btn-primary"><?php echo $submit_button_title; ?></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
<h2>Details</h2>
|
||||
<h2>Asset Master</h2>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="x_content">
|
||||
@ -37,7 +37,7 @@
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<a type="button" class="manufacture" id="" style=" text-align: center; font-size: 25px; color:#2A3F54; ">
|
||||
<li class="fa fa-plus-circle"></li></a>
|
||||
<li class="fa fa-plus-circle" title="Add New"></li></a>
|
||||
<?php } ?>
|
||||
</ul> </br>
|
||||
<div class="card-box table-responsive">
|
||||
@ -47,11 +47,11 @@
|
||||
<th class="column-title" width="15%">Name </th>
|
||||
<th class="column-title" width="15%">Phone </th>
|
||||
<th class="column-title" width="15%">Email </th>
|
||||
<th class="column-title" width="10%">GST </th>
|
||||
<th class="column-title" width="15%">Address </th>
|
||||
<th class="column-title" width="15%">City </th>
|
||||
<th class="column-title" width="15%">State </th>
|
||||
<th class="column-title" width="10%">Pincode </th>
|
||||
<th class="column-title" width="10%">Gst </th>
|
||||
<th class="column-title" width="10%">Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -61,17 +61,19 @@
|
||||
<td class=" "><?php echo $value->name; ?></td>
|
||||
<td class=" "><?php echo $value->phone; ?></td>
|
||||
<td class=" "><?php echo $value->email; ?></td>
|
||||
<td class=" "><?php echo $value->gst; ?></td>
|
||||
<td class=" "><?php echo $value->address; ?></td>
|
||||
<td class=" "><?php echo $value->city; ?></td>
|
||||
<td class=" "><?php echo $value->state; ?></td>
|
||||
<td class=" "><?php echo $value->pincode; ?></td>
|
||||
<td class=" "><?php echo $value->gst; ?></td>
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<td>
|
||||
<a class="manufacture" id="<?php echo md5($value->id); ?>" style="font-size: 16px;" >
|
||||
<i class="fa fa-pencil"></i></a>
|
||||
<i class="fa fa-pencil" title="Edit"></i></a>
|
||||
|
||||
<a href="<?php echo base_url()?>Asset/deleteThirdPartyData/<?php echo md5($value->id); ?>" style="font-size: 16px;"><i class="fa fa-trash"></i></a>
|
||||
<a class="deleteManufacturerData" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;" id="<?php echo md5($value->id); ?>">
|
||||
<i class="fa fa-trash " ></i></a>
|
||||
<!-- <a href="<?php echo base_url()?>Asset/deleteThirdPartyData/<?php echo md5($value->id); ?>" style="font-size: 16px;"><i class="fa fa-trash" title="Delete"></i></a> -->
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
@ -88,7 +90,7 @@
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<a type="button" class="supplier" id="" style=" text-align: center; font-size: 25px; color:#2A3F54; ">
|
||||
<li class="fa fa-plus-circle"></li></a>
|
||||
<li class="fa fa-plus-circle" title="Add New"></li></a>
|
||||
<?php } ?>
|
||||
</ul> </br>
|
||||
<div class="card-box table-responsive">
|
||||
@ -98,11 +100,11 @@
|
||||
<th class="column-title" width="15%">Name </th>
|
||||
<th class="column-title" width="15%">Phone </th>
|
||||
<th class="column-title" width="15%">Email </th>
|
||||
<th class="column-title" width="10%">GST </th>
|
||||
<th class="column-title" width="15%">Address </th>
|
||||
<th class="column-title" width="15%">City </th>
|
||||
<th class="column-title" width="15%">State </th>
|
||||
<th class="column-title" width="10%">Pincode </th>
|
||||
<th class="column-title" width="10%">Gst </th>
|
||||
<th class="column-title" width="10%">Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -112,17 +114,19 @@
|
||||
<td class=" "><?php echo $value->name; ?></td>
|
||||
<td class=" "><?php echo $value->phone; ?></td>
|
||||
<td class=" "><?php echo $value->email; ?></td>
|
||||
<td class=" "><?php echo $value->gst; ?></td>
|
||||
<td class=" "><?php echo $value->address; ?></td>
|
||||
<td class=" "><?php echo $value->city; ?></td>
|
||||
<td class=" "><?php echo $value->state; ?></td>
|
||||
<td class=" "><?php echo $value->pincode; ?></td>
|
||||
<td class=" "><?php echo $value->gst; ?></td>
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<td>
|
||||
<a class="supplier" id="<?php echo md5($value->id); ?>" style="font-size: 16px;" >
|
||||
<i class="fa fa-pencil"></i></a>
|
||||
<i class="fa fa-pencil" title="Edit"></i></a>
|
||||
|
||||
<a href="<?php echo base_url()?>Asset/deleteThirdPartyData/<?php echo md5($value->id); ?>" style="font-size: 16px;"><i class="fa fa-trash"></i></a>
|
||||
<a class="deleteSupplierData" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;" id="<?php echo md5($value->id); ?>">
|
||||
<i class="fa fa-trash " ></i></a>
|
||||
<!-- <a href="<?php echo base_url()?>Asset/deleteThirdPartyData/<?php echo md5($value->id); ?>" style="font-size: 16px;"><i class="fa fa-trash" title="Delete"></i></a> -->
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
@ -138,7 +142,7 @@
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<a type="button" class="service_privoder" id="" style=" text-align: center; font-size: 25px; color:#2A3F54; ">
|
||||
<li class="fa fa-plus-circle"></li></a>
|
||||
<li class="fa fa-plus-circle" title="Add New"></li></a>
|
||||
<?php } ?>
|
||||
</ul> </br>
|
||||
<div class="card-box table-responsive">
|
||||
@ -148,11 +152,11 @@
|
||||
<th class="column-title" width="15%">Name </th>
|
||||
<th class="column-title" width="15%">Phone </th>
|
||||
<th class="column-title" width="15%">Email </th>
|
||||
<th class="column-title" width="10%">GST </th>
|
||||
<th class="column-title" width="15%">Address </th>
|
||||
<th class="column-title" width="15%">City </th>
|
||||
<th class="column-title" width="15%">State </th>
|
||||
<th class="column-title" width="10%">Pincode </th>
|
||||
<th class="column-title" width="10%">Gst </th>
|
||||
<th class="column-title" width="10%">Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -162,17 +166,19 @@
|
||||
<td class=" "><?php echo $value->name; ?></td>
|
||||
<td class=" "><?php echo $value->phone; ?></td>
|
||||
<td class=" "><?php echo $value->email; ?></td>
|
||||
<td class=" "><?php echo $value->gst; ?></td>
|
||||
<td class=" "><?php echo $value->address; ?></td>
|
||||
<td class=" "><?php echo $value->city; ?></td>
|
||||
<td class=" "><?php echo $value->state; ?></td>
|
||||
<td class=" "><?php echo $value->pincode; ?></td>
|
||||
<td class=" "><?php echo $value->gst; ?></td>
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<td>
|
||||
<a class="service_privoder" id="<?php echo md5($value->id); ?>" style="font-size: 16px;" >
|
||||
<i class="fa fa-pencil"></i></a>
|
||||
<i class="fa fa-pencil" title="Edit"></i></a>
|
||||
|
||||
<a href="<?php echo base_url()?>Asset/deleteThirdPartyData/<?php echo md5($value->id); ?>" style="font-size: 16px;"><i class="fa fa-trash"></i></a>
|
||||
<a class="deleteServicePrivoderData" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;" id="<?php echo md5($value->id); ?>">
|
||||
<i class="fa fa-trash " ></i></a>
|
||||
<!-- <a href="<?php echo base_url()?>Asset/deleteThirdPartyData/<?php echo md5($value->id); ?>" style="font-size: 16px;"><i class="fa fa-trash" title="Delete"></i></a> -->
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
@ -188,7 +194,7 @@
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<a type="button" class="insurence" id="" style=" text-align: center; font-size: 25px; color:#2A3F54; ">
|
||||
<li class="fa fa-plus-circle"></li></a>
|
||||
<li class="fa fa-plus-circle" title="Add New"></li></a>
|
||||
<?php } ?>
|
||||
</ul> </br>
|
||||
<div class="card-box table-responsive">
|
||||
@ -198,11 +204,11 @@
|
||||
<th class="column-title" width="15%">Name </th>
|
||||
<th class="column-title" width="15%">Phone </th>
|
||||
<th class="column-title" width="15%">Email </th>
|
||||
<th class="column-title" width="10%">GST </th>
|
||||
<th class="column-title" width="15%">Address </th>
|
||||
<th class="column-title" width="15%">City </th>
|
||||
<th class="column-title" width="15%">State </th>
|
||||
<th class="column-title" width="10%">Pincode </th>
|
||||
<th class="column-title" width="10%">Gst </th>
|
||||
<th class="column-title" width="10%">Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -212,17 +218,19 @@
|
||||
<td class=" "><?php echo $value->name; ?></td>
|
||||
<td class=" "><?php echo $value->phone; ?></td>
|
||||
<td class=" "><?php echo $value->email; ?></td>
|
||||
<td class=" "><?php echo $value->gst; ?></td>
|
||||
<td class=" "><?php echo $value->address; ?></td>
|
||||
<td class=" "><?php echo $value->city; ?></td>
|
||||
<td class=" "><?php echo $value->state; ?></td>
|
||||
<td class=" "><?php echo $value->pincode; ?></td>
|
||||
<td class=" "><?php echo $value->gst; ?></td>
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<td>
|
||||
<a class="insurence" id="<?php echo md5($value->id); ?>" style="font-size: 16px;" >
|
||||
<i class="fa fa-pencil"></i></a>
|
||||
<i class="fa fa-pencil" title="Edit"></i></a>
|
||||
|
||||
<a href="<?php echo base_url()?>Asset/deleteThirdPartyData/<?php echo md5($value->id); ?>" style="font-size: 16px;"><i class="fa fa-trash"></i></a>
|
||||
<a class="deleteInsurenceData" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;" id="<?php echo md5($value->id); ?>">
|
||||
<i class="fa fa-trash " ></i></a>
|
||||
<!-- <a href="<?php echo base_url()?>Asset/deleteThirdPartyData/<?php echo md5($value->id); ?>" style="font-size: 16px;"><i class="fa fa-trash" title="Delete"></i></a> -->
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
@ -238,7 +246,7 @@
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<a type="button" class="location" id="" style=" text-align: center; font-size: 25px; color:#2A3F54; ">
|
||||
<li class="fa fa-plus-circle"></li></a>
|
||||
<li class="fa fa-plus-circle" title="Add New"></li></a>
|
||||
<?php } ?>
|
||||
</ul> </br>
|
||||
<div class="card-box table-responsive">
|
||||
@ -275,29 +283,33 @@
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<a type="button" class="catogary" id="" style=" text-align: center; font-size: 25px; color:#2A3F54; ">
|
||||
<li class="fa fa-plus-circle"></li></a>
|
||||
<li class="fa fa-plus-circle" title="Add New"></li></a>
|
||||
<?php } ?>
|
||||
</ul> </br>
|
||||
<div class="card-box table-responsive">
|
||||
<table class="table table-bordered table-striped" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr class="headings">
|
||||
<th class="column-title" width="15%">Catogary </th>
|
||||
<!-- <th class="column-title" width="10%">Action </th> -->
|
||||
<th class="column-title" width="15%">Catogary </th>
|
||||
<th class="column-title" width="15%">Depreciation % </th>
|
||||
<th class="column-title" width="10%">Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($categoriesData as $key => $value) { ?>
|
||||
<tr class="even pointer">
|
||||
<td class=" "><?php echo $value->name; ?></td>
|
||||
<!-- <?php if(user()->action_permit != 'view' ) { ?>
|
||||
<td class=" "><?php echo $value->depreciation_percentage; ?></td>
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<td>
|
||||
<a class="location" id="<?php echo md5($value->id); ?>" style="font-size: 16px;" >
|
||||
<i class="fa fa-pencil"></i></a>
|
||||
<a class="catogary" id="<?php echo md5($value->id); ?>" style="font-size: 16px;" >
|
||||
<i class="fa fa-pencil" title="Edit"></i></a>
|
||||
|
||||
<a href="<?php echo base_url()?>Asset/deleteThirdPartyData/<?php echo md5($value->id); ?>" style="font-size: 16px;"><i class="fa fa-trash"></i></a>
|
||||
<a class="deleteCategoriesData" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;" id="<?php echo md5($value->id); ?>">
|
||||
<i class="fa fa-trash " ></i></a>
|
||||
<!-- <a href="<?php echo base_url()?>Asset/deleteCategoriesFormData/<?php echo md5($value->id); ?>" style="font-size: 16px;"><i class="fa fa-trash" title="Delete"></i></a> -->
|
||||
</td>
|
||||
<?php } ?> -->
|
||||
<?php } ?>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
@ -305,6 +317,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- ------------------------------------------------------------------------- -->
|
||||
|
||||
|
||||
@ -313,10 +326,174 @@
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- EMPLOYEE MASTER
|
||||
###################################################################################################################
|
||||
###################################################################################################################
|
||||
################################################################################################################### -->
|
||||
|
||||
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
<h2>Employee Master</h2>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="x_content">
|
||||
<ul class="nav nav-tabs bar_tabs" id="myTab" role="tablist">
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="department-tab" data-toggle="tab" href="#department" role="tab" aria-controls="department" aria-selected="false">Department</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="leave-tab" data-toggle="tab" href="#leave" role="tab" aria-controls="leave" aria-selected="false">Leave</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="decline-tab" data-toggle="tab" href="#decline" role="tab" aria-controls="decline" aria-selected="false">Decline Reason</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<div class="tab-content" id="myTabContent">
|
||||
|
||||
|
||||
|
||||
|
||||
<!------------------------------ DEPARTMENT DATA ------------------------------>
|
||||
<div class="tab-pane fade" id="department" role="tabpanel" aria-labelledby="department-tab">
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<a type="button" class="department" id="" style=" text-align: center; font-size: 25px; color:#2A3F54; ">
|
||||
<li class="fa fa-plus-circle" title="Add New"></li></a>
|
||||
<?php } ?>
|
||||
</ul> </br>
|
||||
<div class="card-box table-responsive">
|
||||
<table class="table table-bordered table-striped" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr class="headings">
|
||||
<th class="column-title" width="15%">Name </th>
|
||||
<th class="column-title" width="10%">Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($departmentData as $key => $value) { ?>
|
||||
<tr class="even pointer">
|
||||
<td class=" "><?php echo $value->name; ?></td>
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<td>
|
||||
<a class="department" id="<?php echo md5($value->id); ?>" style="font-size: 16px;" >
|
||||
<i class="fa fa-pencil" title="Edit"></i></a>
|
||||
|
||||
<a class="deleteDepartmentData" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;" id="<?php echo md5($value->id); ?>">
|
||||
<i class="fa fa-trash " ></i></a>
|
||||
<!-- <a href="<?php echo base_url()?>Asset/deleteCategoriesFormData/<?php echo md5($value->id); ?>" style="font-size: 16px;"><i class="fa fa-trash" title="Delete"></i></a> -->
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ------------------------------------------------------------------------- -->
|
||||
|
||||
|
||||
<!------------------------------ LEAVE DATA ------------------------------------->
|
||||
<div class="tab-pane fade" id="leave" role="tabpanel" aria-labelledby="leave-tab">
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<a type="button" class="leave" id="" style=" text-align: center; font-size: 25px; color:#2A3F54; ">
|
||||
<li class="fa fa-plus-circle" title="Add New"></li></a>
|
||||
<?php } ?>
|
||||
</ul> </br>
|
||||
<div class="card-box table-responsive">
|
||||
<table class="table table-bordered table-striped" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr class="headings">
|
||||
<th class="column-title" width="15%">Leave Type </th>
|
||||
<th class="column-title" width="15%">Days </th>
|
||||
<th class="column-title" width="10%">Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($leaveData as $key => $value) { ?>
|
||||
<tr class="even pointer">
|
||||
<td class=" "><?php echo $value->type; ?></td>
|
||||
<td class=" "><?php echo $value->days; ?></td>
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<td>
|
||||
<a class="leave" id="<?php echo md5($value->id); ?>" style="font-size: 16px;" >
|
||||
<i class="fa fa-pencil" title="Edit"></i></a>
|
||||
|
||||
<a class="deleteLeaveData" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;" id="<?php echo md5($value->id); ?>">
|
||||
<i class="fa fa-trash " ></i></a>
|
||||
<!-- <a href="<?php echo base_url()?>Asset/deleteCategoriesFormData/<?php echo md5($value->id); ?>" style="font-size: 16px;"><i class="fa fa-trash" title="Delete"></i></a> -->
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ------------------------------------------------------------------------- -->
|
||||
|
||||
|
||||
<!------------------------------ DECLINE REASON ------------------------------>
|
||||
<div class="tab-pane fade" id="decline" role="tabpanel" aria-labelledby="decline-tab">
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<a type="button" class="decline" id="" style=" text-align: center; font-size: 25px; color:#2A3F54; ">
|
||||
<li class="fa fa-plus-circle" title="Add New"></li></a>
|
||||
<?php } ?>
|
||||
</ul> </br>
|
||||
<div class="card-box table-responsive">
|
||||
<table class="table table-bordered table-striped" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr class="headings">
|
||||
<th class="column-title" width="15%">Reason</th>
|
||||
<th class="column-title" width="10%">Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($enum_value as $key => $value) { ?>
|
||||
<tr class="even pointer">
|
||||
<td class=" "><?php echo $value->enum_value; ?></td>
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<td>
|
||||
<a class="decline" id="<?php echo md5($value->id); ?>" style="font-size: 16px;" >
|
||||
<i class="fa fa-pencil" title="Edit"></i></a>
|
||||
|
||||
<a class="deletedeclineData" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;" id="<?php echo md5($value->id); ?>">
|
||||
<i class="fa fa-trash " ></i></a>
|
||||
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ------------------------------------------------------------------------- -->
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<input type="hidden" class="form-control" id="change_active" value="<?php echo $this->session->flashdata('msg'); ?>" />
|
||||
|
||||
|
||||
@ -332,6 +509,10 @@
|
||||
$('#catogary-tab').removeClass('nav-link').addClass('nav-link active');
|
||||
$('#catogary').removeClass('tab-pane fade').addClass('tab-pane fade show active');
|
||||
}
|
||||
else if ($('#change_active').val() == "department") {
|
||||
$('#department-tab').removeClass('nav-link').addClass('nav-link active');
|
||||
$('#department').removeClass('tab-pane fade').addClass('tab-pane fade show active');
|
||||
}
|
||||
else if ($('#change_active').val() == "1") {
|
||||
$('#manufacture-tab').removeClass('nav-link').addClass('nav-link active');
|
||||
$('#manufacture').removeClass('tab-pane fade').addClass('tab-pane fade show active');
|
||||
@ -348,19 +529,26 @@
|
||||
$('#insurence-tab').removeClass('nav-link').addClass('nav-link active');
|
||||
$('#insurence').removeClass('tab-pane fade').addClass('tab-pane fade show active');
|
||||
}
|
||||
else if ($('#change_active').val() == "leave") {
|
||||
$('#leave-tab').removeClass('nav-link').addClass('nav-link active');
|
||||
$('#leave').removeClass('tab-pane fade').addClass('tab-pane fade show active');
|
||||
}
|
||||
else if ($('#change_active').val() == "decline") {
|
||||
$('#decline-tab').removeClass('nav-link').addClass('nav-link active');
|
||||
$('#decline').removeClass('tab-pane fade').addClass('tab-pane fade show active');
|
||||
}
|
||||
else{
|
||||
$('#manufacture-tab').removeClass('nav-link').addClass('nav-link active');
|
||||
$('#manufacture').removeClass('tab-pane fade').addClass('tab-pane fade show active');
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click','.manufacture',function(){
|
||||
var id = $(this).attr("id")
|
||||
if (id) {
|
||||
var URL = "<?php echo base_url();?>asset/getThirdPartyForm/"+id
|
||||
var URL = "<?php echo base_url();?>Asset/getThirdPartyForm/"+id
|
||||
}
|
||||
else {
|
||||
var URL = "<?php echo base_url();?>asset/getThirdPartyForm/"+"manufacture"
|
||||
var URL = "<?php echo base_url();?>Asset/getThirdPartyForm/"+"manufacture"
|
||||
}
|
||||
$.ajax({
|
||||
url: URL,
|
||||
@ -377,10 +565,10 @@
|
||||
$(document).on('click','.supplier',function(){
|
||||
var id = $(this).attr("id")
|
||||
if (id) {
|
||||
var URL = "<?php echo base_url();?>asset/getThirdPartyForm/"+id
|
||||
var URL = "<?php echo base_url();?>Asset/getThirdPartyForm/"+id
|
||||
}
|
||||
else {
|
||||
var URL = "<?php echo base_url();?>asset/getThirdPartyForm/"+"supplier"
|
||||
var URL = "<?php echo base_url();?>Asset/getThirdPartyForm/"+"supplier"
|
||||
}
|
||||
$.ajax({
|
||||
url: URL,
|
||||
@ -397,10 +585,10 @@
|
||||
$(document).on('click','.service_privoder',function(){
|
||||
var id = $(this).attr("id")
|
||||
if (id) {
|
||||
var URL = "<?php echo base_url();?>asset/getThirdPartyForm/"+id
|
||||
var URL = "<?php echo base_url();?>Asset/getThirdPartyForm/"+id
|
||||
}
|
||||
else {
|
||||
var URL = "<?php echo base_url();?>asset/getThirdPartyForm/"+"service_privoder"
|
||||
var URL = "<?php echo base_url();?>Asset/getThirdPartyForm/"+"service_privoder"
|
||||
}
|
||||
$.ajax({
|
||||
url: URL,
|
||||
@ -418,10 +606,10 @@
|
||||
$(document).on('click','.insurence',function(){
|
||||
var id = $(this).attr("id")
|
||||
if (id) {
|
||||
var URL = "<?php echo base_url();?>asset/getThirdPartyForm/"+id
|
||||
var URL = "<?php echo base_url();?>Asset/getThirdPartyForm/"+id
|
||||
}
|
||||
else {
|
||||
var URL = "<?php echo base_url();?>asset/getThirdPartyForm/"+"insurence"
|
||||
var URL = "<?php echo base_url();?>Asset/getThirdPartyForm/"+"insurence"
|
||||
}
|
||||
$.ajax({
|
||||
url: URL,
|
||||
@ -439,10 +627,10 @@
|
||||
$(document).on('click','.location',function(){
|
||||
var id = $(this).attr("id")
|
||||
if (id) {
|
||||
var URL = "<?php echo base_url();?>asset/getLocationForm/"+id
|
||||
var URL = "<?php echo base_url();?>Asset/getLocationForm/"+id
|
||||
}
|
||||
else {
|
||||
var URL = "<?php echo base_url();?>asset/getLocationForm/"+"location"
|
||||
var URL = "<?php echo base_url();?>Asset/getLocationForm/"+"location"
|
||||
}
|
||||
$.ajax({
|
||||
url: URL,
|
||||
@ -456,13 +644,14 @@
|
||||
|
||||
|
||||
$(document).on('click','.catogary',function(){
|
||||
var id = $(this).attr("id")
|
||||
var id = $(this).attr("id");
|
||||
if (id) {
|
||||
var URL = "<?php echo base_url();?>asset/getCatogaryForm/"+id
|
||||
var URL = "<?php echo base_url();?>Asset/getCatogaryForm/"+id
|
||||
}
|
||||
else {
|
||||
var URL = "<?php echo base_url();?>asset/getCatogaryForm/"+"catogary"
|
||||
var URL = "<?php echo base_url();?>Asset/getCatogaryForm/"+"catogary"
|
||||
}
|
||||
console.log(URL);
|
||||
$.ajax({
|
||||
url: URL,
|
||||
type:"GET",
|
||||
@ -474,6 +663,192 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click','.department',function(){
|
||||
var id = $(this).attr("id");
|
||||
if (id) {
|
||||
var URL = "<?php echo base_url();?>Asset/getDepartmentForm/"+id
|
||||
}
|
||||
else {
|
||||
var URL = "<?php echo base_url();?>Asset/getDepartmentForm/"+"department"
|
||||
}
|
||||
console.log(URL);
|
||||
$.ajax({
|
||||
url: URL,
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
|
||||
$('#edit-form').html(JSON.parse(data));
|
||||
$('.bs-example-modal-sm').modal("show");
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$(document).on('click','.leave',function(){
|
||||
var id = $(this).attr("id");
|
||||
if (id) {
|
||||
var URL = "<?php echo base_url();?>Asset/getLeaveForm/"+id
|
||||
}
|
||||
else {
|
||||
var URL = "<?php echo base_url();?>Asset/getLeaveForm/"+"leave"
|
||||
}
|
||||
console.log(URL);
|
||||
$.ajax({
|
||||
url: URL,
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
|
||||
$('#edit-form').html(JSON.parse(data));
|
||||
$('.bs-example-modal-sm').modal("show");
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$(document).on('click','.decline',function(){
|
||||
var id = $(this).attr("id");
|
||||
if (id) {
|
||||
var URL = "<?php echo base_url();?>Asset/getDeclineForm/"+id
|
||||
}
|
||||
else {
|
||||
var URL = "<?php echo base_url();?>Asset/getDeclineForm/"+"decline"
|
||||
}
|
||||
console.log(URL);
|
||||
$.ajax({
|
||||
url: URL,
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
|
||||
$('#edit-form').html(JSON.parse(data));
|
||||
$('.bs-example-modal-sm').modal("show");
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.deleteManufacturerData').click(function() {
|
||||
var id = $(this).attr('id');
|
||||
var url = "<?php echo base_url()?>Asset/deleteThirdPartyData";
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo base_url()?>Asset/getDeleteConfirmationPopup",
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
$('#edit-form').html(JSON.parse(data));
|
||||
$('.delete_id').attr('value',id);
|
||||
$('.delete_url').attr('action',url);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.deleteSupplierData').click(function() {
|
||||
var id = $(this).attr('id');
|
||||
var url = "<?php echo base_url()?>Asset/deleteThirdPartyData";
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo base_url()?>Asset/getDeleteConfirmationPopup",
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
$('#edit-form').html(JSON.parse(data));
|
||||
$('.delete_id').attr('value',id);
|
||||
$('.delete_url').attr('action',url);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.deleteServicePrivoderData').click(function() {
|
||||
var id = $(this).attr('id');
|
||||
var url = "<?php echo base_url()?>Asset/deleteThirdPartyData";
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo base_url()?>Asset/getDeleteConfirmationPopup",
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
$('#edit-form').html(JSON.parse(data));
|
||||
$('.delete_id').attr('value',id);
|
||||
$('.delete_url').attr('action',url);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.deleteInsurenceData').click(function() {
|
||||
var id = $(this).attr('id');
|
||||
var url = "<?php echo base_url()?>Asset/deleteThirdPartyData";
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo base_url()?>Asset/getDeleteConfirmationPopup",
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
$('#edit-form').html(JSON.parse(data));
|
||||
$('.delete_id').attr('value',id);
|
||||
$('.delete_url').attr('action',url);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.deleteCategoriesData').click(function() {
|
||||
var id = $(this).attr('id');
|
||||
var url = "<?php echo base_url()?>Asset/deleteCategoriesFormData";
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo base_url()?>Asset/getDeleteConfirmationPopup",
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
$('#edit-form').html(JSON.parse(data));
|
||||
$('.delete_id').attr('value',id);
|
||||
$('.delete_url').attr('action',url);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.deleteDepartmentData').click(function() {
|
||||
var id = $(this).attr('id');
|
||||
var url = "<?php echo base_url()?>Asset/deleteDepartmentFormData";
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo base_url()?>Asset/getDeleteConfirmationPopup",
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
$('#edit-form').html(JSON.parse(data));
|
||||
$('.delete_id').attr('value',id);
|
||||
$('.delete_url').attr('action',url);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.deleteLeaveData').click(function() {
|
||||
var id = $(this).attr('id');
|
||||
var url = "<?php echo base_url()?>Asset/deleteLeaveFormData";
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo base_url()?>Asset/getDeleteConfirmationPopup",
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
$('#edit-form').html(JSON.parse(data));
|
||||
$('.delete_id').attr('value',id);
|
||||
$('.delete_url').attr('action',url);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.deletedeclineData').click(function() {
|
||||
var id = $(this).attr('id');
|
||||
var url = "<?php echo base_url()?>Asset/deleteDeclineFormData";
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo base_url()?>Asset/getDeleteConfirmationPopup",
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
$('#edit-form').html(JSON.parse(data));
|
||||
$('.delete_id').attr('value',id);
|
||||
$('.delete_url').attr('action',url);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@ -18,37 +18,44 @@
|
||||
<input type="hidden" name="business_id" value="<?php echo user()->business_id; ?>">
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">Name</label>
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">Name<a style="color:red;">*</a></label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<input type="text" class="form-control" name="name" value="<?php if(isset($third_party_data)) { echo $third_party_data->name; } ?>">
|
||||
<input type="text" class="form-control" name="name" value="<?php if(isset($third_party_data)) { echo $third_party_data->name; } ?>" required >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">Phone</label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<input type="text" pattern="[6-9]{1}[0-9]{9}" title="Phone number with 6-9 and remaing 9 digit with 0-9" class="form-control" name="phone" value="<?php if(isset($third_party_data)) { echo $third_party_data->phone; } ?>">
|
||||
<input type="text" pattern="[6-9]{1}[0-9]{9}" title="Phone number with 6-9 and remaing 9 digit with 0-9" class="form-control" name="phone" value="<?php if(isset($third_party_data)) { echo $third_party_data->phone; } ?>" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">Email</label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<input type="email" class="form-control" name="email" value="<?php if(isset($third_party_data)) { echo $third_party_data->email; } ?>">
|
||||
<input type="email" class="form-control" name="email" value="<?php if(isset($third_party_data)) { echo $third_party_data->email; } ?>" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">GST<a style="color:red;">*</a></label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<input type="text" class="form-control" name="gst" value="<?php if(isset($third_party_data)) { echo $third_party_data->gst; } ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">Address</label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<input type="text" class="form-control" name="address" value="<?php if(isset($third_party_data)) { echo $third_party_data->address; } ?>">
|
||||
<input type="text" class="form-control" name="address" value="<?php if(isset($third_party_data)) { echo $third_party_data->address; } ?>" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">City</label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<input type="text" class="form-control" name="city" value="<?php if(isset($third_party_data)) { echo $third_party_data->city; } ?>">
|
||||
<input type="text" class="form-control" name="city" value="<?php if(isset($third_party_data)) { echo $third_party_data->city; } ?>" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -69,18 +76,12 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">Pincode</label>
|
||||
<label class="col-form-label col-md-3 col-sm-3 " >Pincode</label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<input type="text" class="form-control" name="pincode" value="<?php if(isset($third_party_data)) { echo $third_party_data->pincode; } ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">Gst</label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<input type="text" class="form-control" name="gst" value="<?php if(isset($third_party_data)) { echo $third_party_data->gst; } ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -25,8 +25,10 @@ public function __construct()
|
||||
{
|
||||
// To inherit directly the attributes of the parent class.
|
||||
parent::__construct();
|
||||
$this->load->model('auth_model');
|
||||
$this->load->model('MY_Model');
|
||||
### Syntax : $this->load->model('Model Path' , 'Alias name');
|
||||
### The second parameter (optional) is used to call the method.
|
||||
$this->load->model('Auth_model','auth_model');
|
||||
$this->load->model('MY_Model','MY_Model');
|
||||
}
|
||||
|
||||
|
||||
@ -44,10 +46,10 @@ public function index()
|
||||
// Example
|
||||
if(check_auth())
|
||||
{
|
||||
redirect('dashboard');
|
||||
redirect('Dashboard');
|
||||
}
|
||||
else{
|
||||
$this->layout->load_view('auth/login');
|
||||
$this->layout->load_view('Auth/login');
|
||||
}
|
||||
// $this->load->view('welcome/welcome_message');
|
||||
// $this->load->view('welcome_message');
|
||||
@ -122,7 +124,7 @@ public function authendicate()
|
||||
);
|
||||
$data = $this->security->xss_clean($data);
|
||||
$this->session->set_userdata($data);
|
||||
redirect('dashboard');
|
||||
redirect('Dashboard');
|
||||
}
|
||||
// pass the value 1 when the username or password is wrong
|
||||
$this->session->set_flashdata('msg',"password doesn't match");
|
||||
@ -137,7 +139,7 @@ public function logout()
|
||||
|
||||
public function lost_your_password()
|
||||
{
|
||||
$this->layout->load_view("auth/otp_verification");
|
||||
$this->layout->load_view("Auth/otp_verification");
|
||||
}
|
||||
|
||||
public function send__mail(){
|
||||
|
||||
@ -34,6 +34,18 @@ public function get_logged_user()
|
||||
}
|
||||
}
|
||||
|
||||
public function get_logged_employee()
|
||||
{
|
||||
if ($this->is_logged_in()) {
|
||||
$this->db->select('u.*, e.*');
|
||||
$this->db->from('users as u');
|
||||
$this->db->join('employees as e', 'e.user_id = u.id', 'LEFT');
|
||||
$this->db->where('u.id', $this->session->userdata('id'));
|
||||
$query = $this->db->get();
|
||||
return $query->row();
|
||||
}
|
||||
}
|
||||
|
||||
//get user by id
|
||||
public function get_user($id)
|
||||
{
|
||||
|
||||
@ -31,26 +31,26 @@
|
||||
<div class="login_wrapper">
|
||||
<div class="animate form login_form">
|
||||
<section class="login_content">
|
||||
<form method="post" action="<?php echo base_url().'auth/authendicate'?>">
|
||||
<form method="post" action="<?php echo base_url().'Auth/authendicate'?>">
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
<h1>Sign In</h1>
|
||||
<div>
|
||||
<input type="text" class="form-control" value="admin@abc.com" name="user_name" placeholder="Username" required="" />
|
||||
<input type="text" class="form-control" value="" name="user_name" placeholder="Username" required="" />
|
||||
</div>
|
||||
<div>
|
||||
<input type="password" class="form-control" value="password" name="password" placeholder="Password" required="" />
|
||||
<input type="password" class="form-control" value="" name="password" placeholder="Password" required="" />
|
||||
<p id='message' style="color:red"><?php echo $this->session->flashdata('msg'); ?></p>
|
||||
</div>
|
||||
<div>
|
||||
<button type="submit" class="btn btn-primary">Log in</button>
|
||||
<a class="reset_pass" href="<?php echo base_url();?>auth/lost_your_password">Lost your password?</a>
|
||||
<a class="reset_pass" href="<?php echo base_url();?>Auth/lost_your_password">Lost your password?</a>
|
||||
</div>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<div class="separator">
|
||||
<!-- <p class="change_link">New to site? -->
|
||||
<!-- <a href="<?php echo base_url().'auth/lost_your_password'?>" class="to_register"> Create Account </a>
|
||||
<!-- <a href="<?php echo base_url().'Auth/lost_your_password'?>" class="to_register"> Create Account </a>
|
||||
</p> -->
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
@ -48,6 +48,7 @@ public function index()
|
||||
// Example
|
||||
// $this->load->render_page('backend/dashboard',[]);
|
||||
echo 'Hi from Backend_Controller&index function';//die();
|
||||
redirect('login');
|
||||
}
|
||||
|
||||
public function str_length()
|
||||
|
||||
@ -25,8 +25,10 @@ public function __construct()
|
||||
{
|
||||
// To inherit directly the attributes of the parent class.
|
||||
parent::__construct();
|
||||
$this->load->model('MY_Model');
|
||||
$this->load->model('Business_model');
|
||||
### Syntax : $this->load->model('Model Path' , 'Alias name');
|
||||
### The second parameter (optional) is used to call the method.
|
||||
$this->load->model('MY_Model','MY_Model');
|
||||
$this->load->model('Business_model','Business_model');
|
||||
$this->load->helper(array('form', 'url'));
|
||||
}
|
||||
|
||||
@ -103,9 +105,9 @@ public function create_business()
|
||||
// $create_business = 3;
|
||||
if($add_admin == 1)
|
||||
{
|
||||
redirect('user/addUser/'.$create_business);
|
||||
redirect('User/addUser/'.$create_business);
|
||||
}else{
|
||||
redirect('business/business_list');
|
||||
redirect('Business/business_list');
|
||||
}
|
||||
|
||||
}
|
||||
@ -161,15 +163,15 @@ public function edit_business()
|
||||
//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)); }
|
||||
if(is_superadmin()){ redirect('Business/business_list');}
|
||||
else if(is_admin()){ redirect('User/businessProfile/'.md5(user()->business_id)); }
|
||||
|
||||
}
|
||||
|
||||
public function delete_business($id)
|
||||
{
|
||||
$Data = $this->Business_model->delete_by_md5_id($id,user()->business_id,'asset');
|
||||
redirect('business/business_list');
|
||||
redirect('Business/business_list');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<h2>Business Details </h2>
|
||||
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<a href="<?php echo base_url();?>business/add_business" class="btn btn-sm btn-primary">Add Business</a>
|
||||
<a href="<?php echo base_url();?>Business/add_business" class="btn btn-sm btn-primary">Add Business</a>
|
||||
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
|
||||
</li>
|
||||
</ul>
|
||||
@ -54,10 +54,10 @@
|
||||
<td class=" "><?php echo $value->logo; ?> </td>
|
||||
|
||||
<td style=" text-align: center; font-size: 16px;">
|
||||
<a href="<?php echo base_url()?>business/get_business/<?php echo md5($value->id);?>" ><i class="fa fa-pencil"></i></a>
|
||||
<a href="<?php echo base_url()?>Business/get_business/<?php echo md5($value->id);?>" ><i class="fa fa-pencil"></i></a>
|
||||
|
||||
|
||||
<a href="<?php echo base_url()?>business/delete_business/<?php echo md5($value->id);?>" ><i class="fa fa-trash"></i></a>
|
||||
<a href="<?php echo base_url()?>Business/delete_business/<?php echo md5($value->id);?>" ><i class="fa fa-trash"></i></a>
|
||||
|
||||
|
||||
<a> <i id="<?php echo md5($value->id);?>" class="bi bi-card-list" title="History"></i></a>
|
||||
@ -89,7 +89,7 @@
|
||||
var id = $(this).attr("id")
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "<?php echo base_url()?>user/view_business_history/"+id,
|
||||
url: "<?php echo base_url()?>User/view_business_history/"+id,
|
||||
success: function(response) {
|
||||
response = JSON.parse(response);
|
||||
console.log(response);
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
<h3>Edit Business</h3>
|
||||
</div>
|
||||
|
||||
<a class="btn btn-sm btn-primary" style="float: right;" href="<?php echo base_url();?>business/business_list">Business List</a>
|
||||
<a class="btn btn-sm btn-primary" style="float: right;" href="<?php echo base_url();?>Business/business_list">Business List</a>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
<div class="row">
|
||||
|
||||
@ -25,7 +25,9 @@ public function __construct()
|
||||
{
|
||||
// To inherit directly the attributes of the parent class.
|
||||
parent::__construct();
|
||||
$this->load->model('Dashboard_model');
|
||||
### Syntax : $this->load->model('Model Path' , 'Alias name');
|
||||
### The second parameter (optional) is used to call the method.
|
||||
$this->load->model('Dashboard_model','Dashboard_model');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -72,7 +74,7 @@ public function index()
|
||||
$business_count = $this->Dashboard_model->get_business_count();
|
||||
$this->layout->set('business_count', $business_count);
|
||||
}
|
||||
$this->layout->buffer('main_content', 'dashboard/dashboard');
|
||||
$this->layout->buffer('main_content', 'Dashboard/dashboard');
|
||||
$this->layout->render('default_layout');
|
||||
|
||||
}
|
||||
|
||||
@ -1,14 +0,0 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "../../../.."
|
||||
},
|
||||
{
|
||||
"path": "../../../../../demo"
|
||||
},
|
||||
{
|
||||
"path": "../../../../../codeigniter-3-crud"
|
||||
}
|
||||
],
|
||||
"settings": {}
|
||||
}
|
||||
@ -5,9 +5,8 @@
|
||||
<div class="tile_count">
|
||||
|
||||
<?php if (is_superadmin()) { ?>
|
||||
|
||||
<div class="col-md-6 col-sm-4 tile_stats_count">
|
||||
<span class="count_top"><i class="fa fa-building"></i> Total Business</span>
|
||||
<span class="count_top"><i class="fa fa-building"></i> Total Business </span>
|
||||
<div class="count"><?php echo $business_count; ?></div>
|
||||
<!--<span class="count_bottom"><i class="green">4% </i> From last Week</span> -->
|
||||
</div>
|
||||
@ -265,11 +264,16 @@
|
||||
|
||||
<!-- /page content -->
|
||||
<?php if (is_admin() || user()->action_permit != 'view') { ?>
|
||||
<input type="hidden" value="<?php if(is_admin() || is_user()){ echo $business->is_master_data_entered; } ?>" id="master_key_exist" >
|
||||
<!-- <input type="hidden" value="<?php if(is_admin() || !is_null(is_user()) ){ echo $business->is_master_data_entered; } ?>" id="master_key_exist" > -->
|
||||
<?php } ?>
|
||||
|
||||
<?php if (is_superadmin()) { ?>
|
||||
<input type="hidden" value="sadmin" id="sadmin">
|
||||
<?php } ?>
|
||||
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
if($("#sadmin").val() != "sadmin")
|
||||
var master_value = $("#master_key_exist").val();
|
||||
if(master_value == 0)
|
||||
{
|
||||
|
||||
119
application/modules/Delegation/controllers/Delegation.php
Normal file
@ -0,0 +1,119 @@
|
||||
<?php defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
use chillerlan\QRCode\Data\QRMatrix;
|
||||
use chillerlan\QRCode\QRCode;
|
||||
use chillerlan\QRCode\QROptions;
|
||||
|
||||
date_default_timezone_set('Asia/Kolkata');
|
||||
|
||||
/**
|
||||
* AMS
|
||||
*
|
||||
* @package HMVC
|
||||
* @author Venba
|
||||
* @copyright 2022 Venba
|
||||
* @license https://venbainfotech.com/licenses/MIT MIT License
|
||||
* @link <URI> (description)
|
||||
* @version GIT: $Id$
|
||||
* @since Version 0.0.1
|
||||
* @filesource
|
||||
*
|
||||
*/
|
||||
|
||||
class Delegation extends Admin_Controller
|
||||
{
|
||||
/**
|
||||
* [__construct description]
|
||||
*
|
||||
* @method __construct
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// To inherit directly the attributes of the parent class.
|
||||
parent::__construct();
|
||||
### Syntax : $this->load->model('Model Path' , 'Alias name');
|
||||
### The second parameter (optional) is used to call the method.
|
||||
$this->load->model('MY_Model','MY_Model');
|
||||
$this->load->model('Delegation_model','Delegation_model');
|
||||
$this->load->model('Employee/Employee_model','Emp_model');
|
||||
$this->load->model('Audit/Audit_model','audit_model');
|
||||
$this->load->helper(array('form', 'url'));
|
||||
|
||||
}
|
||||
|
||||
public function Delegation_form()
|
||||
{
|
||||
$business_id = user()->business_id;
|
||||
$Employee_list = $this->Delegation_model->Employee_list_by_business_id($business_id);
|
||||
$this->layout->set('emp', $Employee_list);
|
||||
$this->layout->buffer('main_content', 'Delegation/delegation_form');
|
||||
$this->layout->render('Employee_Layout');
|
||||
}
|
||||
|
||||
public function Assign_Delecation()
|
||||
{
|
||||
$data = $this->input->post();
|
||||
$data['business_id'] = user()->business_id;
|
||||
$data['delegated_at'] = date('d-m-Y H:i');
|
||||
$data['is_active'] = 1;
|
||||
|
||||
$table="delegation";
|
||||
$Delecation = $this->MY_Model->insert($data, $table);
|
||||
|
||||
|
||||
$this->session->set_flashdata('Success', 'Delegation Assigned Successfully');
|
||||
redirect('Delegation/Delegation_list');
|
||||
}
|
||||
|
||||
|
||||
public function Edit_Delegation()
|
||||
{
|
||||
$id = $this->input->get('id');
|
||||
$business_id = user()->business_id;
|
||||
$Employee_list = $this->Delegation_model->Employee_list_by_business_id($business_id);
|
||||
$Delegation_list_Row = $this->Delegation_model->Delegation_list_by_id($id);
|
||||
$this->layout->set('emp', $Employee_list);
|
||||
$this->layout->set('Delegation_list', $Delegation_list_Row);
|
||||
$this->layout->buffer('main_content', 'Delegation/edit_delegation_form');
|
||||
$this->layout->render('Employee_Layout');
|
||||
}
|
||||
|
||||
|
||||
public function Edit_Create_Delecation()
|
||||
{
|
||||
|
||||
$action = $this->input->post();
|
||||
unset($action['id']);
|
||||
$id = $this->input->post('id');
|
||||
//var_dump($id); die();
|
||||
$action['business_id'] = user()->business_id;
|
||||
$action['updated_at'] = date('d-m-Y H:i a');
|
||||
$action['is_active'] = 1;
|
||||
|
||||
$table="delegation";
|
||||
$Delecation = $this->MY_Model->edit_option($action, $id, $table);
|
||||
$this->session->set_flashdata('Success', 'Delegation Updated Successfully');
|
||||
redirect('Delegation/Delegation_list');
|
||||
}
|
||||
|
||||
|
||||
public function Delegation_list()
|
||||
{
|
||||
$business_id = user()->business_id;
|
||||
$Delegation_list = $this->Delegation_model->Get_Delegation_list($business_id);
|
||||
$get_emp_id = null;
|
||||
if (!empty($get_delegation)) {
|
||||
|
||||
$get_emp_id = array_shift($Delegation_list)->delegated_to;
|
||||
}
|
||||
$get_emp_name = $this->Delegation_model->Get_emp_name_list($get_emp_id,
|
||||
$business_id);
|
||||
$this->layout->set('tableData', $Delegation_list);
|
||||
$this->layout->set('empname', $get_emp_name);
|
||||
$this->layout->buffer('main_content', 'Delegation/delegation_list');
|
||||
$this->layout->render('Employee_Layout');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
88
application/modules/Delegation/models/Delegation_model.php
Normal file
@ -0,0 +1,88 @@
|
||||
<?php
|
||||
class Delegation_model extends MY_Model {
|
||||
|
||||
public function Employee_list_by_business_id($business_id)
|
||||
{
|
||||
|
||||
$this->db->select('users.name, employees.user_id');
|
||||
$this->db->from('users');
|
||||
$this->db->join('employees', 'employees.user_id = users.id');
|
||||
$this->db->where('users.business_id', $business_id);
|
||||
$this->db->where('users.is_active', 1);
|
||||
$this->db->where('employees.is_active', 1);
|
||||
$query = $this->db->get();
|
||||
|
||||
if ($query->num_rows() > 0) {
|
||||
return $query->result();
|
||||
} else {
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public function Get_Delegation_list($business_id)
|
||||
{
|
||||
$this->db->select('A.* , name', 'users.name');
|
||||
$this->db->from('delegation A');
|
||||
$this->db->join('users', 'users.id = A.delegated_to', 'left');
|
||||
$this->db->where('A.business_id', $business_id);
|
||||
$this->db->order_by('id','DESC');
|
||||
$this->db->where('A.is_active', 1);
|
||||
$query = $this->db->get();
|
||||
$query = $query->result();
|
||||
return $query;
|
||||
|
||||
}
|
||||
|
||||
public function Get_emp_name_list($get_emp_id, $business_id)
|
||||
|
||||
{
|
||||
|
||||
$this->db->select('name');
|
||||
$this->db->from('users');
|
||||
$this->db->where('id', $get_emp_id);
|
||||
$this->db->where('business_id', $business_id);
|
||||
$query = $this->db->get();
|
||||
if ($query->num_rows() > 0) {
|
||||
return $query->result();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function Delegation_list_by_id($id)
|
||||
{
|
||||
$this->db->select('A.*, name', 'users.name');
|
||||
$this->db->from('delegation A');
|
||||
$this->db->join('users', 'users.id = A.delegated_to', 'left');
|
||||
$this->db->where('md5(A.id)', $id);
|
||||
$this->db->where('A.is_active', 1);
|
||||
$query = $this->db->get();
|
||||
if ($query->num_rows() > 0) {
|
||||
return $query->result();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function ExpenceDecline($id, $data)
|
||||
{
|
||||
$this->db->where('id',$id);
|
||||
$this->db->where('status', 'pending');
|
||||
$this->db->update('expence_list', $data);
|
||||
return;
|
||||
}
|
||||
|
||||
public function Expencecancle($id, $data)
|
||||
{
|
||||
$this->db->where('md5(id)',$id);
|
||||
$this->db->where('status', 'pending');
|
||||
$this->db->update('expence_list', $data);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
158
application/modules/Delegation/views/delegation_form.php
Normal file
@ -0,0 +1,158 @@
|
||||
<!-- bootstrap-daterangepicker -->
|
||||
<script src="https://localhost/ams//assets/default/moment/min/moment.min.js"></script>
|
||||
<script src="https://localhost/ams//assets/default/bootstrap-daterangepicker/daterangepicker.js"></script>
|
||||
<!-- bootstrap-datetimepicker -->
|
||||
<script src="https://localhost/ams//assets/default/bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>
|
||||
|
||||
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||
|
||||
|
||||
<!-- Body page content -->
|
||||
<style>
|
||||
.alert-success {
|
||||
background-color: #dff0d8;
|
||||
color: #3c763d;
|
||||
border-color: #d6e9c6;
|
||||
}
|
||||
|
||||
.flash-message {
|
||||
padding: 15px 15px;
|
||||
margin-bottom: 10px;
|
||||
border-radius: 5px;
|
||||
margin-left: 650px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<a href="<?php echo base_url();?>Delegation/Delegation_list" class="btn btn-primary" style="margin-top: 20px;">Back</a>
|
||||
</ul>
|
||||
|
||||
<h1>Delegate</h1>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="x_content">
|
||||
<br />
|
||||
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Delegation/Assign_Delecation" enctype="multipart/form-data">
|
||||
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="first-name"> From Date<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-3 col-sm-3 ">
|
||||
<div class='input-group date'onclick="openDatePicker('fromdate')">
|
||||
<input type='text' class="form-control" placeholder="DD-MM-YYYY" id="fromdate" name="from_date" value="" required />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1" for="last-name">To Date<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-3 col-sm-3 ">
|
||||
<div class='input-group date' onclick="openDatePicker('todate')">
|
||||
<input type='text' class="form-control input-field" placeholder="DD-MM-YYYY " id="todate" name= "to_date" value="" required />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type='hidden' name="emp_id" value="<?php echo user()->id; ?>" required />
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="last-name">Delegated To<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-7 col-sm-7 ">
|
||||
<select id="emp_id" name="delegated_to" required="required" class="form-control" >
|
||||
<option value="">--Select--</option>
|
||||
<?php foreach ($emp as $key => $value) { ?>
|
||||
<?php if($value->user_id != user()->id) { ?>
|
||||
|
||||
<option value="<?php echo $value->user_id; ?>"><?php echo $value->name; ?></option>
|
||||
<?php } } ?>
|
||||
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ln_solid"></div>
|
||||
<div class="item form-group">
|
||||
<div class=" offset-md-8">
|
||||
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
||||
<button class="btn btn-primary" type="reset">Reset</button>
|
||||
<button type="submit" class="btn btn-success">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Initialize datepickers
|
||||
var dateFormat = "dd-mm-yy";
|
||||
var fromDateInput = $("#fromdate");
|
||||
var toDateInput = $("#todate");
|
||||
|
||||
fromDateInput.datepicker({
|
||||
dateFormat: dateFormat,
|
||||
onSelect: function (dateText, inst) {
|
||||
toDateInput.datepicker("option", "minDate", dateText);
|
||||
validateDateRange();
|
||||
}
|
||||
});
|
||||
|
||||
toDateInput.datepicker({
|
||||
dateFormat: dateFormat,
|
||||
onSelect: function (dateText, inst) {
|
||||
validateDateRange();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Function to validate the date range
|
||||
function validateDateRange() {
|
||||
var fromDate = fromDateInput.datepicker("getDate");
|
||||
var toDate = toDateInput.datepicker("getDate");
|
||||
|
||||
// Check if both dates are selected
|
||||
if (!fromDate || !toDate) {
|
||||
$("#error-msg").text("Please select both From Date and To Date");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Compare the dates
|
||||
if (fromDate > toDate) {
|
||||
$("#error-msg").text("From Date cannot be after To Date");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Clear the error message if the date range is valid
|
||||
$("#error-msg").text("");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
114
application/modules/Delegation/views/delegation_list.php
Normal file
@ -0,0 +1,114 @@
|
||||
|
||||
<head>
|
||||
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css'>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
|
||||
|
||||
<style>
|
||||
|
||||
.alert-success {
|
||||
background-color: #dff0d8;
|
||||
color: #3c763d;
|
||||
border-color: #d6e9c6;
|
||||
}
|
||||
|
||||
.flash-message {
|
||||
padding: 15px 15px;
|
||||
margin-bottom: 10px;
|
||||
border-radius: 5px;
|
||||
margin-left: 600px;
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_filter{
|
||||
margin-top: -44px !important; //search to up
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
|
||||
<?php if ($this->session->userdata('Success')): ?>
|
||||
|
||||
<div class="alert-success flash-message" id="customPrompt" style="text-align: right;">
|
||||
<h2><?php echo $this->session->userdata('Success'); ?></h2>
|
||||
<span onclick="$('#customPrompt').hide()" style="text-align: right;" ><i class="fa fa-times" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php $this->session->unset_userdata('Success');?>
|
||||
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
|
||||
<a href="<?php echo base_url();?>Delegation/Delegation_form" class="btn btn-sm btn-primary" style="margin-top: 20px;">Assign Delegation</a>
|
||||
</ul>
|
||||
<h1>Delegation List</h1>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="x_content">
|
||||
<div class="row">
|
||||
<div class="col-sm-12" style="overflow: auto;">
|
||||
<table id="datatable-buttons" class="table table-striped table-bordered" width="100%">
|
||||
<thead>
|
||||
<tr class="headings">
|
||||
<th class="column-title">Delegate Duration</th>
|
||||
<th class="column-title">Delegated To </th>
|
||||
<th class="column-title"> Delegation Date </th>
|
||||
<th class="column-title" >Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($tableData as $key => $value) { ?>
|
||||
|
||||
<?php if(user()->id == $value->emp_id) { ?>
|
||||
|
||||
<tr class="even pointer">
|
||||
|
||||
<td class=" "><?php echo $value->from_date;?> to <?php echo $value->to_date;?> </td>
|
||||
<td class=" "><?php echo $value->name; ?> (<?php echo $value->delegated_to; ?>)</td>
|
||||
<td class=" "> <?php echo $value->delegated_at;?> </td>
|
||||
<td style=" text-align: center; font-size: 16px;">
|
||||
|
||||
<a href="<?php echo base_url('Delegation/Edit_Delegation')?>?id=<?php echo md5($value->id);?> "><i class="fa fa-edit" aria-hidden="true"title="Edit"></i></a>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<?php } } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="customPrompt" class="modal">
|
||||
<div class="modal-content ">
|
||||
<span onclick="$('#customPrompt').hide()" style="text-align: right;"><i class="fa fa-times fa-2x" aria-hidden="true"></i></span>
|
||||
<h3>Decline Reason</h3>
|
||||
<input list="browsers" style="padding:20px; margin:6px;" id="decline_reason" required name="myBrowser" />
|
||||
<datalist id="browsers" >
|
||||
<?php foreach ($dropdown as $key => $value) { ?>
|
||||
<option value="<?php echo $value->enum_value; ?>"><?php echo $value->enum_value; ?></option>
|
||||
<?php } ?>
|
||||
</datalist>
|
||||
|
||||
<button onclick="submitCustomPrompt()" type="button" class="btn btn-primary">Submit</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
||||
<div class="modal fade bs-example-modal-lg" id="ItemModal" tabindex="-1" role="dialog" aria-hidden="true"></div>
|
||||
<div class="modal bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" id="popup"> </div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
174
application/modules/Delegation/views/edit_delegation_form.php
Normal file
@ -0,0 +1,174 @@
|
||||
<!-- bootstrap-daterangepicker -->
|
||||
<script src="https://localhost/ams//assets/default/moment/min/moment.min.js"></script>
|
||||
<script src="https://localhost/ams//assets/default/bootstrap-daterangepicker/daterangepicker.js"></script>
|
||||
<!-- bootstrap-datetimepicker -->
|
||||
<script src="https://localhost/ams//assets/default/bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||
|
||||
|
||||
<!-- Body page content -->
|
||||
<style>
|
||||
.alert-success {
|
||||
background-color: #dff0d8;
|
||||
color: #3c763d;
|
||||
border-color: #d6e9c6;
|
||||
}
|
||||
|
||||
.flash-message {
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
border-radius: 5px;
|
||||
margin-left: 690px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
|
||||
<?php if ($this->session->userdata('Create')): ?>
|
||||
<div class="alert-success flash-message" id="customPrompt" style="text-align: right;">
|
||||
<h2><?php echo $this->session->userdata('Create'); ?></h2>
|
||||
<span onclick="$('#customPrompt').hide()" style="text-align: right;" ><i class="fa fa-times" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php $this->session->unset_userdata('Create');?>
|
||||
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<a href="<?php echo base_url();?>Delegation/Delegation_list" class="btn btn-primary" style="margin-top: 20px;">Back</a>
|
||||
</ul>
|
||||
|
||||
<h1>Edit Delegate</h1>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="x_content">
|
||||
<br />
|
||||
|
||||
<?php foreach( $Delegation_list as $data) { ?>
|
||||
|
||||
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Delegation/Edit_Create_Delecation" enctype="multipart/form-data">
|
||||
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="first-name"> From Date<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-3 col-sm-3 ">
|
||||
<div class='input-group date'>
|
||||
<input type='text' class="form-control" placeholder="DD-MM-YYYY" id="fromdate" name="from_date" value="<?php echo $data->from_date ?>" required />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1" for="last-name">To Date<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-3 col-sm-3 ">
|
||||
<div class='input-group date' >
|
||||
<input type='text' class="form-control" placeholder="DD-MM-YYYY" id="todate" name= "to_date" value="<?php echo $data->to_date ?>" required />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type='hidden' name="emp_id" value="<?php echo user()->id; ?>" required />
|
||||
|
||||
<input type='hidden' name="id" value="<?php echo $data->id; ?>" required />
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="last-name">Delegated To<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-7 col-sm-7 ">
|
||||
<select id="emp_id" name="delegated_to" required="required" class="form-control" >
|
||||
<option value="<?php echo $data->delegated_to; ?>"><?php echo $data->name; ?></option>
|
||||
<?php foreach ($emp as $key => $value) { ?>
|
||||
|
||||
<?php if($value->user_id != user()->id) { ?>
|
||||
|
||||
<option value="<?php echo $value->user_id; ?>"><?php echo $value->name; ?></option>
|
||||
|
||||
<?php } } ?>
|
||||
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ln_solid"></div>
|
||||
<div class="item form-group">
|
||||
<div class=" offset-md-8">
|
||||
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
||||
<button class="btn btn-primary" type="reset">Reset</button>
|
||||
<button type="submit" class="btn btn-success">Update</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
// Initialize datepickers
|
||||
var dateFormat = "dd-mm-yy";
|
||||
var fromDateInput = $("#fromdate");
|
||||
var toDateInput = $("#todate");
|
||||
|
||||
fromDateInput.datepicker({
|
||||
dateFormat: dateFormat,
|
||||
onSelect: function (dateText, inst) {
|
||||
toDateInput.datepicker("option", "minDate", dateText);
|
||||
validateDateRange();
|
||||
}
|
||||
});
|
||||
|
||||
toDateInput.datepicker({
|
||||
dateFormat: dateFormat,
|
||||
onSelect: function (dateText, inst) {
|
||||
validateDateRange();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Function to validate the date range
|
||||
function validateDateRange() {
|
||||
var fromDate = fromDateInput.datepicker("getDate");
|
||||
var toDate = toDateInput.datepicker("getDate");
|
||||
|
||||
// Check if both dates are selected
|
||||
if (!fromDate || !toDate) {
|
||||
$("#error-msg").text("Please select both From Date and To Date");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Compare the dates
|
||||
if (fromDate > toDate) {
|
||||
$("#error-msg").text("From Date cannot be after To Date");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Clear the error message if the date range is valid
|
||||
$("#error-msg").text("");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
0
application/modules/Employee/.gitkeep
Normal file
557
application/modules/Employee/controllers/Employee.php
Normal file
@ -0,0 +1,557 @@
|
||||
<?php defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
use chillerlan\QRCode\Data\QRMatrix;
|
||||
use chillerlan\QRCode\QRCode;
|
||||
use chillerlan\QRCode\QROptions;
|
||||
|
||||
/**
|
||||
* AMS
|
||||
*
|
||||
* @package HMVC
|
||||
* @author Venba
|
||||
* @copyright 2022 Venba
|
||||
* @license https://venbainfotech.com/licenses/MIT MIT License
|
||||
* @link <URI> (description)
|
||||
* @version GIT: $Id$
|
||||
* @since Version 0.0.1
|
||||
* @filesource
|
||||
*
|
||||
*/
|
||||
|
||||
class Employee extends Admin_Controller
|
||||
{
|
||||
/**
|
||||
* [__construct description]
|
||||
*
|
||||
* @method __construct
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// To inherit directly the attributes of the parent class.
|
||||
parent::__construct();
|
||||
### Syntax : $this->load->model('Model Path' , 'Alias name');
|
||||
### The second parameter (optional) is used to call the method.
|
||||
$this->load->model('MY_Model','MY_Model');
|
||||
$this->load->model('Employee_model','Emp_model');
|
||||
$this->load->model('Audit/Audit_model','audit_model');
|
||||
$this->load->helper(array('form', 'url'));
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
$this->layout->set('users', "gowtham");
|
||||
$this->layout->buffer('main_content', 'Asset/index');
|
||||
$this->layout->render('Employee_Layout');
|
||||
|
||||
}
|
||||
|
||||
|
||||
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');
|
||||
$this->layout->render('Employee_Layout');
|
||||
}
|
||||
|
||||
public function addEmployee($businessId = 0)
|
||||
{
|
||||
$manager = $this->Emp_model->get_employee(user()->business_id);
|
||||
$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');
|
||||
$this->layout->render('Employee_Layout');
|
||||
|
||||
}
|
||||
|
||||
public function add_employee_education()
|
||||
{
|
||||
|
||||
$id = $this->input->post('id');
|
||||
if ($id) {
|
||||
$data = $this->input->post();
|
||||
// $id = $this->input->post('id');
|
||||
$data['business_id'] = user()->business_id;
|
||||
$table="employee_qualification";
|
||||
$create_user = $this->MY_Model->update_md5($data,md5($id),$table);
|
||||
redirect('Employee/editEmployee/'.md5($this->input->post('emp_id')));
|
||||
}
|
||||
else{
|
||||
$data = $this->input->post();
|
||||
// $id = $this->input->post('id');
|
||||
$data['business_id'] = user()->business_id;
|
||||
$table="employee_qualification";
|
||||
$create_user = $this->MY_Model->insert($data,$table);
|
||||
redirect('Employee/editEmployee/'.md5($this->input->post('emp_id')));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function add_employee_history()
|
||||
{
|
||||
|
||||
$id = $this->input->post('id');
|
||||
if ($id) {
|
||||
$data = $this->input->post();
|
||||
// $id = $this->input->post('id');
|
||||
$data['business_id'] = user()->business_id;
|
||||
$table="employee_history";
|
||||
$create_user = $this->MY_Model->update_md5($data,md5($id),$table);
|
||||
redirect('Employee/editEmployee/'.md5($this->input->post('emp_id')));
|
||||
}
|
||||
else{
|
||||
$data = $this->input->post();
|
||||
// $id = $this->input->post('id');
|
||||
$data['business_id'] = user()->business_id;
|
||||
$table="employee_history";
|
||||
$create_user = $this->MY_Model->insert($data,$table);
|
||||
redirect('Employee/editEmployee/'.md5($this->input->post('emp_id')));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function createEmp()
|
||||
{
|
||||
//insert in users table
|
||||
$data = array(
|
||||
|
||||
'business_id' => user()->business_id,
|
||||
'name' => $this->input->post('name'),
|
||||
'email' => $this->input->post('email'),
|
||||
'user_name' => $this->input->post('user_name'),
|
||||
'mobile' => $this->input->post('mobile'),
|
||||
'password' => hash_password($this->input->post('password'))
|
||||
|
||||
);
|
||||
|
||||
$table="users";
|
||||
$create_user = $this->MY_Model->insert($data,$table);
|
||||
|
||||
//audit
|
||||
if($create_user)
|
||||
{
|
||||
//set id $ table name for audit history
|
||||
$this->audit->set('id',$create_user);
|
||||
$this->audit->set('table',$table);
|
||||
//fetch new_data after post data insert
|
||||
$this->audit->fetch('new_data');
|
||||
//audit history generation for insert
|
||||
$test = $this->audit->create_history('insert');
|
||||
}
|
||||
|
||||
//file upload confic
|
||||
$config['upload_path'] = APPPATH. '../assets/uploads/';
|
||||
$config['allowed_types'] = 'gif|jpg|png|jpeg';
|
||||
$config['max_size'] = 80000;
|
||||
//upload
|
||||
$this->load->library('upload', $config);
|
||||
$this->upload->initialize($config);
|
||||
if ( ! $this->upload->do_upload('image'))
|
||||
{
|
||||
$error = array('error' => $this->upload->display_errors());
|
||||
|
||||
}
|
||||
|
||||
$upload_image = $this->upload->data();
|
||||
|
||||
//insert in employees table
|
||||
if($create_user == true)
|
||||
{
|
||||
|
||||
$data=$this->input->post();
|
||||
unset($data['name']);
|
||||
unset($data['email']);
|
||||
unset($data['user_name']);
|
||||
unset($data['mobile']);
|
||||
unset($data['password']);
|
||||
unset($data['confirm_password']);
|
||||
$data['user_id'] = $create_user;
|
||||
$data['profile_pic'] = $upload_image['file_name'];
|
||||
$data['business_id'] = user()->business_id;
|
||||
|
||||
$table="employees";
|
||||
$create_emp_details = $this->MY_Model->insert($data,$table);
|
||||
}
|
||||
//audit
|
||||
if($create_emp_details)
|
||||
{
|
||||
//set id $ table name for audit history
|
||||
$this->audit->set('id',$create_user);
|
||||
$this->audit->set('table',$table);
|
||||
//fetch new_data after post data insert
|
||||
$this->audit->fetch('new_data');
|
||||
//audit history generation for insert
|
||||
$test = $this->audit->create_history('insert');
|
||||
}
|
||||
redirect('Employee/addEmployee');
|
||||
|
||||
}
|
||||
|
||||
public function add_employee_file()
|
||||
{
|
||||
// print_r($this->input->post());die();
|
||||
$data=$this->input->post();
|
||||
$data['business_id'] = user()->business_id;
|
||||
// $data['emp_id'] = $this->input->post('emp_id');
|
||||
|
||||
//file upload confic
|
||||
$config['upload_path'] = APPPATH. '../assets/uploads/';
|
||||
$config['allowed_types'] = 'gif|jpg|png|pdf|jpeg';
|
||||
$config['max_size'] = 80000;
|
||||
//upload
|
||||
$this->load->library('upload', $config);
|
||||
$this->upload->initialize($config);
|
||||
if ( ! $this->upload->do_upload('file_name'))
|
||||
{
|
||||
$error = array('error' => $this->upload->display_errors());
|
||||
} else{
|
||||
$upload_image = $this->upload->data();
|
||||
$data['file_name'] = $upload_image['file_name'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
$table="employee_doc";
|
||||
unset($data['image1']);
|
||||
$create_user = $this->MY_Model->insert($data,$table);
|
||||
//audit
|
||||
if($create_user)
|
||||
{
|
||||
//set id $ table name for audit history
|
||||
$this->audit->set('id',$create_user);
|
||||
$this->audit->set('table',$table);
|
||||
//fetch new_data after post data insert
|
||||
$this->audit->fetch('new_data');
|
||||
//audit history generation for insert
|
||||
$test = $this->audit->create_history('insert');
|
||||
}
|
||||
redirect('Employee/editEmployee/'.md5($this->input->post('emp_id')));
|
||||
|
||||
}
|
||||
|
||||
|
||||
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');
|
||||
$empData = $this->Emp_model->get_emp_by_md5_id($id,user()->business_id);
|
||||
$manager_name = $this->Emp_model->get_manager_name($empData->manager);
|
||||
$manager = $this->Emp_model->get_employee(user()->business_id);
|
||||
$data = array(
|
||||
|
||||
'submit_button_title' => 'update' ,
|
||||
'heading' => 'Edit' ,
|
||||
'id' => $empData->user_id ,
|
||||
'images' => $images,
|
||||
'add_education' => $add_education,
|
||||
'employee_history' => $employee_history
|
||||
);
|
||||
|
||||
$emp_sub_list_htmlPage = $this->load->view('emp_sub_list.php',$data,true);
|
||||
$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));
|
||||
$this->layout->set('emp_sub_list_htmlPage', $emp_sub_list_htmlPage);
|
||||
$this->layout->set('editData', $empData);
|
||||
$this->layout->buffer('main_content', 'Employee/edit_emp');
|
||||
$this->layout->render('Employee_Layout');
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function editEmployees()
|
||||
{
|
||||
$table = "users";
|
||||
$id = $this->input->post('user_id');
|
||||
|
||||
//set id $ table name for audit history
|
||||
$this->audit->set('id',$this->input->post('id'));
|
||||
$this->audit->set('table',$table);
|
||||
//fetch old_data before new_data update
|
||||
$this->audit->fetch('old_data');
|
||||
|
||||
$action = array(
|
||||
'name' => $this->input->post('name'),
|
||||
'email' => $this->input->post('email'),
|
||||
'mobile' => $this->input->post('mobile'),
|
||||
);
|
||||
//set id $ table name for audit history
|
||||
$this->audit->set('id',$this->input->post('user_id'));
|
||||
$this->audit->set('table',$table);
|
||||
//fetch old_data before new_data update
|
||||
$this->audit->fetch('old_data');
|
||||
//update new data
|
||||
$empuserData = $this->MY_Model->edit_option($action, $id, $table);
|
||||
if($empuserData)
|
||||
{
|
||||
//fetch new_data after post data update
|
||||
$this->audit->fetch('new_data');
|
||||
//audit history generation for update
|
||||
$test = $this->audit->create_history('update');
|
||||
}
|
||||
|
||||
|
||||
$table="employees";
|
||||
$action = $this->input->post();
|
||||
unset($action['name']);
|
||||
unset($action['email']);
|
||||
unset($action['mobile']);
|
||||
|
||||
//file upload confic
|
||||
$config['upload_path'] = APPPATH. '../assets/uploads/';
|
||||
$config['allowed_types'] = 'gif|jpg|png|jpeg';
|
||||
$config['max_size'] = 80000;
|
||||
//upload
|
||||
$this->load->library('upload', $config);
|
||||
$this->upload->initialize($config);
|
||||
if ( ! $this->upload->do_upload('image'))
|
||||
{
|
||||
$error = array('error' => $this->upload->display_errors());
|
||||
|
||||
unset($action['asset_img']);
|
||||
} else{
|
||||
$upload_image = $this->upload->data();
|
||||
$action['profile_pic'] = $upload_image['file_name'];
|
||||
|
||||
}
|
||||
|
||||
$id = $this->input->post('id');
|
||||
//set id $ table name for audit history
|
||||
$this->audit->set('id',$this->input->post('id'));
|
||||
$this->audit->set('table',$table);
|
||||
//fetch old_data before new_data update
|
||||
$this->audit->fetch('old_data');
|
||||
//update new data
|
||||
$empData = $this->MY_Model->edit_option($action, $id, $table);
|
||||
if($empData)
|
||||
{
|
||||
//fetch new_data after post data update
|
||||
$this->audit->fetch('new_data');
|
||||
//audit history generation for update
|
||||
$test = $this->audit->create_history('update');
|
||||
}
|
||||
redirect('Employee/empList');
|
||||
|
||||
}
|
||||
|
||||
public function getDeleteConfirmationPopup()
|
||||
{
|
||||
$data = array();
|
||||
$htmlPage = $this->load->view('confirmation_popup.php',$data,true);
|
||||
echo json_encode($htmlPage);
|
||||
}
|
||||
|
||||
public function deleteEmp()
|
||||
{
|
||||
$id = $this->input->post('id');
|
||||
$Data = $this->Emp_model->delete_emp_by_md5_id($id,user()->business_id);
|
||||
redirect('Employee/empList');
|
||||
}
|
||||
|
||||
public function deleteEmpImage()
|
||||
{
|
||||
$id = $this->input->post('id');
|
||||
$empData = $this->Emp_model->get_emp_by_md5_id($this->input->post('id'),user()->business_id,'employees');
|
||||
$Data = $this->Emp_model->delete_emp_by_md5_id($id,user()->business_id,'employee_doc');
|
||||
redirect('Employee/editEmployee/'.md5($empData->emp_id));
|
||||
}
|
||||
|
||||
public function deleteEmpQualification()
|
||||
{
|
||||
$id = $this->input->post('id');
|
||||
$empData = $this->Emp_model->get_emp_by_md5_id($this->input->post('id'),user()->business_id,'employee_qualification');
|
||||
$Data = $this->Emp_model->delete_emp_by_md5_id($id,user()->business_id,'employee_qualification');
|
||||
redirect('Employee/editEmployee/'.md5($empData->emp_id));
|
||||
}
|
||||
|
||||
public function deleteEmpHistory()
|
||||
{
|
||||
$id = $this->input->post('id');
|
||||
$empData = $this->Emp_model->get_emp_by_md5_id($this->input->post('id'),user()->business_id,'employee_history');
|
||||
$Data = $this->Emp_model->delete_emp_by_md5_id($id,user()->business_id,'employee_history');
|
||||
redirect('Employee/editEmployee/'.md5($empData->emp_id));
|
||||
}
|
||||
|
||||
public function view_emp_history($id)
|
||||
{
|
||||
$table = 'employees';
|
||||
$user_history = $this->audit_model->get_history( $id , $table , user()->business_id);
|
||||
$data = array('title'=> "Employee History" , 'name' => 'Employee' , 'user_history'=> $user_history );
|
||||
$htmlPage = $this->load->view('view_history.php',$data,true);
|
||||
echo json_encode($htmlPage);
|
||||
}
|
||||
|
||||
public function editEmp_qualification($id)
|
||||
{
|
||||
$table = 'employee_qualification';
|
||||
$data = $this->Emp_model->get_data(user()->business_id , $id , $table);
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
public function editEmp_history($id)
|
||||
{
|
||||
$table = 'employee_history';
|
||||
$data = $this->Emp_model->get_data(user()->business_id , $id , $table);
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 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 = '<option>--select Employee--</option>';
|
||||
// foreach($emp as $val)
|
||||
// {
|
||||
// if($val->user_id != user()->id)
|
||||
// {
|
||||
// $html .='<option id="'.$val->manager.'" value="'.$val->user_id.'">'.$val->name.'</option>';
|
||||
// }
|
||||
// }
|
||||
// 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 '<pre>';
|
||||
// // 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 '<pre>';
|
||||
// // 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');
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
0
application/modules/Employee/models/.gitkeep
Normal file
80
application/modules/Employee/models/Employee_model.php
Normal file
@ -0,0 +1,80 @@
|
||||
<?php
|
||||
class Employee_model extends MY_Model {
|
||||
|
||||
public function get_employee($business_id)
|
||||
{
|
||||
|
||||
$this->db->select('users.*, employees.*');
|
||||
$this->db->from('users');
|
||||
$this->db->join('employees', 'employees.user_id = users.id');
|
||||
$this->db->where('users.business_id', $business_id);
|
||||
$this->db->where('users.is_active', 1);
|
||||
$this->db->where('employees.is_active', 1);
|
||||
$query = $this->db->get();
|
||||
|
||||
if ($query->num_rows() > 0) {
|
||||
return $query->result();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public function get_emp_by_md5_id($id,$business_id)
|
||||
{
|
||||
|
||||
$this->db->select('users.*, employees.*');
|
||||
$this->db->from('users');
|
||||
$this->db->join('employees', 'users.id = employees.user_id');
|
||||
$this->db->where('users.is_active', 1);
|
||||
$this->db->where('employees.is_active', 1);
|
||||
$this->db->where('users.business_id', $business_id);
|
||||
$this->db->where('md5(employees.user_id)', $id);
|
||||
|
||||
|
||||
$query = $this->db->get();
|
||||
|
||||
if ($query->num_rows() > 0) {
|
||||
return $query->row();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function delete_emp_by_md5_id($id,$business_id)
|
||||
{
|
||||
$this->db->where('id', $id);
|
||||
$this->db->where('business_id', $business_id);
|
||||
$this->db->set('is_active',0);
|
||||
$this->db->update('users');
|
||||
$this->db->where('user_id', $id);
|
||||
$this->db->where('business_id', $business_id);
|
||||
$this->db->set('is_active',0);
|
||||
$this->db->update('employees');
|
||||
return;
|
||||
}
|
||||
|
||||
public function get_data($business_id , $id , $table)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from($table);
|
||||
$this->db->where('md5(emp_id)', $id);
|
||||
$this->db->where('business_id', $business_id);
|
||||
$this->db->where('is_active', 1);
|
||||
$query = $this->db->get();
|
||||
$query = $query->result();
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function get_manager_name($manager_id)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('users');
|
||||
$this->db->where('id', $manager_id);
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
0
application/modules/Employee/views/.gitkeep
Normal file
272
application/modules/Employee/views/add_emp.php
Normal file
@ -0,0 +1,272 @@
|
||||
|
||||
<!-- Body page content -->
|
||||
|
||||
|
||||
|
||||
<div class="">
|
||||
<div class="page-title">
|
||||
<div class="title_left"><h3>Add Employee</h3></div>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
<div class="x_panel">
|
||||
<!-- <div class="x_title">
|
||||
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<li><a class="collapse-link"><i id="chevron" class="fa fa-chevron-up"></i></a></li>
|
||||
</li>
|
||||
</ul>
|
||||
<h6>Add Employee Information</h6>
|
||||
<div class="clearfix"></div>
|
||||
</div> -->
|
||||
<!-- <div class="x_content"> -->
|
||||
<br />
|
||||
<form id="form" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Employee/createEmp" enctype="multipart/form-data">
|
||||
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
|
||||
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
|
||||
</li>
|
||||
|
||||
<div class="x_title">
|
||||
<h5>Personal Information<a style="color:red;">*</a> <i id="chevron1" class=" collapse-link " aria-hidden="true" data-toggle="collapse" data-target="#demo" style="font-size:20px;"></i></h5>
|
||||
<div class="clearfix"></div>
|
||||
</div><br />
|
||||
<div class="collapse" id="demo">
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Name<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="text" id="name" name="name" value="<?php if(isset($editData)) { echo $editData->name; } ?>" required="required" class="form-control ">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="email"> Email<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="email" name="email" value="<?php if(isset($editData)) { echo $editData->email; } ?>" required="required" class="form-control" type="email" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="email"> Mobile<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="mobile" name="mobile" value="<?php if(isset($editData)) { echo $editData->mobile; } ?>" required="required" class="form-control" type="text">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name">Department<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="department" name="department" required="required" class="form-control" >
|
||||
<option value="<?php if(isset($editData)) { echo $editData->department; } ?>"><?php if(isset($assetData)) { echo $editData->department; } ?></option>
|
||||
<?php foreach ($departmentData as $key => $value) { ?>
|
||||
<option value="<?php echo $value->name; ?>"><?php echo $value->name; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="email"> Gender<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 " style="padding:10px;">
|
||||
<input type="radio" name="gender" value="male" />Male
|
||||
<input type="radio" name="gender" value="female" />Female
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name">Marital Status<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="marital_status" name="marital_status" required="required" class="form-control" >
|
||||
<option value="">--Select--</option>
|
||||
<option value="single">Single</option>
|
||||
<option value="married">Married</option>
|
||||
<option value="others">Others</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Username<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-3 col-sm-3 ">
|
||||
<input type="text" id="user_name" name="user_name" value="" required="required" class="form-control ">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Password<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-3 col-sm-3 ">
|
||||
<input type="password" id="password" minlength="8" name="password" value="" required="required" class="form-control " title="password must have alphabets 
password requires 6 characters minimum">
|
||||
<span toggle="#password" id="toggle-password" class="fa fa-fw fa-eye field-icon toggle-password"></span>
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Confirm Password<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-3 col-sm-3 ">
|
||||
<input type="password" id="confirm_password" name="confirm_password" value="" required="required" class="form-control ">
|
||||
<span id='message'></span>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- ----------------------------------------- -->
|
||||
<div class="x_title">
|
||||
<h5>Emergency Contact <i id="chevron2" class="fa fa-chevron-circle-down" aria-hidden="true" data-toggle="collapse" data-target="#demo1" style="font-size:20px;"></i></h5>
|
||||
<div class=""></div>
|
||||
</div><br />
|
||||
<div class="collapse" id="demo1">
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Name</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="text" id="relation_name" name="relation_name" value="<?php if(isset($editData)) { echo $editData->name; } ?>" class="form-control ">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="email"> Relationship</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="relationship" name="relationship" value="<?php if(isset($editData)) { echo $editData->email; } ?>" class="form-control" type="text" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Mobile</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="text" id="relation_mobile" name="relation_mobile" value="<?php if(isset($editData)) { echo $editData->name; } ?>" class="form-control ">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="email"> Home Tel</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="relation_tel" name="relation_tel" value="<?php if(isset($editData)) { echo $editData->relation_tel; } ?>" class="form-control" type="text" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- ----------------------------------------- -->
|
||||
<div class="x_title">
|
||||
<h5>Address Details <i id="chevron3" class="fa fa-chevron-circle-down" aria-hidden="true" data-toggle="collapse" data-target="#demo2" style="font-size:20px;"></i></h5>
|
||||
<div class="clearfix"></div>
|
||||
</div><br />
|
||||
<div class="collapse" id="demo2">
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Address</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="text" id="address" name="address" value="<?php if(isset($editData)) { echo $editData->address; } ?>" class="form-control ">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="email"> City</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="city" name="city" value="<?php if(isset($editData)) { echo $editData->city; } ?>" class="form-control" type="text" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> State</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="text" id="state" name="state" value="<?php if(isset($editData)) { echo $editData->state; } ?>" class="form-control ">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="email"> Pincode</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="pincode" name="pincode" value="<?php if(isset($editData)) { echo $editData->pincode; } ?>" class="form-control" type="text" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- ----------------------------------------------------------------------------------->
|
||||
<div class="x_title">
|
||||
<h5>Additional Information <i id="chevron4" class="fa fa-chevron-circle-down" aria-hidden="true" data-toggle="collapse" data-target="#demo3" style="font-size:20px;"></i></h5>
|
||||
<div class="clearfix"></div>
|
||||
</div><br/>
|
||||
<div class="collapse" id="demo3">
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Employee Id</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="text" id="employee_id" name="emp_id" value="<?php if(isset($editData)) { echo $editData->name; } ?>" class="form-control ">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="email">Join date</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="j_date" name="j_date" value="<?php if(isset($editData)) { echo $editData->email; } ?>" class="form-control" type="date" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="email"> Salary</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="salary" name="salary" value="<?php if(isset($editData)) { echo $editData->mobile; } ?>" class="form-control" type="text">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Comment</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="comment" name="comment" value="<?php if(isset($editData)) { echo $editData->mobile; } ?>" class="form-control" type="text">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Photo Upload</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="file" id="image" name="image" value="<?php if(isset($editData)) { echo $editData->profile_pic; } ?>" class="form-control ">
|
||||
<img class="profilepic__image" style="width: 50%; display: block;padding:10px;" src="" alt="Avatar">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Manager</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="manager" name="manager" class="form-control">
|
||||
<option value="">--Select--</option>
|
||||
<?php foreach ($manager as $key => $value) { ?>
|
||||
<option value="<?php echo $value->user_id; ?>"><?php echo $value->name; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- ----------------------------------------- -->
|
||||
|
||||
<div class="ln_solid"></div>
|
||||
<div class="item form-group">
|
||||
<div class="offset-md-8">
|
||||
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
||||
<button class="btn btn-primary" type="reset">Reset</button>
|
||||
<button type="submit" class="btn btn-success">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Body page content -->
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
// $('.fa fa-chevron-up').click();
|
||||
// setTimeout(() => { $('#chevron1').click(); }, 500);
|
||||
});
|
||||
|
||||
|
||||
$(document).on('change','#image',function(){
|
||||
|
||||
const file = this.files[0];
|
||||
if (file){
|
||||
let reader = new FileReader();
|
||||
reader.onload = function(event){
|
||||
$('#image').attr('src', event.target.result);
|
||||
$('.profilepic__image').attr('src', event.target.result);
|
||||
}
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
398
application/modules/Employee/views/add_emp1.php
Normal file
@ -0,0 +1,398 @@
|
||||
<div class="col-md-12 col-sm-12">
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>Add Employee</h2>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="x_content">
|
||||
|
||||
<div class="col-xs-3">
|
||||
<!-- Nav tabs -->
|
||||
<div class="nav nav-tabs flex-column bar_tabs" id="v-pills-tab" role="tablist" aria-orientation="vertical">
|
||||
<a class="nav-link active" id="personal_detail-tab" data-toggle="pill" href="#personal_detail" role="tab" aria-controls="personal_detail" aria-selected="true">Personal Details</a>
|
||||
<a class="nav-link" id="contact_detail-tab" data-toggle="pill" href="#contact_detail" role="tab" aria-controls="contact_detail" aria-selected="false">Contact Detail</a>
|
||||
<a class="nav-link" id="qualification-tab" data-toggle="pill" href="#qualification" role="tab" aria-controls="qualification" aria-selected="false">Qualification</a>
|
||||
<a class="nav-link" id="employee_history-tab" data-toggle="pill" href="#employee_history" role="tab" aria-controls="employee_history" aria-selected="false">Employee History</a>
|
||||
<a class="nav-link" id="additional_info-tab" data-toggle="pill" href="#additional_info" role="tab" aria-controls="additional_info" aria-selected="false">Additional Information</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12">
|
||||
<!-- Tab panes -->
|
||||
<div class="tab-content" id="v-pills-tabContent">
|
||||
|
||||
<!-- ---------------------------------------------------personal_detail----------------------------------------------------- -->
|
||||
|
||||
<div class="tab-pane fade show active" id="personal_detail" role="tabpanel" aria-labelledby="personal_detail-tab">
|
||||
|
||||
<h6>Personal Details</h6>
|
||||
<div class="clearfix"></div>
|
||||
<div class="x_content">
|
||||
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Employee/createEmp" enctype="multipart/form-data">
|
||||
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="first-name"> Name<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="text" id="name" name="name" value="<?php if(isset($editData)) { echo $editData->name; } ?>" required="required" class="form-control ">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="email"> Email<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="email" name="email" value="<?php if(isset($editData)) { echo $editData->email; } ?>" required="required" class="form-control" type="email" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="email"> Mobile<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="mobile" name="mobile" value="<?php if(isset($editData)) { echo $editData->mobile; } ?>" required="required" class="form-control" type="text">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="first-name">Department<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="department" name="department" required="required" class="form-control" >
|
||||
<option value="<?php if(isset($editData)) { echo $editData->department; } ?>"><?php if(isset($assetData)) { echo $editData->department; } ?></option>
|
||||
<?php foreach ($departmentData as $key => $value) { ?>
|
||||
<option value="<?php echo $value->id; ?>"><?php echo $value->name; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="email"> Gender<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 " style="padding:10px;">
|
||||
<input type="radio" name="gender" value="male" />Male
|
||||
<input type="radio" name="gender" value="female" />Female
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="first-name">Marital Status<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="marital_status" name="marital_status" required="required" class="form-control" >
|
||||
<option value="">--Select--</option>
|
||||
<option value="single">Single</option>
|
||||
<option value="married">Married</option>
|
||||
<option value="others">Others</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<br /> <h6>Emergency Contact</h6> <div class="x_title"> </div> <br />
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="first-name"> Name<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="text" id="relation_name" name="relation_name" value="<?php if(isset($editData)) { echo $editData->name; } ?>" required="required" class="form-control ">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="email"> Relationship<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="Relationship" name="Relationship" value="<?php if(isset($editData)) { echo $editData->email; } ?>" required="required" class="form-control" type="text" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="first-name"> Mobile<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="text" id="relation_mobile" name="relation_mobile" value="<?php if(isset($editData)) { echo $editData->name; } ?>" required="required" class="form-control ">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="email"> Home Tel<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="relation_tel" name="relation_tel" value="<?php if(isset($editData)) { echo $editData->email; } ?>" required="required" class="form-control" type="text" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<div class="ln_solid"></div>
|
||||
<div class="item form-group">
|
||||
<div class="offset-md-8">
|
||||
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
||||
<button type="submit" class="btn btn-success">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ---------------------------------------------------contact_detail----------------------------------------------------- -->
|
||||
|
||||
<div class="tab-pane fade" id="contact_detail" role="tabpanel" aria-labelledby="contact_detail-tab">
|
||||
<h6>Contact Details</h6>
|
||||
<div class="clearfix"></div>
|
||||
<div class="x_content">
|
||||
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Employee/createEmp" enctype="multipart/form-data">
|
||||
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="first-name"> Address<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="text" id="address" name="address" value="<?php if(isset($editData)) { echo $editData->name; } ?>" required="required" class="form-control ">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="email"> City<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="city" name="city" value="<?php if(isset($editData)) { echo $editData->email; } ?>" required="required" class="form-control" type="text" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="email"> State<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="state" name="state" value="<?php if(isset($editData)) { echo $editData->mobile; } ?>" required="required" class="form-control" type="text">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="first-name">Postal Code<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="pincode" name="pincode" value="<?php if(isset($editData)) { echo $editData->mobile; } ?>" required="required" class="form-control" type="text">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="email"> Country<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="country" name="country" value="<?php if(isset($editData)) { echo $editData->mobile; } ?>" required="required" class="form-control" type="text">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
<div class="ln_solid"></div>
|
||||
<div class="item form-group">
|
||||
<div class="offset-md-8">
|
||||
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
||||
<button type="submit" class="btn btn-success">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ---------------------------------------------------qualification----------------------------------------------------- -->
|
||||
|
||||
<div class="tab-pane fade" id="qualification" role="tabpanel" aria-labelledby="qualification-tab">
|
||||
<h6>Add Education</h6>
|
||||
<div class="clearfix"></div>
|
||||
<div class="x_content">
|
||||
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Employee/createEmp" enctype="multipart/form-data">
|
||||
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
|
||||
<!-- <div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="first-name"> Company<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="text" id="company" name="company" value="<?php if(isset($editData)) { echo $editData->name; } ?>" required="required" class="form-control ">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="email"> Job Title<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="job_title" name="job_title" value="<?php if(isset($editData)) { echo $editData->email; } ?>" required="required" class="form-control" type="text" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="email"> From<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="from" name="from" value="<?php if(isset($editData)) { echo $editData->mobile; } ?>" required="required" class="form-control" type="text">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="first-name"> To<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="to" name="to" value="<?php if(isset($editData)) { echo $editData->mobile; } ?>" required="required" class="form-control" type="text">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="email"> Comment<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-12 col-sm-12 " >
|
||||
<input id="country" name="country" value="<?php if(isset($editData)) { echo $editData->mobile; } ?>" required="required" class="form-control" type="text">
|
||||
</div>
|
||||
|
||||
</div> -->
|
||||
|
||||
<!-- <br /> <h6>Add Education</h6> <div class="x_title"> </div> <br /> -->
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="first-name"> Level<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="text" id="level" name="level" value="<?php if(isset($editData)) { echo $editData->name; } ?>" required="required" class="form-control ">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="email"> Institute<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="institute" name="institute" value="<?php if(isset($editData)) { echo $editData->email; } ?>" required="required" class="form-control" type="text" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="first-name"> Major<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="text" id="major" name="major" value="<?php if(isset($editData)) { echo $editData->name; } ?>" required="required" class="form-control ">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="email"> GPA/Score<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="cgpa" name="cgpa" value="<?php if(isset($editData)) { echo $editData->email; } ?>" required="required" class="form-control" type="text" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="email"> From<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="q_from" name="q_from" value="<?php if(isset($editData)) { echo $editData->mobile; } ?>" required="required" class="form-control" type="text">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="first-name"> To<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="q_to" name="q_to" value="<?php if(isset($editData)) { echo $editData->mobile; } ?>" required="required" class="form-control" type="text">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<div class="ln_solid"></div>
|
||||
<div class="item form-group">
|
||||
<div class="offset-md-8">
|
||||
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
||||
<button type="submit" class="btn btn-success">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ---------------------------------------------------employee_history----------------------------------------------------- -->
|
||||
|
||||
<div class="tab-pane fade" id="employee_history" role="tabpanel" aria-labelledby="employee_history-tab">
|
||||
<h6>Employee History</h6>
|
||||
<div class="clearfix"></div>
|
||||
<div class="x_content">
|
||||
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Employee/createEmp" enctype="multipart/form-data">
|
||||
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="first-name"> Company Name<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="text" id="c_name" name="c_name" value="<?php if(isset($editData)) { echo $editData->name; } ?>" required="required" class="form-control ">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="email"> Role<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="role" name="role" value="<?php if(isset($editData)) { echo $editData->email; } ?>" required="required" class="form-control" type="text" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="email"> From<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="h_from" name="from" value="<?php if(isset($editData)) { echo $editData->mobile; } ?>" required="required" class="form-control" type="text">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="first-name"> To<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="h_to" name="to" value="<?php if(isset($editData)) { echo $editData->mobile; } ?>" required="required" class="form-control" type="text">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
<div class="ln_solid"></div>
|
||||
<div class="item form-group">
|
||||
<div class="offset-md-8">
|
||||
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
||||
<button type="submit" class="btn btn-success">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ---------------------------------------------------additional_info----------------------------------------------------- -->
|
||||
|
||||
<div class="tab-pane fade" id="additional_info" role="tabpanel" aria-labelledby="additional_info-tab">
|
||||
<h6>Additional Information</h6>
|
||||
<div class="clearfix"></div>
|
||||
<div class="x_content">
|
||||
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Employee/createEmp" enctype="multipart/form-data">
|
||||
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="first-name"> Employee Id<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="text" id="employee_id" name="employee_id" value="<?php if(isset($editData)) { echo $editData->name; } ?>" required="required" class="form-control ">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="email">Join date<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="j_date" name="j_date" value="<?php if(isset($editData)) { echo $editData->email; } ?>" required="required" class="form-control" type="text" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="email"> Salary<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="salary" name="salary" value="<?php if(isset($editData)) { echo $editData->mobile; } ?>" required="required" class="form-control" type="text">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-2 col-sm-1 " for="first-name"> Comment<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="comment" name="comment" value="<?php if(isset($editData)) { echo $editData->mobile; } ?>" required="required" class="form-control" type="text">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
<div class="ln_solid"></div>
|
||||
<div class="item form-group">
|
||||
<div class="offset-md-8">
|
||||
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
||||
<button type="submit" class="btn btn-success">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ----------------------------------------------------------------------------------------------------------------------- -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
26
application/modules/Employee/views/confirmation_popup.php
Normal file
@ -0,0 +1,26 @@
|
||||
|
||||
|
||||
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<h6 class="modal-title" id="myModalLabel2">Are you sure you want to delete</h6>
|
||||
<button type="button" id="close-form" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
</br>
|
||||
<center>
|
||||
<form class="delete_url" method="post" action="" id="">
|
||||
<button type="button" class="btn btn-sm btn-secondary" id="close-form" data-dismiss="modal" aria-label="Close">No</button>
|
||||
|
||||
<input type="hidden" class="delete_id" name="id" value="">
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>" >
|
||||
<button type="submit" class="btn btn-sm btn-primary" id="">Yes</button>
|
||||
</form>
|
||||
</center>
|
||||
</br>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
289
application/modules/Employee/views/edit_emp.php
Normal file
@ -0,0 +1,289 @@
|
||||
|
||||
<!-- Body page content -->
|
||||
|
||||
|
||||
|
||||
<div class="">
|
||||
<div class="page-title">
|
||||
|
||||
<div class="title_left">
|
||||
<h3>Edit Employee</h3>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
<div class="x_panel">
|
||||
<!-- <div class="x_title">
|
||||
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
|
||||
</li>
|
||||
</ul>
|
||||
<h6>General Information</h6>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="x_content"> -->
|
||||
<br />
|
||||
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Employee/editEmployees" enctype="multipart/form-data">
|
||||
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
<input type="hidden" name="id" value="<?php echo $editData->id; ?>">
|
||||
<input type="hidden" name="user_id" value="<?php echo $editData->user_id; ?>">
|
||||
|
||||
<div class="x_title">
|
||||
<h5>Personal Information<a style="color:red;">*</a> <i id="chevron1" class="fa fa-chevron-circle-down" aria-hidden="true" data-toggle="collapse" data-target="#demo" style="font-size:20px;"></i></h5>
|
||||
<div class="clearfix"></div>
|
||||
</div><br />
|
||||
<div class="collapse" id="demo">
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Name<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="text" id="name" name="name" value="<?php if(isset($editData)) { echo $editData->name; } ?>" required="required" class="form-control ">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="email"> Email<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="email" name="email" value="<?php if(isset($editData)) { echo $editData->email; } ?>" required="required" class="form-control" type="email" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="email"> Mobile<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="mobile" name="mobile" value="<?php if(isset($editData)) { echo $editData->mobile; } ?>" required="required" class="form-control" type="tel" >
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name">Department<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="department" name="department" required="required" class="form-control" placeholder="choose" <?php if(isset($viewData)) { echo "readonly"; } ?>>
|
||||
<option value="<?php echo $editData->department; ?>"><?php echo $editData->department; ?></option>
|
||||
<?php foreach ($departmentData as $key => $value) { ?>
|
||||
<option value="<?php echo $value->name; ?>"><?php echo $value->name; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="email"> Gender<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 " style="padding:10px;">
|
||||
<?php
|
||||
if ($editData->gender == 'male')
|
||||
{
|
||||
echo '<input type="radio" name="gender" value="male" checked/>Male';
|
||||
echo '  ';
|
||||
echo '<input type="radio" name="gender" value="female" />Female';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<input type="radio" name="gender" value="male"/>Male';
|
||||
echo '  ';
|
||||
echo '<input type="radio" name="gender" value="female" checked/>Female';
|
||||
} ?>
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name">Marital Status<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="marital_status" name="marital_status" required="required" class="form-control" placeholder="choose" <?php if(isset($viewData)) { echo "readonly"; } ?>>
|
||||
<option value="<?php echo $editData->marital_status; ?>"><?php echo ucfirst($editData->marital_status); ?></option>
|
||||
<?php
|
||||
if ($editData->marital_status != 'single')
|
||||
{
|
||||
echo '<option value="single">Single</option>';
|
||||
}
|
||||
if ($editData->marital_status != 'married')
|
||||
{
|
||||
echo '<option value="married">Married</option>';
|
||||
}
|
||||
if ($editData->marital_status != 'others')
|
||||
{
|
||||
echo '<option value="others">Others</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- ----------------------------------------- -->
|
||||
<div class="x_title">
|
||||
<h5>Emergency Contact <i id="chevron2" class="fa fa-chevron-circle-down" aria-hidden="true" data-toggle="collapse" data-target="#demo1" style="font-size:20px;"></i></h5>
|
||||
<div class=""></div>
|
||||
</div><br />
|
||||
<div class="collapse" id="demo1">
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Name</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="text" id="relation_name" name="relation_name" value="<?php if(isset($editData)) { echo $editData->relation_name; } ?>" class="form-control ">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="email"> Relationship</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="relationship" name="relationship" value="<?php if(isset($editData)) { echo $editData->relationship; } ?>" class="form-control" type="text" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Mobile</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="text" id="relation_mobile" name="relation_mobile" value="<?php if(isset($editData)) { echo $editData->relation_mobile; } ?>" class="form-control ">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="email"> Home Tel</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="relation_tel" name="relation_tel" value="<?php if(isset($editData)) { echo $editData->relation_tel; } ?>" class="form-control" type="text" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- ----------------------------------------- -->
|
||||
<div class="x_title">
|
||||
<h5>Address Detail <i id="chevron2" class="fa fa-chevron-circle-down" aria-hidden="true" data-toggle="collapse" data-target="#demo2" style="font-size:20px;"></i></h5>
|
||||
<div class=""></div>
|
||||
</div><br />
|
||||
<div class="collapse" id="demo2">
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Address</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="text" id="address" name="address" value="<?php if(isset($editData)) { echo $editData->address; } ?>" class="form-control ">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="email"> City</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="city" name="city" value="<?php if(isset($editData)) { echo $editData->city; } ?>" class="form-control" type="text" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> State</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="text" id="state" name="state" value="<?php if(isset($editData)) { echo $editData->state; } ?>" class="form-control ">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="email"> Pincode</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="pincode" name="pincode" value="<?php if(isset($editData)) { echo $editData->pincode; } ?>" class="form-control" type="text" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- ----------------------------------------- -->
|
||||
<div class="x_title">
|
||||
<h5>Additional Information <i id="chevron4" class="fa fa-chevron-circle-down" aria-hidden="true" data-toggle="collapse" data-target="#demo3" style="font-size:20px;"></i></h5>
|
||||
<div class="clearfix"></div>
|
||||
</div><br />
|
||||
<div class="collapse" id="demo3">
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Employee Id</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="text" id="emp_id" name="emp_id" value="<?php if(isset($editData)) { echo $editData->emp_id; } ?>"class="form-control ">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="email"> Joining Date</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="j_date" name="j_date" value="<?php if(isset($editData)) { echo $editData->j_date; } ?>" class="form-control" type="date" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="email"> Salary</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="salary" name="salary" value="<?php if(isset($editData)) { echo $editData->salary; } ?>" class="form-control" type="text">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Comment</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="comment" name="comment" value="<?php if(isset($editData)) { echo $editData->comment; } ?>" class="form-control" type="text">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Photo Upload</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="file" id="image" name="image" value="<?php if(isset($editData->profile_pic)) { echo $editData->profile_pic; } ?>" class="form-control ">
|
||||
<img class="profilepic__image" style="width: 50%; display: block;padding:10px;" src="<?php echo base_url();?>/assets/uploads/<?php echo $editData->profile_pic ?>" alt="Avatar" title="Change the avatar">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Manager</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="manager" name="manager" class="form-control">
|
||||
<option value="<?php echo $manager_name[0]->name; ?>"><?php echo $manager_name[0]->name; ?></option>
|
||||
<?php foreach ($manager as $key => $value) { ?>
|
||||
<option value="<?php echo $value->user_id; ?>"><?php echo $value->name; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <div class="ln_solid"></div> -->
|
||||
<div class="item form-group">
|
||||
<div class=" offset-md-8">
|
||||
<button class="btn btn-primary" onclick="history.back()">Cancel</button>
|
||||
<button type="submit" class="btn btn-success">Update</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br/>
|
||||
|
||||
<div id="sub-value" class="col-md-12 col-sm-12">
|
||||
<?php echo $emp_sub_list_htmlPage; ?>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).on('change','#image',function(){
|
||||
|
||||
const file = this.files[0];
|
||||
if (file){
|
||||
let reader = new FileReader();
|
||||
reader.onload = function(event){
|
||||
$('#image').attr('src', event.target.result);
|
||||
$('.profilepic__image').attr('src', event.target.result);
|
||||
}
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<!-- /Body page content -->
|
||||
105
application/modules/Employee/views/emp_list.php
Normal file
@ -0,0 +1,105 @@
|
||||
<head>
|
||||
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css'>
|
||||
</head>
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
<h2>Employee Details </h2>
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<!-- <?php if(user()->action_permit != 'view' ) { ?> -->
|
||||
<a href="<?php echo base_url();?>Employee/addEmployee" class="btn btn-sm btn-primary">Add Employee</a>
|
||||
<!-- <?php } ?> -->
|
||||
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="x_content">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<table id="datatable-buttons" class="table table-striped table-bordered" width="100%">
|
||||
<thead>
|
||||
<tr class="headings">
|
||||
<th class="column-title">Name </th>
|
||||
<th class="column-title">Email </th>
|
||||
<th class="column-title">Mobile </th>
|
||||
<th class="column-title" >Department </th>
|
||||
<th class="column-title" >Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php if (!is_null($tableData)) {
|
||||
foreach ($tableData as $key => $value) { ?>
|
||||
<tr class="even pointer">
|
||||
<td class=" "> <?php echo $value->name; ?> </td>
|
||||
<!-- <?php if (is_superadmin()) { ?>
|
||||
<td class=" "> <?php echo $value->business ?> </td>
|
||||
<?php
|
||||
} ?> -->
|
||||
<td class=" "><?php echo $value->email; ?> </td>
|
||||
<td class=" "><?php echo $value->mobile; ?></td>
|
||||
<td class=" "><?php echo $value->department; ?></td>
|
||||
<td style=" text-align: center; font-size: 16px;">
|
||||
|
||||
<a href="<?php echo base_url()?>Employee/editEmployee/<?php echo md5($value->user_id);?>" ><i class="fa fa-pencil" title="Edit"></i></a>
|
||||
|
||||
<a><i class="fa fa-trash deleteEmp" data-toggle="modal" data-target=".bs-example-modal-sm" title="Delete" id="<?php echo $value->user_id;?>"></i></a>
|
||||
|
||||
<!-- <a href="<?php echo base_url()?>Employee/deleteEmployee/<?php echo md5($value->id);?>" ><i class="fa fa-trash" title="Edit"></i></a> -->
|
||||
|
||||
<a> <i id="<?php echo md5($value->user_id);?>" class="bi bi-card-list" title="History"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }}?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
||||
<!-- Large modal -->
|
||||
<!-- <button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-lg" hidden>Large modal</button> -->
|
||||
<div class="modal fade bs-example-modal-lg" id="ItemModal" tabindex="-1" role="dialog" aria-hidden="true"></div>
|
||||
<div class="modal bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" id="popup"> </div>
|
||||
|
||||
<div style="display:none" id="sub-value">
|
||||
|
||||
<script>
|
||||
$('.deleteEmp').click(function() {
|
||||
var id = $(this).attr('id');
|
||||
var url = "<?php echo base_url()?>Employee/deleteEmp";
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo base_url()?>Employee/getDeleteConfirmationPopup",
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
$('#popup').html(JSON.parse(data));
|
||||
$('.delete_id').attr('value',id);
|
||||
$('.delete_url').attr('action',url);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$(document).on('click','.bi-card-list',function(){
|
||||
var id = $(this).attr("id")
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "<?php echo base_url()?>Employee/view_emp_history/"+id,
|
||||
success: function(response) {
|
||||
response = JSON.parse(response);
|
||||
console.log(response);
|
||||
$('.bs-example-modal-lg').html(response);
|
||||
$('.bs-example-modal-lg').modal("show");
|
||||
},
|
||||
error: function(jqXHR, textStatus, err) { alert('text status '+textStatus+', err '+err) }
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</div>
|
||||
|
||||
461
application/modules/Employee/views/emp_sub_list.php
Normal file
@ -0,0 +1,461 @@
|
||||
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
<h2>Details</h2>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="x_content">
|
||||
<ul class="nav nav-tabs bar_tabs" id="myTab" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="add_edu-tab" data-toggle="tab" href="#add_education" role="tab" aria-controls="add_edu-tab" aria-selected="true">Employee Education</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="emp_history-tab" data-toggle="tab" href="#employee_history" role="tab" aria-controls="emp_history-tab" aria-selected="true">Employee History</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="upload_files" data-toggle="tab" href="#upload_image" role="tab" aria-controls="upload_files" aria-selected="true">Upload Files</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<div class="tab-content" id="myTabContent">
|
||||
|
||||
|
||||
|
||||
<!------------------------------ add_education ------------------------------->
|
||||
<div class="tab-pane fade" id="add_education" role="tabpanel" aria-labelledby="add_edu-tab">
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<a type="button" class="add_education" id="<?php echo md5($id) ?>" data-toggle="modal" data-target="#edit-form_add_education" style=" text-align: center; font-size: 25px; color:#2A3F54; ">
|
||||
<li class="fa fa-plus-circle" title="Add New"></li></a>
|
||||
<?php } ?>
|
||||
</ul> </br>
|
||||
<div class="card-box table-responsive">
|
||||
<table class="table table-bordered table-striped" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr class="headings">
|
||||
<th class="column-title" width="15%">Level </th>
|
||||
<th class="column-title" width="15%">Institute </th>
|
||||
<th class="column-title" width="15%">Major </th>
|
||||
<th class="column-title" width="10%">GPA/Score </th>
|
||||
<th class="column-title" width="15%">From </th>
|
||||
<th class="column-title" width="15%">To </th>
|
||||
<th class="column-title" width="10%">Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($add_education as $key => $value) { ?>
|
||||
<tr class="even pointer">
|
||||
<td class=" "><?php echo $value->level; ?></td>
|
||||
<td class=" "><?php echo $value->institute; ?></td>
|
||||
<td class=" "><?php echo $value->major; ?></td>
|
||||
<td class=" "><?php echo $value->cgpa; ?></td>
|
||||
<td class=" "><?php echo $value->q_from; ?></td>
|
||||
<td class=" "><?php echo $value->q_to; ?></td>
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<td>
|
||||
<a class="edit_education" id="<?php echo md5($value->emp_id); ?>" style="font-size: 16px;" >
|
||||
<i class="fa fa-pencil" title="Edit"></i></a>
|
||||
|
||||
<a class="deleteAddEducationData" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;" id="<?php echo md5($value->id); ?>">
|
||||
<i class="fa fa-trash " ></i></a>
|
||||
<!-- <a href="<?php echo base_url()?>Asset/deleteThirdPartyData/<?php echo md5($value->id); ?>" style="font-size: 16px;"><i class="fa fa-trash" title="Delete"></i></a> -->
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!------------------------------ emp_hostory --------------------------------->
|
||||
<div class="tab-pane fade" id="employee_history" role="tabpanel" aria-labelledby="emp_history-tab">
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<a type="button" class="employee_history" id="<?php echo md5($id) ?>" data-toggle="modal" data-target="#edit-form_add_history" style=" text-align: center; font-size: 25px; color:#2A3F54; ">
|
||||
<li class="fa fa-plus-circle" title="Add New"></li></a>
|
||||
<?php } ?>
|
||||
</ul> </br>
|
||||
<div class="card-box table-responsive">
|
||||
<table class="table table-bordered table-striped" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr class="headings">
|
||||
<th class="column-title" width="15%">Company Name </th>
|
||||
<th class="column-title" width="15%">Role </th>
|
||||
<th class="column-title" width="15%">From </th>
|
||||
<th class="column-title" width="15%">To </th>
|
||||
<th class="column-title" width="10%">Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($employee_history as $key => $value) { ?>
|
||||
<tr class="even pointer">
|
||||
<td class=" "><?php echo $value->c_name; ?></td>
|
||||
<td class=" "><?php echo $value->role; ?></td>
|
||||
<td class=" "><?php echo $value->h_from; ?></td>
|
||||
<td class=" "><?php echo $value->h_to; ?></td>
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<td>
|
||||
<a class="edit_employee_history" id="<?php echo md5($id) ?>" style="font-size: 16px;" >
|
||||
<i class="fa fa-pencil" title="Edit"></i></a>
|
||||
|
||||
<a class="deleteEmpHistoryData" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;" id="<?php echo md5($value->id); ?>">
|
||||
<i class="fa fa-trash " ></i></a>
|
||||
<!-- <a href="<?php echo base_url()?>Asset/deleteThirdPartyData/<?php echo md5($value->id); ?>" style="font-size: 16px;"><i class="fa fa-trash" title="Delete"></i></a> -->
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!------------------------------ UPLOAD FILE DATA ---------------------------->
|
||||
<div class="tab-pane fade" id="upload_image" role="tabpanel" aria-labelledby="upload_files">
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<!-- <?php if(user()->action_permit != 'view' ) { ?> -->
|
||||
<a type="button" class="add_image_emp" id="<?php echo md5($id) ?>" data-toggle="modal" data-target="#edit-form_add_image" style=" text-align: center; font-size: 25px; color:#2A3F54; ">
|
||||
<li class="fa fa-plus-circle" title="Add New"></li></a>
|
||||
<!-- <?php } ?> -->
|
||||
</ul> </br> </br>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="x_panel">
|
||||
<div class="x_content">
|
||||
<div class="row">
|
||||
<?php foreach ($images as $key => $value) { $EXTENSION = pathinfo($value->file_name, PATHINFO_EXTENSION); ?>
|
||||
|
||||
|
||||
<div class="col-md-55">
|
||||
<div class="thumbnail">
|
||||
<div class="image view view-first">
|
||||
<?php if($EXTENSION == 'pdf') { ?>
|
||||
<embed style="width: 100%; display: block;" src="<?php echo base_url(); ?>assets/uploads/<?php echo $value->file_name; ?>" alt="image" />
|
||||
<?php } else { ?>
|
||||
<img style="width: 100%; display: block;" src="<?php echo base_url(); ?>assets/uploads/<?php echo $value->file_name; ?>" alt="image" />
|
||||
<?php } ?>
|
||||
<div class="mask">
|
||||
<p> </p>
|
||||
<div class="tools tools-bottom">
|
||||
<a class="deleteuploadImage" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;" id="<?php echo md5($value->id);?>"><i class="fa fa-trash" ></i></a>
|
||||
<?php if($EXTENSION == 'pdf') { ?>
|
||||
<a href="<?php echo base_url()?>/assets/uploads/<?php echo $value->file_name; ?>" download><i class="fa fa-download" title="Download"></i></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p><?php echo $value->f_name; ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- ################################################################### -->
|
||||
<!-------------------------------FORM------------------------------>
|
||||
<!-------------------------------FILE MODEL FORM------------------------------>
|
||||
<div class="modal bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" id="edit-form_add_image">
|
||||
<div class="modal-dialog modal-lm">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title" id="myModalLabel2"><?php echo $heading; ?></h3>
|
||||
<button type="button" id="close-form" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<form data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Employee/add_employee_file" enctype="multipart/form-data">
|
||||
<div class="modal-body">
|
||||
<div class="x_content">
|
||||
<br />
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
<input type="hidden" name="emp_id" value="<?php echo $id; ?>">
|
||||
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">Name<a style="color:red;">*</a></label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<input type="text" id="f_name" name="f_name" value="" required="required" class="form-control ">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">File Upload<a style="color:red;">*</a></label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<input type="file" id="file_name" name="file_name" value="" required="required" class="form-control ">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal" id="close-form">Close</button>
|
||||
<button type="submit" class="btn btn-primary"><?php echo $submit_button_title; ?></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-------------------------------add_education MODEL FORM--------------------->
|
||||
<div class="modal bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" id="edit-form_add_education">
|
||||
<div class="modal-dialog modal-lm">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title" id="myModalLabel2"><?php echo $heading; ?></h3>
|
||||
<button type="button" id="close-form" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<form data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Employee/add_employee_education" enctype="multipart/form-data">
|
||||
<div class="modal-body">
|
||||
<div class="x_content">
|
||||
<br />
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
<input type="hidden" name="emp_id" value="<?php echo $id; ?>">
|
||||
<input type="hidden" name="id" class="edu_id" value="">
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">Level<a style="color:red;">*</a></label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<input type="text" id="level" name="level" value="" required="required" class="form-control ">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">Institute<a style="color:red;">*</a></label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<input id="institute" name="institute" value="" required="required" class="form-control" type="text" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">Major<a style="color:red;">*</a></label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<input type="text" id="major" name="major" value="" required="required" class="form-control ">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">GPA/Score<a style="color:red;">*</a></label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<input id="cgpa" name="cgpa" value="" required="required" class="form-control" type="text" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">From<a style="color:red;">*</a></label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<input id="q_from" name="q_from" value="" required="required" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">To<a style="color:red;">*</a></label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<input id="q_to" name="q_to" value="" required="required" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal" id="close-form">Close</button>
|
||||
<button type="submit" class="btn btn-primary"><?php echo $submit_button_title; ?></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-------------------------------emp_history MODEL FORM--------------------->
|
||||
<div class="modal bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" id="edit-form_add_history">
|
||||
<div class="modal-dialog modal-lm">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title" id="myModalLabel2"><?php echo $heading; ?></h3>
|
||||
<button type="button" id="close-form" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<form data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Employee/add_employee_history" enctype="multipart/form-data">
|
||||
<div class="modal-body">
|
||||
<div class="x_content">
|
||||
<br />
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
<input type="hidden" name="emp_id" value="<?php echo $id; ?>">
|
||||
<input type="hidden" name="id" class="his_id" value="">
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">Company Name<a style="color:red;">*</a></label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<input type="text" id="c_name" name="c_name" value="" required="required" class="form-control ">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">Role<a style="color:red;">*</a></label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<input id="role" name="role" value="" required="required" class="form-control" type="text" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">From<a style="color:red;">*</a></label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<input id="h_from" name="h_from" value="" required="required" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">To<a style="color:red;">*</a></label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<input id="h_to" name="h_to" value="" required="required" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal" id="close-form">Close</button>
|
||||
<button type="submit" class="btn btn-primary"><?php echo $submit_button_title; ?></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-------------------------------------------------------------------------->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" id="popup"> </div>
|
||||
|
||||
<script>
|
||||
|
||||
$(document).on('click','.edit_education',function(){
|
||||
var id = $(this).attr("id");
|
||||
console.log(id);
|
||||
var URL = "<?php echo base_url();?>Employee/editEmp_qualification/"+id
|
||||
$.ajax({
|
||||
url: URL,
|
||||
type:"get",
|
||||
success:function(data){
|
||||
value = JSON.parse(data);
|
||||
console.log(value);
|
||||
$('.edu_id').val(value[0].id);
|
||||
$('#level').val(value[0].level);
|
||||
$('#institute').val(value[0].institute);
|
||||
$('#major').val(value[0].major);
|
||||
$('#cgpa').val(value[0].cgpa);
|
||||
$('#q_from').val(value[0].q_from);
|
||||
$('#q_to').val(value[0].q_to);
|
||||
$('#edit-form_add_education').modal("show");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click','.edit_employee_history',function(){
|
||||
var id = $(this).attr("id");
|
||||
var URL = "<?php echo base_url();?>Employee/editEmp_history/"+id
|
||||
$.ajax({
|
||||
url: URL,
|
||||
type:"get",
|
||||
success:function(data){
|
||||
value = JSON.parse(data);
|
||||
$('.his_id').val(value[0].id);
|
||||
$('#c_name').val(value[0].c_name);
|
||||
$('#role').val(value[0].role);
|
||||
$('#h_from').val(value[0].h_from);
|
||||
$('#h_to').val(value[0].h_to);
|
||||
$('#edit-form_add_history').modal("show");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$(document).on('click','.add_image',function(){
|
||||
var id = $(this).attr("id")
|
||||
if (id) {
|
||||
var URL = "<?php echo base_url();?>Employee/uploadForm/"+id
|
||||
}
|
||||
else {
|
||||
var URL = "<?php echo base_url();?>Employee/uploadForm/"+"uploadform"
|
||||
}
|
||||
$.ajax({
|
||||
url: URL,
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
$('#edit-form_add_image').html(JSON.parse(data));
|
||||
$('.bs-example-modal-sm add_image').modal("show");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.deleteAddEducationData').click(function() {
|
||||
var id = $(this).attr('id');
|
||||
var url = "<?php echo base_url()?>Employee/deleteEmpQualification";
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo base_url()?>Employee/getDeleteConfirmationPopup",
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
$('#edit-form_add_image').html(JSON.parse(data));
|
||||
$('.delete_id').attr('value',id);
|
||||
$('.delete_url').attr('action',url);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.deleteEmpHistoryData').click(function() {
|
||||
var id = $(this).attr('id');
|
||||
var url = "<?php echo base_url()?>Employee/deleteEmpHistory";
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo base_url()?>Employee/getDeleteConfirmationPopup",
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
$('#edit-form_add_image').html(JSON.parse(data));
|
||||
$('.delete_id').attr('value',id);
|
||||
$('.delete_url').attr('action',url);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.deleteuploadImage').click(function() {
|
||||
var id = $(this).attr('id');
|
||||
var url = "<?php echo base_url()?>Employee/deleteEmpImage";
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo base_url()?>Employee/getDeleteConfirmationPopup",
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
$('#edit-form_add_image').html(JSON.parse(data));
|
||||
$('.delete_id').attr('value',id);
|
||||
$('.delete_url').attr('action',url);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
185
application/modules/Employee/views/expence_form.php
Normal file
@ -0,0 +1,185 @@
|
||||
|
||||
<!-- Body page content -->
|
||||
|
||||
|
||||
|
||||
<div class="">
|
||||
<div class="page-title">
|
||||
|
||||
<div class="title_left">
|
||||
<h3>Expence Request</h3>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="x_content">
|
||||
<br />
|
||||
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Employee/rise_expence_request" enctype="multipart/form-data">
|
||||
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="last-name">Expence Requisted For</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
|
||||
<input type="radio" name="created_by" value="self"style="margin:10px;"checked /><b>Self</b>
|
||||
|
||||
<input type="radio" name="created_by" value="<?php echo user()->name;?>" style="margin: 10px;" /><b>Others</b>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="item form-group">
|
||||
<label class="control-label col-md-2 col-sm-2 " for="last-name"> Employee Name </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="user_dropdown" name="emp_id" style="margin-top: 10px;padding-bottom: 10px;" class="form-control manager" > </select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="first-name"> Date of expence</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<div class="form-group">
|
||||
<div class='input-group date' id='myDatepicker'>
|
||||
<input type='text' class="form-control" name="date_of_expence" value="<?php if(isset($expenceData)) { echo $expenceData->purchase_date; } ?>" />
|
||||
<span class="input-group-addon">
|
||||
<li class="fa fa-calendar"></li>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="first-name"> Expence Cost </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="cost" name="amount" value="<?php if(isset($assetData)) { echo $assetData->cost; } ?>" class="form-control" type="text" name="middle-name">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="item form-group">
|
||||
<label class="control-label col-md-2 col-sm-2 " for="last-name">Description</label>
|
||||
<div class="col-md-5 col-sm-5">
|
||||
<textarea id="comments" name="comments" value="" class="form-control" style="height:200px !important;" type="text" ></textarea>
|
||||
|
||||
<input type="hidden" id="manager_id" name="manager" value="">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="first-name">Expence Bill</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="formFile" name="bill" class="typeFile" type="file" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ln_solid"></div>
|
||||
<div class="item form-group">
|
||||
<div class=" offset-md-8">
|
||||
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
||||
<button class="btn btn-primary" type="reset">Reset</button>
|
||||
<button type="submit" class="btn btn-success">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Body page content -->
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
|
||||
var currentUserName = '<?php echo user()->name; ?>';
|
||||
var currentUserId = '<?php echo user()->id; ?>';
|
||||
$('#user_dropdown').append('<option value="' + currentUserId + '">' +
|
||||
currentUserName + '</option>');
|
||||
$('#user_dropdown').prop('disabled', true);
|
||||
|
||||
$('#user_dropdown').on('change',function() {
|
||||
|
||||
});
|
||||
|
||||
|
||||
$('input[type="radio"][name="created_by"]').change(function() {
|
||||
var selectedValue = $(this).val();
|
||||
var $userDropdown = $('#user_dropdown');
|
||||
|
||||
$userDropdown.empty();
|
||||
|
||||
if (selectedValue === 'self') {
|
||||
|
||||
var currentUserName = '<?php echo user()->name; ?>';
|
||||
var currentUserId = '<?php echo user()->id; ?>';
|
||||
$userDropdown.append('<option value="' + currentUserId + '">' + currentUserName + '</option>');
|
||||
$userDropdown.prop('disabled', true);
|
||||
} else if (selectedValue === '<?php echo user()->name; ?>') {
|
||||
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('Employee/get_emp_name/')?>"',
|
||||
method: 'GET',
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
|
||||
$('#user_dropdown').append(response);
|
||||
$('#user_dropdown').prop('disabled', false);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
//get manager id from the dropdown employee assign the value to $("#manager_id") input field
|
||||
|
||||
$("#user_dropdown").on("change", function(){
|
||||
let manager_id = $(this).children(":selected").attr("id");
|
||||
|
||||
$("#manager_id").val(manager_id);
|
||||
|
||||
})
|
||||
|
||||
</script>
|
||||
296
application/modules/Employee/views/expence_list.php
Normal file
@ -0,0 +1,296 @@
|
||||
|
||||
<head>
|
||||
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css'>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
|
||||
|
||||
<style>
|
||||
.design {
|
||||
display: none;
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
.design-form {
|
||||
background-color: #fefefe;
|
||||
margin: 15% auto;
|
||||
padding: 20px;
|
||||
border: 1px solid #888;
|
||||
width: 380px;
|
||||
height: 280px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
button {
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
|
||||
#myImg {
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
#myImg:hover {opacity: 0.7;}
|
||||
|
||||
/* The Modal (background) */
|
||||
.modal {
|
||||
display: none; /* Hidden by default */
|
||||
position: fixed; /* Stay in place */
|
||||
z-index: 1; /* Sit on top */
|
||||
padding-top: 100px; /* Location of the box */
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%; /* Full width */
|
||||
height: 100%; /* Full height */
|
||||
overflow: auto; /* Enable scroll if needed */
|
||||
background-color: rgb(0,0,0); /* Fallback color */
|
||||
background-color: rgba(0,0,0,0.9); /* Black w/ opacity */
|
||||
}
|
||||
|
||||
/* Modal Content (image) */
|
||||
.modal-content {
|
||||
margin: auto;
|
||||
display: block;
|
||||
width: 80%;
|
||||
max-width: 700px;
|
||||
}
|
||||
|
||||
/* Caption of Modal Image */
|
||||
#caption {
|
||||
margin: auto;
|
||||
display: block;
|
||||
width: 80%;
|
||||
max-width: 700px;
|
||||
text-align: center;
|
||||
color: #ccc;
|
||||
padding: 10px 0;
|
||||
height: 150px;
|
||||
}
|
||||
|
||||
/* Add Animation */
|
||||
.modal-content, #caption {
|
||||
-webkit-animation-name: zoom;
|
||||
-webkit-animation-duration: 0.6s;
|
||||
animation-name: zoom;
|
||||
animation-duration: 0.6s;
|
||||
}
|
||||
|
||||
@-webkit-keyframes zoom {
|
||||
from {-webkit-transform:scale(0)}
|
||||
to {-webkit-transform:scale(1)}
|
||||
}
|
||||
|
||||
@keyframes zoom {
|
||||
from {transform:scale(0)}
|
||||
to {transform:scale(1)}
|
||||
}
|
||||
|
||||
.close {
|
||||
position: absolute;
|
||||
top: 15px;
|
||||
right: 35px;
|
||||
color: #f1f1f1;
|
||||
font-size: 40px;
|
||||
font-weight: bold;
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
.close:hover,
|
||||
.close:focus {
|
||||
color: #bbb;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* 100% Image Width on Smaller Screens */
|
||||
@media only screen and (max-width: 700px){
|
||||
.modal-content {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
<h1>Expence List</h1>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="x_content">
|
||||
<div class="row">
|
||||
<div class="col-sm-12" style="overflow: auto;">
|
||||
<table id="datatable-buttons" class="table table-striped table-bordered" width="100%">
|
||||
<thead>
|
||||
<tr class="headings">
|
||||
<th class="column-title">Creadted Date</th>
|
||||
<th class="column-title">Employee Id</th>
|
||||
<th class="column-title">Employee Name</th>
|
||||
<th class="column-title">Expence Date</th>
|
||||
<th class="column-title">Expence Raised By</th>
|
||||
<th class="column-title">Expence Cost(₹)</th>
|
||||
<th class="column-title">Expence Bill</th>
|
||||
<th class="column-title">Comments </th>
|
||||
<th class="column-title">Status </th>
|
||||
<th class="column-title" >Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($tableData as $key => $value) { ?>
|
||||
<tr class="even pointer">
|
||||
|
||||
<td class=" "><?php echo $value->created_at; ?> </td>
|
||||
<td class=" "><?php echo $value->emp_id; ?> </td>
|
||||
<td class=" "><?php echo $value->name; ?> </td>
|
||||
<td class=" "><?php echo $value->date_of_expence; ?></td>
|
||||
<td class=" "><?php echo $value->created_by; ?></td>
|
||||
<td class=" ">₹ <?php echo $value->amount; ?></td>
|
||||
<td class=" ">
|
||||
<img id="myImg" style="width: 50%; display: block;" src="<?php echo base_url(); ?>assets/uploads/Expence_Bill/<?php echo $value->bill; ?>" alt="invoice"/>
|
||||
</td>
|
||||
<td class=" "><?php echo $value->comments; ?></td>
|
||||
<?php if($value->status == 'pending'){ ?>
|
||||
<td style="color:#e68a00"><?php echo $value->status; ?></td>
|
||||
<?php }
|
||||
else if($value->status == 'Approved'){ ?>
|
||||
<td style="color:green"><?php echo $value->status; ?>By <?php echo $value->approved_by; ?><br><?php echo $value->approved_at;?></td>
|
||||
<?php }
|
||||
else if($value->status == 'Declined'){ ?>
|
||||
<td style="color:red"><?php echo $value->status; ?><br><?php echo $value->DReason; ?></td>
|
||||
<?php }
|
||||
else if($value->status == 'canceled'){ ?>
|
||||
<td style="color:darkcyan;"><?php echo $value->status; ?></td>
|
||||
<?php }
|
||||
else{
|
||||
|
||||
}?>
|
||||
<td style=" text-align: center; font-size: 16px;">
|
||||
|
||||
<?php if($value->status == 'pending') { ?>
|
||||
|
||||
<a href="<?php echo base_url('Employee/Approve_Expence')?>?id=<?php echo $value->id;?> "><i class="fa fa-check" aria-hidden="true"title="Approve" onclick = "return confirm('Are you sure to Approve This Leave ')" ></i></a>
|
||||
|
||||
|
||||
<a href="#"><i class="fa fa-times test" aria-hidden="true" title="Decline" onclick="showCustomPrompt()"
|
||||
id= "<?php echo $value->id; ?>"></i></a>
|
||||
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="customPrompt" class="design">
|
||||
<div class="design-form ">
|
||||
<span onclick="$('#customPrompt').hide()">X</span>
|
||||
<h3>Decline Reason</h3>
|
||||
<input list="browsers" id="decline_reason" required name="myBrowser" />
|
||||
<datalist id="browsers" >
|
||||
<?php foreach ($dropdown as $key => $value) { ?>
|
||||
<option value="<?php echo $value->enum_value; ?>"><?php echo $value->enum_value; ?></option>
|
||||
<?php } ?>
|
||||
</datalist>
|
||||
|
||||
<button onclick="submitCustomPrompt()" type="button" class="btn btn-primary">Submit</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
||||
<div class="modal fade bs-example-modal-lg" id="ItemModal" tabindex="-1" role="dialog" aria-hidden="true"></div>
|
||||
<div class="modal bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" id="popup"> </div>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
function showCustomPrompt() {
|
||||
var customPrompt = document.getElementById("customPrompt");
|
||||
customPrompt.style.display = "block";
|
||||
}
|
||||
|
||||
function submitCustomPrompt() {
|
||||
|
||||
var id = $('.test').attr("id");
|
||||
var reason = document.getElementById("decline_reason").value;
|
||||
|
||||
if( reason != "")
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
data:{id : id , reason : reason },
|
||||
url:"<?php echo base_url('Employee/Decline_expence');?>",
|
||||
type:"get",
|
||||
success: function(response) {
|
||||
|
||||
window.location ='<?php echo base_url('Employee/expence_list');?>';
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
else
|
||||
|
||||
alert('Decline Reason is required');
|
||||
}
|
||||
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<!-- The Modal -->
|
||||
<div id="myModal" class="modal">
|
||||
<span class="close">×</span>
|
||||
<img class="modal-content" id="img01">
|
||||
<div id="caption"></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
|
||||
|
||||
$('#myImg').on('click', function(){
|
||||
|
||||
var modal = document.getElementById("myModal");
|
||||
var modalImg = document.getElementById("img01");
|
||||
var captionText = document.getElementById("caption");
|
||||
img.onclick = function(){
|
||||
modal.style.display = "block";
|
||||
modalImg.src = this.src;
|
||||
captionText.innerHTML = this.alt;
|
||||
}
|
||||
|
||||
// Get the <span> element that closes the modal
|
||||
var span = document.getElementsByClassName("close")[0];
|
||||
|
||||
// When the user clicks on <span> (x), close the modal
|
||||
span.onclick = function() {
|
||||
modal.style.display = "none";
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
40
application/modules/Employee/views/view_history.php
Normal file
@ -0,0 +1,40 @@
|
||||
|
||||
<!-- Large modal -->
|
||||
<!-- <button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-lg" hidden>Large modal</button> -->
|
||||
<!-- <div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-hidden="true"> -->
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myModalLabel"><?php echo $title; ?></h4>
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- <?php echo json_encode($user_history) ?> -->
|
||||
<?php foreach ($user_history as $key => $value) { ?>
|
||||
<div id="data" style="padding : 10px;">
|
||||
<lable class="col-form-label" id="first-line"><?php echo my_date_show_time($value->created_at). " " ?><i><?php echo $value->user_name; ?></i></lable></br>
|
||||
<lable class="column-title" style="color : black;" >
|
||||
<?php
|
||||
$column_name = str_replace("_"," ",$value->column_name);
|
||||
$column_name = ucwords($column_name);
|
||||
if($value->old_value == null)
|
||||
{
|
||||
echo "$name "." ' $value->new_value ' "." Created";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $column_name." Changed from "."'$value->old_value'"." to "."'$value->new_value'";
|
||||
}
|
||||
?>
|
||||
</lable></br>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<!-- <button type="button" class="btn btn-primary">Save changes</button> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
259
application/modules/Expence/controllers/Expence.php
Normal file
@ -0,0 +1,259 @@
|
||||
<?php defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
use chillerlan\QRCode\Data\QRMatrix;
|
||||
use chillerlan\QRCode\QRCode;
|
||||
use chillerlan\QRCode\QROptions;
|
||||
|
||||
date_default_timezone_set('Asia/Kolkata');
|
||||
|
||||
/**
|
||||
* AMS
|
||||
*
|
||||
* @package HMVC
|
||||
* @author Venba
|
||||
* @copyright 2022 Venba
|
||||
* @license https://venbainfotech.com/licenses/MIT MIT License
|
||||
* @link <URI> (description)
|
||||
* @version GIT: $Id$
|
||||
* @since Version 0.0.1
|
||||
* @filesource
|
||||
*
|
||||
*/
|
||||
|
||||
class Expence extends Admin_Controller
|
||||
{
|
||||
/**
|
||||
* [__construct description]
|
||||
*
|
||||
* @method __construct
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// To inherit directly the attributes of the parent class.
|
||||
parent::__construct();
|
||||
### Syntax : $this->load->model('Model Path' , 'Alias name');
|
||||
### The second parameter (optional) is used to call the method.
|
||||
$this->load->model('MY_Model','MY_Model');
|
||||
$this->load->model('Expence_model','Expence_model');
|
||||
$this->load->model('Employee/Employee_model','Emp_model');
|
||||
$this->load->model('Audit/Audit_model','audit_model');
|
||||
$this->load->helper(array('form', 'url'));
|
||||
|
||||
}
|
||||
|
||||
public function expence_form()
|
||||
{
|
||||
|
||||
$this->layout->buffer('main_content', 'Expence/expence_form');
|
||||
$this->layout->render('Employee_Layout');
|
||||
}
|
||||
|
||||
public function get_emp_name()
|
||||
{
|
||||
$emp = $this->Expence_model->get_employee_name(user()->business_id);
|
||||
$html = '<option>--select Employee--</option>';
|
||||
foreach($emp as $val)
|
||||
{
|
||||
if($val->user_id != user()->id)
|
||||
{
|
||||
$html .='<option id="'.$val->manager.'" value="'.$val->user_id.'">'.$val->name.'</option>';
|
||||
}
|
||||
}
|
||||
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;
|
||||
|
||||
if($data['manager']){
|
||||
$manager = $this->input->post('manager');
|
||||
}else{
|
||||
$manager = employee()->manager;
|
||||
}
|
||||
$data['manager'] = $manager;
|
||||
$data['business_id'] = user()->business_id;
|
||||
$data['status'] = 'pending';
|
||||
$data['created_date'] = date('d-m-Y');
|
||||
$data['created_time'] = date('H:i A');
|
||||
$data['is_active'] = 1;
|
||||
|
||||
|
||||
$table="expence_list";
|
||||
$create_leave = $this->MY_Model->insert($data,$table);
|
||||
|
||||
$this->session->set_flashdata('Create', 'Claim Request Rised Successfully');
|
||||
redirect('Expence/expence_form');
|
||||
}
|
||||
|
||||
|
||||
public function edit_expence()
|
||||
{
|
||||
$id = $this->input->get('id');
|
||||
$get_expence = $this->Expence_model->get_expence_list_by_id($id);
|
||||
$this->layout->set('get_expence', $get_expence);
|
||||
$this->layout->buffer('main_content', 'Expence/edit_expence');
|
||||
$this->layout->render('Employee_Layout');
|
||||
}
|
||||
|
||||
|
||||
public function edit_rise_expence_request()
|
||||
{
|
||||
|
||||
$action = $this->input->post();
|
||||
unset($action['bill']);
|
||||
unset($action['id']);
|
||||
$id = $this->input->post('id');
|
||||
|
||||
|
||||
//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();
|
||||
$action['bill'] = $upload_image['file_name'];
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(isset($data['emp_id'])){
|
||||
$emp_id =$this->input->post('emp_id');
|
||||
}else{
|
||||
$emp_id = user()->id;
|
||||
}
|
||||
$action['emp_id'] = $emp_id;
|
||||
$action['business_id'] = user()->business_id;
|
||||
$action['status'] = 'pending';
|
||||
$action['updated_at'] = date('d-m-Y H:i:s');
|
||||
$action['updated_by'] = user()->id;
|
||||
$action['is_active'] = 1;
|
||||
|
||||
$table="expence_list";
|
||||
$create_leave = $this->MY_Model->edit_option($action, $id, $table);
|
||||
$this->session->set_flashdata('update', 'Claim Request Updated Successfully');
|
||||
redirect('Expence/Emp_Expence_List');
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function expence_list()
|
||||
{
|
||||
$business_id = user()->business_id;
|
||||
$expence_list = $this->Expence_model->get_expence_list($business_id);
|
||||
$this->layout->set('tableData', $expence_list);
|
||||
$this->layout->buffer('main_content', 'Expence/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);
|
||||
$this->session->set_flashdata('approve', 'Claim Request Approved');
|
||||
redirect('Expence/expence_list');
|
||||
}
|
||||
|
||||
public function manager_approvel_list()
|
||||
{
|
||||
$business_id = user()->business_id;
|
||||
$user_id = user()->id;
|
||||
$expence_list = $this->Expence_model->get_expence_list($business_id);
|
||||
$get_delegation = $this->Expence_model->Get_delegation_id($business_id);
|
||||
//print_r($expence_list); die();
|
||||
$this->layout->set('get_delegation', $get_delegation);
|
||||
$this->layout->set('tableData', $expence_list);
|
||||
$this->layout->buffer('main_content', 'Expence/expence_manager_approvel');
|
||||
$this->layout->render('Employee_Layout');
|
||||
}
|
||||
|
||||
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);
|
||||
$this->session->set_flashdata('manager_approve', 'Claim Request Approved');
|
||||
redirect('Expence/manager_approvel_list');
|
||||
}
|
||||
|
||||
public function Emp_Expence_List()
|
||||
{
|
||||
$Emp_Expence_List = $this->Expence_model->get_expence_list(user()->business_id);
|
||||
$this->layout->set('tableData', $Emp_Expence_List);
|
||||
$this->layout->buffer('main_content', 'Expence/emp_expence_list');
|
||||
$this->layout->render('Employee_Layout');
|
||||
}
|
||||
|
||||
|
||||
|
||||
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->Expence_model->ExpenceDecline($id, $data);
|
||||
return true;
|
||||
}
|
||||
|
||||
public function cancled_expence()
|
||||
{
|
||||
$id=$this->input->get('id');
|
||||
$data['status'] = 'canceled';
|
||||
$data['canceled_at'] = date('d-m-Y H:i:s');
|
||||
$this->Expence_model->Expencecancle($id, $data);
|
||||
$this->session->set_flashdata('cancel', 'Claim Request Canceled.... ');
|
||||
redirect('Expence/emp_expence_list');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
97
application/modules/Expence/models/Expence_model.php
Normal file
@ -0,0 +1,97 @@
|
||||
<?php
|
||||
class Expence_model extends MY_Model {
|
||||
|
||||
public function get_employee_name($business_id)
|
||||
{
|
||||
|
||||
$this->db->select('users.name, employees.user_id, employees.manager');
|
||||
$this->db->from('users');
|
||||
$this->db->join('employees', 'employees.user_id = users.id');
|
||||
$this->db->where('users.business_id', $business_id);
|
||||
$this->db->where('users.is_active', 1);
|
||||
$this->db->where('employees.is_active', 1);
|
||||
$query = $this->db->get();
|
||||
|
||||
if ($query->num_rows() > 0) {
|
||||
return $query->result();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public function get_expence_list($business_id)
|
||||
{
|
||||
$this->db->select('A.* , name', 'users.name');
|
||||
$this->db->from('expence_list A');
|
||||
$this->db->join('users', 'users.id = A.emp_id', 'left');
|
||||
//$this->db->join('delegation', 'delegation.emp_id = users.id', 'left');
|
||||
$this->db->where('A.business_id', $business_id);
|
||||
$this->db->order_by('id','DESC');
|
||||
$this->db->where('A.is_active', 1);
|
||||
$query = $this->db->get();
|
||||
$query = $query->result();
|
||||
return $query;
|
||||
|
||||
}
|
||||
|
||||
public function decline_dropdown($business_id)
|
||||
|
||||
{
|
||||
|
||||
$this->db->select('*');
|
||||
$this->db->from('enum');
|
||||
$this->db->where('enum_type', 'decline');
|
||||
$this->db->where('business_id', $business_id);
|
||||
$query = $this->db->get();
|
||||
if ($query->num_rows() > 0) {
|
||||
return $query->result();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function get_expence_list_by_id($id)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('expence_list');
|
||||
$this->db->where('md5(id)', $id);
|
||||
$this->db->where('is_active', 1);
|
||||
$query = $this->db->get();
|
||||
if ($query->num_rows() > 0) {
|
||||
return $query->result();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function ExpenceDecline($id, $data)
|
||||
{
|
||||
$this->db->where('id',$id);
|
||||
$this->db->where('status', 'pending');
|
||||
$this->db->update('expence_list', $data);
|
||||
return;
|
||||
}
|
||||
|
||||
public function Expencecancle($id, $data)
|
||||
{
|
||||
$this->db->where('md5(id)',$id);
|
||||
$this->db->where('status', 'pending');
|
||||
$this->db->update('expence_list', $data);
|
||||
return;
|
||||
}
|
||||
|
||||
public function Get_delegation_id($business_id)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('delegation');
|
||||
$this->db->where('business_id', $business_id);
|
||||
//$this->db->where('delegated_to', $emp_id);
|
||||
$this->db->where('is_active', 1);
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
}
|
||||
213
application/modules/Expence/views/edit_expence.php
Normal file
@ -0,0 +1,213 @@
|
||||
|
||||
<!-- Body page content -->
|
||||
|
||||
|
||||
|
||||
<div class="">
|
||||
<div class="page-title">
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<li><a href="<?php echo base_url();?>Expence/emp_expence_list" class="btn btn-primary" style="margin-top: 22px;">Back</a></li>
|
||||
</ul>
|
||||
<h1>Edit Expense</h1>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="x_content">
|
||||
<br />
|
||||
|
||||
<?php if(!empty($get_expence)) { ?>
|
||||
|
||||
<?php foreach( $get_expence as $data) { ?>
|
||||
|
||||
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Expence/edit_rise_expence_request" enctype="multipart/form-data">
|
||||
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
|
||||
<input type="hidden" name="id" value="<?php echo $data->id; ?>">
|
||||
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="last-name">Expense Requisted For</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
|
||||
<input type="radio" name="created_by" value="self"style="margin:10px;"checked /><b>Self</b>
|
||||
|
||||
<input type="radio" name="created_by" value="<?php echo user()->name;?>" style="margin: 10px;" /><b>Others</b>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="item form-group">
|
||||
<label class="control-label col-md-2 col-sm-2 " for="last-name"> Employee Name <a style="color:red;">*</a></label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="user_dropdown" name="emp_id" style="margin-top: 10px;padding-bottom: 10px;" class="form-control manager" > </select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="first-name"> Date of expence<a style="color:red;">*</a></label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<div class="form-group">
|
||||
<div class='input-group date'>
|
||||
<input type='text' placeholder="DD-MM-YYYY" class="form-control" id='myDatepicker' required name="date_of_expence" value="<?php echo $data->date_of_expence; ?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="first-name"> Expense Cost <a style="color:red;">*</a></label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="cost" name="amount" required value="<?php echo $data->amount; ?>" class="form-control" type="text" name="middle-name">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="item form-group">
|
||||
<label class="control-label col-md-2 col-sm-2 " for="last-name">Description</label>
|
||||
<div class="col-md-5 col-sm-5">
|
||||
<textarea id="comments" name="comments" value="" class="form-control" style="height:200px !important;" type="text" ><?php echo $data->comments;?></textarea>
|
||||
|
||||
<!-- <input type="hidden" id="manager_id" name="manager" value=""> -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " required for="first-name">Upload Bill</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="formFile" name="bill" onchange="PreviewImage()" class="typeFile" type="file">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " required for="first-name"></label>
|
||||
<div class="col-md-2 col-sm-2 ">
|
||||
<img src="<?php echo base_url(); ?>/assets/uploads/Expence_Bill/<?php echo $data->bill; ?>" style="height: 100px; width: 100px;" id="uploadPreview" class="avatar img-circle img-thumbnail" alt="avatar"><br><br>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ln_solid"></div>
|
||||
<div class="item form-group">
|
||||
<div class=" offset-md-8">
|
||||
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
||||
<button class="btn btn-primary" type="reset">Reset</button>
|
||||
<button type="submit" class="btn btn-success">Update</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<?php } } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Body page content -->
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
|
||||
var currentUserName = '<?php echo user()->name; ?>';
|
||||
var currentUserId = '<?php echo user()->id; ?>';
|
||||
$('#user_dropdown').append('<option value="' + currentUserId + '">' +
|
||||
currentUserName + '</option>');
|
||||
$('#user_dropdown').prop('disabled', true);
|
||||
|
||||
$('#user_dropdown').on('change',function() {
|
||||
|
||||
});
|
||||
|
||||
|
||||
$('input[type="radio"][name="created_by"]').change(function() {
|
||||
var selectedValue = $(this).val();
|
||||
var $userDropdown = $('#user_dropdown');
|
||||
|
||||
$userDropdown.empty();
|
||||
|
||||
if (selectedValue === 'self') {
|
||||
|
||||
var currentUserName = '<?php echo user()->name; ?>';
|
||||
var currentUserId = '<?php echo user()->id; ?>';
|
||||
$userDropdown.append('<option value="' + currentUserId + '">' + currentUserName + '</option>');
|
||||
$userDropdown.prop('disabled', true);
|
||||
} else if (selectedValue === '<?php echo user()->name; ?>') {
|
||||
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('Expence/get_emp_name/')?>"',
|
||||
method: 'GET',
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
|
||||
$('#user_dropdown').append(response);
|
||||
$('#user_dropdown').prop('disabled', false);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
$('#myDatepicker').datetimepicker({
|
||||
format: 'DD.MM.YYYY'
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
//get manager id from the dropdown employee assign the value to $("#manager_id") input field
|
||||
|
||||
$("#user_dropdown").on("change", function(){
|
||||
let manager_id = $(this).children(":selected").attr("id");
|
||||
|
||||
$("#manager_id").val(manager_id);
|
||||
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function PreviewImage() {
|
||||
var oFReader = new FileReader();
|
||||
oFReader.readAsDataURL(document.getElementById("formFile").files[0]);
|
||||
|
||||
oFReader.onload = function (oFREvent) {
|
||||
document.getElementById("uploadPreview").src = oFREvent.target.result;
|
||||
};
|
||||
};
|
||||
</script>
|
||||
195
application/modules/Expence/views/emp_expence_list.php
Normal file
@ -0,0 +1,195 @@
|
||||
<head>
|
||||
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css'>
|
||||
|
||||
<style>
|
||||
/* Modal Popup Styles */
|
||||
.modal {
|
||||
display: none; /* Hide the modal by default */
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
background-color: rgba(0, 0, 0, 0.9);
|
||||
}
|
||||
|
||||
.modal img {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
max-width: 80%;
|
||||
max-height: 100%;
|
||||
margin-top: 5%;
|
||||
margin-bottom: 5%;
|
||||
}
|
||||
|
||||
.close {
|
||||
color: #fff;
|
||||
font-size: 40px;
|
||||
font-weight: bold;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
div.dataTables_wrapper div.dataTables_filter{
|
||||
margin-top: -44px !important; //search to up
|
||||
}
|
||||
|
||||
.alert-success {
|
||||
background-color: #dff0d8;
|
||||
color: #3c763d;
|
||||
border-color: #d6e9c6;
|
||||
}
|
||||
|
||||
.flash-message {
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
border-radius: 5px;
|
||||
margin-left: 690px;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
|
||||
<?php if ($this->session->userdata('update')): ?>
|
||||
<div class="alert-success flash-message" id="customPrompt" style="text-align: right;">
|
||||
<?php echo $this->session->userdata('update'); ?>
|
||||
<span onclick="$('#customPrompt').hide()" style="text-align: right;" ><i class="fa fa-times" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php $this->session->unset_userdata('update');?>
|
||||
|
||||
<?php if ($this->session->userdata('cancel')): ?>
|
||||
<div class="alert alert-dark flash-message" id="customPrompt" style="text-align: right;">
|
||||
<?php echo $this->session->userdata('cancel'); ?>
|
||||
<span onclick="$('#customPrompt').hide()" style="text-align: right;" ><i class="fa fa-times" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php $this->session->unset_userdata('cancel');?>
|
||||
|
||||
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
|
||||
<a href="<?php echo base_url();?>Expence/expence_form" class="btn btn-sm btn-primary" style="margin-top: 20px;">New Claim</a>
|
||||
|
||||
<?php if(is_user() || user()->role == null) { ?>
|
||||
<a href="<?php echo base_url();?>Expence/manager_approvel_list" class="btn btn-sm btn-warning" style="margin-top: 20px;">My Approval</a>
|
||||
<?php } ?>
|
||||
|
||||
<?php if(is_admin()) { ?>
|
||||
<a href="<?php echo base_url();?>Expence/expence_list" class="btn btn-sm btn-warning" style="margin-top: 20px;">My Approval</a>
|
||||
<?php }?>
|
||||
|
||||
</ul>
|
||||
<h1>Expense Claims</h1>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="x_content">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<table id="datatable-buttons" class="table table-striped table-bordered" width="100%">
|
||||
<thead>
|
||||
<tr class="headings">
|
||||
<th class="column-title">Claim Date </th>
|
||||
<th class="column-title">Desription</th>
|
||||
<th class="column-title">Expense Date</th>
|
||||
<th class="column-title">Expense Cost(₹)</th>
|
||||
<th class="column-title">Status </th>
|
||||
<th class="column-title">Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php foreach ($tableData as $key => $value) { ?>
|
||||
<?php if(user()->id == $value->emp_id) { ?>
|
||||
<tr class="even pointer">
|
||||
<td class=" "><?php echo dateFormat('d-m-Y',$value->created_at);?>
|
||||
<?php echo timeFormat('h:i:s a',$value->created_at);?>
|
||||
</td>
|
||||
<td class=" "><?php echo $value->comments; ?></td>
|
||||
<td class=" "> <?php echo dateFormat('d-m-Y',$value->date_of_expence);?></td>
|
||||
<td class=" ">₹ <?php echo $value->amount; ?></td>
|
||||
<?php if($value->status == 'pending'){ ?>
|
||||
<td style="color:#e68a00"><?php echo $value->status; ?></td>
|
||||
<?php }
|
||||
else if($value->status == 'Approved'){ ?>
|
||||
<td style="color:green"><?php echo $value->status; ?> By <?php echo $value->approved_by; ?><br><?php echo $value->approved_at; ?></td>
|
||||
<?php }
|
||||
else if($value->status == 'Declined'){ ?>
|
||||
<td style="color:red"><?php echo $value->status; ?> <br> <?php echo $value->Dreason; ?></td>
|
||||
<?php }
|
||||
else if($value->status == 'canceled'){ ?>
|
||||
<td style="color:darkcyan;"><?php echo $value->status; ?></td>
|
||||
<?php }
|
||||
else{
|
||||
|
||||
}?>
|
||||
<td style=" text-align: center; font-size: 16px;">
|
||||
|
||||
<?php if(!empty($value->bill)) { ?>
|
||||
|
||||
<a onclick="openModal('<?php echo base_url(); ?>assets/uploads/Expence_Bill/<?php echo $value->bill; ?>')" title="ViewBill"><i class="fa fa-eye" aria-hidden="true"></i></a><br>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php if($value->status == 'pending') { ?>
|
||||
|
||||
<a href="<?php echo base_url('Expence/edit_expence')?>?id=<?php echo md5($value->id);?> "><i class="fa fa-edit" aria-hidden="true"title="Edit"></i></a>
|
||||
|
||||
<a href="<?php echo base_url('Expence/cancled_expence')?>?id=<?php echo md5($value->id);?> "><i class="fa fa-ban" aria-hidden="true"title="Cancel"></i></a>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<?php } } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div class="modal fade bs-example-modal-lg" id="ItemModal" tabindex="-1" role="dialog" aria-hidden="true"></div>
|
||||
<div class="modal bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" id="popup"> </div>
|
||||
|
||||
|
||||
<div id="myModal" class="modal">
|
||||
<span class="close">×</span>
|
||||
<img id="modalImage" src="" alt="Image">
|
||||
</div>
|
||||
|
||||
<!-- JavaScript -->
|
||||
<script>
|
||||
function openModal(itemId) {
|
||||
// Get the image URL for the item with the specified ID
|
||||
var imageUrl = itemId;
|
||||
|
||||
// Set the image source of the modal
|
||||
document.getElementById("modalImage").src = imageUrl;
|
||||
|
||||
// Open the modal
|
||||
var modal = document.getElementById("myModal");
|
||||
modal.style.display = "block";
|
||||
|
||||
// Close the modal when the user clicks on the close button
|
||||
var closeButton = document.getElementsByClassName("close")[0];
|
||||
closeButton.onclick = function() {
|
||||
modal.style.display = "none";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
227
application/modules/Expence/views/expence_form.php
Normal file
@ -0,0 +1,227 @@
|
||||
<!-- bootstrap-daterangepicker -->
|
||||
<script src="https://localhost/ams//assets/default/moment/min/moment.min.js"></script>
|
||||
<script src="https://localhost/ams//assets/default/bootstrap-daterangepicker/daterangepicker.js"></script>
|
||||
<!-- bootstrap-datetimepicker -->
|
||||
<script src="https://localhost/ams//assets/default/bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>
|
||||
<!-- Body page content -->
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
|
||||
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||
|
||||
<style>
|
||||
.alert-success {
|
||||
background-color: #dff0d8;
|
||||
color: #3c763d;
|
||||
border-color: #d6e9c6;
|
||||
}
|
||||
|
||||
.flash-message {
|
||||
padding: 20px;
|
||||
margin-bottom: 10px;
|
||||
border-radius: 5px;
|
||||
margin-left: 500px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
|
||||
<?php if ($this->session->userdata('Create')): ?>
|
||||
<div class="alert-success flash-message" id="customPrompt" style="text-align: right;">
|
||||
<h2><?php echo $this->session->userdata('Create'); ?></h2>
|
||||
<span onclick="$('#customPrompt').hide()" style="text-align: right;" ><i class="fa fa-times" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php $this->session->unset_userdata('Create');?>
|
||||
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<a href="<?php echo base_url();?>Expence/emp_expence_list" class="btn btn-primary" style="margin-top: 20px;">Back</a>
|
||||
</ul>
|
||||
|
||||
<h1>Expense Claim</h1>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="x_content">
|
||||
<br />
|
||||
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Expence/rise_expence_request" enctype="multipart/form-data">
|
||||
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="last-name">Expense Requisted For</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
|
||||
<input type="radio" name="created_by" value="self(<?php echo user()->id;?>)"style="margin:10px;"checked /><b>Self</b>
|
||||
|
||||
<input type="radio" name="created_by" value="<?php echo user()->name;?> (<?php echo user()->id;?>)" style="margin: 10px;" /><b>Others</b>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="item form-group">
|
||||
<label class="control-label col-md-2 col-sm-2 " for="last-name"> Employee Name <a style="color:red;">*</a></label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="user_dropdown" name="emp_id" style="margin-top: 10px;padding-bottom: 10px;" class="form-control manager" > </select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="first-name"> Date of Expense<a style="color:red;">*</a></label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<div class="form-group">
|
||||
<div class='input-group date' >
|
||||
<input type='text' id='myDatepicker' class="form-control" placeholder="DD-MM-YYYY" required name="date_of_expence" value="" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="first-name"> Expense Cost <a style="color:red;">*</a></label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="cost" name="amount" required value="<?php if(isset($assetData)) { echo $assetData->cost; } ?>" class="form-control" type="text" name="middle-name">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="item form-group">
|
||||
<label class="control-label col-md-2 col-sm-2 " for="last-name">Description</label>
|
||||
<div class="col-md-5 col-sm-5">
|
||||
<textarea id="comments" name="comments" value="" class="form-control" style="height:200px !important;" type="text" ></textarea>
|
||||
|
||||
<input type="hidden" id="manager_id" name="manager" value="">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " required for="first-name">Upload Bill </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="formFile" name="bill" onchange="PreviewImage()" class="typeFile" type="file">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " required for="first-name"></label>
|
||||
<div class="col-md-2 col-sm-2 ">
|
||||
<img src="http://ssl.gstatic.com/accounts/ui/avatar_2x.png" width="100" height="100" id="uploadPreview" class="avatar img-circle img-thumbnail" style="height: 100px; width: 100px;" alt="avatar"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ln_solid"></div>
|
||||
<div class="item form-group">
|
||||
<div class=" offset-md-8">
|
||||
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
||||
<button class="btn btn-primary" type="reset">Reset</button>
|
||||
<button type="submit" class="btn btn-success">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- /Body page content -->
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
|
||||
var currentUserName = '<?php echo user()->name; ?>';
|
||||
var currentUserId = '<?php echo user()->id; ?>';
|
||||
$('#user_dropdown').append('<option value="' + currentUserId + '">' +
|
||||
currentUserName + '</option>');
|
||||
$('#user_dropdown').prop('disabled', true);
|
||||
|
||||
$('#user_dropdown').on('change',function() {
|
||||
|
||||
});
|
||||
|
||||
|
||||
$('input[type="radio"][name="created_by"]').change(function() {
|
||||
var selectedValue = $(this).val();
|
||||
var $userDropdown = $('#user_dropdown');
|
||||
|
||||
$userDropdown.empty();
|
||||
|
||||
if (selectedValue === 'self (<?php echo user()->id;?>)') {
|
||||
|
||||
var currentUserName = '<?php echo user()->name; ?>';
|
||||
var currentUserId = '<?php echo user()->id; ?>';
|
||||
$userDropdown.append('<option value="' + currentUserId + '">' + currentUserName + '</option>');
|
||||
$userDropdown.prop('disabled', true);
|
||||
} else if (selectedValue === '<?php echo user()->name; ?> (<?php echo user()->id;?>)') {
|
||||
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('Expence/get_emp_name/')?>"',
|
||||
method: 'GET',
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
|
||||
$('#user_dropdown').append(response);
|
||||
$('#user_dropdown').prop('disabled', false);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
//get manager id from the dropdown employee assign the value to $("#manager_id") input field
|
||||
|
||||
$("#user_dropdown").on("change", function(){
|
||||
let manager_id = $(this).children(":selected").attr("id");
|
||||
|
||||
console.log(manager_id);
|
||||
|
||||
$("#manager_id").val(manager_id);
|
||||
|
||||
})
|
||||
|
||||
</script>
|
||||
<script>
|
||||
function PreviewImage() {
|
||||
var oFReader = new FileReader();
|
||||
oFReader.readAsDataURL(document.getElementById("formFile").files[0]);
|
||||
|
||||
oFReader.onload = function (oFREvent) {
|
||||
document.getElementById("uploadPreview").src = oFREvent.target.result;
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
257
application/modules/Expence/views/expence_list.php
Normal file
@ -0,0 +1,257 @@
|
||||
|
||||
<head>
|
||||
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css'>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
|
||||
|
||||
<style>
|
||||
.design {
|
||||
display: none;
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
.design-form {
|
||||
background-color: #fefefe;
|
||||
margin: 15% auto;
|
||||
padding: 20px;
|
||||
border: 1px solid #888;
|
||||
width: 380px;
|
||||
height: 280px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
button {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_filter{
|
||||
margin-top: -44px !important; //search to up
|
||||
|
||||
</style>
|
||||
|
||||
<style>
|
||||
/* Modal Popup Styles */
|
||||
.modal {
|
||||
display: none; /* Hide the modal by default */
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
background-color: rgba(0, 0, 0, 0.9);
|
||||
}
|
||||
|
||||
.modal img {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
max-width: 80%;
|
||||
max-height: 100%;
|
||||
margin-top: 5%;
|
||||
margin-bottom: 5%;
|
||||
}
|
||||
|
||||
.close {
|
||||
color: #fff;
|
||||
font-size: 40px;
|
||||
font-weight: bold;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
background-color: #fefefe;
|
||||
margin: 15% auto;
|
||||
padding: 30px;
|
||||
border: 1px solid #888;
|
||||
width: 380px;
|
||||
height: 280px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
</head>
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<a href="<?php echo base_url();?>Expence/emp_expence_list" class="btn btn-sm btn-primary" style="margin-top: 20px;">Back</a>
|
||||
</ul>
|
||||
<h1>My Approvals</h1>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="x_content">
|
||||
<div class="row">
|
||||
<div class="col-sm-12" style="overflow: auto;">
|
||||
<table id="datatable-buttons" class="table table-striped table-bordered" width="100%">
|
||||
<thead>
|
||||
<tr class="headings">
|
||||
<th class="column-title">Claim Date</th>
|
||||
<th class="column-title">Employee Name</th>
|
||||
<th class="column-title">Description </th>
|
||||
<th class="column-title">Expense Date</th>
|
||||
<th class="column-title">Expense Cost(₹)</th>
|
||||
<th class="column-title">Claim Raised By</th>
|
||||
<th class="column-title">Status </th>
|
||||
<th class="column-title" >Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($tableData as $key => $value) { ?>
|
||||
<tr class="even pointer">
|
||||
|
||||
<td class=" "><?php echo $value->created_date; ?><br><?php echo $value->created_time;?></td>
|
||||
<td class=" "><?php echo $value->name; ?> (<?php echo $value->emp_id; ?>) </td>
|
||||
<td class=" "><?php echo $value->comments; ?></td>
|
||||
<td class=" "><?php echo $value->date_of_expence; ?></td>
|
||||
<td class=" ">₹ <?php echo $value->amount; ?></td>
|
||||
<td class=" "><?php echo $value->created_by; ?></td>
|
||||
|
||||
<?php if($value->status == 'pending'){ ?>
|
||||
<td style="color:#e68a00"><?php echo $value->status; ?></td>
|
||||
<?php }
|
||||
else if($value->status == 'Approved'){ ?>
|
||||
<td style="color:green"><?php echo $value->status; ?>By <?php echo $value->approved_by; ?><br><?php echo $value->approved_at;?></td>
|
||||
<?php }
|
||||
else if($value->status == 'Declined'){ ?>
|
||||
<td style="color:red"><?php echo $value->status; ?><br><?php echo $value->Dreason; ?></td>
|
||||
<?php }
|
||||
else if($value->status == 'canceled'){ ?>
|
||||
<td style="color:darkcyan;"><?php echo $value->status; ?></td>
|
||||
<?php }
|
||||
else{
|
||||
|
||||
}?>
|
||||
<td style=" text-align: center; font-size: 16px;">
|
||||
|
||||
<?php if(!empty($value->bill)) { ?>
|
||||
|
||||
<a onclick="openModal('<?php echo base_url(); ?>assets/uploads/Expence_Bill/<?php echo $value->bill; ?>')" title="ViewBill"><i class="fa fa-eye" aria-hidden="true"></i></a><br>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php if($value->status == 'pending') { ?>
|
||||
|
||||
<a href="<?php echo base_url('Expence/Approve_Expence')?>?id=<?php echo $value->id;?> "><i class="fa fa-check" aria-hidden="true"title="Approve" onclick = "return confirm('Are you sure to Approve This Leave ')" ></i></a>
|
||||
|
||||
|
||||
<a href="#"><i class="fa fa-times test" aria-hidden="true" title="Decline" onclick="showCustomPrompt()"
|
||||
id= "<?php echo $value->id; ?>"></i></a>
|
||||
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="customPrompt" class="modal">
|
||||
<div class="modal-content ">
|
||||
<span onclick="$('#customPrompt').hide()" style="text-align: right;"><i class="fa fa-times fa-2x" aria-hidden="true"></i></span>
|
||||
<h3>Decline Reason</h3>
|
||||
<input list="browsers" style="padding:20px; margin:6px;" id="decline_reason" required name="myBrowser" />
|
||||
<datalist id="browsers" >
|
||||
<?php foreach ($dropdown as $key => $value) { ?>
|
||||
<option value="<?php echo $value->enum_value; ?>"><?php echo $value->enum_value; ?></option>
|
||||
<?php } ?>
|
||||
</datalist>
|
||||
|
||||
<button onclick="submitCustomPrompt()" type="button" class="btn btn-primary">Submit</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
||||
<div class="modal fade bs-example-modal-lg" id="ItemModal" tabindex="-1" role="dialog" aria-hidden="true"></div>
|
||||
<div class="modal bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" id="popup"> </div>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
function showCustomPrompt() {
|
||||
var customPrompt = document.getElementById("customPrompt");
|
||||
customPrompt.style.display = "block";
|
||||
}
|
||||
|
||||
function submitCustomPrompt() {
|
||||
|
||||
var id = $('.test').attr("id");
|
||||
var reason = document.getElementById("decline_reason").value;
|
||||
|
||||
if( reason != "")
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
data:{id : id , reason : reason },
|
||||
url:"<?php echo base_url('Expence/Decline_expence');?>",
|
||||
type:"get",
|
||||
success: function(response) {
|
||||
|
||||
window.location ='<?php echo base_url('Expence/expence_list');?>';
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
else
|
||||
|
||||
alert('Decline Reason is required');
|
||||
}
|
||||
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<div id="myModal" class="modal">
|
||||
<span class="close">×</span>
|
||||
<img id="modalImage" src="" alt="Image">
|
||||
</div>
|
||||
|
||||
<!-- JavaScript -->
|
||||
<script>
|
||||
function openModal(itemId) {
|
||||
// Get the image URL for the item with the specified ID
|
||||
var imageUrl = itemId;
|
||||
|
||||
// Set the image source of the modal
|
||||
document.getElementById("modalImage").src = imageUrl;
|
||||
|
||||
// Open the modal
|
||||
var modal = document.getElementById("myModal");
|
||||
modal.style.display = "block";
|
||||
|
||||
// Close the modal when the user clicks on the close button
|
||||
var closeButton = document.getElementsByClassName("close")[0];
|
||||
closeButton.onclick = function() {
|
||||
modal.style.display = "none";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$(".hide-it").hide(5000);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
251
application/modules/Expence/views/expence_manager_approvel.php
Normal file
@ -0,0 +1,251 @@
|
||||
|
||||
<head>
|
||||
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css'>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
|
||||
|
||||
<style>
|
||||
.design {
|
||||
display: none;
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
.design-form {
|
||||
background-color: #fefefe;
|
||||
margin: 15% auto;
|
||||
padding: 20px;
|
||||
border: 1px solid #888;
|
||||
width: 380px;
|
||||
height: 280px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
button {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_filter{
|
||||
margin-top: -44px !important; //search to up
|
||||
|
||||
</style>
|
||||
|
||||
<style>
|
||||
/* Modal Popup Styles */
|
||||
.modal {
|
||||
display: none; /* Hide the modal by default */
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
background-color: rgba(0, 0, 0, 0.9);
|
||||
}
|
||||
|
||||
.modal img {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
max-width: 80%;
|
||||
max-height: 100%;
|
||||
margin-top: 5%;
|
||||
margin-bottom: 5%;
|
||||
}
|
||||
|
||||
.close {
|
||||
color: #fff;
|
||||
font-size: 40px;
|
||||
font-weight: bold;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
background-color: #fefefe;
|
||||
margin: 15% auto;
|
||||
padding: 30px;
|
||||
border: 1px solid #888;
|
||||
width: 380px;
|
||||
height: 280px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
<ul class="nav navbar-right panel_toolbox current-page">
|
||||
<a href="<?php echo base_url();?>Expence/emp_expence_list" class="btn btn-primary current-page" style="margin-top: 20px;">Back</a>
|
||||
</ul>
|
||||
<h1>My Approvals</h1>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="x_content">
|
||||
<div class="row">
|
||||
<div class="col-sm-12" style="overflow: auto;">
|
||||
<table id="datatable-buttons" class="table table-striped table-bordered" width="100%">
|
||||
<thead>
|
||||
<tr class="headings">
|
||||
<th class="column-title">Claim Date</th>
|
||||
<th class="column-title">Employee Name</th>
|
||||
<th class="column-title">Description </th>
|
||||
<th class="column-title">Expense Date</th>
|
||||
<th class="column-title">Expense Cost(₹)</th>
|
||||
<th class="column-title">Claim Raised By</th>
|
||||
<th class="column-title">Status </th>
|
||||
<th class="column-title" >Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php foreach ($tableData as $key => $value) { ?>
|
||||
|
||||
<?php foreach ($get_delegation as $key => $val) { ?>
|
||||
|
||||
|
||||
|
||||
<?php if(user()->id == $value->manager || user()->id == $val->delegated_to && date('d-m-Y') >= $val->from_date && date('d-m-Y') <= $val->to_date && $value->created_date >= $val->from_date && $value->created_date <= $val->to_date ){ ?>
|
||||
|
||||
<tr class="even pointer">
|
||||
|
||||
<td class=" "><?php echo $value->created_date; ?><br><?php echo $value->created_time;?></td>
|
||||
<td class=" "><?php echo $value->name; ?> (<?php echo $value->emp_id; ?>)</td>
|
||||
<td class=" "><?php echo $value->comments; ?></td>
|
||||
<td class=" "><?php echo $value->date_of_expence; ?></td>
|
||||
<td class=" ">₹ <?php echo $value->amount; ?></td>
|
||||
<td class=" "><?php echo $value->created_by; ?></td>
|
||||
<?php if($value->status == 'pending'){ ?>
|
||||
<td style="color:#e68a00"><?php echo $value->status; ?></td>
|
||||
<?php }
|
||||
else if($value->status == 'Approved'){ ?>
|
||||
<td style="color:green"><?php echo $value->status; ?>By <?php echo $value->approved_by; ?><br><?php echo $value->approved_at;?></td>
|
||||
<?php }
|
||||
else if($value->status == 'Declined'){ ?>
|
||||
<td style="color:red"> <?php echo $value->status; ?><br><?php echo $value->Dreason; ?></td>
|
||||
<?php }
|
||||
else if($value->status == 'canceled'){ ?>
|
||||
<td style="color:darkcyan;"><?php echo $value->status; ?></td>
|
||||
<?php }
|
||||
else{
|
||||
|
||||
}?>
|
||||
<td style=" text-align: center; font-size: 16px;">
|
||||
|
||||
<?php if(!empty($value->bill)) { ?>
|
||||
|
||||
|
||||
<a onclick="openModal('<?php echo base_url(); ?>assets/uploads/Expence_Bill/<?php echo $value->bill; ?>')" title="ViewBill"><i class="fa fa-eye" aria-hidden="true"></i></a><br>
|
||||
<?php } ?>
|
||||
|
||||
<?php if($value->status == 'pending') { ?>
|
||||
|
||||
<a href="<?php echo base_url('Expence/Manager_Approvel')?>?id=<?php echo $value->id;?> "><i class="fa fa-check" aria-hidden="true"title="Approve" onclick = "return confirm('Are you sure to Approve This Claim')"></i></a>
|
||||
|
||||
|
||||
<a href="#"><i class="fa fa-times test" aria-hidden="true" title="Decline" onclick="showCustomPrompt()"
|
||||
id= "<?php echo $value->id; ?>"></i></a>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<?php } } } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="customPrompt" class="modal">
|
||||
<div class="modal-content ">
|
||||
<span onclick="$('#customPrompt').hide()" style="text-align: right;"><i class="fa fa-times fa-2x" aria-hidden="true"></i></span>
|
||||
<h3>Decline Reason</h3>
|
||||
<input list="browsers" style="padding:20px; margin:6px;" id="decline_reason" required name="myBrowser" />
|
||||
<datalist id="browsers" >
|
||||
<?php foreach ($dropdown as $key => $value) { ?>
|
||||
<option value="<?php echo $value->enum_value; ?>"><?php echo $value->enum_value; ?></option>
|
||||
<?php } ?>
|
||||
</datalist>
|
||||
|
||||
<button onclick="submitCustomPrompt()" type="button" class="btn btn-primary">Submit</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
||||
<div class="modal fade bs-example-modal-lg" id="ItemModal" tabindex="-1" role="dialog" aria-hidden="true"></div>
|
||||
<div class="modal bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" id="popup"> </div>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
function showCustomPrompt() {
|
||||
var customPrompt = document.getElementById("customPrompt");
|
||||
customPrompt.style.display = "block";
|
||||
}
|
||||
|
||||
function submitCustomPrompt() {
|
||||
|
||||
var id = $('.test').attr("id");
|
||||
var reason = document.getElementById("decline_reason").value;
|
||||
|
||||
if( reason != "")
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
data:{id : id , reason : reason },
|
||||
url:"<?php echo base_url('Expence/Decline_expence');?>",
|
||||
type:"get",
|
||||
success: function(response) {
|
||||
|
||||
window.location ='<?php echo base_url('Expence/expence_list');?>';
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
else
|
||||
|
||||
alert('Decline Reason is required');
|
||||
}
|
||||
|
||||
</script>
|
||||
</div>
|
||||
<div id="myModal" class="modal">
|
||||
<span class="close">×</span>
|
||||
<img id="modalImage" src="" alt="Image">
|
||||
</div>
|
||||
|
||||
<!-- JavaScript -->
|
||||
<script>
|
||||
function openModal(itemId) {
|
||||
|
||||
var imageUrl = itemId;
|
||||
document.getElementById("modalImage").src = imageUrl;
|
||||
var modal = document.getElementById("myModal");
|
||||
modal.style.display = "block";
|
||||
var closeButton = document.getElementsByClassName("close")[0];
|
||||
closeButton.onclick = function()
|
||||
{
|
||||
modal.style.display = "none";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@ -71,7 +71,7 @@ public function render($view = 'layout')
|
||||
// print_r($this->view_data);die();
|
||||
// $this->output->enable_profiler(true);
|
||||
|
||||
$this->load->view('layout/'.$view, $this->view_data);
|
||||
$this->load->view('Layout/'.$view, $this->view_data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
22
application/modules/Layout/views/Employee_Layout.php
Normal file
@ -0,0 +1,22 @@
|
||||
<!-- top navigation -->
|
||||
<?php $this->layout->load_view('Layout/includes/employee_header.php');?>
|
||||
<!-- /top navigation -->
|
||||
|
||||
<!-- menu here -->
|
||||
<?php $this->layout->load_view('Layout/includes/employee_menu.php');?>
|
||||
<!-- menu here -->
|
||||
|
||||
<!-- Body page content -->
|
||||
<div class="right_col" role="main">
|
||||
|
||||
<?php echo $main_content; ?>
|
||||
|
||||
</div>
|
||||
<!-- /Body page content -->
|
||||
|
||||
<!-- footer content -->
|
||||
<?php $this->layout->load_view('Layout/includes/employee_footer.php');?>
|
||||
<!-- /footer content -->
|
||||
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<!-- top navigation -->
|
||||
<?php $this->layout->load_view('layout/includes/default_header.php');?>
|
||||
<?php $this->layout->load_view('Layout/includes/default_header.php');?>
|
||||
<!-- /top navigation -->
|
||||
|
||||
<!-- menu here -->
|
||||
<?php $this->layout->load_view('layout/includes/default_menu.php');?>
|
||||
<?php $this->layout->load_view('Layout/includes/default_menu.php');?>
|
||||
<!-- menu here -->
|
||||
|
||||
<!-- Body page content -->
|
||||
@ -15,7 +15,7 @@
|
||||
<!-- /Body page content -->
|
||||
|
||||
<!-- footer content -->
|
||||
<?php $this->layout->load_view('layout/includes/default_footer.php');?>
|
||||
<?php $this->layout->load_view('Layout/includes/default_footer.php');?>
|
||||
<!-- /footer content -->
|
||||
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
<!---ajax call--->
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"> </script>
|
||||
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"> </script> -->
|
||||
|
||||
<title>Ams</title>
|
||||
|
||||
@ -82,9 +82,13 @@
|
||||
<div class="nav_menu">
|
||||
<div class="nav toggle">
|
||||
<a id="menu_toggle"><i class="fa fa-bars"></i></a>
|
||||
|
||||
</div>
|
||||
|
||||
<nav class="nav navbar-nav">
|
||||
<ul class=" navbar-right">
|
||||
<a onclick="history.back()"><span class="glyphicon glyphicon-circle-arrow-left" style="margin-left:-60px;font-size:23px" title="Back"></span></a>
|
||||
|
||||
<li class="nav-item dropdown open" style="padding-left: 15px;">
|
||||
<a href="javascript:;" class="user-profile dropdown-toggle" aria-haspopup="true" id="navbarDropdown" data-toggle="dropdown" aria-expanded="false">
|
||||
<?php if(user()->profile_image == '' || user()->profile_image == null) { ?>
|
||||
@ -96,29 +100,24 @@
|
||||
<?php if(check_auth() && is_admin() || is_user()){echo user()->name;}else{echo user()->name; }?>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-usermenu pull-right" aria-labelledby="navbarDropdown">
|
||||
<a class="dropdown-item" href="<?php echo base_url()?>user/profile/"> Profile</a>
|
||||
<a class="dropdown-item" href="<?php echo base_url()?>user/changepassword/">Change Password</a>
|
||||
<a class="dropdown-item" href="<?php echo base_url()?>User/profile/"> Profile</a>
|
||||
<a class="dropdown-item" href="<?php echo base_url()?>User/changepassword/">Change Password</a>
|
||||
<?php
|
||||
if (is_admin()) {
|
||||
?>
|
||||
<a class="dropdown-item" href="<?php echo base_url()?>user/businessProfile/<?php echo md5(user()->business_id); ?>"> Business</a>
|
||||
<a class="dropdown-item" href="<?php echo base_url()?>User/businessProfile/<?php echo md5(user()->business_id); ?>"> Business</a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php if (is_admin() || is_user()) { ?>
|
||||
<a class="dropdown-item" href="<?php echo base_url()?>asset/masterDataList/">Masters</a>
|
||||
<a class="dropdown-item" href="<?php echo base_url()?>Asset/masterDataList/">Masters</a>
|
||||
<?php } ?>
|
||||
<a class="dropdown-item" href="#">Settings</a>
|
||||
<!-- <a class="dropdown-item" href="javascript:;">Help</a> -->
|
||||
<a class="dropdown-item" href="<?php echo base_url();?>auth/logout"><i class="fa fa-sign-out pull-right"></i> Log Out</a>
|
||||
<a class="dropdown-item" href="<?php echo base_url();?>Auth/logout"><i class="fa fa-sign-out pull-right"></i> Log Out</a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li role="presentation" class="nav-item dropdown open">
|
||||
<a href="javascript:;" class="dropdown-toggle info-number" id="navbarDropdown1" data-toggle="dropdown" aria-expanded="false">
|
||||
<i class="fa fa-envelope-o"></i>
|
||||
<span class="badge bg-green">6</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu list-unstyled msg_list" role="menu" aria-labelledby="navbarDropdown1">
|
||||
<li class="nav-item">
|
||||
<a class="dropdown-item">
|
||||
|
||||
@ -4,14 +4,15 @@
|
||||
<a class="site_title">
|
||||
<?php if(check_auth() && is_superadmin()) { ?>
|
||||
<img src="<?php echo base_url(); ?>/assets/uploads/logo/<?php echo $settings->logo;?>" class="img-circle logo">
|
||||
<?php } else if(check_auth() && is_admin() || is_user()) { ?>
|
||||
<img src="<?php echo base_url(); ?>/assets/uploads/logo/<?php echo $business->logo;?>" class="img-circle logo">
|
||||
<?php } ?>
|
||||
|
||||
<?php } else if(check_auth() && is_admin() || !is_null(is_user())) { ?>
|
||||
<img src="<?php echo base_url(); ?>/assets/uploads/logo/<?php echo $business->logo;?>" class="img-circle logo">
|
||||
<?php } ?>
|
||||
<span>
|
||||
<?php if(check_auth() && is_admin() || is_user())
|
||||
{echo $business->business_name;}
|
||||
else if(check_auth() && is_superadmin())
|
||||
{ echo $settings->site_name; }?>
|
||||
<?php if(check_auth() && is_admin() || !is_null(is_user()))
|
||||
{echo $business->business_name;}
|
||||
else if(check_auth() && is_superadmin())
|
||||
{ echo $settings->site_name; }?>
|
||||
</span></a>
|
||||
</div>
|
||||
|
||||
@ -52,9 +53,9 @@
|
||||
<?php if(check_auth() && is_admin() || is_user() ) { ?>
|
||||
<li><a><i class="fa fa-university"></i> Assets <span class="fa fa-chevron-down"></span></a>
|
||||
<ul class="nav child_menu">
|
||||
<li><a href="<?php echo base_url();?>asset/assetList">Assets List</a></li>
|
||||
<li><a href="<?php echo base_url();?>Asset/assetLandingPage">Assets List</a></li>
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<li><a href="<?php echo base_url();?>asset/addAsset">Add Asset</a></li>
|
||||
<li><a href="<?php echo base_url();?>Asset/addAsset">Add Asset</a></li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
@ -62,8 +63,8 @@
|
||||
<?php if(check_auth() && is_superadmin() ) { ?>
|
||||
<li><a><i class="fa fa-archive"></i> Business <span class="fa fa-chevron-down"></span></a>
|
||||
<ul class="nav child_menu">
|
||||
<li><a href="<?php echo base_url();?>business/business_list">Business List</a></li>
|
||||
<li><a href="<?php echo base_url();?>business/add_business">Add Business</a></li>
|
||||
<li><a href="<?php echo base_url();?>Business/business_list">Business List</a></li>
|
||||
<li><a href="<?php echo base_url();?>Business/add_business">Add Business</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
@ -71,19 +72,43 @@
|
||||
<?php if(check_auth() && is_admin() || is_superadmin() || is_user() ) { ?>
|
||||
<li><a><i class="fa fa-user"></i> Users <span class="fa fa-chevron-down"></span></a>
|
||||
<ul class="nav child_menu">
|
||||
<li><a href="<?php echo base_url();?>user/userList">Users List</a></li>
|
||||
<li><a href="<?php echo base_url();?>User/userList">Users List</a></li>
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<li><a href="<?php echo base_url();?>user/addUser">Add Users</a></li>
|
||||
<li><a href="<?php echo base_url();?>User/addUser">Add Users</a></li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<?php if(check_auth() && is_admin() || is_superadmin() || is_user() ) { ?>
|
||||
<li><a href="<?php echo base_url();?>Employee/empList"><i class="fa fa-group"></i> Employee</a></li>
|
||||
<?php } ?>
|
||||
|
||||
<?php if(check_auth() && is_user() || user()->role == null ) { ?>
|
||||
|
||||
<li><a href="<?php echo base_url();?>Leave/leavehistory"><i class="fa fa-calendar-times-o"></i>Leaves</a></li>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php if(check_auth() && is_user() || user()->role == null ) { ?>
|
||||
|
||||
<li><a href="<?php echo base_url();?>Expence/emp_expence_list"><i class="fa fa-money"></i> Expense </a></li>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php if(check_auth() && is_user() || user()->role == null ) { ?>
|
||||
|
||||
<li><a href="<?php echo base_url();?>Delegation/Delegation_list"><i class="fa fa-tasks" aria-hidden="true"></i> Delegation</a></li>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<?php if(check_auth() && is_admin() || is_user() ) { ?>
|
||||
<li><a><i class="fa fa-clipboard"></i> Reports <span class="fa fa-chevron-down"></span></a>
|
||||
<ul class="nav child_menu">
|
||||
<li><a href="<?php echo base_url();?>asset/depreciation_report">Depreciation Reports</a></li>
|
||||
<li><a href="<?php echo base_url();?>asset/amc_report">AMC Reports</a></li>
|
||||
<li><a href="<?php echo base_url();?>asset/insurance_report">Insurance Reports</a></li>
|
||||
<li><a href="<?php echo base_url();?>Asset/depreciation_report">Depreciation Reports</a></li>
|
||||
<li><a href="<?php echo base_url();?>Asset/amc_report">AMC Reports</a></li>
|
||||
<li><a href="<?php echo base_url();?>Asset/insurance_report">Insurance Reports</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
@ -109,7 +134,7 @@
|
||||
<a data-toggle="tooltip" data-placement="top" title="Lock">
|
||||
<span class="glyphicon glyphicon-eye-close" aria-hidden="true"></span>
|
||||
</a>
|
||||
<a data-toggle="tooltip" data-placement="top" title="Logout" href="login.html">
|
||||
<a data-toggle="tooltip" data-placement="top" title="Logout" href="<?php echo base_url();?>Auth/logout">
|
||||
<span class="glyphicon glyphicon-off" aria-hidden="true"></span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@ -0,0 +1,93 @@
|
||||
<!-- Footer code -->
|
||||
<footer >
|
||||
<div class="pull-right">
|
||||
<?php if(check_auth() && is_admin() || is_user()){echo $business->business_name;}else{echo $settings->site_name;}?>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</footer>
|
||||
<!-- Footer code -->
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="<?php echo base_url(); ?>/assets/default/jquery/dist/jquery.min.js"></script>
|
||||
<!-- Bootstrap -->
|
||||
<script src="<?php echo base_url(); ?>/assets/default/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<!-- FastClick ------->
|
||||
<script src="<?php echo base_url(); ?>/assets/default/fastclick/lib/fastclick.js"></script>
|
||||
<!-- NProgress ------->
|
||||
<script src="<?php echo base_url(); ?>/assets/default/nprogress/nprogress.js"></script>
|
||||
<!-- Chart.js -------->
|
||||
|
||||
<!-- gauge.js -->
|
||||
<script src="<?php echo base_url(); ?>/assets/default/gauge.js/dist/gauge.min.js"></script>
|
||||
<!-- bootstrap-progressbar -->
|
||||
<script src="<?php echo base_url(); ?>/assets/default/bootstrap-progressbar/bootstrap-progressbar.min.js"></script>
|
||||
<!-- iCheck -->
|
||||
<script src="<?php echo base_url(); ?>/assets/default/iCheck/icheck.min.js"></script>
|
||||
<!-- Skycons -->
|
||||
<script src="<?php echo base_url(); ?>/assets/default/skycons/skycons.js"></script>
|
||||
<!-- Flot -->
|
||||
<script src="<?php echo base_url(); ?>/assets/default/Flot/jquery.flot.js"></script>
|
||||
<script src="<?php echo base_url(); ?>/assets/default/Flot/jquery.flot.pie.js"></script>
|
||||
<script src="<?php echo base_url(); ?>/assets/default/Flot/jquery.flot.time.js"></script>
|
||||
<script src="<?php echo base_url(); ?>/assets/default/Flot/jquery.flot.stack.js"></script>
|
||||
<script src="<?php echo base_url(); ?>/assets/default/Flot/jquery.flot.resize.js"></script>
|
||||
<!-- Flot plugins -->
|
||||
<script src="<?php echo base_url(); ?>/assets/default/flot.orderbars/js/jquery.flot.orderBars.js"></script>
|
||||
<script src="<?php echo base_url(); ?>/assets/default/flot-spline/js/jquery.flot.spline.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>/assets/default/flot.curvedlines/curvedLines.js"></script>
|
||||
<!-- DateJS -->
|
||||
<script src="<?php echo base_url(); ?>/assets/default/DateJS/build/date.js"></script>
|
||||
<!-- Custom Theme Scripts -->
|
||||
<script src="<?php echo base_url(); ?>/assets/default/build/js/custom.min.js"></script>
|
||||
<!-- datatables -->
|
||||
<script src="<?php echo base_url(); ?>/assets/default/datatables.net/js/jquery.dataTables.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>/assets/default/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>/assets/default/datatables.net-buttons/js/dataTables.buttons.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>/assets/default/datatables.net-buttons-bs/js/buttons.bootstrap.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>/assets/default/datatables.net-buttons/js/buttons.flash.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>/assets/default/datatables.net-buttons/js/buttons.html5.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>/assets/default/datatables.net-buttons/js/buttons.print.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>/assets/default/datatables.net-fixedheader/js/dataTables.fixedHeader.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>/assets/default/datatables.net-keytable/js/dataTables.keyTable.min.js"></script>
|
||||
|
||||
<script src="<?php echo base_url(); ?>/assets/default/datatables.net-scroller/js/dataTables.scroller.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>/assets/default/jszip/dist/jszip.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>/assets/default/pdfmake/build/pdfmake.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>/assets/default/pdfmake/build/vfs_fonts.js"></script>
|
||||
|
||||
|
||||
<!-- PNotify -->
|
||||
<script src="<?php echo base_url(); ?>/assets/default/pnotify/dist/pnotify.js"></script>
|
||||
<script src="<?php echo base_url(); ?>/assets/default/pnotify/dist/pnotify.buttons.js"></script>
|
||||
<script src="<?php echo base_url(); ?>/assets/default/pnotify/dist/pnotify.nonblock.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- bootstrap-daterangepicker -->
|
||||
<script src="<?php echo base_url(); ?>/assets/default/moment/min/moment.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>/assets/default/bootstrap-daterangepicker/daterangepicker.js"></script>
|
||||
<!-- bootstrap-datetimepicker -->
|
||||
<script src="<?php echo base_url(); ?>/assets/default/bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>
|
||||
|
||||
|
||||
|
||||
<script src="<?php echo base_url(); ?>/assets/default/customize/ajax.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
126
application/modules/Layout/views/includes/employee_header.php
Normal file
@ -0,0 +1,126 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<!-- Meta, title, CSS, favicons, etc. -->
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="icon" href="images/favicon.ico" type="image/ico" />
|
||||
|
||||
|
||||
<!---ajax call--->
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"> </script>
|
||||
|
||||
<title>Ams</title>
|
||||
|
||||
<!-- Bootstrap -->
|
||||
<link href="<?php echo base_url(); ?>/assets/default/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<!-- Font Awesome -->
|
||||
<link href="<?php echo base_url(); ?>/assets/default/font-awesome/css/font-awesome.min.css" rel="stylesheet">
|
||||
<!-- NProgress -->
|
||||
<link href="<?php echo base_url(); ?>/assets/default/nprogress/nprogress.css" rel="stylesheet">
|
||||
<!-- iCheck -->
|
||||
<link href="<?php echo base_url(); ?>/assets/default/iCheck/skins/flat/green.css" rel="stylesheet">
|
||||
<!-- bootstrap-progressbar -->
|
||||
<link href="<?php echo base_url(); ?>/assets/default/bootstrap-progressbar/css/bootstrap-progressbar-3.3.4.min.css" rel="stylesheet">
|
||||
<!-- Custom Theme Style -->
|
||||
<link href="<?php echo base_url(); ?>/assets/default/build/css/custom.min.css" rel="stylesheet">
|
||||
<!-- Datatables -->
|
||||
|
||||
<link href="<?php echo base_url(); ?>/assets/default/datatables.net-bs/css/dataTables.bootstrap.min.css" rel="stylesheet">
|
||||
<link href="<?php echo base_url(); ?>/assets/default/datatables.net-buttons-bs/css/buttons.bootstrap.min.css" rel="stylesheet">
|
||||
<link href="<?php echo base_url(); ?>/assets/default/datatables.net-fixedheader-bs/css/fixedHeader.bootstrap.min.css" rel="stylesheet">
|
||||
<link href="<?php echo base_url(); ?>/assets/default/datatables.net-responsive-bs/css/responsive.bootstrap.min.css" rel="stylesheet">
|
||||
<link href="<?php echo base_url(); ?>/assets/default/datatables.net-scroller-bs/css/scroller.bootstrap.min.css" rel="stylesheet">
|
||||
|
||||
|
||||
<!-- bootstrap-daterangepicker -->
|
||||
<link href="<?php echo base_url(); ?>/assets/default/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet">
|
||||
<!-- bootstrap-datetimepicker -->
|
||||
<link href="<?php echo base_url(); ?>/assets/default/bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css" rel="stylesheet">
|
||||
<!-- style.css -->
|
||||
<link href="<?php echo base_url(); ?>/assets/default/customize/style.css" rel="stylesheet">
|
||||
|
||||
<!-- PNotify -->
|
||||
<link href="<?php echo base_url(); ?>/assets/default/pnotify/dist/pnotify.css" rel="stylesheet">
|
||||
<link href="<?php echo base_url(); ?>/assets/default/pnotify/dist/pnotify.buttons.css" rel="stylesheet">
|
||||
<link href="<?php echo base_url(); ?>/assets/default/pnotify/dist/pnotify.nonblock.css" rel="stylesheet">
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.typeFile
|
||||
{
|
||||
border: 1px solid #ccc;
|
||||
display: inline-block;
|
||||
padding: 6px 12px;
|
||||
cursor: pointer;
|
||||
width:100%;
|
||||
}
|
||||
.logo
|
||||
{
|
||||
width:28px;
|
||||
height:28px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
|
||||
<body class="nav-md">
|
||||
|
||||
<div class="container body">
|
||||
<div class="main_container">
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Header code -->
|
||||
<div class="top_nav">
|
||||
<div class="nav_menu">
|
||||
<div class="nav toggle">
|
||||
<a id="menu_toggle"><i class="fa fa-bars"></i></a>
|
||||
|
||||
</div>
|
||||
|
||||
<nav class="nav navbar-nav">
|
||||
<ul class=" navbar-right">
|
||||
<a onclick="history.back()"><span class="glyphicon glyphicon-circle-arrow-left" style="margin-left:-60px;font-size:23px" title="Back"></span></a>
|
||||
|
||||
<li class="nav-item dropdown open" style="padding-left: 15px;">
|
||||
<a href="javascript:;" class="user-profile dropdown-toggle" aria-haspopup="true" id="navbarDropdown" data-toggle="dropdown" aria-expanded="false">
|
||||
<?php if(user()->profile_image == '' || user()->profile_image == null) { ?>
|
||||
<img src="<?php echo base_url(); ?>/assets/uploads/profile_picture/profile.jpg" alt="">
|
||||
|
||||
<?php } else { ?>
|
||||
<img src="<?php echo base_url(); ?>/assets/uploads/profile_picture/<?php echo user()->profile_image; ?>" alt="">
|
||||
<?php } ?>
|
||||
<?php if(check_auth() && is_admin() || is_user()){echo user()->name;}else{echo user()->name; }?>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-usermenu pull-right" aria-labelledby="navbarDropdown">
|
||||
<a class="dropdown-item" href="<?php echo base_url()?>User/profile/"> Profile</a>
|
||||
<a class="dropdown-item" href="<?php echo base_url()?>User/changepassword/">Change Password</a>
|
||||
<?php
|
||||
if (is_admin()) {
|
||||
?>
|
||||
<a class="dropdown-item" href="<?php echo base_url()?>User/businessProfile/<?php echo md5(user()->business_id); ?>"> Business</a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php if (is_admin() || is_user()) { ?>
|
||||
<a class="dropdown-item" href="<?php echo base_url()?>Asset/masterDataList/">Masters</a>
|
||||
<?php } ?>
|
||||
<a class="dropdown-item" href="<?php echo base_url();?>Auth/logout"><i class="fa fa-sign-out pull-right"></i> Log Out</a>
|
||||
</div>
|
||||
</li>
|
||||
<ul class="dropdown-menu list-unstyled msg_list" role="menu" aria-labelledby="navbarDropdown1">
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Header code -->
|
||||
172
application/modules/Layout/views/includes/employee_menu.php
Normal file
@ -0,0 +1,172 @@
|
||||
<div class="col-md-3 left_col menu_fixed">
|
||||
<div class="left_col scroll-view">
|
||||
<div class="navbar nav_title" style="border: 0;">
|
||||
<a class="site_title">
|
||||
<?php if(check_auth() && is_superadmin()) { ?>
|
||||
<img src="<?php echo base_url(); ?>/assets/uploads/logo/<?php echo $settings->logo;?>" class="img-circle logo">
|
||||
<?php } else if(check_auth() && is_admin() || !is_null(is_user())) { ?>
|
||||
<img src="<?php echo base_url(); ?>/assets/uploads/logo/<?php echo $business->logo;?>" class="img-circle logo">
|
||||
<?php } ?>
|
||||
<span>
|
||||
<?php if(check_auth() && is_admin() || !is_null(is_user()))
|
||||
{echo $business->business_name;}
|
||||
else if(check_auth() && is_superadmin())
|
||||
{ echo $settings->site_name; }?>
|
||||
</span></a>
|
||||
</div>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<!-- menu profile quick info -->
|
||||
<div class="profile clearfix">
|
||||
<div class="profile_pic">
|
||||
<?php if(user()->profile_image == '' || user()->profile_image == null) { ?>
|
||||
<img src="<?php echo base_url(); ?>/assets/uploads/profile_picture/profile.jpg" alt="..." class="img-circle profile_img">
|
||||
<?php } else { ?>
|
||||
<img src="<?php echo base_url(); ?>/assets/uploads/profile_picture/<?php echo user()->profile_image; ?>"
|
||||
alt="..." class="img-circle profile_img">
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
<div class="profile_info">
|
||||
<span>Welcome,</span>
|
||||
<h2> <?php if(check_auth() && is_admin() || is_user()){echo user()->name;}else{echo user()->name; }?></h2>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /menu profile quick info -->
|
||||
|
||||
<br />
|
||||
|
||||
<!-- sidebar menu -->
|
||||
<div id="sidebar-menu" class="main_menu_side hidden-print main_menu">
|
||||
<div class="menu_section">
|
||||
<h3>General</h3>
|
||||
<ul class="nav side-menu">
|
||||
<li><a href="<?php echo base_url();?>Auth/"><i class="fa fa-home"></i> Home </a>
|
||||
</li>
|
||||
|
||||
|
||||
<?php if(check_auth() && is_admin() || is_superadmin() || is_user() ) { ?>
|
||||
<li><a href="<?php echo base_url();?>Employee/empList"><i class="fa fa-group"></i>Employee List</a></li>
|
||||
<?php } ?>
|
||||
|
||||
<?php if(check_auth() && is_user() || user()->role == null ) { ?>
|
||||
|
||||
<li><a><i class="fa fa-calendar-times-o"></i> Leaves <span class="fa fa-chevron-down"></span></a>
|
||||
<ul class="nav child_menu">
|
||||
|
||||
<li><a href="<?php echo base_url();?>Leave/leavehistory">My Leaves</a></li>
|
||||
|
||||
<li><a href="<?php echo base_url();?>Leave/applyLeave">Apply Leave</a></li>
|
||||
|
||||
<li><a href="<?php echo base_url();?>Leave/manager_approvel">My Approvals</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php if(check_auth() && is_admin() || is_superadmin() ) { ?>
|
||||
|
||||
<li><a><i class="fa fa-calendar-times-o"></i> Leaves <span class="fa fa-chevron-down"></span></a>
|
||||
<ul class="nav child_menu">
|
||||
|
||||
<li><a href="<?php echo base_url();?>Leave/leavehistory">My Leaves</a></li>
|
||||
|
||||
<li><a href="<?php echo base_url();?>Leave/applyLeave">Apply Leave</a></li>
|
||||
|
||||
<li><a href="<?php echo base_url();?>Leave/manager_approvel">My Approvals</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php if(check_auth() && is_user() || user()->role == null ) { ?>
|
||||
|
||||
<li><a><i class="fa fa-money"></i> Expense <span class="fa fa-chevron-down"></span></a>
|
||||
<ul class="nav child_menu">
|
||||
|
||||
<li><a href="<?php echo base_url();?>Expence/emp_expence_list">My Claims</a></li>
|
||||
|
||||
<li><a href="<?php echo base_url();?>Expence/expence_form">New Claim</a></li>
|
||||
|
||||
<li><a href="<?php echo base_url();?>Expence/manager_approvel_list">My Approvals</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php if(check_auth() && is_admin() || is_superadmin() ) { ?>
|
||||
|
||||
<li><a><i class="fa fa-money"></i> Expense <span class="fa fa-chevron-down"></span></a>
|
||||
<ul class="nav child_menu">
|
||||
|
||||
<li><a href="<?php echo base_url();?>Expence/emp_expence_list">My Claims</a></li>
|
||||
|
||||
<li><a href="<?php echo base_url();?>Expence/expence_form">New Claim</a></li>
|
||||
|
||||
<li><a href="<?php echo base_url();?>Expence/manager_approvel_list">My Approvals</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php if(check_auth() && is_user() || user()->role == null ) { ?>
|
||||
|
||||
<li><a><i class="fa fa-tasks"></i> Delegation <span class="fa fa-chevron-down"></span></a>
|
||||
<ul class="nav child_menu">
|
||||
|
||||
<li><a href="<?php echo base_url();?>Delegation/Delegation_list">Delegation List</a></li>
|
||||
|
||||
<li><a href="<?php echo base_url();?>Delegation/Delegation/Delegation_form">Assign Delegation</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php if(check_auth() && is_admin() || is_superadmin() ) { ?>
|
||||
|
||||
<li><a><i class="fa fa-tasks"></i> Delegation <span class="fa fa-chevron-down"></span></a>
|
||||
<ul class="nav child_menu">
|
||||
|
||||
<li><a href="<?php echo base_url();?>Delegation/Delegation_list">My Claims</a></li>
|
||||
|
||||
<li><a href="<?php echo base_url();?>Delegation/Delegation/Delegation_form">Assign Delegation</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /sidebar menu -->
|
||||
|
||||
<!-- /menu footer buttons -->
|
||||
<div class="sidebar-footer hidden-small">
|
||||
<a data-toggle="tooltip" data-placement="top" title="Settings">
|
||||
<span class="glyphicon glyphicon-cog" aria-hidden="true"></span>
|
||||
</a>
|
||||
<a data-toggle="tooltip" data-placement="top" title="FullScreen">
|
||||
<span class="glyphicon glyphicon-fullscreen" aria-hidden="true"></span>
|
||||
</a>
|
||||
<a data-toggle="tooltip" data-placement="top" title="Lock">
|
||||
<span class="glyphicon glyphicon-eye-close" aria-hidden="true"></span>
|
||||
</a>
|
||||
<a data-toggle="tooltip" data-placement="top" title="Logout" href="<?php echo base_url();?>Auth/logout">
|
||||
<span class="glyphicon glyphicon-off" aria-hidden="true"></span>
|
||||
</a>
|
||||
</div>
|
||||
<!-- /menu footer buttons -->
|
||||
</div>
|
||||
|
||||
|
||||
0
application/modules/Leave/.gitkeep
Normal file
386
application/modules/Leave/controllers/Leave.php
Normal file
@ -0,0 +1,386 @@
|
||||
<?php defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
use chillerlan\QRCode\Data\QRMatrix;
|
||||
use chillerlan\QRCode\QRCode;
|
||||
use chillerlan\QRCode\QROptions;
|
||||
|
||||
date_default_timezone_set('Asia/Kolkata');
|
||||
|
||||
/**
|
||||
* AMS
|
||||
*
|
||||
* @package HMVC
|
||||
* @author Venba
|
||||
* @copyright 2022 Venba
|
||||
* @license https://venbainfotech.com/licenses/MIT MIT License
|
||||
* @link <URI> (description)
|
||||
* @version GIT: $Id$
|
||||
* @since Version 0.0.1
|
||||
* @filesource
|
||||
*
|
||||
*/
|
||||
|
||||
class Leave extends Admin_Controller
|
||||
{
|
||||
/**
|
||||
* [__construct description]
|
||||
*
|
||||
* @method __construct
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// To inherit directly the attributes of the parent class.
|
||||
parent::__construct();
|
||||
### Syntax : $this->load->model('Model Path' , 'Alias name');
|
||||
### The second parameter (optional) is used to call the method.
|
||||
$this->load->model('MY_Model','MY_Model');
|
||||
$this->load->model('Leave_model','Leave_model');
|
||||
$this->load->model('Employee/Employee_model','Emp_model');
|
||||
$this->load->model('Audit/Audit_model','audit_model');
|
||||
$this->load->helper(array('form', 'url'));
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
$this->layout->set('users', "gowtham");
|
||||
$this->layout->buffer('main_content', 'Asset/index');
|
||||
$this->layout->render('Employee_Layout');
|
||||
|
||||
}
|
||||
|
||||
public function leaveList()
|
||||
{
|
||||
|
||||
$business_id = user()->business_id;
|
||||
$leave_list = $this->Leave_model->get_leave_with_emp_name(user()->business_id);
|
||||
$decline_dropdown = $this->Leave_model->decline_dropdown($business_id);
|
||||
$this->layout->set('tableData', $leave_list);
|
||||
$this->layout->set('dropdown', $decline_dropdown);
|
||||
$this->layout->buffer('main_content', 'Leave/leave_list');
|
||||
$this->layout->render('Employee_Layout');
|
||||
}
|
||||
|
||||
public function applyLeave()
|
||||
{
|
||||
$emp_leave_count = $this->Leave_model->get("emp_leave_days");
|
||||
$emp = $this->Emp_model->get_employee(user()->business_id);
|
||||
$business_id = user()->business_id;
|
||||
$leavetype = $this->Leave_model->getLeaveType($business_id);
|
||||
$this->layout->set('emp', $emp);
|
||||
$this->layout->set('count', $emp_leave_count);
|
||||
$this->layout->set('leavetype', $leavetype);
|
||||
$this->layout->buffer('main_content', 'Leave/apply_leave');
|
||||
$this->layout->render('Employee_Layout');
|
||||
|
||||
}
|
||||
|
||||
public function get_emp_name()
|
||||
{
|
||||
$emp = $this->Leave_model->get_employee(user()->business_id);
|
||||
$html = '<option>--select Employee--</option>';
|
||||
foreach($emp as $val)
|
||||
{
|
||||
if($val->user_id != user()->id)
|
||||
{
|
||||
$html .='<option id="'.$val->manager.'" value="'.$val->user_id.'">'.$val->name.'</option>';
|
||||
}
|
||||
}
|
||||
echo json_encode($html);
|
||||
}
|
||||
|
||||
public function createLeave()
|
||||
{
|
||||
if($this->input->post('type') === 'Permission')
|
||||
{
|
||||
$perm_data = $this->input->post();
|
||||
if(isset($perm_data['emp_id'])){
|
||||
$emp_id =$this->input->post('emp_id');
|
||||
}else{
|
||||
$emp_id = user()->id;
|
||||
}
|
||||
$perm_data['emp_id'] = $emp_id;
|
||||
if($data['manager']){
|
||||
$manager = $this->input->post('manager');
|
||||
}else{
|
||||
$manager = employee()->manager;
|
||||
}
|
||||
$perm_data['manager'] = $manager;
|
||||
$perm_data['business_id'] = user()->business_id;
|
||||
$perm_data['status'] = 'pending';
|
||||
$perm_data['created_date'] = date('d-m-Y');
|
||||
$perm_data['created_time'] = date('H:i A');
|
||||
$table="leave_list";
|
||||
$create_permission = $this->MY_Model->insert($perm_data,$table);
|
||||
$this->session->set_flashdata('Success', 'Submitted for Approval');
|
||||
redirect('Leave/LeaveHistory');
|
||||
}
|
||||
|
||||
$data = $this->input->post();
|
||||
if(isset($data['emp_id'])){
|
||||
$emp_id =$this->input->post('emp_id');
|
||||
}else{
|
||||
$emp_id = user()->id;
|
||||
}
|
||||
$data['emp_id'] = $emp_id;
|
||||
if($data['manager']){
|
||||
$manager = $this->input->post('manager');
|
||||
}else{
|
||||
$manager = employee()->manager;
|
||||
}
|
||||
$data['manager'] = $manager;
|
||||
$data['business_id'] = user()->business_id;
|
||||
$data['status'] = 'pending';
|
||||
$data['created_date'] = date('d-m-Y');
|
||||
$data['created_time'] = date('H:i A');
|
||||
$emp_leave_count = $this->Leave_model->get_leave( $emp_id , user()->business_id , "emp_leave_days");
|
||||
|
||||
// count number of days between two dates
|
||||
$days_between = ceil(abs(dateFormat('d-m-Y',$this->input->post('to_date')) - dateFormat('d-m-Y',$this->input->post('from_date'))) / 86400);
|
||||
$data['no_of_days'] = $days_between + 1;
|
||||
$noofdays = $days_between + 1;
|
||||
if (count($emp_leave_count) != 0)
|
||||
{
|
||||
$data['leave_bal'] = $emp_leave_count[0]->remaining_days;
|
||||
$days['remaining_days'] = $emp_leave_count[0]->remaining_days;
|
||||
$this->Leave_model->update($days , $emp_id , 'emp_leave_days');
|
||||
}
|
||||
else
|
||||
{
|
||||
$all_leave_count = $this->Leave_model->get_by_type( $this->input->post('type') , user()->business_id , "leave_master");
|
||||
$data['leave_bal'] = $all_leave_count[0]->days;
|
||||
$days['remaining_days'] = $all_leave_count[0]->days;
|
||||
|
||||
$days['business_id'] = user()->business_id;
|
||||
$days['emp_id'] = $emp_id;
|
||||
$days['total_days'] = $all_leave_count[0]->days;
|
||||
$days['type'] = $all_leave_count[0]->id;
|
||||
$this->MY_Model->insert($days,'emp_leave_days');
|
||||
}
|
||||
|
||||
$table="leave_list";
|
||||
$create_leave = $this->MY_Model->insert($data,$table);
|
||||
|
||||
//audit
|
||||
if($create_leave)
|
||||
{
|
||||
//set id $ table name for audit history
|
||||
$this->audit->set('id',$create_leave);
|
||||
$this->audit->set('table',$table);
|
||||
//fetch new_data after post data insert
|
||||
$this->audit->fetch('new_data');
|
||||
//audit history generation for insert
|
||||
$test = $this->audit->create_history('insert');
|
||||
}
|
||||
$this->session->set_flashdata('Success', 'Submitted for Approval');
|
||||
redirect('Leave/LeaveHistory');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function edit_leave_function()
|
||||
{
|
||||
$id = $this->input->get('id');
|
||||
$emp_leave_count = $this->Leave_model->get("emp_leave_days");
|
||||
$emp = $this->Emp_model->get_employee(user()->business_id);
|
||||
$business_id = user()->business_id;
|
||||
$leavetype = $this->Leave_model->getLeaveType($business_id);
|
||||
$editleave = $this->Leave_model->editleave($id);
|
||||
$this->layout->set('emp', $emp);
|
||||
$this->layout->set('editleave', $editleave);
|
||||
$this->layout->set('count', $emp_leave_count);
|
||||
$this->layout->set('leavetype', $leavetype);
|
||||
$this->layout->buffer('main_content', 'Leave/edit_leave');
|
||||
$this->layout->render('Employee_Layout');
|
||||
}
|
||||
|
||||
public function editleave()
|
||||
{
|
||||
if($this->input->post('type') === 'Permission')
|
||||
{
|
||||
$action = $this->input->post();
|
||||
unset($action['from_date']);
|
||||
unset($action['to_date']);
|
||||
$id = $this->input->post('id');
|
||||
|
||||
if(isset($action['emp_id'])){
|
||||
$emp_id =$this->input->post('emp_id');
|
||||
}else{
|
||||
$emp_id = user()->id;
|
||||
}
|
||||
$action['emp_id'] = $emp_id;
|
||||
if($action['manager']){
|
||||
$manager = $this->input->post('manager');
|
||||
}else{
|
||||
$manager = employee()->manager;
|
||||
}
|
||||
$action['manager'] = $manager;
|
||||
$action['business_id'] = user()->business_id;
|
||||
$action['status'] = 'pending';
|
||||
$action['created_date'] = date('d-m-Y');
|
||||
$action['created_time'] = date('H:i A');
|
||||
$table="leave_list";
|
||||
$create_permission = $this->MY_Model->edit_option($action, $id, $table);
|
||||
$this->session->set_flashdata('Success', 'Submitted for Approval');
|
||||
redirect('Leave/LeaveHistory');
|
||||
}
|
||||
|
||||
|
||||
|
||||
$action = $this->input->post();
|
||||
$id = $this->input->post('id');
|
||||
if(isset($action['emp_id'])){
|
||||
$emp_id =$this->input->post('emp_id');
|
||||
}else{
|
||||
$emp_id = user()->id;
|
||||
}
|
||||
$action['emp_id'] = $emp_id;
|
||||
$action['business_id'] = user()->business_id;
|
||||
$action['status'] = 'pending';
|
||||
$emp_leave_count = $this->Leave_model->get_leave( $emp_id , user()->business_id , "emp_leave_days");
|
||||
|
||||
// count number of days between two dates
|
||||
$days_between = ceil(abs(strtotime($this->input->post('to_date')) - strtotime($this->input->post('from_date'))) / 86400);
|
||||
$action['no_of_days'] = $days_between + 1;
|
||||
$noofdays = $days_between + 1;
|
||||
|
||||
if (count($emp_leave_count) != 0)
|
||||
{
|
||||
$action['leave_bal'] = $emp_leave_count[0]->remaining_days;
|
||||
$days['remaining_days'] = $emp_leave_count[0]->remaining_days;
|
||||
$this->Leave_model->update($days , $emp_id , 'emp_leave_days');
|
||||
}
|
||||
else
|
||||
{
|
||||
$all_leave_count = $this->Leave_model->get_by_type( $this->input->post('type') , user()->business_id , "leave_master");
|
||||
$action['leave_bal'] = $all_leave_count[0]->days;
|
||||
$days['remaining_days'] = $all_leave_count[0]->days;
|
||||
|
||||
$days['business_id'] = user()->business_id;
|
||||
$days['emp_id'] = $emp_id;
|
||||
$days['total_days'] = $all_leave_count[0]->days;
|
||||
$days['type'] = $all_leave_count[0]->id;
|
||||
$this->MY_Model->update($days,'emp_leave_days');
|
||||
}
|
||||
|
||||
$table="leave_list";
|
||||
$update_leave = $this->MY_Model->edit_option($action,$id,$table);
|
||||
$this->session->set_flashdata('Success', 'Leave Updated Successfully');
|
||||
redirect('Leave/LeaveHistory');
|
||||
}
|
||||
|
||||
public function get_leave_count($id)
|
||||
{
|
||||
$str = $id;
|
||||
$res = preg_split('~[_]+~', $str, 0, PREG_SPLIT_NO_EMPTY);
|
||||
|
||||
|
||||
$emp_leave_count = $this->Leave_model->get_leave_based_on_tpye($res[0] , $res[1] , user()->business_id , "emp_leave_days");
|
||||
echo json_encode($emp_leave_count);
|
||||
|
||||
}
|
||||
|
||||
public function get_all_leave_count($id)
|
||||
{
|
||||
|
||||
$all_leave_count = $this->Leave_model->get_id( $id , user()->business_id , "leave_master");
|
||||
echo json_encode($all_leave_count);
|
||||
|
||||
}
|
||||
|
||||
public function ApproveLeave()
|
||||
{
|
||||
$id=$this->input->get('id');
|
||||
$emp_id = $this->Leave_model->get_emp_id($id);
|
||||
$no_of_days = $this->Leave_model->get_Leave_nodays($emp_id);
|
||||
$remaining_days = $this->Leave_model->remaining_days($emp_id, user()->business_id);
|
||||
$balance_days = $remaining_days[0]->remaining_days - $no_of_days->no_of_days;
|
||||
|
||||
|
||||
$data['leave_bal'] = $balance_days;
|
||||
$days['remaining_days'] = $balance_days;
|
||||
$this->Leave_model->emp_leave_days_update($emp_id, $days);
|
||||
|
||||
|
||||
$data['status'] = 'Approved';
|
||||
$data['approved_by']= user()->name;
|
||||
$data['approved_at'] = date('d-m-Y H:i:s');
|
||||
$this->Leave_model->LeaveApprove($id, $data);
|
||||
redirect('Leave/leaveList');
|
||||
}
|
||||
|
||||
public function ManagerLeaveApprove()
|
||||
{
|
||||
$id=$this->input->get('id');
|
||||
$emp_id = $this->Leave_model->get_emp_id($id);
|
||||
$no_of_days = $this->Leave_model->get_Leave_nodays($emp_id);
|
||||
$remaining_days = $this->Leave_model->remaining_days($emp_id, user()->business_id);
|
||||
$balance_days = $remaining_days[0]->remaining_days - $no_of_days->no_of_days;
|
||||
|
||||
|
||||
$data['leave_bal'] = $balance_days;
|
||||
$days['remaining_days'] = $balance_days;
|
||||
$this->Leave_model->emp_leave_days_update($emp_id, $days);
|
||||
|
||||
|
||||
$data['status'] = 'Approved';
|
||||
$data['approved_by']= user()->name;
|
||||
$data['approved_at'] = date('d-m-Y H:i:s');
|
||||
$this->Leave_model->LeaveApprove($id, $data);
|
||||
redirect('Leave/manager_approvel');
|
||||
}
|
||||
|
||||
public function Decline()
|
||||
{
|
||||
$id=$this->input->get('id');
|
||||
$data['status'] = 'Declined';
|
||||
$data['declined_by']= user()->name;
|
||||
$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()
|
||||
{
|
||||
$id=$this->input->get('id');
|
||||
$data['status'] = 'canceled';
|
||||
$data['cancled_at'] = date('d-m-Y H:i:s');
|
||||
$this->Leave_model->Leavecancle($id, $data);
|
||||
$this->session->set_flashdata('Success', 'Leave canceled Successfully');
|
||||
redirect('Leave/LeaveHistory');
|
||||
}
|
||||
|
||||
public function LeaveHistory()
|
||||
{
|
||||
$leave_list = $this->Leave_model->get_leave_with_emp_name(user()->business_id);
|
||||
$this->layout->set('tableData', $leave_list);
|
||||
$this->layout->buffer('main_content', 'Leave/leavehistory');
|
||||
$this->layout->render('Employee_Layout');
|
||||
}
|
||||
|
||||
|
||||
public function manager_approvel()
|
||||
{
|
||||
$business_id = user()->business_id;
|
||||
$user_id = user()->id;
|
||||
$manager = $this->Leave_model->under_emp_manager($user_id, $business_id);
|
||||
$get_delegation = $this->Leave_model->Get_delegation_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('dropdown', $decline_dropdown);
|
||||
$this->layout->set('get_delegation', $get_delegation);
|
||||
$this->layout->set('manager', $manager);
|
||||
$this->layout->buffer('main_content', 'Leave/manager_approvel');
|
||||
$this->layout->render('Employee_Layout');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
0
application/modules/Leave/models/.gitkeep
Normal file
264
application/modules/Leave/models/Leave_model.php
Normal file
@ -0,0 +1,264 @@
|
||||
<?php
|
||||
class Leave_model extends MY_Model {
|
||||
|
||||
public function get_leave_with_emp_name($business_id)
|
||||
{
|
||||
$this->db->select('A.* , name', 'users.name');
|
||||
$this->db->from('leave_list A');
|
||||
$this->db->join('users', 'users.id = A.emp_id', 'left');
|
||||
$this->db->where('A.business_id', $business_id);
|
||||
$this->db->order_by('id','DESC');
|
||||
$this->db->where('A.is_active', 1);
|
||||
$query = $this->db->get();
|
||||
$query = $query->result();
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function get_with_emp_name($business_id, )
|
||||
{
|
||||
$this->db->select('A.* , name', 'users.name');
|
||||
$this->db->from('leave_list A');
|
||||
$this->db->join('users', 'users.id = A.emp_id', 'left');
|
||||
$this->db->where('A.business_id', $business_id);
|
||||
$this->db->order_by('id','DESC');
|
||||
$this->db->where('A.is_active', 1);
|
||||
$query = $this->db->get();
|
||||
$query = $query->result();
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function get($table)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from($table);
|
||||
$this->db->order_by('id','DESC');
|
||||
$this->db->where('is_active', 1);
|
||||
$query = $this->db->get();
|
||||
$query = $query->result();
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function remaining_days($emp_id, $business_id)
|
||||
{
|
||||
$this->db->select('remaining_days');
|
||||
$this->db->from('emp_leave_days');
|
||||
$this->db->where('emp_id', $emp_id);
|
||||
$this->db->where('business_id', $business_id);
|
||||
$this->db->where('is_active', 1);
|
||||
$query = $this->db->get();
|
||||
$query = $query->result();
|
||||
return $query;
|
||||
}
|
||||
|
||||
function get_id($id,$business_id,$table)
|
||||
{
|
||||
$this->db->select();
|
||||
$this->db->from($table);
|
||||
$this->db->where('id', $id);
|
||||
$this->db->where('business_id', $business_id);
|
||||
$this->db->where('is_active', 1);
|
||||
$query = $this->db->get();
|
||||
$query = $query->result();
|
||||
return $query;
|
||||
}
|
||||
|
||||
function get_by_type($type,$business_id,$table)
|
||||
{
|
||||
$this->db->select();
|
||||
$this->db->from($table);
|
||||
$this->db->where('type', $type);
|
||||
$this->db->where('business_id', $business_id);
|
||||
$this->db->where('is_active', 1);
|
||||
$query = $this->db->get();
|
||||
$query = $query->result();
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function get_employee($business_id)
|
||||
{
|
||||
|
||||
$this->db->select('users.name, employees.user_id, employees.manager');
|
||||
$this->db->from('users');
|
||||
$this->db->join('employees', 'employees.user_id = users.id');
|
||||
$this->db->where('users.business_id', $business_id);
|
||||
$this->db->where('users.is_active', 1);
|
||||
$this->db->where('employees.is_active', 1);
|
||||
$query = $this->db->get();
|
||||
|
||||
if ($query->num_rows() > 0) {
|
||||
return $query->result();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public function get_leave($id , $business_id , $table)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from($table);
|
||||
$this->db->where('business_id', $business_id);
|
||||
$this->db->where('emp_id', $id);
|
||||
$this->db->order_by('id','DESC');
|
||||
$this->db->where('is_active', 1);
|
||||
$query = $this->db->get();
|
||||
$query = $query->result();
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function get_leave_based_on_tpye($id , $type , $business_id , $table)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from($table);
|
||||
$this->db->where('business_id', $business_id);
|
||||
$this->db->where('emp_id', $id);
|
||||
$this->db->where('type', $type);
|
||||
$this->db->order_by('id','DESC');
|
||||
$this->db->where('is_active', 1);
|
||||
$query = $this->db->get();
|
||||
$query = $query->result();
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function get_leave_by_md5_id($id,$business_id,$table)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from($table);
|
||||
$this->db->where('business_id', $business_id);
|
||||
$this->db->where('md5(id)', $id);
|
||||
$this->db->where('is_active', 1);
|
||||
$query = $this->db->get();
|
||||
$query = $query->row();
|
||||
return $query;
|
||||
}
|
||||
|
||||
function update($action,$id,$table){
|
||||
$this->db->where('emp_id',$id);
|
||||
$this->db->update($table,$action);
|
||||
return;
|
||||
}
|
||||
|
||||
public function LeaveApprove($id, $data)
|
||||
{
|
||||
|
||||
$this->db->where('id',$id);
|
||||
$this->db->update('leave_list', $data);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
public function LeaveDecline($id, $data)
|
||||
{
|
||||
$this->db->where('id',$id);
|
||||
$this->db->where('status', 'pending');
|
||||
$this->db->update('leave_list', $data);
|
||||
return;
|
||||
}
|
||||
|
||||
public function Leavecancle($id, $data)
|
||||
{
|
||||
$this->db->where('md5(id)',$id);
|
||||
$this->db->where('status', 'pending');
|
||||
$this->db->update('leave_list', $data);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getLeaveType($business_id)
|
||||
{
|
||||
|
||||
$this->db->select('*');
|
||||
$this->db->from('leave_master');
|
||||
$this->db->where('business_id', $business_id);
|
||||
$this->db->where('is_active', 1);
|
||||
return $this->db->get()->result();
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function get_Leave_nodays($id)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('leave_list');
|
||||
$this->db->where('emp_id',$id);
|
||||
$this->db->where('is_active', 1);
|
||||
$query = $this->db->get();
|
||||
$query = $query->row();
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function emp_leave_days_update($id, $days)
|
||||
{
|
||||
$this->db->where('emp_id',$id);
|
||||
$this->db->update('emp_leave_days', $days);
|
||||
}
|
||||
|
||||
public function get_emp_id($id)
|
||||
{
|
||||
$this->db->select('emp_id');
|
||||
$this->db->where('id', $id); // Assuming $leaveListId is the ID to match
|
||||
$query = $this->db->get('leave_list');
|
||||
|
||||
if ($query->num_rows() > 0) {
|
||||
$row = $query->row();
|
||||
$empId = $row->emp_id;
|
||||
return $empId;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function under_emp_manager($user_id, $business_id)
|
||||
{
|
||||
$this->db->select('manager');
|
||||
$this->db->from('employees');
|
||||
$this->db->where('business_id', $business_id);
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
public function editleave($id)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('leave_list');
|
||||
$this->db->where('md5(id)', $id);
|
||||
$query = $this->db->get();
|
||||
if ($query->num_rows() > 0) {
|
||||
return $query->result();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public function decline_dropdown($business_id)
|
||||
|
||||
{
|
||||
|
||||
$this->db->select('*');
|
||||
$this->db->from('enum');
|
||||
$this->db->where('enum_type', 'decline');
|
||||
$this->db->where('business_id', $business_id);
|
||||
$query = $this->db->get();
|
||||
if ($query->num_rows() > 0) {
|
||||
return $query->result();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function Get_delegation_id($business_id)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('delegation');
|
||||
$this->db->where('business_id', $business_id);
|
||||
//$this->db->where('delegated_to', $emp_id);
|
||||
$this->db->where('is_active', 1);
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
0
application/modules/Leave/views/.gitkeep
Normal file
565
application/modules/Leave/views/apply_leave.php
Normal file
@ -0,0 +1,565 @@
|
||||
|
||||
<!-- Body page content -->
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.3/moment.min.js"></script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.3/moment.min.js"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.13.0/jquery-ui.min.js"></script>
|
||||
|
||||
<!-- bootstrap-daterangepicker -->
|
||||
<link href="https://localhost/ams//assets/default/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet">
|
||||
<!-- bootstrap-datetimepicker -->
|
||||
<link href="https://localhost/ams//assets/default/bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css" rel="stylesheet">
|
||||
<!-- style.css -->
|
||||
<link href="https://localhost/ams//assets/default/customize/style.css" rel="stylesheet">
|
||||
|
||||
<!-- bootstrap-daterangepicker -->
|
||||
<script src="https://localhost/ams//assets/default/moment/min/moment.min.js"></script>
|
||||
<script src="https://localhost/ams//assets/default/bootstrap-daterangepicker/daterangepicker.js"></script>
|
||||
<!-- bootstrap-datetimepicker -->
|
||||
<script src="https://localhost/ams//assets/default/bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>
|
||||
|
||||
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
|
||||
input[type=date] {
|
||||
position: relative;
|
||||
/* width: 150px; height: 20px;
|
||||
color: white;*/
|
||||
}
|
||||
|
||||
input[type=date]:before {
|
||||
position: absolute;
|
||||
top: 3px; left: 3px;
|
||||
content: attr(data-date);
|
||||
display: inline-block;
|
||||
color: black;
|
||||
}
|
||||
|
||||
input[type=date]::-webkit-datetime-edit, input::-webkit-inner-spin-button, input::-webkit-clear-button {
|
||||
display: none;s
|
||||
}
|
||||
|
||||
input[type=date]::-webkit-calendar-picker-indicator {
|
||||
position: absolute;
|
||||
top: 3px;
|
||||
right: 0;
|
||||
color: black;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.alert-success {
|
||||
background-color: #dff0d8;
|
||||
color: #3c763d;
|
||||
border-color: #d6e9c6;
|
||||
}
|
||||
|
||||
.flash-message {
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
border-radius: 5px;
|
||||
margin-left: 690px;
|
||||
}
|
||||
|
||||
.custom-select {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
padding: 6px 12px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
background-color: #fff;
|
||||
appearance: none;
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
.custom-select::after {
|
||||
content: '\25BC';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 10px;
|
||||
transform: translateY(-50%);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.custom-select:hover {
|
||||
border-color: #999;
|
||||
}
|
||||
|
||||
.custom-select:focus {
|
||||
border-color: #aaa;
|
||||
outline: none;
|
||||
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.custom-select option {
|
||||
padding: 10px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<a href="<?php echo base_url();?>Leave/LeaveHistory" class="btn btn-primary" style="margin-top: 20px;">Back</a>
|
||||
</ul>
|
||||
|
||||
<h1>Apply Leave</h1>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="x_content">
|
||||
<br />
|
||||
<form id="myForm" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Leave/createLeave" enctype="multipart/form-data">
|
||||
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="last-name">Leave Applied For</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
|
||||
<input type="radio" name="risedby" value="self(<?php echo user()->id;?>)"style="margin:10px;"checked /><b>Self</b>
|
||||
|
||||
<input type="radio" name="risedby" value="<?php echo user()->name;?>(<?php echo user()->id;?>)" style="margin: 10px;" /><b>Others</b>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="item form-group">
|
||||
<label class="control-label col-md-2 col-sm-2 " for="last-name"> Employee Name </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="user_dropdown" name="emp_id" style="margin-top: 10px;padding-bottom: 10px;" class="form-control manager" > </select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="last-name">Leave Type<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="type" name="type" required class="form-control" onclick="permission()" >
|
||||
<option value="">--Select--</option>
|
||||
<?php foreach ($leavetype as $key => $value) { ?>
|
||||
<option id="<?php echo $value->id; ?>" value="<?php echo $value->type; ?>"><?php echo $value->type; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name" id="balance" > Balance</label>
|
||||
<div class="col-md-1 col-sm-1 ">
|
||||
<input type="text" id="leave_bal" name="" value="" style="width:90px;" class="form-control " readonly>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- <div class="item form-group" id="hidedate" >
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="first-name"> From Date<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-2 col-sm-2 ">
|
||||
<input id="from_date" name="from_date" value="" required class="form-control" type="date" data-date="" data-date-format="DD-MM-YYYY" >
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1" for="last-name">To Date<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-2 col-sm-2 ">
|
||||
<input id="to_date" name="to_date" required class="form-control" type="date" date-date="" data-date-format="DD-MM-YYYY" value="" date-date="">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name"></label>
|
||||
<div class="col-md-2 col-sm-2 ">
|
||||
<input id="dateDifference" value="" readonly class="form-control" style="width:90px;" type="text" >
|
||||
</div>
|
||||
|
||||
</div> -->
|
||||
|
||||
<div class="item form-group" id="hidedate" >
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="first-name"> From Date<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-2 col-sm-2 ">
|
||||
<div class='input-group date'>
|
||||
<input type='text' class="form-control" placeholder="DD-MM-YYYY" id="fromdate" name="from_date" value="" required />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1" for="last-name">To Date<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-2 col-sm-2 ">
|
||||
<div class='input-group date' >
|
||||
<input type='text' class="form-control" placeholder="DD-MM-YYYY" id="todate" name= "to_date" value="" required />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name"></label>
|
||||
<div class="col-md-2 col-sm-2 ">
|
||||
<input id="dateDifference" value="" readonly class="form-control" style="width:90px;" type="text" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group" id="showdate" >
|
||||
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="first-name">Date<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<div class='input-group date'>
|
||||
<input type='text' class="form-control" required name="perm_date" placeholder="DD-MM-YYYY" value="" id='myDatepicker'/></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item form-group" id="showtime" >
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="first-name"> From<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-2 col-sm-2 ">
|
||||
<select class="custom-select" id="from_time" name=from_time required >
|
||||
<option>select time</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name">To<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-2 col-sm-2 ">
|
||||
<select id="to_time" class="custom-select" name="to_time" required>
|
||||
<option>select time</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="last-name">Note</label>
|
||||
<div class="col-md-5 col-sm-5">
|
||||
<textarea id="comments" name="comments" value="" class="form-control" style="height:100px !important;" type="text" ></textarea>
|
||||
|
||||
<input type="hidden" id="manager_id" name="manager" value="">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="ln_solid"></div>
|
||||
<div class="item form-group">
|
||||
<div class=" offset-md-8">
|
||||
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
||||
<button class="btn btn-primary" type="reset">Reset</button>
|
||||
<button type="submit" id="submit" class="btn btn-success">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Body page content -->
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
|
||||
|
||||
|
||||
var currentUserName = '<?php echo user()->name; ?>';
|
||||
var currentUserId = '<?php echo user()->id; ?>';
|
||||
$('#user_dropdown').append('<option value="' + currentUserId + '">' +
|
||||
currentUserName + '</option>');
|
||||
$('#user_dropdown').prop('disabled', true);
|
||||
|
||||
$('#user_dropdown').on('change',function() {
|
||||
|
||||
$('#type').prop('selectedIndex',0);
|
||||
|
||||
});
|
||||
|
||||
$('#type').on('change',function() {
|
||||
let id = $("#user_dropdown").val();
|
||||
|
||||
var type_id = $('option:selected', this).attr('id');
|
||||
|
||||
if (id)
|
||||
{
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "<?php echo base_url()?>Leave/get_leave_count/"+id+'_'+type_id,
|
||||
success: function(response) {
|
||||
response = JSON.parse(response);
|
||||
if(response.length == 0)
|
||||
{
|
||||
|
||||
get_all_count(type_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(response[0].remaining_days == 1 )
|
||||
{
|
||||
$('#leave_bal').val(response[0].remaining_days + ' day');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#leave_bal').val(response[0].remaining_days + ' days');
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, err) { alert('text status '+textStatus+', err '+err) }
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#leave_bal').val("");
|
||||
}
|
||||
});
|
||||
|
||||
$('input[type="radio"][name="risedby"]').change(function() {
|
||||
var selectedValue = $(this).val();
|
||||
var $userDropdown = $('#user_dropdown');
|
||||
|
||||
$userDropdown.empty();
|
||||
|
||||
if (selectedValue === 'self(<?php echo user()->id;?>)') {
|
||||
|
||||
var currentUserName = '<?php echo user()->name; ?>';
|
||||
var currentUserId = '<?php echo user()->id; ?>';
|
||||
$userDropdown.append('<option value="' + currentUserId + '">' + currentUserName + '</option>');
|
||||
$userDropdown.prop('disabled', true);
|
||||
} else if (selectedValue === '<?php echo user()->name; ?>(<?php echo user()->id;?>)') {
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('Leave/get_emp_name/')?>"',
|
||||
method: 'GET',
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
|
||||
$('#user_dropdown').append(response);
|
||||
$('#user_dropdown').prop('disabled', false);
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function get_all_count(id) {
|
||||
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "<?php echo base_url()?>Leave/get_all_leave_count/"+id,
|
||||
success: function(response) {
|
||||
response = JSON.parse(response);
|
||||
console.log(response);
|
||||
$('#leave_bal').val( response[0].days);
|
||||
},
|
||||
error: function(jqXHR, textStatus, err) { alert('text status '+textStatus+', err '+err) }
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
$('#myDatepicker').datetimepicker({
|
||||
format: 'DD.MM.YYYY'
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
$('#showtime').hide()
|
||||
$('#showdate').hide()
|
||||
function permission() {
|
||||
|
||||
console.log($('#showtime').val())
|
||||
|
||||
var type = $('#type').val();
|
||||
|
||||
if( type === 'Permission' ){
|
||||
|
||||
$('#hidedate').hide()
|
||||
$('#balance').hide()
|
||||
$('#leave_bal').hide()
|
||||
$('#fromdate').removeAttr('required');
|
||||
$('#todate').removeAttr('required');
|
||||
$('#showtime').show();
|
||||
$('#showdate').show();
|
||||
}
|
||||
else{
|
||||
|
||||
$('#from_time').removeAttr('required');
|
||||
$('#to_time').removeAttr('required');
|
||||
$('#myDatepicker').removeAttr('required');
|
||||
$('#hidedate').show();
|
||||
$('#showtime').hide();
|
||||
$('#showdate').hide();
|
||||
$('#balance').show()
|
||||
$('#leave_bal').show()
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
//get manager id from the dropdown employee assign the value to $("#manager_id") input field
|
||||
|
||||
$("#user_dropdown").on("change", function(){
|
||||
let manager_id = $(this).children(":selected").attr("id");
|
||||
|
||||
$("#manager_id").val(manager_id);
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var selectField = $('#from_time');
|
||||
|
||||
var options = [ '12:00 AM', '12:30 AM', '1:00 AM', '1:30 AM', '2:00 AM', '2:30 AM', '3:00 AM', '3:30 AM', '4:00 AM', '4:30 AM', '5:00 AM', '5:30 AM', '6:00 AM', '6:30 AM', '7:00 AM', '7:30 AM', '8:00 AM', '8:30 AM', '9:00 AM', '9:30 AM', '10:00 AM', '10:30 AM', '11:00 AM', '11:30 AM', '12:00 Noon', '12:30 PM', '1:00 PM', '1:30 PM', '2:00 PM', '2:30 PM', '3:00 PM', '3:30 PM', '4:00 PM', '4:30 PM', '5:00 PM', '5:30 PM', '6:00 PM', '6:30 PM', '7:00 PM', '7:30 PM', '8:00 PM', '8:30 PM', '9:00 PM', '9:30 PM', '10:00 PM', '10:30 PM', '11:00 PM', '11:30 PM'];
|
||||
|
||||
|
||||
for (var i = 0; i < options.length; i++) {
|
||||
selectField.append('<option value="' + options[i] + '">' + options[i] + '</option>');
|
||||
}
|
||||
});
|
||||
|
||||
var selectField = $('#from_time');
|
||||
selectField.on('click', function() {
|
||||
|
||||
var selectedValue = $(this).val();
|
||||
console.log(selectedValue);
|
||||
|
||||
var timeSlots = [ '12:00 AM', '12:30 AM', '1:00 AM', '1:30 AM', '2:00 AM', '2:30 AM', '3:00 AM', '3:30 AM', '4:00 AM', '4:30 AM', '5:00 AM', '5:30 AM', '6:00 AM', '6:30 AM', '7:00 AM', '7:30 AM', '8:00 AM', '8:30 AM', '9:00 AM', '9:30 AM', '10:00 AM', '10:30 AM', '11:00 AM', '11:30 AM', '12:00 Noon', '12:30 PM', '1:00 PM', '1:30 PM', '2:00 PM', '2:30 PM', '3:00 PM', '3:30 PM', '4:00 PM', '4:30 PM', '5:00 PM', '5:30 PM', '6:00 PM', '6:30 PM', '7:00 PM', '7:30 PM', '8:00 PM', '8:30 PM', '9:00 PM', '9:30 PM', '10:00 PM', '10:30 PM', '11:00 PM', '11:30 PM'];
|
||||
|
||||
|
||||
function filterTimeSlots(startingTime, numberOfHours) {
|
||||
// Find the index of the starting time in the array
|
||||
console.log(startingTime,numberOfHours);
|
||||
const startIndex = timeSlots.findIndex(time => time === startingTime);
|
||||
console.log(startIndex);
|
||||
if (startIndex !== -1) {
|
||||
|
||||
const endIndex = startIndex + (numberOfHours * 2) - 1;
|
||||
|
||||
return timeSlots.slice(startIndex, endIndex + 2);
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
// Usage example
|
||||
const startingTime = selectedValue;
|
||||
const numberOfHours = 4 ;
|
||||
const filteredTimeSlots = filterTimeSlots(startingTime, numberOfHours);
|
||||
|
||||
filteredTimeSlots.shift();
|
||||
var totime = $('#to_time');
|
||||
totime.empty();
|
||||
for (var i = 0; i < filteredTimeSlots.length; i++) {
|
||||
totime.append('<option value="' + filteredTimeSlots[i] + '">' + filteredTimeSlots[i] + '</option>');
|
||||
|
||||
}
|
||||
|
||||
console.log(filteredTimeSlots);
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// Initialize datepickers
|
||||
var dateFormat = "dd-mm-yy";
|
||||
var fromDateInput = $("#fromdate");
|
||||
console.log(fromDateInput);
|
||||
var toDateInput = $("#todate");
|
||||
console.log(toDateInput);
|
||||
|
||||
fromDateInput.datepicker({
|
||||
dateFormat: dateFormat,
|
||||
onSelect: function (dateText, inst) {
|
||||
toDateInput.datepicker("option", "minDate", dateText);
|
||||
validateDateRange();
|
||||
calculateDateDifference();
|
||||
}
|
||||
});
|
||||
|
||||
toDateInput.datepicker({
|
||||
dateFormat: dateFormat,
|
||||
onSelect: function (dateText, inst) {
|
||||
validateDateRange();
|
||||
calculateDateDifference();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Function to validate the date range
|
||||
function validateDateRange() {
|
||||
var fromDate = fromDateInput.datepicker("getDate");
|
||||
var toDate = toDateInput.datepicker("getDate");
|
||||
|
||||
// Check if both dates are selected
|
||||
if (!fromDate || !toDate) {
|
||||
$("#error-msg").text("Please select both From Date and To Date");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Compare the dates
|
||||
if (fromDate > toDate) {
|
||||
$("#error-msg").text("From Date cannot be after To Date");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Clear the error message if the date range is valid
|
||||
$("#error-msg").text("");
|
||||
return true;
|
||||
}
|
||||
|
||||
function calculateDateDifference() {
|
||||
var fromDate = fromDateInput.datepicker("getDate");
|
||||
var toDate = toDateInput.datepicker("getDate");
|
||||
|
||||
if (fromDate && toDate) {
|
||||
var difference = Math.ceil((toDate - fromDate) / (1000 * 60 * 60 * 24) + 1);
|
||||
if(difference === 1)s
|
||||
{
|
||||
$("#dateDifference").val(difference + ' day');
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#dateDifference").val(difference + ' days');
|
||||
}
|
||||
|
||||
} else {
|
||||
$("#dateDifference").val("");
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
160
application/modules/Leave/views/assign_leave.php
Normal file
@ -0,0 +1,160 @@
|
||||
|
||||
<!-- Body page content -->
|
||||
|
||||
|
||||
|
||||
<div class="">
|
||||
<div class="page-title">
|
||||
|
||||
<div class="title_left">
|
||||
<h3>Assign Leave</h3>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
|
||||
<!-- <h6>General Information</h6> -->
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="x_content">
|
||||
<br />
|
||||
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Leave/createLeave" enctype="multipart/form-data">
|
||||
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name">Employee Name<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="emp_id" name="emp_id" required="required" class="form-control" >
|
||||
<option value="">--Select--</option>
|
||||
<?php foreach ($emp as $key => $value) { ?>
|
||||
<option value="<?php echo $value->id; ?>"><?php echo $value->name; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name">Leave Type<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="type" name="type" required="required" class="form-control" >
|
||||
<option value="">--Select--</option>
|
||||
<?php foreach ($leavetype as $key => $value) { ?>
|
||||
<option id="<?php echo $value->id; ?>" value="<?php echo $value->type; ?>"><?php echo $value->type; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Leave Balance</label>
|
||||
<div class="col-md-2 col-sm-2 ">
|
||||
<input type="text" id="leave_bal" name="" value="" class="form-control " readonly>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> From Date<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-2 col-sm-2 ">
|
||||
<input id="from_date" name="from_date" value="" required="required" class="form-control" type="date" >
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name">To Date<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-2 col-sm-2 ">
|
||||
<input id="to_date" name="to_date" value="" required="required" class="form-control" type="date" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name">Comments</label>
|
||||
<div class="col-md-5 col-sm-5">
|
||||
<textarea id="comments" name="comments" value="" class="form-control" style="height:100px !important;" type="text" ></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="ln_solid"></div>
|
||||
<div class="item form-group">
|
||||
<div class=" offset-md-8">
|
||||
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
||||
<button class="btn btn-primary" type="reset">Reset</button>
|
||||
<button type="submit" class="btn btn-success">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Body page content -->
|
||||
<script>
|
||||
var id;
|
||||
|
||||
$('#emp_id').on('change', function() {
|
||||
id = this.value;
|
||||
});
|
||||
|
||||
|
||||
$('#type').on('change',function() {
|
||||
// var type_id = this.id;
|
||||
var type_id = $('option:selected', this).attr('id');
|
||||
if (id)
|
||||
{
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "<?php echo base_url()?>Leave/get_leave_count/"+id+'_'+type_id,
|
||||
success: function(response) {
|
||||
response = JSON.parse(response);
|
||||
console.log(response);
|
||||
if(response.length == 0)
|
||||
{
|
||||
get_all_count(type_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#leave_bal').val(response[0].remaining_days);
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, err) { alert('text status '+textStatus+', err '+err) }
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#leave_bal').val("");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function get_all_count(id) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "<?php echo base_url()?>Leave/get_all_leave_count/"+id,
|
||||
success: function(response) {
|
||||
response = JSON.parse(response);
|
||||
$('#leave_bal').val( response[0].days);
|
||||
},
|
||||
error: function(jqXHR, textStatus, err) { alert('text status '+textStatus+', err '+err) }
|
||||
});
|
||||
}
|
||||
</script>
|
||||
487
application/modules/Leave/views/edit_leave.php
Normal file
@ -0,0 +1,487 @@
|
||||
<!-- Body page content -->
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.3/moment.min.js"></script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.3/moment.min.js"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.13.0/jquery-ui.min.js"></script>
|
||||
|
||||
<!-- bootstrap-daterangepicker -->
|
||||
<script src="https://localhost/ams//assets/default/moment/min/moment.min.js"></script>
|
||||
<script src="https://localhost/ams//assets/default/bootstrap-daterangepicker/daterangepicker.js"></script>
|
||||
<!-- bootstrap-datetimepicker -->
|
||||
<script src="https://localhost/ams//assets/default/bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>
|
||||
|
||||
<!-- bootstrap-daterangepicker -->
|
||||
<link href="https://localhost/ams//assets/default/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet">
|
||||
<!-- bootstrap-datetimepicker -->
|
||||
<link href="https://localhost/ams//assets/default/bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css" rel="stylesheet">
|
||||
<!-- style.css -->
|
||||
<link href="https://localhost/ams//assets/default/customize/style.css" rel="stylesheet">
|
||||
|
||||
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||
|
||||
|
||||
<style>
|
||||
|
||||
input[type=date] {
|
||||
position: relative;
|
||||
/* width: 150px; height: 20px;
|
||||
color: white;*/
|
||||
}
|
||||
|
||||
input[type=date]:before {
|
||||
position: absolute;
|
||||
top: 3px; left: 3px;
|
||||
content: attr(data-date);
|
||||
display: inline-block;
|
||||
color: black;
|
||||
}
|
||||
|
||||
input[type=date]::-webkit-datetime-edit, input::-webkit-inner-spin-button, input::-webkit-clear-button {
|
||||
display: none;s
|
||||
}
|
||||
|
||||
input[type=date]::-webkit-calendar-picker-indicator {
|
||||
position: absolute;
|
||||
top: 3px;
|
||||
right: 0;
|
||||
color: black;
|
||||
opacity: 1;
|
||||
}
|
||||
</style>
|
||||
<div class="">
|
||||
<div class="page-title">
|
||||
|
||||
<div class="title_left">
|
||||
<h3>Edit Leave</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
|
||||
|
||||
<!-- <h6>General Information</h6> -->
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="x_content">
|
||||
<br />
|
||||
|
||||
<?php if(!empty($editleave)) { ?>
|
||||
|
||||
<?php foreach( $editleave as $leave) { ?>
|
||||
|
||||
<form id="myForm" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url()?>Leave/editleave" enctype="multipart/form-data">
|
||||
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="last-name">Leave Applied For</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
|
||||
<input type="radio" name="risedby" value="self"style="margin:10px;"checked /><b>Self</b>
|
||||
|
||||
<input type="radio" name="risedby" value="<?php echo user()->name;?>" style="margin: 10px;" /><b>Others</b>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="item form-group">
|
||||
<label class="control-label col-md-2 col-sm-2 " for="last-name"> Employee Name </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="user_dropdown" name="emp_id" style="margin-top: 10px;padding-bottom: 10px;" class="form-control" > </select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="last-name">Leave Type<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="type" name="type" class="form-control" >
|
||||
<option value="<?php echo $leave->type; ?>"><?php echo $leave->type; ?></option>
|
||||
<?php foreach ($leavetype as $key => $value) { ?>
|
||||
<option id="<?php echo $value->id; ?>" value="<?php echo $value->type; ?>"><?php echo $value->type; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Balance</label>
|
||||
<div class="col-md-1 col-sm-1 ">
|
||||
<input type="text" id="leave_bal" name="" value="" style="width:90px;" class="form-control " readonly>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="item form-group" id="hidedate">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="first-name"> From Date<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-2 col-sm-2 ">
|
||||
<div class='input-group date'>
|
||||
<input type='text' class="form-control" placeholder="DD-MM-YYYY" id="fromdate" name="from_date" value="<?php echo dateFormat('d-m-Y', $leave->from_date); ?>" required />
|
||||
<span class="input-group-addon">
|
||||
<li class="fa fa-calendar"></li>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1" for="last-name">To Date<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-2 col-sm-2 ">
|
||||
<div class='input-group date' >
|
||||
<input type='text' class="form-control" placeholder="DD-MM-YYYY" id="todate" name= "to_date" value="<?php echo dateFormat('d-m-Y', $leave->to_date); ?>" required />
|
||||
<span class="input-group-addon">
|
||||
<li class="fa fa-calendar"></li>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name"></label>
|
||||
<div class="col-md-2 col-sm-2 ">
|
||||
<input id="dateDifference" value="" readonly class="form-control" style="width:90px;" type="text" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group" id="showdate" >
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="first-name">Date<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<div class='input-group date'>
|
||||
<input type='text' class="form-control" required name="perm_date" placeholder="DD-MM-YYYY" value="<?php echo $leave->perm_date; ?>" id='myDatepicker'/></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item form-group" id="showtime" >
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="first-name"> From<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-2 col-sm-2 ">
|
||||
<select class="custom-select" id="from_time" name=from_time required >
|
||||
<option value="<?php echo $leave->from_time; ?>"><?php echo $leave->from_time; ?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name">To<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-2 col-sm-2 ">
|
||||
<select id="to_time" class="custom-select" name="to_time" required>
|
||||
<option value="<?php echo $leave->to_time; ?>"><?php echo $leave->to_time; ?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="last-name">Note</label>
|
||||
<div class="col-md-5 col-sm-5">
|
||||
<textarea id="comments" name="comments" value="" class="form-control" style="height:100px !important;" type="text" ><?php echo $leave->comments; ?></textarea>
|
||||
|
||||
<input type="hidden" name="manager" value="<?php echo employee()->manager ?>">
|
||||
<input type="hidden" name="id" value="<?php echo $leave->id; ?>">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="ln_solid"></div>
|
||||
<div class="item form-group">
|
||||
<div class=" offset-md-8">
|
||||
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
||||
<button class="btn btn-primary" type="reset">Reset</button>
|
||||
<button type="submit" id="submit" onclick="sweert()" class="btn btn-success">Update</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<?php } }?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Body page content -->
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
|
||||
var currentUserName = '<?php echo user()->name; ?>';
|
||||
var currentUserId = '<?php echo user()->id; ?>';
|
||||
$('#user_dropdown').append('<option value="' + currentUserId + '">' +
|
||||
currentUserName + '</option>');
|
||||
$('#user_dropdown').prop('disabled', true);
|
||||
|
||||
$('#user_dropdown').on('change',function() {
|
||||
|
||||
$('#type').prop('selectedIndex',0);
|
||||
|
||||
});
|
||||
|
||||
$('#type').on('change',function() {
|
||||
let id = $("#user_dropdown").val();
|
||||
|
||||
var type_id = $('option:selected', this).attr('id');
|
||||
|
||||
if (id)
|
||||
{
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "<?php echo base_url()?>Leave/get_leave_count/"+id+'_'+type_id,
|
||||
success: function(response) {
|
||||
response = JSON.parse(response);
|
||||
if(response.length == 0)
|
||||
{
|
||||
get_all_count(type_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(response[0].remaining_days == 1 )
|
||||
{
|
||||
$('#leave_bal').val(response[0].remaining_days + ' day');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#leave_bal').val(response[0].remaining_days + ' days');
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, err) { alert('text status '+textStatus+', err '+err) }
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#leave_bal').val("");
|
||||
}
|
||||
});
|
||||
|
||||
$('input[type="radio"][name="risedby"]').change(function() {
|
||||
var selectedValue = $(this).val();
|
||||
var $userDropdown = $('#user_dropdown');
|
||||
|
||||
$userDropdown.empty();
|
||||
|
||||
if (selectedValue === 'self') {
|
||||
|
||||
var currentUserName = '<?php echo user()->name; ?>';
|
||||
var currentUserId = '<?php echo user()->id; ?>';
|
||||
$userDropdown.append('<option value="' + currentUserId + '">' + currentUserName + '</option>');
|
||||
$userDropdown.prop('disabled', true);
|
||||
} else if (selectedValue === '<?php echo user()->name; ?>') {
|
||||
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('Leave/get_emp_name/')?>"',
|
||||
method: 'GET',
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
$('#user_dropdown').append(response);
|
||||
$('#user_dropdown').prop('disabled', false);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function get_all_count(id) {
|
||||
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "<?php echo base_url()?>Leave/get_all_leave_count/"+id,
|
||||
success: function(response) {
|
||||
response = JSON.parse(response);
|
||||
console.log(response);
|
||||
$('#leave_bal').val( response[0].days);
|
||||
},
|
||||
error: function(jqXHR, textStatus, err) { alert('text status '+textStatus+', err '+err) }
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// Initialize datepickers
|
||||
var dateFormat = "dd-mm-yy";
|
||||
var fromDateInput = $("#fromdate");
|
||||
console.log(fromDateInput);
|
||||
var toDateInput = $("#todate");
|
||||
console.log(toDateInput);
|
||||
|
||||
fromDateInput.datepicker({
|
||||
dateFormat: dateFormat,
|
||||
onSelect: function (dateText, inst) {
|
||||
toDateInput.datepicker("option", "minDate", dateText);
|
||||
validateDateRange();
|
||||
calculateDateDifference();
|
||||
}
|
||||
});
|
||||
|
||||
toDateInput.datepicker({
|
||||
dateFormat: dateFormat,
|
||||
onSelect: function (dateText, inst) {
|
||||
validateDateRange();
|
||||
calculateDateDifference();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Function to validate the date range
|
||||
function validateDateRange() {
|
||||
var fromDate = fromDateInput.datepicker("getDate");
|
||||
var toDate = toDateInput.datepicker("getDate");
|
||||
|
||||
// Check if both dates are selected
|
||||
if (!fromDate || !toDate) {
|
||||
$("#error-msg").text("Please select both From Date and To Date");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Compare the dates
|
||||
if (fromDate > toDate) {
|
||||
$("#error-msg").text("From Date cannot be after To Date");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Clear the error message if the date range is valid
|
||||
$("#error-msg").text("");
|
||||
return true;
|
||||
}
|
||||
|
||||
function calculateDateDifference() {
|
||||
var fromDate = fromDateInput.datepicker("getDate");
|
||||
var toDate = toDateInput.datepicker("getDate");
|
||||
|
||||
if (!isNaN(fromDate) && !isNaN(toDate)) {
|
||||
var difference = Math.ceil((toDate - fromDate) / (1000 * 60 * 60 * 24) + 1 );
|
||||
if(difference == 1)
|
||||
{
|
||||
$("#dateDifference").val(difference + ' day');
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#dateDifference").val(difference + ' days');
|
||||
}
|
||||
|
||||
} else {
|
||||
$("#dateDifference").val("");
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$('#showtime').hide()
|
||||
$('#showdate').hide()
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
let type = $('#type').val();
|
||||
|
||||
console.log($('#showtime').val())
|
||||
|
||||
if( type === 'Permission' ){
|
||||
|
||||
$('#hidedate').hide()
|
||||
$('#balance').hide()
|
||||
$('#leave_bal').hide()
|
||||
$('#fromdate').removeAttr('required');
|
||||
$('#todate').removeAttr('required');
|
||||
$('#showtime').show();
|
||||
$('#showdate').show();
|
||||
}
|
||||
else{
|
||||
|
||||
$('#from_time').removeAttr('required');
|
||||
$('#to_time').removeAttr('required');
|
||||
$('#myDatepicker').removeAttr('required');
|
||||
$('#hidedate').show();
|
||||
$('#showtime').hide();
|
||||
$('#showdate').hide();
|
||||
$('#balance').show()
|
||||
$('#leave_bal').show()
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var selectField = $('#from_time');
|
||||
|
||||
var options = [ '12:00 AM', '12:30 AM', '1:00 AM', '1:30 AM', '2:00 AM', '2:30 AM', '3:00 AM', '3:30 AM', '4:00 AM', '4:30 AM', '5:00 AM', '5:30 AM', '6:00 AM', '6:30 AM', '7:00 AM', '7:30 AM', '8:00 AM', '8:30 AM', '9:00 AM', '9:30 AM', '10:00 AM', '10:30 AM', '11:00 AM', '11:30 AM', '12:00 Noon', '12:30 PM', '1:00 PM', '1:30 PM', '2:00 PM', '2:30 PM', '3:00 PM', '3:30 PM', '4:00 PM', '4:30 PM', '5:00 PM', '5:30 PM', '6:00 PM', '6:30 PM', '7:00 PM', '7:30 PM', '8:00 PM', '8:30 PM', '9:00 PM', '9:30 PM', '10:00 PM', '10:30 PM', '11:00 PM', '11:30 PM'];
|
||||
|
||||
|
||||
for (var i = 0; i < options.length; i++) {
|
||||
selectField.append('<option value="' + options[i] + '">' + options[i] + '</option>');
|
||||
}
|
||||
});
|
||||
|
||||
var selectField = $('#from_time');
|
||||
selectField.on('click', function() {
|
||||
|
||||
var selectedValue = $(this).val();
|
||||
console.log(selectedValue);
|
||||
|
||||
var timeSlots = [ '12:00 AM', '12:30 AM', '1:00 AM', '1:30 AM', '2:00 AM', '2:30 AM', '3:00 AM', '3:30 AM', '4:00 AM', '4:30 AM', '5:00 AM', '5:30 AM', '6:00 AM', '6:30 AM', '7:00 AM', '7:30 AM', '8:00 AM', '8:30 AM', '9:00 AM', '9:30 AM', '10:00 AM', '10:30 AM', '11:00 AM', '11:30 AM', '12:00 Noon', '12:30 PM', '1:00 PM', '1:30 PM', '2:00 PM', '2:30 PM', '3:00 PM', '3:30 PM', '4:00 PM', '4:30 PM', '5:00 PM', '5:30 PM', '6:00 PM', '6:30 PM', '7:00 PM', '7:30 PM', '8:00 PM', '8:30 PM', '9:00 PM', '9:30 PM', '10:00 PM', '10:30 PM', '11:00 PM', '11:30 PM'];
|
||||
|
||||
|
||||
function filterTimeSlots(startingTime, numberOfHours) {
|
||||
// Find the index of the starting time in the array
|
||||
console.log(startingTime,numberOfHours);
|
||||
const startIndex = timeSlots.findIndex(time => time === startingTime);
|
||||
console.log(startIndex);
|
||||
if (startIndex !== -1) {
|
||||
|
||||
const endIndex = startIndex + (numberOfHours * 2) - 1;
|
||||
|
||||
return timeSlots.slice(startIndex, endIndex + 2);
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
// Usage example
|
||||
const startingTime = selectedValue;
|
||||
const numberOfHours = 4 ;
|
||||
const filteredTimeSlots = filterTimeSlots(startingTime, numberOfHours);
|
||||
|
||||
filteredTimeSlots.shift();
|
||||
var totime = $('#to_time');
|
||||
totime.empty();
|
||||
for (var i = 0; i < filteredTimeSlots.length; i++) {
|
||||
totime.append('<option value="' + filteredTimeSlots[i] + '">' + filteredTimeSlots[i] + '</option>');
|
||||
|
||||
}
|
||||
|
||||
console.log(filteredTimeSlots);
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
310
application/modules/Leave/views/leave_list.php
Normal file
@ -0,0 +1,310 @@
|
||||
|
||||
<head>
|
||||
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css'>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
|
||||
<style>
|
||||
.modal {
|
||||
display: none;
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
background-color: #fefefe;
|
||||
margin: 15% auto;
|
||||
padding: 20px;
|
||||
border: 1px solid #888;
|
||||
width: 380px;
|
||||
height: 280px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
button {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_filter{
|
||||
margin-top: -44px !important; //search move to up
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<a href="<?php echo base_url();?>Leave/LeaveHistory" class="btn btn-sm btn-primary" style="margin-top: 20px;" >Back</a>
|
||||
</ul>
|
||||
|
||||
<h1>My Approvals</h1>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="x_content">
|
||||
<div class="row">
|
||||
<div class="col-sm-12" style="overflow: auto;">
|
||||
<table id="datatable-buttons" class="table table-striped table-bordered" width="100%">
|
||||
<thead>
|
||||
<tr class="headings">
|
||||
<th class="column-title">Created Date/Time</th>
|
||||
<th class="column-title">Employee Name </th>
|
||||
<th class="column-title">Leave Duration </th>
|
||||
<th class="column-title">Leave Type </th>
|
||||
<th class="column-title">Leave Raised By</th>
|
||||
<th class="column-title">No of Days </th>
|
||||
<th class="column-title">Status </th>
|
||||
<th class="column-title">Note</th>
|
||||
<th class="column-title" >Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($tableData as $key => $value) { ?>
|
||||
<tr class="even pointer">
|
||||
|
||||
<td class=" "><?php echo $value->created_date; ?><br><?php echo $value->created_time; ?></td>
|
||||
<td class=" "><?php echo $value->name; ?> (<?php echo $value->emp_id; ?>) </td>
|
||||
<?php if($value->from_date == "" && $value->to_date == "") { ?>
|
||||
<td class="">
|
||||
<?php echo dateFormat('d-m-Y',$value->perm_date);?><br>
|
||||
<?php echo timeFormat('h:i a', $value->from_time); ?> to
|
||||
<?php echo timeFormat('h:i a', $value->to_time);; ?>
|
||||
</td>
|
||||
<?php } else { ?>
|
||||
|
||||
<td class=" "> <?php echo dateFormat('d-m-Y',$value->from_date); echo ' to ';?> <?php echo dateFormat('d-m-Y',$value->to_date);?> </td>
|
||||
<?php } ?>
|
||||
<td class=" "><?php echo $value->type; ?></td>
|
||||
<td class=" "><?php echo $value->risedby; ?></td>
|
||||
<?php if($value->no_of_days == 0){ ?>
|
||||
<td class=" ">---</td>
|
||||
<?php } else { ?>
|
||||
<td class=""><?php echo $value->no_of_days; ?></td>
|
||||
<?php } ?>
|
||||
<?php if($value->status == 'pending'){ ?>
|
||||
<td style="color:#e68a00"><?php echo $value->status; ?></td>
|
||||
<?php }
|
||||
else if($value->status == 'Approved'){ ?>
|
||||
<td style="color:green"><?php echo $value->status; ?></td>
|
||||
<?php }
|
||||
else if($value->status == 'Declined'){ ?>
|
||||
<td style="color:red"><?php echo $value->status; ?>by <?php echo $value->declined_by; ?> <br>" <?php echo $value->DReason; ?> "</td>
|
||||
<?php }
|
||||
else if($value->status == 'canceled'){ ?>
|
||||
<td style="color:darkcyan;"><?php echo $value->status; ?></td>
|
||||
<?php }
|
||||
else{
|
||||
|
||||
}?>
|
||||
<td class=" "><?php echo $value->comments; ?></td>
|
||||
<td style=" text-align: center; font-size: 16px;">
|
||||
|
||||
<?php if($value->status == 'pending') { ?>
|
||||
|
||||
<a href="<?php echo base_url('Leave/ApproveLeave')?>?id=<?php echo $value->id;?> "><i class="fa fa-check" aria-hidden="true"title="Approve" onclick = "return confirm('Are you sure to Approve This Leave ')" ></i></a>
|
||||
|
||||
|
||||
<a href="#"><i class="fa fa-times test" aria-hidden="true" title="Decline" onclick="showCustomPrompt()"
|
||||
id= "<?php echo $value->id; ?>"></i></a>
|
||||
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="customPrompt" class="modal">
|
||||
<div class="modal-content">
|
||||
<span style="text-align: right;" onclick="$('#customPrompt').hide()"><i class="fa fa-times" aria-hidden="true"></i></span>
|
||||
<h3>Decline Reason</h3>
|
||||
<input list="browsers" onfocus id="decline_reason" required name="myBrowser" style="margin-top: 10%;padding: 10px;"/>
|
||||
<datalist id="browsers" >
|
||||
<?php foreach ($dropdown as $key => $value) { ?>
|
||||
<option value="<?php echo $value->enum_value; ?>"><?php echo $value->enum_value; ?></option>
|
||||
<?php } ?>
|
||||
</datalist>
|
||||
|
||||
<button onclick="submitCustomPrompt()" type="button" class="btn btn-primary">Submit</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
||||
<!-- Large modal -->
|
||||
<!-- <button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-lg" hidden>Large modal</button> -->
|
||||
<div class="modal fade bs-example-modal-lg" id="ItemModal" tabindex="-1" role="dialog" aria-hidden="true"></div>
|
||||
<div class="modal bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" id="popup"> </div>
|
||||
|
||||
<div style="display:none" id="sub-value">
|
||||
|
||||
<script>
|
||||
$('.deleteEmp').click(function() {
|
||||
var id = $(this).attr('id');
|
||||
var url = "<?php echo base_url()?>Employee/deleteEmp";
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo base_url()?>Employee/getDeleteConfirmationPopup",
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
$('#popup').html(JSON.parse(data));
|
||||
$('.delete_id').attr('value',id);
|
||||
$('.delete_url').attr('action',url);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$(document).on('click','.bi-card-list',function(){
|
||||
var id = $(this).attr("id")
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "<?php echo base_url()?>Employee/view_emp_history/"+id,
|
||||
success: function(response) {
|
||||
response = JSON.parse(response);
|
||||
console.log(response);
|
||||
$('.bs-example-modal-lg').html(response);
|
||||
$('.bs-example-modal-lg').modal("show");
|
||||
},
|
||||
error: function(jqXHR, textStatus, err) { alert('text status '+textStatus+', err '+err) }
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<!-- <script>
|
||||
$(document).on('click','.test',function(){
|
||||
var id = $(this).attr("id");
|
||||
var reason = prompt("Decline Reason", "");
|
||||
if(reason != null && reason != "" ){
|
||||
$.ajax(
|
||||
{
|
||||
data:{id : id , reason : reason },
|
||||
url:"<?php echo base_url('Leave/Decline');?>",
|
||||
type:"get",
|
||||
success: function(response) {
|
||||
|
||||
window.location = '<?php echo base_url('Leave/leaveList');?>';
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
else if(reason == "")
|
||||
{
|
||||
alert('Decline Reason is Required');
|
||||
}
|
||||
});
|
||||
</script> -->
|
||||
|
||||
<!-- <script>
|
||||
|
||||
var reason = $('#decline_reason').val();
|
||||
$.ajax(
|
||||
{
|
||||
data:{id : id , reason : reason },
|
||||
url:"<?php echo base_url('Leave/Decline');?>",
|
||||
type:"get",
|
||||
success: function(response) {
|
||||
|
||||
window.location = '<?php echo base_url('Leave/leaveList');?>';
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
</script> -->
|
||||
|
||||
<script>
|
||||
|
||||
function showCustomPrompt() {
|
||||
var customPrompt = document.getElementById("customPrompt");
|
||||
customPrompt.style.display = "block";
|
||||
}
|
||||
|
||||
function submitCustomPrompt() {
|
||||
|
||||
var id = $('.test').attr("id");
|
||||
var reason = document.getElementById("decline_reason").value;
|
||||
|
||||
if( reason != "")
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
data:{id : id , reason : reason },
|
||||
url:"<?php echo base_url('Leave/Decline');?>",
|
||||
type:"get",
|
||||
success: function(response) {
|
||||
|
||||
window.location ='<?php echo base_url('Leave/leaveList');?>';
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
else
|
||||
|
||||
alert('Decline Reason is required');
|
||||
|
||||
|
||||
// var customPrompt = document.getElementById("customPrompt");
|
||||
// customPrompt.style.display = "none";
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
function alert(){
|
||||
|
||||
const swalWithBootstrapButtons = Swal.mixin({
|
||||
customClass: {
|
||||
confirmButton: 'btn btn-success',
|
||||
cancelButton: 'btn btn-danger'
|
||||
},
|
||||
buttonsStyling: false
|
||||
})
|
||||
|
||||
swalWithBootstrapButtons.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to Approve this!",
|
||||
icon: false,
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Yes, Approved it!',
|
||||
cancelButtonText: 'No, cancel!',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Approved!',
|
||||
'Leave has been Approved.',
|
||||
'success'
|
||||
)
|
||||
} else if (
|
||||
/* Read more about handling dismissals below */
|
||||
result.dismiss === Swal.DismissReason.cancel
|
||||
) {
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Cancelled',
|
||||
'Your imaginary file is safe :)',
|
||||
'error'
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
|
||||
167
application/modules/Leave/views/leavehistory.php
Normal file
@ -0,0 +1,167 @@
|
||||
<head>
|
||||
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css'>
|
||||
<style>
|
||||
.alert-success {
|
||||
background-color: #dff0d8;
|
||||
color: #3c763d;
|
||||
border-color: #d6e9c6;
|
||||
}
|
||||
|
||||
.flash-message {
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
border-radius: 5px;
|
||||
margin-left: 650px;
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_filter{
|
||||
margin-top: -44px !important; //search move to up
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
|
||||
<?php if ($this->session->userdata('Success')): ?>
|
||||
<div class="alert-success flash-message" id="customPrompt" style="text-align: right;">
|
||||
<h2><?php echo $this->session->userdata('Success'); ?></h2>
|
||||
<span onclick="$('#customPrompt').hide()" style="text-align: right;" ><i class="fa fa-times" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php $this->session->unset_userdata('Success');?>
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<a href="<?php echo base_url();?>Leave/applyLeave" class="btn btn-sm btn-primary" style="margin-top: 20px;">Apply Leave</a>
|
||||
|
||||
<?php if(is_user() || user()->role == null) { ?>
|
||||
<a href="<?php echo base_url();?>Leave/manager_approvel" class="btn btn-sm btn-warning" style="margin-top: 20px;">My Approvals</a>
|
||||
<?php } ?>
|
||||
|
||||
<?php if(is_admin()) { ?>
|
||||
<a href="<?php echo base_url();?>Leave/leaveList" class="btn btn-sm btn-warning" style="margin-top: 20px;">My Approvals</a>
|
||||
<?php }?>
|
||||
|
||||
</ul>
|
||||
|
||||
<h1>My Leaves</h1>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="x_content">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<table id="datatable-buttons" class="table table-striped table-bordered" width="100%">
|
||||
<thead>
|
||||
<tr class="headings">
|
||||
<th class="column-title">Created Date/Time</th>
|
||||
<th class="column-title">Leave Type </th>
|
||||
<th class="column-title">Leave Duration</th>
|
||||
<th class="column-title">No of Days </th>
|
||||
<th class="column-title">Status </th>
|
||||
<th class="column-title">Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php foreach ($tableData as $key => $value) { ?>
|
||||
<?php if( user()->id == $value->emp_id) { ?>
|
||||
<tr class="even pointer">
|
||||
<td class=" "><?php echo $value->created_date; ?><br><?php echo $value->created_time; ?></td>
|
||||
<td class=" "><?php echo $value->type; ?></td>
|
||||
<?php if($value->from_date == "" && $value->to_date == "") { ?>
|
||||
<td class="">
|
||||
<?php echo dateFormat('d-m-Y',$value->perm_date);?><br>
|
||||
<?php echo timeFormat('h:i a', $value->from_time); ?> to
|
||||
<?php echo timeFormat('h:i a', $value->to_time);; ?>
|
||||
</td>
|
||||
<?php } else { ?>
|
||||
|
||||
<td class=" "> <?php echo dateFormat('d-m-Y',$value->from_date); echo ' to ';?> <?php echo dateFormat('d-m-Y',$value->to_date);?> </td>
|
||||
<?php } ?>
|
||||
<?php if($value->no_of_days == 0){ ?>
|
||||
<td class=" ">---</td>
|
||||
<?php } else { ?>
|
||||
<td class=""><?php echo $value->no_of_days; ?></td>
|
||||
<?php } ?>
|
||||
<?php if($value->status == 'pending'){ ?>
|
||||
<td style="color:#e68a00"><?php echo $value->status; ?></td>
|
||||
<?php }
|
||||
else if($value->status == 'Approved'){ ?>
|
||||
<td style="color:green"><?php echo $value->status; ?> By <?php echo $value->approved_by; ?><br><?php echo $value->approved_at; ?></td>
|
||||
<?php }
|
||||
else if($value->status == 'Declined'){ ?>
|
||||
<td style="color:red"><?php echo $value->status; ?> by <?php echo $value->DReason; ?></td>
|
||||
<?php }
|
||||
else if($value->status == 'canceled'){ ?>
|
||||
<td style="color:darkcyan;"><?php echo $value->status; ?></td>
|
||||
<?php }
|
||||
else{
|
||||
|
||||
}?>
|
||||
|
||||
<td style=" text-align: center; font-size: 16px;">
|
||||
<?php if($value->status == 'pending') { ?>
|
||||
|
||||
<a href="<?php echo base_url('Leave/edit_leave_function')?>?id=<?php echo md5($value->id);?> "><i class="fa fa-edit" aria-hidden="true"title="Edit"></i></a>
|
||||
|
||||
<a href="<?php echo base_url('Leave/cancled')?>?id=<?php echo md5($value->id);?> "><i class="fa fa-ban" aria-hidden="true"title="Edit"></i></a>
|
||||
|
||||
<?php } ?>
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
<?php } } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
||||
<!-- Large modal -->
|
||||
<!-- <button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-lg" hidden>Large modal</button> -->
|
||||
<div class="modal fade bs-example-modal-lg" id="ItemModal" tabindex="-1" role="dialog" aria-hidden="true"></div>
|
||||
<div class="modal bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" id="popup"> </div>
|
||||
|
||||
<div style="display:none" id="sub-value">
|
||||
|
||||
<script>
|
||||
$('.deleteEmp').click(function() {
|
||||
var id = $(this).attr('id');
|
||||
var url = "<?php echo base_url()?>Employee/deleteEmp";
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo base_url()?>Employee/getDeleteConfirmationPopup",
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
$('#popup').html(JSON.parse(data));
|
||||
$('.delete_id').attr('value',id);
|
||||
$('.delete_url').attr('action',url);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$(document).on('click','.bi-card-list',function(){
|
||||
var id = $(this).attr("id")
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "<?php echo base_url()?>Employee/view_emp_history/"+id,
|
||||
success: function(response) {
|
||||
response = JSON.parse(response);
|
||||
console.log(response);
|
||||
$('.bs-example-modal-lg').html(response);
|
||||
$('.bs-example-modal-lg').modal("show");
|
||||
},
|
||||
error: function(jqXHR, textStatus, err) { alert('text status '+textStatus+', err '+err) }
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
255
application/modules/Leave/views/manager_approvel.php
Normal file
@ -0,0 +1,255 @@
|
||||
<head>
|
||||
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css'>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
|
||||
|
||||
<style>
|
||||
.modal {
|
||||
display: none;
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
background-color: #fefefe;
|
||||
margin: 15% auto;
|
||||
padding: 20px;
|
||||
border: 1px solid #888;
|
||||
width: 380px;
|
||||
height: 280px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
button {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_filter{
|
||||
margin-top: -44px !important; //search move to up
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
</head>
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<a href="<?php echo base_url();?>Leave/LeaveHistory" class="btn btn-sm btn-primary" style="margin-top: 20px;" >Back</a>
|
||||
</ul>
|
||||
|
||||
<h1>My Approvals</h1>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="x_content">
|
||||
<div class="row">
|
||||
<div class="col-sm-12" style="overflow: auto;">
|
||||
<table id="datatable-buttons" class="table table-striped table-bordered" width="100%">
|
||||
<thead>
|
||||
<tr class="headings">
|
||||
<th class="column-title">Created Date/Time</th>
|
||||
<th class="column-title">Employee Name </th>
|
||||
<th class="column-title">Leave Duration </th>
|
||||
<th class="column-title">Leave Type </th>
|
||||
<th class="column-title">Leave Raised By</th>
|
||||
<th class="column-title">No of Days </th>
|
||||
<th class="column-title">Note</th>
|
||||
<th class="column-title">Status </th>
|
||||
<th class="column-title" >Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($tableData as $key => $value) { ?>
|
||||
|
||||
<?php foreach ($get_delegation as $key => $val) { ?>
|
||||
|
||||
<?php if(user()->id == $value->manager || user()->id == $val->delegated_to && date('d-m-Y') >= $val->from_date && date('d-m-Y') <= $val->to_date && $value->created_date >= $val->from_date && $value->created_date <= $val->to_date ){ ?>
|
||||
|
||||
<tr class="even pointer">
|
||||
<td class=" "><?php echo $value->created_date; ?><br><?php echo $value->created_time; ?></td>
|
||||
<td class=" "><?php echo $value->name; ?> (<?php echo $value->emp_id; ?>) </td>
|
||||
<?php if($value->from_date == "" && $value->to_date == "") { ?>
|
||||
<td class="">
|
||||
<?php echo dateFormat('d-m-Y',$value->perm_date);?><br>
|
||||
<?php echo timeFormat('h:i a', $value->from_time); ?> to
|
||||
<?php echo timeFormat('h:i a', $value->to_time);; ?>
|
||||
</td>
|
||||
<?php } else { ?>
|
||||
|
||||
<td class=" "> <?php echo dateFormat('d-m-Y',$value->from_date); echo ' to ';?> <?php echo dateFormat('d-m-Y',$value->to_date);?> </td>
|
||||
<?php } ?>
|
||||
<td class=" "><?php echo $value->type; ?></td>
|
||||
<td class=" "><?php echo $value->risedby; ?></td>
|
||||
<?php if($value->no_of_days == 0){ ?>
|
||||
<td class=" ">---</td>
|
||||
<?php } else { ?>
|
||||
<td class=""><?php echo $value->no_of_days; ?></td>
|
||||
<?php } ?>
|
||||
<td class=" "><?php echo $value->comments; ?></td>
|
||||
<?php if($value->status == 'pending'){ ?>
|
||||
<td style="color:#e68a00"><?php echo $value->status; ?></td>
|
||||
<?php }
|
||||
else if($value->status == 'Approved'){ ?>
|
||||
<td style="color:green"><?php echo $value->status; ?> By <?php echo $value->approved_by; ?><br><?php echo $value->approved_at; ?></td>
|
||||
<?php }
|
||||
else if($value->status == 'Declined'){ ?>
|
||||
<td style="color:red"><?php echo $value->status; ?> by <?php echo $value->declined_by; ?> <br>" <?php echo $value->DReason; ?> "</td>
|
||||
<?php }
|
||||
else if($value->status == 'canceled'){ ?>
|
||||
<td style="color:darkcyan;"><?php echo $value->status; ?></td>
|
||||
<?php }
|
||||
else{
|
||||
|
||||
}?>
|
||||
<td style=" text-align: center; font-size: 16px;">
|
||||
|
||||
<?php if($value->status == 'pending') { ?>
|
||||
|
||||
<a href="<?php echo base_url('Leave/ManagerLeaveApprove')?>?id=<?php echo $value->id;?> "><i class="fa fa-check" aria-hidden="true"title="Approve" onclick = "return confirm('Are you sure to Approve This Leave ')" ></i></a>
|
||||
|
||||
|
||||
<a href="#"><i class="fa fa-times test" aria-hidden="true" title="Decline" id= "<?php echo $value->id; ?>" onclick="showCustomPrompt()"></i></a>
|
||||
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } } } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="customPrompt" class="modal">
|
||||
<div class="modal-content">
|
||||
<span style="text-align: right;" onclick="$('#customPrompt').hide()"><i class="fa fa-times" aria-hidden="true"></i></span>
|
||||
<h3>Decline Reason</h3>
|
||||
<input list="browsers" onfocus id="decline_reason" required name="myBrowser" style="margin-top: 10%;padding: 10px;"/>
|
||||
<datalist id="browsers" >
|
||||
<?php foreach ($dropdown as $key => $value) { ?>
|
||||
<option value="<?php echo $value->enum_value; ?>"><?php echo $value->enum_value; ?></option>
|
||||
<?php } ?>
|
||||
</datalist>
|
||||
|
||||
<button onclick="submitCustomPrompt()" type="button" class="btn btn-primary">Submit</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
||||
<!-- Large modal -->
|
||||
<!-- <button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-lg" hidden>Large modal</button> -->
|
||||
<div class="modal fade bs-example-modal-lg" id="ItemModal" tabindex="-1" role="dialog" aria-hidden="true"></div>
|
||||
<div class="modal bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" id="popup"> </div>
|
||||
|
||||
<div style="display:none" id="sub-value">
|
||||
|
||||
<script>
|
||||
$('.deleteEmp').click(function() {
|
||||
var id = $(this).attr('id');
|
||||
var url = "<?php echo base_url()?>Employee/deleteEmp";
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo base_url()?>Employee/getDeleteConfirmationPopup",
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
$('#popup').html(JSON.parse(data));
|
||||
$('.delete_id').attr('value',id);
|
||||
$('.delete_url').attr('action',url);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$(document).on('click','.bi-card-list',function(){
|
||||
var id = $(this).attr("id")
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "<?php echo base_url()?>Employee/view_emp_history/"+id,
|
||||
success: function(response) {
|
||||
response = JSON.parse(response);
|
||||
console.log(response);
|
||||
$('.bs-example-modal-lg').html(response);
|
||||
$('.bs-example-modal-lg').modal("show");
|
||||
},
|
||||
error: function(jqXHR, textStatus, err) { alert('text status '+textStatus+', err '+err) }
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<!-- <script>
|
||||
$(document).on('click','.test',function(){
|
||||
var id = $(this).attr("id");
|
||||
var reason = prompt("Decline Reason", "");
|
||||
console.log(reason);
|
||||
if(reason != null && reason != "" ){
|
||||
$.ajax(
|
||||
{
|
||||
data:{id : id , reason : reason },
|
||||
url:"<?php echo base_url('Leave/Decline');?>",
|
||||
type:"get",
|
||||
success: function(response) {
|
||||
|
||||
window.location = '<?php echo base_url('Leave/leaveList');?>';
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
else if(reason == "")
|
||||
{
|
||||
alert('Decline Reason is Required');
|
||||
}
|
||||
});
|
||||
</script> -->
|
||||
<script>
|
||||
|
||||
function showCustomPrompt() {
|
||||
var customPrompt = document.getElementById("customPrompt");
|
||||
customPrompt.style.display = "block";
|
||||
}
|
||||
|
||||
function submitCustomPrompt() {
|
||||
|
||||
var id = $('.test').attr("id");
|
||||
var reason = document.getElementById("decline_reason").value;
|
||||
|
||||
if( reason != "")
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
data:{id : id , reason : reason },
|
||||
url:"<?php echo base_url('Leave/Decline');?>",
|
||||
type:"get",
|
||||
success: function(response) {
|
||||
|
||||
window.location ='<?php echo base_url('Leave/manager_approvel');?>';
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
else
|
||||
|
||||
alert('Decline Reason is required');
|
||||
|
||||
|
||||
// var customPrompt = document.getElementById("customPrompt");
|
||||
// customPrompt.style.display = "none";
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
100
application/modules/Leave/views/permissions.php
Normal file
@ -0,0 +1,100 @@
|
||||
|
||||
<div class="">
|
||||
<div class="page-title">
|
||||
|
||||
<div class="title_left">
|
||||
<h3>Permission</h3>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
|
||||
|
||||
|
||||
<!-- <h6>General Information</h6> -->
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="x_content">
|
||||
<br />
|
||||
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Leave/Permission" enctype="multipart/form-data">
|
||||
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name">Employee Name<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="emp_id" name="emp_id" required="required" class="form-control" >
|
||||
<option value="">--Select--</option>
|
||||
<?php foreach ($emp as $key => $value) { ?>
|
||||
<option value="<?php echo $value->id; ?>"><?php echo $value->name; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- <div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name">Leave Type<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="type" name="type" required="required" class="form-control" >
|
||||
<option value="">--Select--</option>
|
||||
<?php foreach ($leavetype as $key => $value) { ?>
|
||||
<option id="<?php echo $value->id; ?>" value="<?php echo $value->type; ?>"><?php echo $value->type; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Leave Balance</label>
|
||||
<div class="col-md-2 col-sm-2 ">
|
||||
<input type="text" id="leave_bal" name="" value="" class="form-control " readonly>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> From<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-2 col-sm-2 ">
|
||||
<input id="from_date" name="from_date" value="" required="required" class="form-control" type="time" >
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name">To<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-2 col-sm-2 ">
|
||||
<input id="to_date" name="to_date" value="" required="required" class="form-control" type="time">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name">Comments</label>
|
||||
<div class="col-md-5 col-sm-5">
|
||||
<textarea id="comments" name="comments" value="" class="form-control" style="height:100px !important;" type="text" ></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="ln_solid"></div>
|
||||
<div class="item form-group">
|
||||
<div class=" offset-md-8">
|
||||
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
||||
<button class="btn btn-primary" type="reset">Reset</button>
|
||||
<button type="submit" class="btn btn-success">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Body page content -->
|
||||
|
||||
@ -0,0 +1,11 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "../../../../../Minton_v5.0.0"
|
||||
},
|
||||
{
|
||||
"path": "../../../.."
|
||||
}
|
||||
],
|
||||
"settings": {}
|
||||
}
|
||||
@ -26,8 +26,8 @@ public function __construct()
|
||||
// To inherit directly the attributes of the parent class.
|
||||
parent::__construct();
|
||||
$this->load->model('MY_Model');
|
||||
$this->load->model('user_model');
|
||||
$this->load->model('audit_model');
|
||||
$this->load->model('User_model','user_model');
|
||||
$this->load->model('Audit/Audit_model','audit_model');
|
||||
// $this->load->helper(array('form', 'url'));
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ public function createUser()
|
||||
//audit history generation for insert
|
||||
$test = $this->audit->create_history('insert');
|
||||
}
|
||||
redirect('user/userList');
|
||||
redirect('User/userList');
|
||||
|
||||
}
|
||||
|
||||
@ -126,20 +126,20 @@ public function editUsers()
|
||||
//audit history generation for update
|
||||
$test = $this->audit->create_history('update');
|
||||
}
|
||||
redirect('user/userList');
|
||||
redirect('User/userList');
|
||||
|
||||
}
|
||||
|
||||
public function deleteUser($id)
|
||||
{
|
||||
$Data = $this->user_model->delete_user_by_md5_id($id,user()->business_id);
|
||||
redirect('user/userList');
|
||||
redirect('User/userList');
|
||||
}
|
||||
|
||||
public function activateUser($id)
|
||||
{
|
||||
$Data = $this->user_model->activate_inactive_users($id,user()->business_id);
|
||||
redirect('user/userList');
|
||||
redirect('User/userList');
|
||||
}
|
||||
|
||||
public function profile()
|
||||
@ -183,7 +183,7 @@ public function editprofiles()
|
||||
}
|
||||
|
||||
$userData = $this->MY_Model->edit_option($action, $id, $table);
|
||||
redirect('user/profile');
|
||||
redirect('User/profile');
|
||||
}
|
||||
|
||||
|
||||
@ -191,7 +191,7 @@ public function changepassword()
|
||||
{
|
||||
// $password = md5(user()->password);
|
||||
// $this->layout->set('pass', $password);
|
||||
$this->layout->buffer('main_content', 'user/change_password');
|
||||
$this->layout->buffer('main_content', 'User/change_password');
|
||||
$this->layout->render('default_layout');
|
||||
}
|
||||
|
||||
|
||||
@ -48,6 +48,12 @@ public function delete_user_by_md5_id($id,$business_id)
|
||||
}
|
||||
$this->db->set('is_active',0);
|
||||
$this->db->update('users');
|
||||
$this->db->where('md5(user_id)', $id);
|
||||
if ($business_id != NULL) {
|
||||
$this->db->where('business_id', $business_id);
|
||||
}
|
||||
$this->db->set('is_active',0);
|
||||
$this->db->update('employees');
|
||||
return;
|
||||
}
|
||||
|
||||
@ -59,6 +65,12 @@ public function activate_inactive_users($id,$business_id)
|
||||
}
|
||||
$this->db->set('is_active',1);
|
||||
$this->db->update('users');
|
||||
$this->db->where('md5(user_id)', $id);
|
||||
if ($business_id != NULL) {
|
||||
$this->db->where('business_id', $business_id);
|
||||
}
|
||||
$this->db->set('is_active',1);
|
||||
$this->db->update('employees');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -80,7 +80,7 @@
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<a class="btn btn-success" href="<?php echo base_url()?>business/get_business/<?php echo md5($businessData->id);?>"><i class="fa fa-edit m-right-xs"></i>Edit Business</a>
|
||||
<a class="btn btn-success" href="<?php echo base_url()?>Business/get_business/<?php echo md5($businessData->id);?>"><i class="fa fa-edit m-right-xs"></i>Edit Business</a>
|
||||
<br />
|
||||
|
||||
</div>
|
||||
|
||||
@ -97,7 +97,7 @@
|
||||
var data = $("#change-pass").serialize();
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "<?php echo base_url();?>user/check_password",
|
||||
url: "<?php echo base_url();?>User/check_password",
|
||||
data: data,
|
||||
json: true,
|
||||
success: function(response) {
|
||||
@ -105,7 +105,7 @@
|
||||
if (response.status == "success") {
|
||||
console.log("ssssssssss");
|
||||
$('input[name=csrf_test_name]').val(response.csrf_hash);
|
||||
location.href = "<?php echo base_url();?>auth/logout";
|
||||
location.href = "<?php echo base_url();?>Auth/logout";
|
||||
}
|
||||
else {
|
||||
$('input[name=csrf_test_name]').val(response.csrf_hash);
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
if ($userData->profile_image == NULL) {
|
||||
?>
|
||||
<div class="profilepic">
|
||||
<img style="width: 100%;height: 100%; display: block;" src="<?php echo base_url(); ?>assets/uploads/profile_picture/profile.jpg ?>" alt="Avatar" title="Change the avatar">
|
||||
<img style="width: 100%;height: 100%; display: block;" src="<?php echo base_url(); ?>/assets/uploads/profile_picture/profile.jpg" alt="Avatar" title="Change the avatar">
|
||||
<input id="file_profile" name="profile_image" class="typeFile1" type="file" hidden/>
|
||||
<div class="profilepic__content">
|
||||
<span class="profilepic__icon"><i class="fa fa-camera" style="font-size:25px;color:black"></i></span>
|
||||
@ -68,7 +68,7 @@
|
||||
} else {
|
||||
?>
|
||||
<div class="profilepic">
|
||||
<img class="profilepic__image" style="width: 100%; display: block;border-radius:50%" src="<?php echo base_url(); ?>assets/uploads/profile_picture/<?php echo $userData->profile_image ?> ?>" alt="Avatar" title="Change the avatar">
|
||||
<img class="profilepic__image" style="width: 100%; display: block;border-radius:50%" src="<?php echo base_url();?>/assets/uploads/profile_picture/<?php echo $userData->profile_image ?>" alt="Avatar" title="Change the avatar">
|
||||
<input id="file_profile" name="profile_image" class="typeFile1" type="file" hidden/>
|
||||
<div class="profilepic__content">
|
||||
<span class="profilepic__icon"><i class="fa fa-camera" style="font-size:25px;color:black"></i></span>
|
||||
@ -95,7 +95,7 @@
|
||||
<?php
|
||||
if (is_superadmin()) {
|
||||
?>
|
||||
<a class="btn btn-success" href="<?php echo base_url()?>user/editprofile/<?php echo md5(user()->id);?>"><i class="fa fa-edit m-right-xs"></i>Edit Profile</a>
|
||||
<a class="btn btn-success" href="<?php echo base_url()?>User/editprofile/<?php echo md5(user()->id);?>"><i class="fa fa-edit m-right-xs"></i>Edit Profile</a>
|
||||
<br />
|
||||
<?php
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<h2>User Details </h2>
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<a href="<?php echo base_url();?>user/addUser" class="btn btn-sm btn-primary">Add User</a>
|
||||
<a href="<?php echo base_url();?>User/addUser" class="btn btn-sm btn-primary">Add User</a>
|
||||
<?php } ?>
|
||||
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
|
||||
</ul>
|
||||
@ -46,16 +46,16 @@
|
||||
<td style=" text-align: center; font-size: 16px;">
|
||||
<?php if ($value->is_active == 1) { ?>
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
<a href="<?php echo base_url()?>user/editUser/<?php echo md5($value->id);?>" ><i class="fa fa-pencil"></i></a>
|
||||
<a href="<?php echo base_url()?>User/editUser/<?php echo md5($value->id);?>" ><i class="fa fa-pencil" title="Edit"></i></a>
|
||||
|
||||
<a href="<?php echo base_url()?>user/deleteUser/<?php echo md5($value->id);?>" >
|
||||
<i class="#008000 fa fa-check-circle" style="font-size:20px;" title="deactivate"></i></a>
|
||||
<a href="<?php echo base_url()?>User/deleteUser/<?php echo md5($value->id);?>" >
|
||||
<i class="fa fa-times-circle-o" aria-hidden="true" style="font-size:20px;" title="deactivate"></i></a>
|
||||
|
||||
<?php } ?>
|
||||
<a> <i id="<?php echo md5($value->id);?>" class="bi bi-card-list" title="History"></i></a>
|
||||
<?php } ?>
|
||||
<?php if ($value->is_active == 0) { ?>
|
||||
<a href="<?php echo base_url()?>user/activateUser/<?php echo md5($value->id);?>" >
|
||||
<a href="<?php echo base_url()?>User/activateUser/<?php echo md5($value->id);?>" >
|
||||
<i class="green fa fa-check-circle" style="font-size:20px;" title="activate"></i></a>
|
||||
|
||||
<a> <i id="<?php echo md5($value->id);?>" class="bi bi-card-list" title="History"></i></a>
|
||||
@ -86,7 +86,7 @@
|
||||
var id = $(this).attr("id")
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "<?php echo base_url()?>user/view_user_history/"+id,
|
||||
url: "<?php echo base_url()?>User/view_user_history/"+id,
|
||||
success: function(response) {
|
||||
response = JSON.parse(response);
|
||||
console.log(response);
|
||||
|
||||
2
assets/default/build/css/custom.min.css
vendored
@ -14,7 +14,7 @@ $(document).on('click','.test',function(){
|
||||
var url = baseUrl+"/";
|
||||
|
||||
$.ajax({
|
||||
url:url+"asset/getAssetDetails/"+id,
|
||||
url:url+"Asset/getAssetDetails/"+id,
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
|
||||
@ -32,7 +32,7 @@ $(document).on('click','.asset_value',function(){
|
||||
var url = baseUrl+"/";
|
||||
|
||||
$.ajax({
|
||||
url:url+"asset/getAssetValueForm/"+id,
|
||||
url:url+"Asset/getAssetValueForm/"+id,
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
|
||||
@ -51,7 +51,7 @@ $(document).on('click','.asset_usage',function(){
|
||||
var url = baseUrl+"/";
|
||||
|
||||
$.ajax({
|
||||
url:url+"asset/getAssetUsageForm/"+id,
|
||||
url:url+"Asset/getAssetUsageForm/"+id,
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
|
||||
@ -69,7 +69,7 @@ $(document).on('click','.asset_amc',function(){
|
||||
var url = baseUrl+"/";
|
||||
|
||||
$.ajax({
|
||||
url:url+"asset/getAssetAMCForm/"+id,
|
||||
url:url+"Asset/getAssetAMCForm/"+id,
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
|
||||
@ -87,7 +87,7 @@ $(document).on('click','.asset_insurance',function(){
|
||||
var url = baseUrl+"/";
|
||||
|
||||
$.ajax({
|
||||
url:url+"asset/getAssetInsuranceForm/"+id,
|
||||
url:url+"Asset/getAssetInsuranceForm/"+id,
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
|
||||
@ -105,7 +105,7 @@ $(document).on('click','.asset_image',function(){
|
||||
var url = baseUrl+"/";
|
||||
|
||||
$.ajax({
|
||||
url:url+"asset/getAssetImageForm/"+id,
|
||||
url:url+"Asset/getAssetImageForm/"+id,
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
|
||||
@ -125,17 +125,17 @@ $(document).on('click','#close-form',function(){
|
||||
});
|
||||
|
||||
|
||||
$( document ).ready(function() {
|
||||
// $( document ).ready(function() {
|
||||
|
||||
|
||||
var tab_value = $("#current_tab").val();
|
||||
// var tab_value = $("#current_tab").val();
|
||||
|
||||
if(tab_value == 1)
|
||||
{
|
||||
$("#asset_usage-tab").tab('show');
|
||||
}
|
||||
// if(tab_value == 1)
|
||||
// {
|
||||
// $("#asset_usage-tab").tab('show');
|
||||
// }
|
||||
|
||||
});
|
||||
// });
|
||||
|
||||
|
||||
//fetch history start
|
||||
@ -149,7 +149,7 @@ $(document).on('click','.asset_value_history',function(){
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url:url+"asset/get_history",
|
||||
url:url+"Asset/get_history",
|
||||
data: data,
|
||||
json: true,
|
||||
success: function(response) {
|
||||
|
||||
@ -26,12 +26,13 @@ body {
|
||||
}
|
||||
|
||||
.profilepic {
|
||||
position: relative;
|
||||
/* width: 125px;
|
||||
height: 125px; */
|
||||
/* border-radius: 50%; */
|
||||
overflow: hidden;
|
||||
background-color: #fffff7;
|
||||
position: relative;
|
||||
border-radius: 100% !important;
|
||||
overflow: hidden;
|
||||
background-color: #fffff7;
|
||||
width: 125px !important;
|
||||
height: 125px !important;
|
||||
border: 3px solid seagreen !important;
|
||||
}
|
||||
|
||||
.profilepic:hover .profilepic__content {
|
||||
|
||||
BIN
assets/uploads/07156b4680962b650af1c6927c7019d5.jpg
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
assets/uploads/1.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
assets/uploads/600px-Instagram_icon.png
Normal file
|
After Width: | Height: | Size: 168 KiB |
BIN
assets/uploads/600px-Instagram_icon1.png
Normal file
|
After Width: | Height: | Size: 168 KiB |
BIN
assets/uploads/600px-Instagram_icon2.png
Normal file
|
After Width: | Height: | Size: 168 KiB |
BIN
assets/uploads/Expence_Bill/07156b4680962b650af1c6927c7019d5.jpg
Normal file
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 11 KiB |
BIN
assets/uploads/Expence_Bill/1686929223.jpg
Normal file
|
After Width: | Height: | Size: 118 KiB |
BIN
assets/uploads/Expence_Bill/16869292231.jpg
Normal file
|
After Width: | Height: | Size: 118 KiB |
BIN
assets/uploads/Expence_Bill/1686929550.jpg
Normal file
|
After Width: | Height: | Size: 67 KiB |
BIN
assets/uploads/Expence_Bill/16869295501.jpg
Normal file
|
After Width: | Height: | Size: 67 KiB |