suseendhiran
@ -67,6 +67,7 @@ public function addAsset($id='empty')
|
||||
|
||||
public function assetList()
|
||||
{
|
||||
|
||||
$assets_list = $this->Asset_model->get_assets(user()->business_id);
|
||||
$this->layout->set('tableData', $assets_list);
|
||||
$this->layout->buffer('main_content', 'Asset/asset_list');
|
||||
@ -84,7 +85,7 @@ public function createAssets()
|
||||
|
||||
//file upload confic
|
||||
$asset_image['upload_path'] = APPPATH. '../assets/uploads/';
|
||||
$asset_image['allowed_types'] = 'gif|jpg|png';
|
||||
$asset_image['allowed_types'] = 'gif|jpg|png|jpeg';
|
||||
$asset_image['max_size'] = 80000;
|
||||
//upload
|
||||
$this->load->library('upload', $asset_image);
|
||||
@ -147,7 +148,7 @@ public function editAsset($id)
|
||||
$this->layout->buffer('main_content', 'Asset/edit_asset');
|
||||
$this->layout->render('default_layout');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function editAssets()
|
||||
{
|
||||
@ -162,7 +163,7 @@ public function editAssets()
|
||||
$id = $this->input->post('id');
|
||||
//file upload confic
|
||||
$asset_image['upload_path'] = APPPATH. '../assets/uploads/';
|
||||
$asset_image['allowed_types'] = 'gif|jpg|png';
|
||||
$asset_image['allowed_types'] = 'gif|jpg|png|jpeg';
|
||||
$asset_image['max_size'] = 80000;
|
||||
//upload
|
||||
$this->load->library('upload', $asset_image);
|
||||
@ -178,7 +179,7 @@ public function editAssets()
|
||||
|
||||
}
|
||||
|
||||
|
||||
// print_r( $action);die();
|
||||
//set id $ table name for audit history
|
||||
$this->audit->set('id',$this->input->post('id'));
|
||||
$this->audit->set('table','asset');
|
||||
@ -258,7 +259,7 @@ public function view_asset_details($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);
|
||||
$asset_history = $this->Audit_model->get_history($id,'asset',user()->business_id);
|
||||
$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,'asset_history'=>$asset_history,'tab'=>$tab);
|
||||
$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,'asset_history'=>$asset_history,'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);
|
||||
@ -365,8 +366,32 @@ public function getAssetUsageForm($id)
|
||||
|
||||
if(count($split) > 1)
|
||||
{
|
||||
$data = array('asset_id'=> $split[0], 'heading'=>'Add Asset Usage' , 'submit_button_title'=>'Submit');
|
||||
}else{
|
||||
//month year for dropdown
|
||||
$date_output = array();
|
||||
$start = new DateTime;
|
||||
$start->setDate($start->format('Y'), $start->format('n'), 1); // Normalize the day to 1
|
||||
$start->setTime(0, 0, 0); // Normalize time to midnight
|
||||
$start->sub(new DateInterval('P12M'));
|
||||
$interval = new DateInterval('P1M');
|
||||
$recurrences = 12;
|
||||
$i = 1;
|
||||
foreach (new DatePeriod($start, $interval, $recurrences, true) as $key => $date) {
|
||||
if ($key == 0 || $key == 3 || $key == 6 || $key == 9 ) {
|
||||
$data1['first'] = $date->format('M Y');
|
||||
$data1['value'] = "Q$i";
|
||||
array_push($date_output,$data1);
|
||||
$i++;
|
||||
}
|
||||
if ($key == 2 || $key == 5 || $key == 8 || $key == 11 ) {
|
||||
$data2['second'] = $date->format('M Y');
|
||||
array_push($date_output,$data2);
|
||||
}
|
||||
// echo $date->format('M Y'), "</br>"; // attempting to make it more clear to read here
|
||||
}
|
||||
// echo json_encode($date_output);
|
||||
$data = array('asset_id'=> $split[0], 'heading'=>'Add Asset Usage' , 'submit_button_title'=>'Submit' , 'date' => $date_output);
|
||||
}
|
||||
else{
|
||||
$asset_usage_data = $this->MY_Model->get_by_md5_id($id,'asset_usage');
|
||||
$data = array('assetUsageData'=>$asset_usage_data ,'heading'=>'Edit Asset Usage' , 'submit_button_title'=>'Update');
|
||||
}
|
||||
@ -592,7 +617,7 @@ public function add_asset_image()
|
||||
|
||||
//file upload confic
|
||||
$asset_image['upload_path'] = APPPATH. '../assets/uploads/';
|
||||
$asset_image['allowed_types'] = 'gif|jpg|png';
|
||||
$asset_image['allowed_types'] = 'gif|jpg|png|jpeg';
|
||||
$asset_image['max_size'] = 80000;
|
||||
//upload
|
||||
$this->load->library('upload', $asset_image);
|
||||
@ -681,4 +706,133 @@ public function insurance_report()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function masterDataList()
|
||||
{
|
||||
$this->layout->set('manufacturerData', $this->Asset_model->get_third_party_value_by_md5_id(user()->business_id,1));
|
||||
$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->buffer('main_content', 'Asset/master_list');
|
||||
$this->layout->render('default_layout');
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function getThirdPartyForm($id)
|
||||
{
|
||||
if ($id == "manufacture") {
|
||||
$table = 'third_parties';
|
||||
$data = array('heading'=> "Manufacturer Details", 'type' => 1 , 'submit_button_title'=>'Add' );
|
||||
$htmlPage = $this->load->view('third_party_master_form.php',$data,true);
|
||||
echo json_encode($htmlPage);
|
||||
}
|
||||
else if ($id == "supplier") {
|
||||
$table = 'third_parties';
|
||||
$data = array('heading'=> "supplier Details", 'type' => 2 , 'submit_button_title'=>'Add' );
|
||||
$htmlPage = $this->load->view('third_party_master_form.php',$data,true);
|
||||
echo json_encode($htmlPage);
|
||||
}
|
||||
else if ($id == "service_privoder") {
|
||||
$table = 'third_parties';
|
||||
$data = array('heading'=> "Service Privoder Details", 'type' => 3 , 'submit_button_title'=>'Add' );
|
||||
$htmlPage = $this->load->view('third_party_master_form.php',$data,true);
|
||||
echo json_encode($htmlPage);
|
||||
}
|
||||
else if ($id == "insurence") {
|
||||
$table = 'third_parties';
|
||||
$data = array('heading'=> "Insurence Details", 'type' => 4 , 'submit_button_title'=>'Add' );
|
||||
$htmlPage = $this->load->view('third_party_master_form.php',$data,true);
|
||||
echo json_encode($htmlPage);
|
||||
}
|
||||
else {
|
||||
$table = 'third_parties';
|
||||
$user_data = $this->MY_Model->get_by_md5_id($id, $table);
|
||||
$data = array('heading'=> "Edit Details" , 'third_party_data'=> $user_data , 'submit_button_title'=>'Update' );
|
||||
$htmlPage = $this->load->view('third_party_master_form.php',$data,true);
|
||||
echo json_encode($htmlPage);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function getLocationForm($id)
|
||||
{
|
||||
if ($id == "location") {
|
||||
$table = 'locations';
|
||||
$data = array('heading'=> "Location Details", 'submit_button_title'=>'Add' );
|
||||
$htmlPage = $this->load->view('location_master_form.php',$data,true);
|
||||
echo json_encode($htmlPage);
|
||||
}
|
||||
else {
|
||||
$table = 'locations';
|
||||
$location_data = $this->MY_Model->get_by_md5_id($id, $table);
|
||||
$data = array('heading'=> "Location Details", 'location_data'=> $location_data , 'submit_button_title'=>'Add' );
|
||||
$htmlPage = $this->load->view('location_master_form.php',$data,true);
|
||||
echo json_encode($htmlPage);
|
||||
}
|
||||
}
|
||||
|
||||
public function editLocationForm()
|
||||
{
|
||||
|
||||
$table = 'locations';
|
||||
$action = $this->input->post();
|
||||
$id = $this->input->post('id');
|
||||
if ($id) {
|
||||
$userData = $this->MY_Model->edit_option($action, $id, $table);
|
||||
redirect('asset/masterDataList');
|
||||
} else {
|
||||
$userData = $this->MY_Model->insert($action, $table);
|
||||
redirect('asset/masterDataList');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function getCatogaryForm($id)
|
||||
{
|
||||
if ($id == "catogary") {
|
||||
$table = 'categories';
|
||||
$data = array('heading'=> "Catogary Details", 'submit_button_title'=>'Add' );
|
||||
$htmlPage = $this->load->view('catogary_master_form.php',$data,true);
|
||||
echo json_encode($htmlPage);
|
||||
}
|
||||
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' );
|
||||
$htmlPage = $this->load->view('catogary_master_form.php',$data,true);
|
||||
echo json_encode($htmlPage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function editThirdPartyForm()
|
||||
{
|
||||
|
||||
$table = 'third_parties';
|
||||
$action = $this->input->post();
|
||||
$id = $this->input->post('id');
|
||||
if ($id) {
|
||||
$userData = $this->MY_Model->edit_option($action, $id, $table);
|
||||
redirect('asset/masterDataList');
|
||||
} else {
|
||||
$userData = $this->MY_Model->insert($action, $table);
|
||||
redirect('asset/masterDataList');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function deleteThirdPartyData($id)
|
||||
{
|
||||
$Data = $this->Asset_model->delete_user_by_md5_id($id,user()->business_id);
|
||||
redirect('asset/masterDataList');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -171,4 +171,28 @@ public function depreciation_report($business_id)
|
||||
}
|
||||
|
||||
|
||||
public function get_third_party_value_by_md5_id($business_id , $type)
|
||||
{
|
||||
$this->db->select('B.* , state.name as state ');
|
||||
$this->db->from('third_parties B');
|
||||
$this->db->join('state', 'state.id = B.state', 'left');
|
||||
$this->db->where('B.type', $type);
|
||||
$this->db->where('business_id', $business_id);
|
||||
$query = $this->db->get();
|
||||
$query = $query->result();
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function delete_user_by_md5_id($id,$business_id)
|
||||
{
|
||||
$this->db->where('md5(id)', $id);
|
||||
if ($business_id != NULL) {
|
||||
$this->db->where('business_id', $business_id);
|
||||
}
|
||||
$this->db->set('is_active',0);
|
||||
$this->db->update('users');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -6,7 +6,7 @@
|
||||
<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>
|
||||
@ -22,7 +22,6 @@
|
||||
<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">
|
||||
|
||||
@ -280,9 +280,12 @@
|
||||
<lable class="column-title" style="color : black;" >
|
||||
<?php
|
||||
$column_name = str_replace("_"," ",$value->column_name);
|
||||
$column_name = ucwords($column_name);
|
||||
$column_name = ucwords($column_name);
|
||||
if($value->old_value == null)
|
||||
{ echo "'$column_name'"." Created with "."'$value->new_value'"; }
|
||||
{
|
||||
echo "Asset"." '$value->new_value'"." Created";
|
||||
// echo "'$column_name'"." Created with "."'$value->new_value'";
|
||||
}
|
||||
else{ echo $column_name." Changed from "."'$value->old_value'"." to "."'$value->new_value'"; }
|
||||
?>
|
||||
</lable></br>
|
||||
|
||||
@ -55,10 +55,13 @@
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<select id="quater" name="quater" required="required" class="form-control" >
|
||||
<option value="<?php if(isset($assetUsageData)) { echo $assetUsageData->quater; } ?>"><?php if(isset($assetUsageData)) { echo $assetUsageData->quater; } ?></option>
|
||||
<option value="Q1">Q1</option>
|
||||
<option value="Q2">Q2</option>
|
||||
<option value="Q3">Q3</option>
|
||||
<option value="Q4">Q4</option>
|
||||
<?php
|
||||
foreach ($date as $key => $value) {
|
||||
if ($key == 0 || $key == 2 || $key == 4 || $key == 6 ) {?>
|
||||
<option value="<?php echo str_replace('"', '', json_encode($value['value'])) ?>"><?php echo str_replace('"', '', json_encode($value['value'])) ?> ( <?php echo str_replace('"', '', json_encode($value['first']) ) ?> - <?php echo str_replace('"', '', json_encode($date[$key + 1]['second'])) ?> )</option>
|
||||
<?php }
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
36
application/modules/Asset/views/catogary_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/getCatogaryForm" >
|
||||
<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($catogary_data)) { echo $catogary_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 ">Catogary</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; } ?>">
|
||||
</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>
|
||||
|
||||
|
||||
@ -157,14 +157,15 @@
|
||||
</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)) { if($editData->asset_img == null || $editData->asset_img == '') { ?>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<?php if(isset($viewData)) {
|
||||
if($editData->asset_img == null || $editData->asset_img == '') { ?>
|
||||
<img src="<?php echo base_url(); ?>assets/uploads/defauld-img.jpg" width="180" height="150">
|
||||
<?php } else {?>
|
||||
<img src="<?php echo base_url(); ?>assets/uploads/<?php echo $editData->asset_img; ?>" width="180" height="150">
|
||||
<?php } } else {?>
|
||||
|
||||
<?php } }
|
||||
else { ?>
|
||||
<input id="formFile" name="asset_img" class="typeFile" type="file" >
|
||||
|
||||
<?php if($editData->asset_img == null || $editData->asset_img == '') { ?>
|
||||
@ -176,6 +177,16 @@
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <div class="col-md-5 col-sm-5 ">
|
||||
<?php if(isset($viewData)) { if($editData->asset_img == null || $editData->asset_img == '') { ?>
|
||||
<img src="<?php echo base_url(); ?>assets/uploads/defauld-img.jpg" width="180" height="150">
|
||||
<?php } else {?>
|
||||
<img src="<?php echo base_url(); ?>assets/uploads/<?php echo $editData->asset_img; ?>" width="180" height="150">
|
||||
<?php } } else {?>
|
||||
<input id="formFile" name="asset_img" class="typeFile" type="file" >
|
||||
<?php }?>
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
36
application/modules/Asset/views/location_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/editLocationForm" >
|
||||
<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($location_data)) { echo $location_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 ">Location</label>
|
||||
<div class="col-md-9 col-sm-9 ">
|
||||
<input type="text" class="form-control" name="location" value="<?php if(isset($location_data)) { echo $location_data->location; } ?>">
|
||||
</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>
|
||||
|
||||
|
||||
455
application/modules/Asset/views/master_list.php
Normal file
@ -0,0 +1,455 @@
|
||||
|
||||
<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 active" id="manufacture-tab" data-toggle="tab" href="#manufacture" role="tab" aria-controls="manufacture" aria-selected="true">Manufacturer</a>
|
||||
</li>
|
||||
<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>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="service_privoder-tab" data-toggle="tab" href="#service_privoder" role="tab" aria-controls="service_privoder" aria-selected="false">Service Provider</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="insurence-tab" data-toggle="tab" href="#insurence" role="tab" aria-controls="insurence" aria-selected="false">Insurance</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="location-tab" data-toggle="tab" href="#location" role="tab" aria-controls="location" aria-selected="false">Location</a>
|
||||
</li>
|
||||
<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>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<div class="tab-content" id="myTabContent">
|
||||
|
||||
|
||||
|
||||
|
||||
<!------------------------------ MANUCTURE ------------------------------->
|
||||
<div class="tab-pane fade show active" id="manufacture" role="tabpanel" aria-labelledby="manufacture-tab">
|
||||
<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>
|
||||
<?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="15%">Phone </th>
|
||||
<th class="column-title" width="15%">Email </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>
|
||||
<tbody>
|
||||
<?php foreach ($manufacturerData as $key => $value) { ?>
|
||||
<tr class="even pointer">
|
||||
<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->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>
|
||||
|
||||
<a href="<?php echo base_url()?>Asset/deleteThirdPartyData/<?php echo md5($value->id); ?>" style="font-size: 16px;"><i class="fa fa-trash"></i></a>
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!------------------------------ SUPPLIER DATA ------------------------------->
|
||||
<div class="tab-pane fade" id="supplier" role="tabpanel" aria-labelledby="asset_usage-tab">
|
||||
<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>
|
||||
<?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="15%">Phone </th>
|
||||
<th class="column-title" width="15%">Email </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>
|
||||
<tbody>
|
||||
<?php foreach ($supplierData as $key => $value) { ?>
|
||||
<tr class="even pointer">
|
||||
<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->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>
|
||||
|
||||
<a href="<?php echo base_url()?>Asset/deleteThirdPartyData/<?php echo md5($value->id); ?>" style="font-size: 16px;"><i class="fa fa-trash"></i></a>
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!------------------------------ SERVICE PROVIDER DATA ------------------------------->
|
||||
<div class="tab-pane fade" id="service_privoder" role="tabpanel" aria-labelledby="service_privoder-tab">
|
||||
<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>
|
||||
<?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="15%">Phone </th>
|
||||
<th class="column-title" width="15%">Email </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>
|
||||
<tbody>
|
||||
<?php foreach ($service_privoder as $key => $value) { ?>
|
||||
<tr class="even pointer">
|
||||
<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->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>
|
||||
|
||||
<a href="<?php echo base_url()?>Asset/deleteThirdPartyData/<?php echo md5($value->id); ?>" style="font-size: 16px;"><i class="fa fa-trash"></i></a>
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!------------------------------ INSURENCE DATA ------------------------------->
|
||||
<div class="tab-pane fade" id="insurence" role="tabpanel" aria-labelledby="insurence-tab">
|
||||
<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>
|
||||
<?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="15%">Phone </th>
|
||||
<th class="column-title" width="15%">Email </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>
|
||||
<tbody>
|
||||
<?php foreach ($insurence as $key => $value) { ?>
|
||||
<tr class="even pointer">
|
||||
<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->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>
|
||||
|
||||
<a href="<?php echo base_url()?>Asset/deleteThirdPartyData/<?php echo md5($value->id); ?>" style="font-size: 16px;"><i class="fa fa-trash"></i></a>
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!------------------------------ LOCATION DATA ------------------------------->
|
||||
<div class="tab-pane fade" id="location" role="tabpanel" aria-labelledby="location-tab">
|
||||
<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>
|
||||
<?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%">Location </th>
|
||||
<!-- <th class="column-title" width="10%">Action </th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($locationsData as $key => $value) { ?>
|
||||
<tr class="even pointer">
|
||||
<td class=" "><?php echo $value->location; ?></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 href="<?php echo base_url()?>Asset/deleteThirdPartyData/<?php echo md5($value->id); ?>" style="font-size: 16px;"><i class="fa fa-trash"></i></a>
|
||||
</td>
|
||||
<?php } ?> -->
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!------------------------------ CATOGARY DATA ------------------------------->
|
||||
<div class="tab-pane fade" id="catogary" role="tabpanel" aria-labelledby="catogary-tab">
|
||||
<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>
|
||||
<?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> -->
|
||||
</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>
|
||||
<a class="location" id="<?php echo md5($value->id); ?>" style="font-size: 16px;" >
|
||||
<i class="fa fa-pencil"></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>
|
||||
</td>
|
||||
<?php } ?> -->
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ------------------------------------------------------------------------------------------------------- -->
|
||||
|
||||
|
||||
|
||||
<div class="modal bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" id="edit-form"> </div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(document).on('click','.manufacture',function(){
|
||||
var id = $(this).attr("id")
|
||||
if (id) {
|
||||
var URL = "<?php echo base_url();?>asset/getThirdPartyForm/"+id
|
||||
}
|
||||
else {
|
||||
var URL = "<?php echo base_url();?>asset/getThirdPartyForm/"+"manufacture"
|
||||
}
|
||||
$.ajax({
|
||||
url: URL,
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
|
||||
$('#edit-form').html(JSON.parse(data));
|
||||
$('.bs-example-modal-sm').modal("show");
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click','.supplier',function(){
|
||||
var id = $(this).attr("id")
|
||||
if (id) {
|
||||
var URL = "<?php echo base_url();?>asset/getThirdPartyForm/"+id
|
||||
}
|
||||
else {
|
||||
var URL = "<?php echo base_url();?>asset/getThirdPartyForm/"+"supplier"
|
||||
}
|
||||
$.ajax({
|
||||
url: URL,
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
|
||||
$('#edit-form').html(JSON.parse(data));
|
||||
$('.bs-example-modal-sm').modal("show");
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$(document).on('click','.service_privoder',function(){
|
||||
var id = $(this).attr("id")
|
||||
if (id) {
|
||||
var URL = "<?php echo base_url();?>asset/getThirdPartyForm/"+id
|
||||
}
|
||||
else {
|
||||
var URL = "<?php echo base_url();?>asset/getThirdPartyForm/"+"service_privoder"
|
||||
}
|
||||
$.ajax({
|
||||
url: URL,
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
|
||||
$('#edit-form').html(JSON.parse(data));
|
||||
$('.bs-example-modal-sm').modal("show");
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$(document).on('click','.insurence',function(){
|
||||
var id = $(this).attr("id")
|
||||
if (id) {
|
||||
var URL = "<?php echo base_url();?>asset/getThirdPartyForm/"+id
|
||||
}
|
||||
else {
|
||||
var URL = "<?php echo base_url();?>asset/getThirdPartyForm/"+"insurence"
|
||||
}
|
||||
$.ajax({
|
||||
url: URL,
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
|
||||
$('#edit-form').html(JSON.parse(data));
|
||||
$('.bs-example-modal-sm').modal("show");
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$(document).on('click','.location',function(){
|
||||
var id = $(this).attr("id")
|
||||
if (id) {
|
||||
var URL = "<?php echo base_url();?>asset/getLocationForm/"+id
|
||||
}
|
||||
else {
|
||||
var URL = "<?php echo base_url();?>asset/getLocationForm/"+"location"
|
||||
}
|
||||
$.ajax({
|
||||
url: URL,
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
|
||||
$('#edit-form').html(JSON.parse(data));
|
||||
$('.bs-example-modal-sm').modal("show");
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$(document).on('click','.catogary',function(){
|
||||
var id = $(this).attr("id")
|
||||
if (id) {
|
||||
var URL = "<?php echo base_url();?>asset/getCatogaryForm/"+id
|
||||
}
|
||||
else {
|
||||
var URL = "<?php echo base_url();?>asset/getCatogaryForm/"+"catogary"
|
||||
}
|
||||
$.ajax({
|
||||
url: URL,
|
||||
type:"GET",
|
||||
success:function(data){
|
||||
|
||||
$('#edit-form').html(JSON.parse(data));
|
||||
$('.bs-example-modal-sm').modal("show");
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
86
application/modules/Asset/views/third_party_master_form.php
Normal file
@ -0,0 +1,86 @@
|
||||
|
||||
<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/editThirdPartyForm" >
|
||||
<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($third_party_data)) { echo $third_party_data->id; } ?>">
|
||||
<input type="hidden" name="type" value="<?php if(isset($third_party_data)) { echo $third_party_data->type; } else { echo $type;} ?>">
|
||||
<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>
|
||||
<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; } ?>">
|
||||
</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; } ?>">
|
||||
</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; } ?>">
|
||||
</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; } ?>">
|
||||
</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; } ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3 col-sm-3 ">State</label>
|
||||
<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; } ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<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>
|
||||
<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>
|
||||
|
||||
|
||||
@ -92,24 +92,40 @@ public function create_history()
|
||||
return $Output;
|
||||
}else if($args[0] == 'insert') {
|
||||
$Output = array();
|
||||
foreach($this->new_data as $postDatakey=>$postDatavalue)
|
||||
{
|
||||
if($postDatakey != 'id' && $postDatakey != 'created_by ' && $postDatakey != 'is_active' && $postDatakey != 'created_at')
|
||||
{
|
||||
$data['table_name'] = $this->table;
|
||||
$data['column_name'] = $postDatakey;
|
||||
$data['new_value'] = $postDatavalue;
|
||||
$data['created_by'] = user()->id;
|
||||
if(is_superadmin()){ $data['business_id'] = NULL; } else { $data['business_id'] = user()->business_id; }
|
||||
$data['primary_id'] = $this->id;
|
||||
$data['created_at'] = date("Y-m-d h:i:s");
|
||||
array_push($Output,$data);
|
||||
$this->MY_Model->insert($data,'history');
|
||||
}
|
||||
}
|
||||
return $Output;
|
||||
|
||||
}
|
||||
// foreach($this->new_data as $postDatakey=>$postDatavalue)
|
||||
// {
|
||||
// if($postDatakey != 'id' && $postDatakey != 'created_by ' && $postDatakey != 'is_active' && $postDatakey != 'created_at')
|
||||
// {
|
||||
// $data['table_name'] = $this->table;
|
||||
// $data['column_name'] = $postDatakey;
|
||||
// $data['new_value'] = $postDatavalue;
|
||||
// $data['created_by'] = user()->id;
|
||||
// if(is_superadmin()){ $data['business_id'] = NULL; } else { $data['business_id'] = user()->business_id; }
|
||||
// $data['primary_id'] = $this->id;
|
||||
// $data['created_at'] = date("Y-m-d h:i:s");
|
||||
// array_push($Output,$data);
|
||||
// $this->MY_Model->insert($data,'history');
|
||||
// }
|
||||
// }
|
||||
// return $Output;
|
||||
if ($this->table == 'users' || $this->table == 'business' || $this->table == 'asset') {
|
||||
|
||||
$data['table_name']= $this->table;
|
||||
if ( $this->table == 'business') {
|
||||
$data['new_value'] = $this->new_data->business_name;
|
||||
} else {
|
||||
$data['new_value'] = $this->new_data->name;
|
||||
}
|
||||
$data['column_name'] = 'name';
|
||||
$data['created_by'] = user()->id;
|
||||
if(is_superadmin()){ $data['business_id'] = NULL; } else { $data['business_id'] = user()->business_id; }
|
||||
$data['primary_id'] = $this->id;
|
||||
$data['created_at'] = date("Y-m-d h:i:s");
|
||||
$this->MY_Model->insert($data,'history');
|
||||
return $data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ public function create_business()
|
||||
$data['created_by'] = user()->id;
|
||||
//file upload confic
|
||||
$logo_file['upload_path'] = APPPATH. '../assets/uploads/logo';
|
||||
$logo_file['allowed_types'] = 'gif|jpg|png';
|
||||
$logo_file['allowed_types'] = 'gif|jpg|png|jpeg';
|
||||
$logo_file['max_size'] = 80000;
|
||||
//upload
|
||||
$this->load->library('upload', $logo_file);
|
||||
@ -132,7 +132,7 @@ public function edit_business()
|
||||
|
||||
//file upload confic
|
||||
$logo_file['upload_path'] = APPPATH. '../assets/uploads/logo';
|
||||
$logo_file['allowed_types'] = 'gif|jpg|png';
|
||||
$logo_file['allowed_types'] = 'gif|jpg|png|jpeg';
|
||||
$logo_file['max_size'] = 80000;
|
||||
//upload
|
||||
$this->load->library('upload', $logo_file);
|
||||
|
||||
@ -102,10 +102,8 @@
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<a class="dropdown-item" href="javascript:;">
|
||||
<span class="badge bg-red pull-right">50%</span>
|
||||
<span>Settings</span>
|
||||
</a>
|
||||
<a class="dropdown-item" href="<?php echo base_url()?>asset/masterDataList/">Masters</a>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
@ -166,7 +166,7 @@ public function editprofiles()
|
||||
$id = $this->input->post('id');
|
||||
//file upload confic
|
||||
$user_image['upload_path'] = APPPATH. '../assets/uploads/profile_picture';
|
||||
$user_image['allowed_types'] = 'jpg|png';
|
||||
$user_image['allowed_types'] = 'jpg|png|jpeg';
|
||||
$user_image['max_size'] = 80000;
|
||||
//upload
|
||||
$this->load->library('upload', $user_image);
|
||||
@ -229,7 +229,7 @@ public function view_user_history($id)
|
||||
{
|
||||
$table = 'users';
|
||||
$user_history = $this->audit_model->get_history( $id , $table , user()->business_id);
|
||||
$data = array('title'=> "User History" , 'user_history'=> $user_history );
|
||||
$data = array('title'=> "User History" , 'name' => 'User' , 'user_history'=> $user_history );
|
||||
$htmlPage = $this->load->view('view_history.php',$data,true);
|
||||
echo json_encode($htmlPage);
|
||||
}
|
||||
@ -239,7 +239,7 @@ public function view_business_history($id)
|
||||
{
|
||||
$table = 'business';
|
||||
$user_history = $this->audit_model->get_history( $id , $table , user()->business_id);
|
||||
$data = array('title'=> "Business History" , 'user_history'=> $user_history );
|
||||
$data = array('title'=> "Business History" , 'name' => 'Business' ,'user_history'=> $user_history );
|
||||
$htmlPage = $this->load->view('view_history.php',$data,true);
|
||||
echo json_encode($htmlPage);
|
||||
}
|
||||
|
||||
@ -32,40 +32,23 @@
|
||||
<input type="text" id="created_by" name="created_by" value="<?php echo $data->created_by ?>" class="form-control " hidden>
|
||||
|
||||
|
||||
<?php if (is_superadmin()) { ?>
|
||||
<!-- <?php if (is_superadmin()) { ?>
|
||||
<div class="item form-group">
|
||||
<?php }
|
||||
if (is_admin() || user()->action_permit != 'view') { ?>
|
||||
<div class="item form-group" hidden>
|
||||
<?php } ?>
|
||||
|
||||
<?php if (is_admin() || user()->action_permit != 'view') { ?>
|
||||
<input type="text" id="business_id" name="business_id" value="<?php echo $data->business_id ?>" class="form-control " hidden>
|
||||
<?php }
|
||||
else if(is_superadmin()) { ?>
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Business<a style="color:red;">*</a> </label>
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Business<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="business_id" name="business_id" required="required" class="form-control" >
|
||||
<option value="<?php if(isset($businessData)) { echo $businessData->uid; } ?>">
|
||||
<?php if(isset($businessData)) { echo $businessData->business_name; }else{ echo "Select business"; } ?>
|
||||
</option>
|
||||
<?php foreach ($business_dropdown as $key => $value) { ?>
|
||||
<option value="<?php echo $value->uid; ?>"><?php echo $value->business_name; ?></option>
|
||||
<option value="<?php echo $value->uid; ?>"><?php echo $value->business_name; echo $value->uid; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php if (is_admin() || user()->action_permit != 'view') { ?>
|
||||
<input type="text" id="role" name="role" value="user" class="form-control " hidden>
|
||||
<?php }
|
||||
else if(is_superadmin()) { ?>
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Role<a style="color:red;">*</a> </label>
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Role<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="role" name="role" required="required" class="form-control" >
|
||||
<option value="">Select role</option>
|
||||
@ -73,12 +56,51 @@
|
||||
<option value="user">user</option>
|
||||
</select>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php } ?> -->
|
||||
|
||||
<?php if (is_superadmin()) { ?>
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Business<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="business_id" name="business_id" required="required" class="form-control" >
|
||||
<option value="<?php if(isset($businessData)) { echo $businessData->uid; } ?>">
|
||||
<?php if(isset($businessData)) { echo $businessData->business_name; }else{ echo "Select business"; } ?>
|
||||
</option>
|
||||
<?php foreach ($business_dropdown as $key => $value) { ?>
|
||||
<option value="<?php echo $value->uid; ?>"><?php echo $value->business_name; echo $value->uid; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Role<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="role" name="role" required="required" class="form-control" >
|
||||
<option value="">Select role</option>
|
||||
<option value="admin">Admin</option>
|
||||
<option value="user">user</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php }
|
||||
|
||||
else if (is_admin() || user()->action_permit != 'view') { ?>
|
||||
<div class="item form-group" hidden>
|
||||
<input type="text" id="business_id" name="business_id" value="<?php echo $data->business_id ?>" class="form-control " hidden>
|
||||
<input type="text" id="role" name="role" value="user" class="form-control " hidden>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <br /> <h6></h6> <div class="x_title"> </div> <br /> -->
|
||||
<!-- --------------------------- -->
|
||||
<div class="item form-group">
|
||||
|
||||
@ -10,16 +10,22 @@
|
||||
</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="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);
|
||||
$column_name = ucwords($column_name);
|
||||
if($value->old_value == null)
|
||||
{ echo "'$column_name'"." Created with "."'$value->new_value'"; }
|
||||
else{ echo $column_name." Changed from "."'$value->old_value'"." to "."'$value->new_value'"; }
|
||||
{
|
||||
echo "$name "." ' $value->new_value ' "." Created";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $column_name." Changed from "."'$value->old_value'"." to "."'$value->new_value'";
|
||||
}
|
||||
?>
|
||||
</lable></br>
|
||||
</div>
|
||||
|
||||
BIN
assets/uploads/laptop.jpeg
Normal file
|
After Width: | Height: | Size: 122 KiB |
BIN
assets/uploads/laptop1.jpeg
Normal file
|
After Width: | Height: | Size: 122 KiB |
BIN
assets/uploads/laptop2.jpeg
Normal file
|
After Width: | Height: | Size: 122 KiB |
BIN
assets/uploads/logo/company-logo2.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
assets/uploads/logo/company-logo3.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
assets/uploads/logo/company-logo4.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
assets/uploads/logo/company-logo5.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
assets/uploads/logo/logo.jpg
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
assets/uploads/logo/logo1.jpg
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
assets/uploads/logo/logo2.jpg
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
assets/uploads/printer.jpeg
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
assets/uploads/printer1.jpeg
Normal file
|
After Width: | Height: | Size: 6.2 KiB |