suseendhiran
This commit is contained in:
parent
8b3aff7a52
commit
45a3ecc248
@ -133,6 +133,7 @@ function select_by_business_id_and_type($table,$business_id,$type)
|
|||||||
$this->db->from($table);
|
$this->db->from($table);
|
||||||
$this->db->where('business_id', $business_id);
|
$this->db->where('business_id', $business_id);
|
||||||
$this->db->where('type', $type);
|
$this->db->where('type', $type);
|
||||||
|
$this->db->where('is_active', 1);
|
||||||
$this->db->order_by('id','ASC');
|
$this->db->order_by('id','ASC');
|
||||||
$query = $this->db->get();
|
$query = $this->db->get();
|
||||||
$query = $query->result();
|
$query = $query->result();
|
||||||
|
|||||||
@ -322,7 +322,7 @@ public function add_or_edit_asset_value()
|
|||||||
$this->audit->create_history('update');
|
$this->audit->create_history('update');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$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{
|
}else{
|
||||||
$get_latest_asset_value = $this->Asset_model->get_latest_asset_value($this->input->post('asset_id_for_add'),user()->business_id);
|
$get_latest_asset_value = $this->Asset_model->get_latest_asset_value($this->input->post('asset_id_for_add'),user()->business_id);
|
||||||
@ -352,7 +352,7 @@ public function add_or_edit_asset_value()
|
|||||||
//audit history generation for insert
|
//audit history generation for insert
|
||||||
$this->audit->create_history('insert');
|
$this->audit->create_history('insert');
|
||||||
}
|
}
|
||||||
$this->session->set_flashdata(1);
|
$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')));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -422,6 +422,7 @@ public function add_or_edit_asset_usage()
|
|||||||
//audit history generation for update
|
//audit history generation for update
|
||||||
$this->audit->create_history('update');
|
$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{
|
}else{
|
||||||
$data['asset_id'] = $this->input->post('asset_id_for_add');
|
$data['asset_id'] = $this->input->post('asset_id_for_add');
|
||||||
@ -442,6 +443,7 @@ public function add_or_edit_asset_usage()
|
|||||||
//audit history generation for insert
|
//audit history generation for insert
|
||||||
$this->audit->create_history('insert');
|
$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')));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -492,6 +494,7 @@ public function add_or_edit_asset_amc()
|
|||||||
//audit history generation for update
|
//audit history generation for update
|
||||||
$this->audit->create_history('update');
|
$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{
|
}else{
|
||||||
$data['asset_id'] = $this->input->post('asset_id_for_add');
|
$data['asset_id'] = $this->input->post('asset_id_for_add');
|
||||||
@ -517,6 +520,7 @@ public function add_or_edit_asset_amc()
|
|||||||
//audit history generation for insert
|
//audit history generation for insert
|
||||||
$this->audit->create_history('insert');
|
$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')));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -567,6 +571,7 @@ public function add_or_edit_asset_insurance()
|
|||||||
//audit history generation for update
|
//audit history generation for update
|
||||||
$this->audit->create_history('update');
|
$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{
|
}else{
|
||||||
$data['asset_id'] = $this->input->post('asset_id_for_add');
|
$data['asset_id'] = $this->input->post('asset_id_for_add');
|
||||||
@ -591,6 +596,7 @@ public function add_or_edit_asset_insurance()
|
|||||||
//audit history generation for insert
|
//audit history generation for insert
|
||||||
$this->audit->create_history('insert');
|
$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')));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -632,6 +638,7 @@ public function add_asset_image()
|
|||||||
//print_r($data);die();
|
//print_r($data);die();
|
||||||
$table="asset_images";
|
$table="asset_images";
|
||||||
$create_assets = $this->MY_Model->insert($data,$table);
|
$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')));
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -642,6 +649,7 @@ public function deleteAssetValue($id)
|
|||||||
$key = $split[0];
|
$key = $split[0];
|
||||||
$asset_id = $split[1];
|
$asset_id = $split[1];
|
||||||
$Data = $this->Asset_model->delete_by_md5_id($key,user()->business_id,'asset_value');
|
$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)
|
public function deleteAssetUsage($id)
|
||||||
@ -650,6 +658,7 @@ public function deleteAssetUsage($id)
|
|||||||
$key = $split[0];
|
$key = $split[0];
|
||||||
$asset_id = $split[1];
|
$asset_id = $split[1];
|
||||||
$Data = $this->Asset_model->delete_by_md5_id($key,user()->business_id,'asset_usage');
|
$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)
|
||||||
@ -658,6 +667,7 @@ public function deleteAssetAMC($id)
|
|||||||
$key = $split[0];
|
$key = $split[0];
|
||||||
$asset_id = $split[1];
|
$asset_id = $split[1];
|
||||||
$Data = $this->Asset_model->delete_by_md5_id($key,user()->business_id,'amc');
|
$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)
|
||||||
@ -666,6 +676,7 @@ public function deleteAssetImage($id)
|
|||||||
$key = $split[0];
|
$key = $split[0];
|
||||||
$asset_id = $split[1];
|
$asset_id = $split[1];
|
||||||
$Data = $this->Asset_model->delete_by_md5_id($key,user()->business_id,'asset_images');
|
$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)
|
||||||
@ -674,6 +685,7 @@ public function deleteAssetInsurance($id)
|
|||||||
$key = $split[0];
|
$key = $split[0];
|
||||||
$asset_id = $split[1];
|
$asset_id = $split[1];
|
||||||
$Data = $this->Asset_model->delete_by_md5_id($key,user()->business_id,'amc');
|
$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));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -725,39 +737,57 @@ public function masterDataList()
|
|||||||
|
|
||||||
public function getThirdPartyForm($id)
|
public function getThirdPartyForm($id)
|
||||||
{
|
{
|
||||||
|
$state = $this->MY_Model->select('state');
|
||||||
if ($id == "manufacture") {
|
if ($id == "manufacture") {
|
||||||
$table = 'third_parties';
|
$data = array('heading'=> "Manufacturer Details", 'type' => 1 , 'states' => $state , 'submit_button_title'=>'Add' );
|
||||||
$data = array('heading'=> "Manufacturer Details", 'type' => 1 , 'submit_button_title'=>'Add' );
|
|
||||||
$htmlPage = $this->load->view('third_party_master_form.php',$data,true);
|
$htmlPage = $this->load->view('third_party_master_form.php',$data,true);
|
||||||
echo json_encode($htmlPage);
|
echo json_encode($htmlPage);
|
||||||
}
|
}
|
||||||
else if ($id == "supplier") {
|
else if ($id == "supplier") {
|
||||||
$table = 'third_parties';
|
$data = array('heading'=> "supplier Details", 'type' => 2 , 'states' => $state , 'submit_button_title'=>'Add' );
|
||||||
$data = array('heading'=> "supplier Details", 'type' => 2 , 'submit_button_title'=>'Add' );
|
|
||||||
$htmlPage = $this->load->view('third_party_master_form.php',$data,true);
|
$htmlPage = $this->load->view('third_party_master_form.php',$data,true);
|
||||||
echo json_encode($htmlPage);
|
echo json_encode($htmlPage);
|
||||||
}
|
}
|
||||||
else if ($id == "service_privoder") {
|
else if ($id == "service_privoder") {
|
||||||
$table = 'third_parties';
|
$data = array('heading'=> "Service Privoder Details", 'type' => 3 , 'states' => $state , 'submit_button_title'=>'Add' );
|
||||||
$data = array('heading'=> "Service Privoder Details", 'type' => 3 , 'submit_button_title'=>'Add' );
|
|
||||||
$htmlPage = $this->load->view('third_party_master_form.php',$data,true);
|
$htmlPage = $this->load->view('third_party_master_form.php',$data,true);
|
||||||
echo json_encode($htmlPage);
|
echo json_encode($htmlPage);
|
||||||
}
|
}
|
||||||
else if ($id == "insurence") {
|
else if ($id == "insurence") {
|
||||||
$table = 'third_parties';
|
$data = array('heading'=> "Insurence Details", 'type' => 4 , 'states' => $state , 'submit_button_title'=>'Add' );
|
||||||
$data = array('heading'=> "Insurence Details", 'type' => 4 , 'submit_button_title'=>'Add' );
|
|
||||||
$htmlPage = $this->load->view('third_party_master_form.php',$data,true);
|
$htmlPage = $this->load->view('third_party_master_form.php',$data,true);
|
||||||
echo json_encode($htmlPage);
|
echo json_encode($htmlPage);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$table = 'third_parties';
|
$table = 'third_parties';
|
||||||
$user_data = $this->MY_Model->get_by_md5_id($id, $table);
|
$user_data = $this->Asset_model->get_third_party_by_md5_id($id);
|
||||||
$data = array('heading'=> "Edit Details" , 'third_party_data'=> $user_data , 'submit_button_title'=>'Update' );
|
$data = array('heading'=> "Edit Details" , 'third_party_data'=> $user_data , 'states' => $state , 'submit_button_title'=>'Update' );
|
||||||
$htmlPage = $this->load->view('third_party_master_form.php',$data,true);
|
$htmlPage = $this->load->view('third_party_master_form.php',$data,true);
|
||||||
echo json_encode($htmlPage);
|
echo json_encode($htmlPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function add_or_edit_ThirdPartyForm()
|
||||||
|
{
|
||||||
|
|
||||||
|
$table = 'third_parties';
|
||||||
|
$action = $this->input->post();
|
||||||
|
$id = $this->input->post('id');
|
||||||
|
$type = $this->input->post('type');
|
||||||
|
if ($id) {
|
||||||
|
$userData = $this->MY_Model->edit_option($action, $id, $table);
|
||||||
|
$this->session->set_flashdata('msg', $type);
|
||||||
|
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');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLocationForm($id)
|
public function getLocationForm($id)
|
||||||
@ -777,7 +807,7 @@ public function getLocationForm($id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function editLocationForm()
|
public function add_or_edit_LocationForm()
|
||||||
{
|
{
|
||||||
|
|
||||||
$table = 'locations';
|
$table = 'locations';
|
||||||
@ -785,10 +815,12 @@ public function editLocationForm()
|
|||||||
$id = $this->input->post('id');
|
$id = $this->input->post('id');
|
||||||
if ($id) {
|
if ($id) {
|
||||||
$userData = $this->MY_Model->edit_option($action, $id, $table);
|
$userData = $this->MY_Model->edit_option($action, $id, $table);
|
||||||
|
$this->session->set_flashdata('msg', "location");
|
||||||
redirect('asset/masterDataList');
|
redirect('asset/masterDataList');
|
||||||
} else {
|
} else {
|
||||||
$userData = $this->MY_Model->insert($action, $table);
|
$userData = $this->MY_Model->insert($action, $table);
|
||||||
if($business->is_master_data_entered == 0){ $this->MY_Model->editBusiness(); }
|
if($business->is_master_data_entered == 0){ $this->MY_Model->editBusiness(); }
|
||||||
|
$this->session->set_flashdata('msg', "location");
|
||||||
redirect('asset/masterDataList');
|
redirect('asset/masterDataList');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -813,18 +845,20 @@ public function getCatogaryForm($id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function editThirdPartyForm()
|
public function add_or_edit_CategoriesForm()
|
||||||
{
|
{
|
||||||
|
|
||||||
$table = 'third_parties';
|
$table = 'categories';
|
||||||
$action = $this->input->post();
|
$action = $this->input->post();
|
||||||
$id = $this->input->post('id');
|
$id = $this->input->post('id');
|
||||||
if ($id) {
|
if ($id) {
|
||||||
$userData = $this->MY_Model->edit_option($action, $id, $table);
|
$userData = $this->MY_Model->edit_option($action, $id, $table);
|
||||||
|
$this->session->set_flashdata('msg', "categories");
|
||||||
redirect('asset/masterDataList');
|
redirect('asset/masterDataList');
|
||||||
} else {
|
} else {
|
||||||
$userData = $this->MY_Model->insert($action, $table);
|
$userData = $this->MY_Model->insert($action, $table);
|
||||||
if($business->is_master_data_entered == 0){ $this->MY_Model->editBusiness(); }
|
if($business->is_master_data_entered == 0){ $this->MY_Model->editBusiness(); }
|
||||||
|
$this->session->set_flashdata('msg', "categories");
|
||||||
redirect('asset/masterDataList');
|
redirect('asset/masterDataList');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -832,7 +866,10 @@ public function editThirdPartyForm()
|
|||||||
|
|
||||||
public function deleteThirdPartyData($id)
|
public function deleteThirdPartyData($id)
|
||||||
{
|
{
|
||||||
$Data = $this->Asset_model->delete_user_by_md5_id($id,user()->business_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');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -178,6 +178,7 @@ public function get_third_party_value_by_md5_id($business_id , $type)
|
|||||||
$this->db->join('state', 'state.id = B.state', 'left');
|
$this->db->join('state', 'state.id = B.state', 'left');
|
||||||
$this->db->where('B.type', $type);
|
$this->db->where('B.type', $type);
|
||||||
$this->db->where('business_id', $business_id);
|
$this->db->where('business_id', $business_id);
|
||||||
|
$this->db->where('is_active', 1);
|
||||||
$query = $this->db->get();
|
$query = $this->db->get();
|
||||||
$query = $query->result();
|
$query = $query->result();
|
||||||
return $query;
|
return $query;
|
||||||
@ -195,4 +196,27 @@ public function delete_user_by_md5_id($id,$business_id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function get_third_party_by_md5_id($id)
|
||||||
|
{
|
||||||
|
$this->db->select('B.* , state.id as state_id , state.name as state_name');
|
||||||
|
$this->db->from('third_parties B');
|
||||||
|
$this->db->join('state', 'state.id = B.state', 'left');
|
||||||
|
$this->db->where('md5(B.id)', $id);
|
||||||
|
$query = $this->db->get();
|
||||||
|
$query = $query->row();
|
||||||
|
return $query;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function get_by_id($id,$table)
|
||||||
|
{
|
||||||
|
$this->db->select();
|
||||||
|
$this->db->from($table);
|
||||||
|
$this->db->where('md5(id)', $id);
|
||||||
|
$query = $this->db->get();
|
||||||
|
$query = $query->row();
|
||||||
|
return $query;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
<ul class="nav nav-tabs bar_tabs" id="myTab" role="tablist">
|
<ul class="nav nav-tabs bar_tabs" id="myTab" role="tablist">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link active" id="asset_value-tab" data-toggle="tab" href="#asset_value" role="tab" aria-controls="asset_value" aria-selected="true">Asset Values</a>
|
<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>
|
||||||
<li class="nav-item">
|
<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>
|
<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>
|
||||||
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="tab-pane fade show active" 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">
|
<ul class="nav navbar-right panel_toolbox">
|
||||||
<?php if(user()->action_permit != 'view' ) { ?>
|
<?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; ">
|
<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; ">
|
||||||
@ -304,7 +304,41 @@
|
|||||||
<div class="modal bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" id="edit-form"> </div>
|
<div class="modal bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" id="edit-form"> </div>
|
||||||
|
|
||||||
|
|
||||||
|
<input type="hidden" class="form-control" id="change_active" value="<?php echo $this->session->flashdata('msg'); ?>" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
// $(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');
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
@ -8,7 +8,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Asset/getCatogaryForm" >
|
<form data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Asset/add_or_edit_CategoriesForm" >
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="x_content">
|
<div class="x_content">
|
||||||
<br />
|
<br />
|
||||||
|
|||||||
@ -14,7 +14,9 @@
|
|||||||
<div class="x_panel">
|
<div class="x_panel">
|
||||||
<div class="x_title">
|
<div class="x_title">
|
||||||
<ul class="nav navbar-right panel_toolbox">
|
<ul class="nav navbar-right panel_toolbox">
|
||||||
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
|
<li><a class="collapse-link">
|
||||||
|
<i id="chevron" class="fa fa-chevron-up"></i>
|
||||||
|
</a></li>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h6>General Information</h6>
|
<h6>General Information</h6>
|
||||||
@ -247,9 +249,35 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// $(document).ready(function(){
|
$(document).ready(function(){
|
||||||
// $("#formFile").change(function(){
|
|
||||||
// $(".btn-success").click();
|
if ($('#change_active').val() == "asset_value") {
|
||||||
// });
|
setTimeout(() => { $('#chevron').click(); }, 500);
|
||||||
// });
|
$('#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") {
|
||||||
|
setTimeout(() => { $('#chevron').click(); }, 500);
|
||||||
|
$('#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") {
|
||||||
|
setTimeout(() => { $('#chevron').click(); }, 500);
|
||||||
|
$('#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") {
|
||||||
|
setTimeout(() => { $('#chevron').click(); }, 500);
|
||||||
|
$('#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');
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Asset/editLocationForm" >
|
<form data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Asset/add_or_edit_LocationForm" >
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="x_content">
|
<div class="x_content">
|
||||||
<br />
|
<br />
|
||||||
|
|||||||
@ -2,14 +2,12 @@
|
|||||||
<div class="x_panel">
|
<div class="x_panel">
|
||||||
<div class="x_title">
|
<div class="x_title">
|
||||||
<h2>Details</h2>
|
<h2>Details</h2>
|
||||||
|
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="x_content">
|
<div class="x_content">
|
||||||
|
|
||||||
<ul class="nav nav-tabs bar_tabs" id="myTab" role="tablist">
|
<ul class="nav nav-tabs bar_tabs" id="myTab" role="tablist">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link active" id="manufacture-tab" data-toggle="tab" href="#manufacture" role="tab" aria-controls="manufacture" aria-selected="true">Manufacturer</a>
|
<a class="nav-link" id="manufacture-tab" data-toggle="tab" href="#manufacture" role="tab" aria-controls="manufacture" aria-selected="true">Manufacturer</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" id="supplier-tab" data-toggle="tab" href="#supplier" role="tab" aria-controls="supplier" aria-selected="false">Supplier</a>
|
<a class="nav-link" id="supplier-tab" data-toggle="tab" href="#supplier" role="tab" aria-controls="supplier" aria-selected="false">Supplier</a>
|
||||||
@ -24,7 +22,7 @@
|
|||||||
<a class="nav-link" id="location-tab" data-toggle="tab" href="#location" role="tab" aria-controls="location" aria-selected="false">Location</a>
|
<a class="nav-link" id="location-tab" data-toggle="tab" href="#location" role="tab" aria-controls="location" aria-selected="false">Location</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" id="catogary-tab" data-toggle="tab" href="#catogary" role="tab" aria-controls="catogary" aria-selected="false">Catogary</a>
|
<a class="nav-link" id="catogary-tab" data-toggle="tab" href="#catogary" role="tab" aria-controls="catogary" aria-selected="false">Category</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@ -34,8 +32,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!------------------------------ MANUCTURE ------------------------------->
|
<!------------------------------ MANUFACTURE DATA ------------------------------->
|
||||||
<div class="tab-pane fade show active" id="manufacture" role="tabpanel" aria-labelledby="manufacture-tab">
|
<div class="tab-pane fade" id="manufacture" role="tabpanel" aria-labelledby="manufacture-tab">
|
||||||
<ul class="nav navbar-right panel_toolbox">
|
<ul class="nav navbar-right panel_toolbox">
|
||||||
<?php if(user()->action_permit != 'view' ) { ?>
|
<?php if(user()->action_permit != 'view' ) { ?>
|
||||||
<a type="button" class="manufacture" id="" style=" text-align: center; font-size: 25px; color:#2A3F54; ">
|
<a type="button" class="manufacture" id="" style=" text-align: center; font-size: 25px; color:#2A3F54; ">
|
||||||
@ -85,7 +83,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!------------------------------ SUPPLIER DATA ------------------------------->
|
<!------------------------------ SUPPLIER DATA ------------------------------>
|
||||||
<div class="tab-pane fade" id="supplier" role="tabpanel" aria-labelledby="asset_usage-tab">
|
<div class="tab-pane fade" id="supplier" role="tabpanel" aria-labelledby="asset_usage-tab">
|
||||||
<ul class="nav navbar-right panel_toolbox">
|
<ul class="nav navbar-right panel_toolbox">
|
||||||
<?php if(user()->action_permit != 'view' ) { ?>
|
<?php if(user()->action_permit != 'view' ) { ?>
|
||||||
@ -135,7 +133,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!------------------------------ SERVICE PROVIDER DATA ------------------------------->
|
<!------------------------------ SERVICE PROVIDER DATA ---------------------->
|
||||||
<div class="tab-pane fade" id="service_privoder" role="tabpanel" aria-labelledby="service_privoder-tab">
|
<div class="tab-pane fade" id="service_privoder" role="tabpanel" aria-labelledby="service_privoder-tab">
|
||||||
<ul class="nav navbar-right panel_toolbox">
|
<ul class="nav navbar-right panel_toolbox">
|
||||||
<?php if(user()->action_permit != 'view' ) { ?>
|
<?php if(user()->action_permit != 'view' ) { ?>
|
||||||
@ -185,7 +183,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!------------------------------ INSURENCE DATA ------------------------------->
|
<!------------------------------ INSURENCE DATA ------------------------------>
|
||||||
<div class="tab-pane fade" id="insurence" role="tabpanel" aria-labelledby="insurence-tab">
|
<div class="tab-pane fade" id="insurence" role="tabpanel" aria-labelledby="insurence-tab">
|
||||||
<ul class="nav navbar-right panel_toolbox">
|
<ul class="nav navbar-right panel_toolbox">
|
||||||
<?php if(user()->action_permit != 'view' ) { ?>
|
<?php if(user()->action_permit != 'view' ) { ?>
|
||||||
@ -235,7 +233,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!------------------------------ LOCATION DATA ------------------------------->
|
<!------------------------------ LOCATION DATA ------------------------------>
|
||||||
<div class="tab-pane fade" id="location" role="tabpanel" aria-labelledby="location-tab">
|
<div class="tab-pane fade" id="location" role="tabpanel" aria-labelledby="location-tab">
|
||||||
<ul class="nav navbar-right panel_toolbox">
|
<ul class="nav navbar-right panel_toolbox">
|
||||||
<?php if(user()->action_permit != 'view' ) { ?>
|
<?php if(user()->action_permit != 'view' ) { ?>
|
||||||
@ -272,7 +270,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!------------------------------ CATOGARY DATA ------------------------------->
|
<!------------------------------ CATOGARY DATA ------------------------------>
|
||||||
<div class="tab-pane fade" id="catogary" role="tabpanel" aria-labelledby="catogary-tab">
|
<div class="tab-pane fade" id="catogary" role="tabpanel" aria-labelledby="catogary-tab">
|
||||||
<ul class="nav navbar-right panel_toolbox">
|
<ul class="nav navbar-right panel_toolbox">
|
||||||
<?php if(user()->action_permit != 'view' ) { ?>
|
<?php if(user()->action_permit != 'view' ) { ?>
|
||||||
@ -307,7 +305,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ------------------------------------------------------------------------------------------------------- -->
|
<!-- ------------------------------------------------------------------------- -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -319,10 +317,43 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<input type="hidden" class="form-control" id="change_active" value="<?php echo $this->session->flashdata('msg'); ?>" />
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
|
||||||
|
if ($('#change_active').val() == "location") {
|
||||||
|
$('#location-tab').removeClass('nav-link').addClass('nav-link active');
|
||||||
|
$('#location').removeClass('tab-pane fade').addClass('tab-pane fade show active');
|
||||||
|
}
|
||||||
|
else if ($('#change_active').val() == "categories") {
|
||||||
|
$('#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() == "1") {
|
||||||
|
$('#manufacture-tab').removeClass('nav-link').addClass('nav-link active');
|
||||||
|
$('#manufacture').removeClass('tab-pane fade').addClass('tab-pane fade show active');
|
||||||
|
}
|
||||||
|
else if ($('#change_active').val() == "2") {
|
||||||
|
$('#supplier-tab').removeClass('nav-link').addClass('nav-link active');
|
||||||
|
$('#supplier').removeClass('tab-pane fade').addClass('tab-pane fade show active');
|
||||||
|
}
|
||||||
|
else if ($('#change_active').val() == "3") {
|
||||||
|
$('#service_privoder-tab').removeClass('nav-link').addClass('nav-link active');
|
||||||
|
$('#service_privoder').removeClass('tab-pane fade').addClass('tab-pane fade show active');
|
||||||
|
}
|
||||||
|
else if ($('#change_active').val() == "4") {
|
||||||
|
$('#insurence-tab').removeClass('nav-link').addClass('nav-link active');
|
||||||
|
$('#insurence').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(){
|
$(document).on('click','.manufacture',function(){
|
||||||
var id = $(this).attr("id")
|
var id = $(this).attr("id")
|
||||||
if (id) {
|
if (id) {
|
||||||
@ -335,7 +366,7 @@
|
|||||||
url: URL,
|
url: URL,
|
||||||
type:"GET",
|
type:"GET",
|
||||||
success:function(data){
|
success:function(data){
|
||||||
|
$("#manufacture-tab").attr('class', 'nav-link active');
|
||||||
$('#edit-form').html(JSON.parse(data));
|
$('#edit-form').html(JSON.parse(data));
|
||||||
$('.bs-example-modal-sm').modal("show");
|
$('.bs-example-modal-sm').modal("show");
|
||||||
|
|
||||||
@ -355,7 +386,6 @@
|
|||||||
url: URL,
|
url: URL,
|
||||||
type:"GET",
|
type:"GET",
|
||||||
success:function(data){
|
success:function(data){
|
||||||
|
|
||||||
$('#edit-form').html(JSON.parse(data));
|
$('#edit-form').html(JSON.parse(data));
|
||||||
$('.bs-example-modal-sm').modal("show");
|
$('.bs-example-modal-sm').modal("show");
|
||||||
|
|
||||||
@ -418,10 +448,8 @@
|
|||||||
url: URL,
|
url: URL,
|
||||||
type:"GET",
|
type:"GET",
|
||||||
success:function(data){
|
success:function(data){
|
||||||
|
|
||||||
$('#edit-form').html(JSON.parse(data));
|
$('#edit-form').html(JSON.parse(data));
|
||||||
$('.bs-example-modal-sm').modal("show");
|
$('.bs-example-modal-sm').modal("show");
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Asset/editThirdPartyForm" >
|
<form data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Asset/add_or_edit_ThirdPartyForm" >
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="x_content">
|
<div class="x_content">
|
||||||
<br />
|
<br />
|
||||||
@ -55,7 +55,16 @@
|
|||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label class="col-form-label col-md-3 col-sm-3 ">State</label>
|
<label class="col-form-label col-md-3 col-sm-3 ">State</label>
|
||||||
<div class="col-md-9 col-sm-9 ">
|
<div class="col-md-9 col-sm-9 ">
|
||||||
<input type="text" class="form-control" name="state" value="<?php if(isset($third_party_data)) { echo $third_party_data->state; } ?>">
|
<!-- <input type="text" class="form-control" name="state" value="<?php if(isset($third_party_data)) { echo $third_party_data->state; } ?>"> -->
|
||||||
|
|
||||||
|
<select class="form-control" name="state" >
|
||||||
|
<option value="<?php if(isset($third_party_data)) { echo $third_party_data->state_id; } ?>" > <?php if(isset($third_party_data)) { echo $third_party_data->state_name; } ?></option>
|
||||||
|
<?php foreach ($states as $key => $value) { ?>
|
||||||
|
<option value="<?php echo $value->id; ?>"><?php echo $value->name; ?></option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -66,10 +66,10 @@ public function index()
|
|||||||
}
|
}
|
||||||
else if(is_superadmin())
|
else if(is_superadmin())
|
||||||
{
|
{
|
||||||
$user_count = $this->Dashboard_model->get_users_count(user()->business_id);
|
$user_count = $this->Dashboard_model->get_user_count_for_sadmin();
|
||||||
$this->layout->set('user_count', $user_count);
|
$this->layout->set('user_count', $user_count);
|
||||||
|
|
||||||
$business_count = $this->Dashboard_model->get_business_count(user()->business_id);
|
$business_count = $this->Dashboard_model->get_business_count();
|
||||||
$this->layout->set('business_count', $business_count);
|
$this->layout->set('business_count', $business_count);
|
||||||
}
|
}
|
||||||
$this->layout->buffer('main_content', 'dashboard/dashboard');
|
$this->layout->buffer('main_content', 'dashboard/dashboard');
|
||||||
|
|||||||
@ -17,6 +17,7 @@ public function get_users_count($business_id)
|
|||||||
$this->db->select();
|
$this->db->select();
|
||||||
$this->db->from('users');
|
$this->db->from('users');
|
||||||
$this->db->where('business_id', $business_id);
|
$this->db->where('business_id', $business_id);
|
||||||
|
$this->db->where('role !=', 'admin');
|
||||||
$this->db->where('is_active', 1);
|
$this->db->where('is_active', 1);
|
||||||
$query = $this->db->get();
|
$query = $this->db->get();
|
||||||
$query = $query->num_rows();
|
$query = $query->num_rows();
|
||||||
@ -143,5 +144,16 @@ public function get_business_count()
|
|||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function get_user_count_for_sadmin()
|
||||||
|
{
|
||||||
|
$this->db->select();
|
||||||
|
$this->db->from('users');
|
||||||
|
$this->db->where('is_active', 1);
|
||||||
|
$this->db->where('role !=', 'sadmin');
|
||||||
|
$query = $this->db->get();
|
||||||
|
$query = $query->num_rows();
|
||||||
|
return $query;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -264,8 +264,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- /page content -->
|
<!-- /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_user()){ echo $business->is_master_data_entered; } ?>" id="master_key_exist" >
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$( document ).ready(function() {
|
$( document ).ready(function() {
|
||||||
@ -273,8 +274,9 @@
|
|||||||
if(master_value == 0)
|
if(master_value == 0)
|
||||||
{
|
{
|
||||||
new PNotify({
|
new PNotify({
|
||||||
title: 'Master Data Not Exist',
|
title: 'Masterdata Not Exist',
|
||||||
text: 'pls enter master data.',
|
text: `Settings are incomplete.You have to set master data.To enter the value please <a style="color:blue;" href="<?php echo base_url()?>Asset/masterDataList/">Click here!</a>`,
|
||||||
|
type: 'error',
|
||||||
hide: false,
|
hide: false,
|
||||||
styling: 'bootstrap3'
|
styling: 'bootstrap3'
|
||||||
});
|
});
|
||||||
|
|||||||
@ -105,7 +105,9 @@
|
|||||||
<?php
|
<?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="#">Settings</a>
|
||||||
<!-- <a class="dropdown-item" href="javascript:;">Help</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>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user