gwm
This commit is contained in:
parent
19e7344dc8
commit
d5e4299aee
@ -27,7 +27,16 @@ function check_auth()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//check admin
|
||||
if (!function_exists('is_superadmin'))
|
||||
{
|
||||
function is_superadmin()
|
||||
{
|
||||
// Get a reference to the controller object
|
||||
$ci =& get_instance();
|
||||
return $ci->auth_model->is_superadmin();
|
||||
}
|
||||
}
|
||||
//check admin
|
||||
if (!function_exists('is_admin'))
|
||||
{
|
||||
|
||||
@ -109,8 +109,9 @@ public function editAsset($id)
|
||||
$asset_value = $this->Asset_model->get_by_asset_id($id,'asset_value',user()->business_id);
|
||||
$asset_usage = $this->Asset_model->get_by_asset_id($id,'asset_usage',user()->business_id);
|
||||
$asset_amc = $this->Asset_model->get_amc_with_join($id,'amc',user()->business_id);
|
||||
$asset_insurance = $this->Asset_model->get_insurance_with_join($id,user()->business_id);
|
||||
$asset_images = $this->Asset_model->get_by_asset_id($id,'asset_images',user()->business_id);
|
||||
$data = array('asset_id'=>$assetData->id,'asset_value' => $asset_value ,'asset_usage' => $asset_usage , 'asset_amc' =>$asset_amc , 'asset_images'=>$asset_images);
|
||||
$data = array('asset_id'=>$assetData->id,'asset_value' => $asset_value ,'asset_usage' => $asset_usage , 'asset_amc' =>$asset_amc ,'asset_insurance'=>$asset_insurance, 'asset_images'=>$asset_images);
|
||||
$sub_asset_value_htmlPage = $this->load->view('asset_sub_value_list.php',$data,true);
|
||||
$this->layout->set('sub_asset_value_htmlPage', $sub_asset_value_htmlPage);
|
||||
$this->layout->set('editData', $assetData);
|
||||
@ -179,20 +180,24 @@ public function deleteAsset($id)
|
||||
|
||||
public function view_asset_details($id)
|
||||
{
|
||||
|
||||
$tab = $this->session->flashdata();
|
||||
// $tab = 1;
|
||||
//print_r($tab);die();
|
||||
// select asset value by id
|
||||
$table="asset";
|
||||
$assetData = $this->Asset_model->get_asset_by_md5_id($id,user()->business_id);
|
||||
// select asset sub values by id
|
||||
$asset_value = $this->Asset_model->get_by_asset_id($id,'asset_value',user()->business_id);
|
||||
$asset_usage = $this->Asset_model->get_by_asset_id($id,'asset_usage',user()->business_id);
|
||||
$asset_amc = $this->Asset_model->get_amc_with_join($id,'amc',user()->business_id);
|
||||
$asset_amc = $this->Asset_model->get_amc_with_join($id,user()->business_id);
|
||||
$asset_insurance = $this->Asset_model->get_insurance_with_join($id,user()->business_id);
|
||||
$asset_images = $this->Asset_model->get_by_asset_id($id,'asset_images',user()->business_id);
|
||||
$data = array('asset_id'=>$assetData->id,'asset_value' => $asset_value ,'asset_usage' => $asset_usage , 'asset_amc' =>$asset_amc , 'asset_images'=>$asset_images);
|
||||
$data = array('asset_id'=>$assetData->id,'asset_value' => $asset_value ,'asset_usage' => $asset_usage , 'asset_amc' =>$asset_amc ,'asset_insurance'=>$asset_insurance, 'asset_images'=>$asset_images,'tab'=>$tab);
|
||||
$sub_asset_value_htmlPage = $this->load->view('asset_sub_value_list.php',$data,true);
|
||||
$this->layout->set('sub_asset_value_htmlPage', $sub_asset_value_htmlPage);
|
||||
$this->layout->set('editData', $assetData);
|
||||
$this->layout->buffer('main_content', 'Asset/view_asset_details');
|
||||
$this->layout->set('viewData', 1);
|
||||
$this->layout->buffer('main_content', 'Asset/edit_asset');
|
||||
$this->layout->render('default_layout');
|
||||
|
||||
}
|
||||
@ -248,6 +253,7 @@ public function add_or_edit_asset_value()
|
||||
$data['created_by'] = user()->id;
|
||||
$createAssetValueData = $this->MY_Model->insert($data, 'asset_value');
|
||||
//$this->view_asset_details(md5($this->input->post('asset_id_for_add')));
|
||||
$this->session->set_flashdata(1);
|
||||
redirect('asset/view_asset_details/'.md5($this->input->post('asset_id_for_add')));
|
||||
}
|
||||
}
|
||||
@ -301,14 +307,13 @@ public function add_or_edit_asset_usage()
|
||||
public function getAssetAMCForm($id)
|
||||
{
|
||||
$split = preg_split('/_/', $id);
|
||||
$insuranceData = $this->MY_Model->select_by_business_id_and_type('third_parties',user()->business_id,4);
|
||||
$serviceProviderData = $this->MY_Model->select_by_business_id_and_type('third_parties',user()->business_id,3);
|
||||
if(count($split) > 1)
|
||||
{
|
||||
$data = array('asset_id'=> $split[0], 'insuranceData'=>$insuranceData,'serviceProviderData'=>$serviceProviderData, 'heading'=>'Add AMC' , 'submit_button_title'=>'Submit');
|
||||
$data = array('asset_id'=> $split[0], 'serviceProviderData'=>$serviceProviderData, 'heading'=>'Add AMC' , 'submit_button_title'=>'Submit');
|
||||
}else{
|
||||
$asset_amc_data = $this->Asset_model->get_amc_by_id_with_join($id);
|
||||
$data = array('insuranceData'=>$insuranceData,'serviceProviderData'=>$serviceProviderData,'assetAMCData'=>$asset_amc_data ,'heading'=>'Edit AMC' , 'submit_button_title'=>'Update');
|
||||
$data = array('serviceProviderData'=>$serviceProviderData,'assetAMCData'=>$asset_amc_data ,'heading'=>'Edit AMC' , 'submit_button_title'=>'Update');
|
||||
}
|
||||
|
||||
$htmlPage = $this->load->view('asset_amc_form.php',$data,true);
|
||||
@ -329,7 +334,6 @@ public function add_or_edit_asset_amc()
|
||||
$data['business_id'] = user()->business_id;
|
||||
$data['service_provider'] = $this->input->post('service_provider');
|
||||
$data['cost'] = $this->input->post('cost');
|
||||
$data['insurance'] = $this->input->post('insurance');
|
||||
$data['description'] = $this->input->post('description');
|
||||
$data['valid_from'] = $this->input->post('valid_from');
|
||||
$data['valid_to'] = $this->input->post('valid_to');
|
||||
@ -342,6 +346,50 @@ public function add_or_edit_asset_amc()
|
||||
|
||||
|
||||
|
||||
public function getAssetInsuranceForm($id)
|
||||
{
|
||||
$split = preg_split('/_/', $id);
|
||||
$insuranceData = $this->MY_Model->select_by_business_id_and_type('third_parties',user()->business_id,4);
|
||||
if(count($split) > 1)
|
||||
{
|
||||
$data = array('asset_id'=> $split[0], 'insuranceData'=>$insuranceData, 'heading'=>'Add AMC' , 'submit_button_title'=>'Submit');
|
||||
}else{
|
||||
$asset_insurance_data = $this->Asset_model->get_insurance_by_id_with_join($id);
|
||||
$data = array('insuranceData'=>$insuranceData,'assetInsuranceData'=>$asset_insurance_data ,'heading'=>'Edit AMC' , 'submit_button_title'=>'Update');
|
||||
}
|
||||
|
||||
$htmlPage = $this->load->view('asset_insurance_form.php',$data,true);
|
||||
echo json_encode($htmlPage);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function add_or_edit_asset_insurance()
|
||||
{
|
||||
if($this->input->post('id'))
|
||||
{
|
||||
$value = $this->input->post();
|
||||
unset($value['asset_id_for_add']);
|
||||
$editInsuranceData = $this->MY_Model->edit_option($value, $this->input->post('id'), 'asset_insurance');
|
||||
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;
|
||||
$data['insurance_company'] = $this->input->post('insurance_company');
|
||||
$data['valid_from'] = $this->input->post('valid_from');
|
||||
$data['valid_to'] = $this->input->post('valid_to');
|
||||
$data['created_by'] = user()->id;
|
||||
$createInsuranceData = $this->MY_Model->insert($data, 'asset_insurance');
|
||||
redirect('asset/view_asset_details/'.md5($this->input->post('asset_id_for_add')));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function getAssetImageForm($id)
|
||||
{
|
||||
|
||||
@ -410,6 +458,14 @@ public function deleteAssetImage($id)
|
||||
$Data = $this->Asset_model->delete_by_md5_id($key,user()->business_id,'asset_images');
|
||||
redirect('asset/view_asset_details/'.md5($asset_id));
|
||||
}
|
||||
public function deleteAssetInsurance($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_insurance');
|
||||
redirect('asset/view_asset_details/'.md5($asset_id));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -47,12 +47,12 @@ public function get_by_asset_id($id,$table,$business_id)
|
||||
$query = $query->result();
|
||||
return $query;
|
||||
}
|
||||
public function get_amc_with_join($id,$table,$business_id)
|
||||
public function get_amc_with_join($id,$business_id)
|
||||
{
|
||||
$this->db->select('A.* , third_parties.name as service_provider_name , tp.name as insurance_name');
|
||||
$this->db->select('A.* , third_parties.name as service_provider_name ');
|
||||
$this->db->from('amc A');
|
||||
$this->db->join('third_parties', 'third_parties.id = A.service_provider', 'left');
|
||||
$this->db->join('third_parties as tp', 'tp.id = A.insurance', 'left');
|
||||
|
||||
$this->db->where('A.business_id', $business_id);
|
||||
$this->db->where('md5(A.asset_id)', $id);
|
||||
$this->db->where('is_active', 1);
|
||||
@ -62,10 +62,33 @@ public function get_amc_with_join($id,$table,$business_id)
|
||||
}
|
||||
public function get_amc_by_id_with_join($id)
|
||||
{
|
||||
$this->db->select('A.* , third_parties.name as service_provider_name , tp.name as insurance_name');
|
||||
$this->db->select('A.* , third_parties.name as service_provider_name ');
|
||||
$this->db->from('amc A');
|
||||
$this->db->join('third_parties', 'third_parties.id = A.service_provider', 'left');
|
||||
$this->db->join('third_parties as tp', 'tp.id = A.insurance', 'left');
|
||||
$this->db->where('md5(A.id)', $id);
|
||||
$this->db->where('is_active', 1);
|
||||
$query = $this->db->get();
|
||||
$query = $query->row();
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function get_insurance_with_join($id,$business_id)
|
||||
{
|
||||
$this->db->select('A.* , third_parties.name as insurance_company_name ');
|
||||
$this->db->from('asset_insurance A');
|
||||
$this->db->join('third_parties', 'third_parties.id = A.insurance_company', 'left');
|
||||
$this->db->where('A.business_id', $business_id);
|
||||
$this->db->where('md5(A.asset_id)', $id);
|
||||
$this->db->where('is_active', 1);
|
||||
$query = $this->db->get();
|
||||
$query = $query->result();
|
||||
return $query;
|
||||
}
|
||||
public function get_insurance_by_id_with_join($id)
|
||||
{
|
||||
$this->db->select('A.* , third_parties.name as insurance_company_name ');
|
||||
$this->db->from('asset_insurance A');
|
||||
$this->db->join('third_parties', 'third_parties.id = A.insurance_company', 'left');
|
||||
$this->db->where('md5(A.id)', $id);
|
||||
$this->db->where('is_active', 1);
|
||||
$query = $this->db->get();
|
||||
|
||||
@ -131,7 +131,7 @@
|
||||
<div class='input-group date' id='myDatepicker'>
|
||||
<input type='text' class="form-control" name="purchase_date" value="<?php if(isset($assetData)) { echo $assetData->purchase_date; } ?>" />
|
||||
<span class="input-group-addon">
|
||||
<span class="glyphicon glyphicon-calendar"></span>
|
||||
<li class="fa fa-calendar"></li>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -38,17 +38,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">Insurance</label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<select id="insurance" name="insurance" required="required" class="form-control" >
|
||||
<option value="<?php if(isset($assetAMCData)) { echo $assetAMCData->insurance; } ?>"><?php if(isset($assetAMCData)) { echo $assetAMCData->insurance_name; } ?></option>
|
||||
<?php foreach ($insuranceData as $key => $value) { ?>
|
||||
<option value="<?php echo $value->id; ?>"><?php echo $value->name; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">Description</label>
|
||||
|
||||
72
application/modules/Asset/views/asset_insurance_form.php
Normal file
72
application/modules/Asset/views/asset_insurance_form.php
Normal file
@ -0,0 +1,72 @@
|
||||
|
||||
<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_asset_insurance" >
|
||||
<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($assetInsuranceData)) { echo $assetInsuranceData->id; } ?>">
|
||||
<input type="hidden" name="asset_id" value="<?php if(isset($assetInsuranceData)) { echo $assetInsuranceData->asset_id; } ?>">
|
||||
<input type="hidden" name="business_id" value="<?php if(isset($assetInsuranceData)) { echo $assetInsuranceData->business_id; } ?>">
|
||||
<input type="hidden" name="asset_id_for_add" value="<?php if(isset($asset_id)) { echo $asset_id; } ?>">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">Insurance</label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<select id="insurance_company" name="insurance_company" required="required" class="form-control">
|
||||
<option value="<?php if(isset($assetInsuranceData)) { echo $assetInsuranceData->insurance_company; } ?>"><?php if(isset($assetInsuranceData)) { echo $assetInsuranceData->insurance_company_name; } ?></option>
|
||||
<?php foreach ($insuranceData as $key => $value) { ?>
|
||||
<option value="<?php echo $value->id; ?>"><?php echo $value->name; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">Valid From</label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<div class='input-group date' id='myDatepicker4'>
|
||||
<input type='text' class="form-control" name="valid_from" value="<?php if(isset($assetInsuranceData)) { echo $assetInsuranceData->valid_from; } ?>" />
|
||||
<span class="input-group-addon">
|
||||
<span class="glyphicon glyphicon-calendar"></span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">Valid To</label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<div class='input-group date' id='myDatepicker5'>
|
||||
<input type='text' class="form-control" name="valid_to" value="<?php if(isset($assetInsuranceData)) { echo $assetInsuranceData->valid_to; } ?>" />
|
||||
<span class="input-group-addon">
|
||||
<span class="glyphicon glyphicon-calendar"></span>
|
||||
</span>
|
||||
</div>
|
||||
</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>
|
||||
@ -14,9 +14,9 @@
|
||||
<div class="x_content">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
|
||||
|
||||
<table id="datatable-buttons" class="table table-striped table-bordered" width="100%">
|
||||
<div class="card-box table-responsive">
|
||||
|
||||
<table id="datatable-buttons" class="table table-striped table-bordered dataTable no-footer" width="100%">
|
||||
<thead>
|
||||
<tr class="headings">
|
||||
|
||||
@ -75,7 +75,7 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
|
||||
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
<h2>Details</h2>
|
||||
@ -15,7 +15,10 @@
|
||||
<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 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">AMC</a>
|
||||
<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>
|
||||
<li class="nav-item">
|
||||
<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>
|
||||
@ -36,16 +39,17 @@
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<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; ">
|
||||
<li class="fa fa-plus-circle"></li></a>
|
||||
</ul> </br>
|
||||
</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">Type </th>
|
||||
<th class="column-title">Name </th>
|
||||
<th class="column-title">Value </th>
|
||||
<th class="column-title">Percentage </th>
|
||||
<th class="column-title">Description </th>
|
||||
<th class="column-title">Action </th>
|
||||
<th class="column-title" width="18%">Type </th>
|
||||
<th class="column-title" width="18%">Name </th>
|
||||
<th class="column-title" width="18%">Value </th>
|
||||
<th class="column-title" width="18%">Percentage </th>
|
||||
<th class="column-title" width="18%">Description </th>
|
||||
<th class="column-title" width="10%">Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@ -69,7 +73,7 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@ -80,15 +84,15 @@
|
||||
<a type="button" class="asset_usage" 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>
|
||||
</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">From </th>
|
||||
<th class="column-title">To </th>
|
||||
<th class="column-title">Quater </th>
|
||||
<th class="column-title">Shift </th>
|
||||
<th class="column-title">Action </th>
|
||||
<th class="column-title" width="20%" >From </th>
|
||||
<th class="column-title" width="20%" >To </th>
|
||||
<th class="column-title" width="20%" >Quater </th>
|
||||
<th class="column-title" width="20%" >Shift </th>
|
||||
<th class="column-title" width="20%" >Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@ -111,9 +115,8 @@
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@ -123,18 +126,17 @@
|
||||
<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>
|
||||
</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">Service Provider </th>
|
||||
<th class="column-title">Cost </th>
|
||||
<th class="column-title">Insurance </th>
|
||||
<th class="column-title">Description </th>
|
||||
<th class="column-title">Valid From </th>
|
||||
<th class="column-title">Valid To </th>
|
||||
<th class="column-title">Expair on </th>
|
||||
<th class="column-title">Action </th>
|
||||
<th class="column-title" width="13.5%">Service Provider </th>
|
||||
<th class="column-title" width="13.5%">Cost </th>
|
||||
<th class="column-title" width="13.5%">Description </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="10%">Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@ -144,7 +146,6 @@
|
||||
|
||||
<td class=" "><?php echo $value->service_provider_name; ?></td>
|
||||
<td class=" "><?php echo $value->cost; ?></td>
|
||||
<td class=" "><?php echo $value->insurance_name; ?></td>
|
||||
<td class=" "><?php echo $value->description; ?></td>
|
||||
<td class=" "><?php echo my_date_show($value->valid_from); ?></td>
|
||||
<td class=" "><?php echo my_date_show($value->valid_to); ?></td>
|
||||
@ -161,11 +162,47 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="tab-pane fade" id="asset_insurance" role="tabpanel" aria-labelledby="asset_insurance-tab">
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<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>
|
||||
</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="25%">Insurance Company </th>
|
||||
<th class="column-title" width="25%">Valid From </th>
|
||||
<th class="column-title" width="25%">Valid To </th>
|
||||
<th class="column-title" width="20%">Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php foreach ($asset_insurance as $key => $value) { ?>
|
||||
<tr class="even pointer">
|
||||
<td class=" "><?php echo $value->insurance_company_name; ?></td>
|
||||
<td class=" "><?php echo my_date_show($value->valid_from); ?></td>
|
||||
<td class=" "><?php echo my_date_show($value->valid_to); ?></td>
|
||||
<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>
|
||||
|
||||
<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>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="tab-pane fade" id="asset_image" role="tabpanel" aria-labelledby="asset_image-tab">
|
||||
@ -208,8 +245,7 @@
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="audit_history" role="tabpanel" aria-labelledby="audit_history-tab">
|
||||
xxFood truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo
|
||||
booth letterpress, commodo enim craft beer mlkshk
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
|
||||
<!-- Body page content -->
|
||||
|
||||
<input type="hidden" id="current_tab" value="<?php if($tab){ echo $tab; }?>" >
|
||||
|
||||
|
||||
<div class="">
|
||||
<div class="page-title">
|
||||
<div class="title_left"><h3>Edit Assets</h3></div>
|
||||
<div class="title_left"><h3><?php if(isset($viewData)) { echo "View Assets"; }else{ echo "Edit Assets"; } ?></h3></div>
|
||||
</div>
|
||||
<button class="btn btn-primary" style="float: right;" onclick="history.back()">Go back</button>
|
||||
<a class="btn btn-sm btn-primary" style="float: right;" href="<?php echo base_url();?>asset/assetList">Assets List</a>
|
||||
<div class="clearfix"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
@ -28,13 +28,14 @@
|
||||
<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="name" name="name" value="<?php echo $editData->name; ?>" required="required" class="form-control ">
|
||||
<input type="text" id="name" name="name" value="<?php echo $editData->name; ?>" required="required" class="form-control"
|
||||
<?php if(isset($viewData)) { echo "readonly"; } ?> >
|
||||
</div>
|
||||
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name">Manufacturer </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="manufacturer" name="manufacturer" required="required" class="form-control" placeholder="choose">
|
||||
<select id="manufacturer" name="manufacturer" required="required" class="form-control" placeholder="choose" <?php if(isset($viewData)) { echo "readonly"; } ?>>
|
||||
<option value="<?php echo $editData->manufacturer; ?>"><?php echo $editData->manufacturer_name; ?></option>
|
||||
<?php foreach ($manufacturerData as $key => $value) { ?>
|
||||
<option value="<?php echo $value->id; ?>"><?php echo $value->name; ?></option>
|
||||
@ -46,24 +47,24 @@
|
||||
<div class="item form-group">
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Tag </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="tag" name="tag" value="<?php echo $editData->tag; ?>" class="form-control" type="text" required="required">
|
||||
<input id="tag" name="tag" value="<?php echo $editData->tag; ?>" class="form-control" type="text" required="required" <?php if(isset($viewData)) { echo "readonly"; } ?>>
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name">Serial </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="serial" name="serial" value="<?php echo $editData->serial; ?>" class="form-control" type="text" required="required">
|
||||
<input id="serial" name="serial" value="<?php echo $editData->serial; ?>" class="form-control" type="text" required="required" <?php if(isset($viewData)) { echo "readonly"; } ?>>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item form-group">
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Model </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="model" name="model" value="<?php echo $editData->model; ?>" class="form-control" type="text" required="required">
|
||||
<input id="model" name="model" value="<?php echo $editData->model; ?>" class="form-control" type="text" required="required" <?php if(isset($viewData)) { echo "readonly"; } ?>>
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name">Status </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="status" name="status" required="required" class="form-control" >
|
||||
<select id="status" name="status" required="required" class="form-control" <?php if(isset($viewData)) { echo "readonly"; } ?>>
|
||||
<option value="<?php echo $editData->status; ?>"> <?php echo $editData->status_display_name; ?> </option>
|
||||
<?php foreach ($statusData as $key => $value) { ?>
|
||||
<option value="<?php echo $value->id; ?>"><?php echo $value->display_name; ?></option>
|
||||
@ -77,7 +78,7 @@
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name">Category </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="category" name="category" required="required" class="form-control" >
|
||||
<select id="category" name="category" required="required" class="form-control" <?php if(isset($viewData)) { echo "readonly"; } ?>>
|
||||
<option value="<?php echo $editData->category; ?>"><?php echo $editData->category_name; ?></option>
|
||||
<?php foreach ($categoriesData as $key => $value) { ?>
|
||||
<option value="<?php echo $value->id; ?>"><?php echo $value->name; ?></option>
|
||||
@ -87,7 +88,7 @@
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name">Location </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="location" name="location" required="required" class="form-control" >
|
||||
<select id="location" name="location" required="required" class="form-control" <?php if(isset($viewData)) { echo "readonly"; } ?> >
|
||||
<option value="<?php echo $editData->location; ?>"><?php echo $editData->location_name; ?></option>
|
||||
<?php foreach ($locationsData as $key => $value) { ?>
|
||||
<option value="<?php echo $value->id; ?>"><?php echo $value->location; ?></option>
|
||||
@ -100,7 +101,7 @@
|
||||
<div class="item form-group">
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Notes </label>
|
||||
<div class="col-md-11 col-sm-11 ">
|
||||
<textarea id="notes" name="notes" value="<?php echo $editData->notes; ?>" class="form-control" type="text" ></textarea>
|
||||
<textarea id="notes" name="notes" value="<?php echo $editData->notes; ?>" class="form-control" type="text" <?php if(isset($viewData)) { echo "readonly"; } ?>></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<br /> <h6>Order Related Information</h6> <div class="x_title"> </div> <br />
|
||||
@ -109,14 +110,14 @@
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name">Order No </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="order_no" name="order_no" value="<?php echo $editData->order_no; ?>" class="form-control" type="text" >
|
||||
<input id="order_no" name="order_no" value="<?php echo $editData->order_no; ?>" class="form-control" type="text" <?php if(isset($viewData)) { echo "readonly"; } ?> >
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name">Purchase Date</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="purchase_date" value="<?php echo $editData->purchase_date; ?>" />
|
||||
<input type='text' class="form-control" name="purchase_date" value="<?php echo $editData->purchase_date; ?>" <?php if(isset($viewData)) { echo "readonly"; } ?>/>
|
||||
<span class="input-group-addon">
|
||||
<span class="glyphicon glyphicon-calendar"></span>
|
||||
</span>
|
||||
@ -132,7 +133,7 @@
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name">Supplier </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="supplier" name="supplier" required="required" class="form-control" >
|
||||
<select id="supplier" name="supplier" required="required" class="form-control" <?php if(isset($viewData)) { echo "readonly"; } ?>>
|
||||
<option value="<?php echo $editData->supplier; ?>"><?php echo $editData->supplier_name; ?></option>
|
||||
<?php foreach ($suppliorData as $key => $value) { ?>
|
||||
<option value="<?php echo $value->id; ?>"><?php echo $value->name; ?></option>
|
||||
@ -143,7 +144,7 @@
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Cost </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="cost" name="cost" value="<?php echo $editData->cost; ?>" class="form-control" type="text" name="middle-name">
|
||||
<input id="cost" name="cost" value="<?php echo $editData->cost; ?>" class="form-control" type="text" name="middle-name" <?php if(isset($viewData)) { echo "readonly"; } ?>>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -152,12 +153,16 @@
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name">Warranty Information</label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="warranty" name="warranty" value="<?php echo $editData->warranty; ?>" class="form-control" type="text" >
|
||||
<textarea id="warranty" name="warranty" value="<?php echo $editData->warranty; ?>" class="form-control" type="text" <?php if(isset($viewData)) { echo "readonly"; } ?> ></textarea>
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Main Image </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<?php if(isset($viewData)) { ?>
|
||||
<img src="<?php echo base_url(); ?>assets/uploads/<?php echo $editData->asset_img; ?>" alt="Girl in a jacket" width="180" height="150">
|
||||
<?php } else {?>
|
||||
<input id="formFile" name="asset_img" class="typeFile" type="file" >
|
||||
<?php }?>
|
||||
</div>
|
||||
|
||||
|
||||
@ -169,7 +174,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<?php if(isset($viewData)) { }else{ ?>
|
||||
<div class="ln_solid"></div>
|
||||
<div class="item form-group">
|
||||
<div class="col-md-6 col-sm-6 offset-md-10">
|
||||
@ -177,6 +182,8 @@
|
||||
<button type="submit" class="btn btn-success">Update</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
@ -190,9 +197,6 @@
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<br/>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
|
||||
<!-- Body page content -->
|
||||
|
||||
|
||||
<!--<input type="hidden" id="current_tab" value="<?php if($tab){ echo $tab; }?>" >-->
|
||||
|
||||
<div class="">
|
||||
<div class="page-title">
|
||||
@ -14,7 +14,7 @@
|
||||
<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><a class="collapse-link" id="test"><i class="fa fa-chevron-up"></i></a></li>
|
||||
</li>
|
||||
</ul>
|
||||
<h6>General Information</h6>
|
||||
|
||||
@ -41,7 +41,24 @@ public function get_user($id)
|
||||
$query = $this->db->get('users');
|
||||
return $query->row();
|
||||
}
|
||||
|
||||
//is super admin
|
||||
public function is_superadmin()
|
||||
{
|
||||
// get_header_info();
|
||||
//check logged in
|
||||
if (!$this->is_logged_in()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//check role
|
||||
if (user()->role == 'sadmin') {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//is admin
|
||||
public function is_admin()
|
||||
{
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
|
||||
<div>
|
||||
<p>LOGGEDIN : <?php echo check_auth()?></p>
|
||||
<p>IS_SUPERADMIN : <?php echo is_superadmin()?></p>
|
||||
<p>IS_ADMIN : <?php echo is_admin()?></p>
|
||||
<p>IS_USER : <?php echo is_user()?></p>
|
||||
<p>USER : <?php print_r(user())?></p>
|
||||
|
||||
@ -180,6 +180,23 @@
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click','.asset_insurance',function(){
|
||||
var id = $(this).attr("id");
|
||||
|
||||
var getUrl = window.location;
|
||||
var baseUrl = getUrl .protocol + "//" + getUrl.host + "/" + getUrl.pathname.split('/')[1];
|
||||
var url = baseUrl+"/";
|
||||
|
||||
$.ajax({
|
||||
url:url+"asset/getAssetInsuranceForm/"+id,
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
|
||||
$('#edit-form').html(JSON.parse(data));
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click','.asset_image',function(){
|
||||
var id = $(this).attr("id");
|
||||
@ -203,12 +220,22 @@
|
||||
|
||||
|
||||
$(document).on('click','#close-form',function(){
|
||||
|
||||
|
||||
$('#edit-form').css('display', 'none');
|
||||
$("#asset_usage-tab").tab('show');
|
||||
|
||||
});
|
||||
$( document ).ready(function() {
|
||||
|
||||
|
||||
var tab_value = $("#current_tab").val();
|
||||
|
||||
if(tab_value == 1)
|
||||
{
|
||||
$("#asset_usage-tab").tab('show');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -2,7 +2,10 @@
|
||||
<div class="left_col scroll-view">
|
||||
<div class="navbar nav_title" style="border: 0;">
|
||||
<a href="index.html" class="site_title"><i class="fa fa-paw"></i> <span>
|
||||
<?php if(check_auth() && is_admin() || is_user()){echo $business->business_name;}else{echo $settings->site_name;}?>
|
||||
<?php if(check_auth() && is_admin() || is_user())
|
||||
{echo $business->business_name;}
|
||||
else if(check_auth() && is_superadmin())
|
||||
{ echo $settings->site_name; }?>
|
||||
</span></a>
|
||||
</div>
|
||||
|
||||
@ -33,20 +36,31 @@
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
<?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/addAsset">Add Asset</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?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 List</a></li>
|
||||
<li><a href="<?php echo base_url();?>#">Add Business</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<?php if(check_auth() && is_admin() || is_superadmin() ) { ?>
|
||||
<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/addUser">Add Users</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
|
||||
@ -75,5 +89,5 @@
|
||||
</div>
|
||||
<!-- /menu footer buttons -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
BIN
assets/uploads/istockphoto-1322913815-612x6121.jpg
Normal file
BIN
assets/uploads/istockphoto-1322913815-612x6121.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 39 KiB |
Loading…
Reference in New Issue
Block a user