feedback changes done : suseendhiran

This commit is contained in:
suseendhiran17 2023-01-21 17:19:35 +05:30
parent 458a1a0d9b
commit 26227b51f4
24 changed files with 164 additions and 43 deletions

View File

@ -8,7 +8,9 @@
<h2>Assets Details </h2> <h2>Assets Details </h2>
<ul class="nav navbar-right panel_toolbox"> <ul class="nav navbar-right panel_toolbox">
<?php if(user()->action_permit != 'view' ) { ?>
<a href="<?php echo base_url();?>asset/addAsset" class="btn btn-sm btn-primary">Add Asset</a> <a href="<?php echo base_url();?>asset/addAsset" class="btn btn-sm btn-primary">Add Asset</a>
<?php } ?>
<button class="btn btn-sm btn-secondary" onclick="deleteRow();">Remove</button> <button class="btn btn-sm btn-secondary" onclick="deleteRow();">Remove</button>
<button class="btn btn-sm btn-info" onclick="viewQr();">View QR</button> <button class="btn btn-sm btn-info" onclick="viewQr();">View QR</button>
<!-- <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a> <!-- <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
@ -61,12 +63,14 @@
<td class=" "><?php echo $value->cost; ?></td> <td class=" "><?php echo $value->cost; ?></td>
<td class=" "><?php echo $value->location_name; ?></td> --> <td class=" "><?php echo $value->location_name; ?></td> -->
<td style=" text-align: center; font-size: 16px;"> <td style=" text-align: center; font-size: 16px;">
<?php if(user()->action_permit != 'view' ) { ?>
<a href="<?php echo base_url()?>Asset/editAsset/<?php echo md5($value->id);?>" ><i class="fa fa-pencil"></i></a> <a href="<?php echo base_url()?>Asset/editAsset/<?php echo md5($value->id);?>" ><i class="fa fa-pencil"></i></a>
&nbsp; &nbsp;
<a href="<?php echo base_url()?>Asset/addAsset/<?php echo md5($value->id);?>" ><i class="fa fa-copy"></i></a> <a href="<?php echo base_url()?>Asset/addAsset/<?php echo md5($value->id);?>" ><i class="fa fa-copy"></i></a>
&nbsp; &nbsp;
<a href="<?php echo base_url()?>Asset/deleteAsset/<?php echo md5($value->id);?>" ><i class="fa fa-trash"></i></a> <a href="<?php echo base_url()?>Asset/deleteAsset/<?php echo md5($value->id);?>" ><i class="fa fa-trash"></i></a>
&nbsp; &nbsp;
<?php } ?>
<a href="<?php echo base_url()?>Asset/view_asset_details/<?php echo md5($value->id);?>" > <i class="fa fa-eye"></i></a> <a href="<?php echo base_url()?>Asset/view_asset_details/<?php echo md5($value->id);?>" > <i class="fa fa-eye"></i></a>
&nbsp; &nbsp;
<!-- <a href="<?php echo base_url()?>Asset/view_qr_code/<?php echo md5($value->id);?>" > <i class="fa fa-qrcode"></i></a> --> <!-- <a href="<?php echo base_url()?>Asset/view_qr_code/<?php echo md5($value->id);?>" > <i class="fa fa-qrcode"></i></a> -->

View File

@ -37,8 +37,10 @@
<div class="tab-pane fade show active" id="asset_value" role="tabpanel" aria-labelledby="asset_value-tab"> <div class="tab-pane fade show active" 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' ) { ?>
<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; ">
<li class="fa fa-plus-circle"></li></a> <li class="fa fa-plus-circle"></li></a>
<?php } ?>
</ul> </br> </ul> </br>
<div class="card-box table-responsive"> <div class="card-box table-responsive">
<table class="table table-bordered table-striped" cellspacing="0" width="100%"> <table class="table table-bordered table-striped" cellspacing="0" width="100%">
@ -63,6 +65,7 @@
<td class=" "><?php echo $value->current_value; ?></td> <td class=" "><?php echo $value->current_value; ?></td>
<td class=" "><?php echo $value->percentage; ?></td> <td class=" "><?php echo $value->percentage; ?></td>
<td class=" "><?php echo $value->description; ?></td> <td class=" "><?php echo $value->description; ?></td>
<?php if(user()->action_permit != 'view' ) { ?>
<td> <td>
&nbsp; &nbsp;
<a class="asset_value" id="<?php echo md5($value->id); ?>" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;" > <a class="asset_value" id="<?php echo md5($value->id); ?>" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;" >
@ -72,6 +75,7 @@
</td> </td>
<?php } ?>
</tr> </tr>
<?php } ?> <?php } ?>
</tbody> </tbody>
@ -85,8 +89,10 @@
<div class="tab-pane fade" id="asset_usage" role="tabpanel" aria-labelledby="asset_usage-tab"> <div class="tab-pane fade" id="asset_usage" 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' ) { ?>
<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; "> <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> <li class="fa fa-plus-circle"></li></a>
<?php } ?>
</ul> </br> </ul> </br>
<div class="card-box table-responsive"> <div class="card-box table-responsive">
<table class="table table-bordered table-striped" cellspacing="0" width="100%"> <table class="table table-bordered table-striped" cellspacing="0" width="100%">
@ -108,13 +114,14 @@
<td class=" "><?php echo my_date_show($value->date_to); ?></td> <td class=" "><?php echo my_date_show($value->date_to); ?></td>
<td class=" "><?php echo $value->quater; ?></td> <td class=" "><?php echo $value->quater; ?></td>
<td class=" "><?php echo $value->shift; ?></td> <td class=" "><?php echo $value->shift; ?></td>
<?php if(user()->action_permit != 'view' ) { ?>
<td> <td>
&nbsp; &nbsp;
<a class="asset_usage" id="<?php echo md5($value->id); ?>" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;"> <a class="asset_usage" id="<?php echo md5($value->id); ?>" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;">
<i class="fa fa-pencil"></i></a> <i class="fa fa-pencil"></i></a>
&nbsp; &nbsp;
<a href="<?php echo base_url()?>Asset/deleteAssetUsage/<?php echo md5($value->id)."_".$value->asset_id;?>" style="font-size: 16px;" ><i class="fa fa-trash"></i></a> <a href="<?php echo base_url()?>Asset/deleteAssetUsage/<?php echo md5($value->id)."_".$value->asset_id;?>" style="font-size: 16px;" ><i class="fa fa-trash"></i></a>
</td> </td> <?php } ?>
</tr> </tr>
<?php } ?> <?php } ?>
</tbody> </tbody>
@ -127,8 +134,10 @@
<div class="tab-pane fade" id="asset_amc" role="tabpanel" aria-labelledby="asset_amc-tab"> <div class="tab-pane fade" id="asset_amc" role="tabpanel" aria-labelledby="asset_amc-tab">
<ul class="nav navbar-right panel_toolbox"> <ul class="nav navbar-right panel_toolbox">
<?php if(user()->action_permit != 'view' ) { ?>
<a type="button" class="asset_amc" id="<?php echo $asset_id."_add"; ?>" data-toggle="modal" data-target=".bs-example-modal-sm" style=" text-align: center; font-size: 25px; color:#2A3F54; "> <a type="button" class="asset_amc" id="<?php echo $asset_id."_add"; ?>" data-toggle="modal" data-target=".bs-example-modal-sm" style=" text-align: center; font-size: 25px; color:#2A3F54; ">
<li class="fa fa-plus-circle"></li></a> <li class="fa fa-plus-circle"></li></a>
<?php } ?>
</ul> </br> </ul> </br>
<div class="card-box table-responsive"> <div class="card-box table-responsive">
<table class="table table-bordered table-striped" cellspacing="0" width="100%"> <table class="table table-bordered table-striped" cellspacing="0" width="100%">
@ -153,6 +162,7 @@
<td class=" "><?php echo my_date_show($value->valid_to); ?></td> <td class=" "><?php echo my_date_show($value->valid_to); ?></td>
<td class=" "><?php echo day_different($value->valid_to)." days left"; ?></td> <td class=" "><?php echo day_different($value->valid_to)." days left"; ?></td>
<td class=" "><?php echo $value->description; ?></td> <td class=" "><?php echo $value->description; ?></td>
<?php if(user()->action_permit != 'view' ) { ?>
<td> <td>
&nbsp; &nbsp;
<a class="asset_amc" id="<?php echo md5($value->id); ?>" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;"> <a class="asset_amc" id="<?php echo md5($value->id); ?>" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;">
@ -160,6 +170,7 @@
&nbsp; &nbsp;
<a href="<?php echo base_url()?>Asset/deleteAssetAMC/<?php echo md5($value->id)."_".$value->asset_id;?>" style="font-size: 16px;"><i class="fa fa-trash"></i></a> <a href="<?php echo base_url()?>Asset/deleteAssetAMC/<?php echo md5($value->id)."_".$value->asset_id;?>" style="font-size: 16px;"><i class="fa fa-trash"></i></a>
</td> </td>
<?php }?>
</tr> </tr>
<?php } ?> <?php } ?>
</tbody> </tbody>
@ -172,8 +183,10 @@
<div class="tab-pane fade" id="asset_insurance" role="tabpanel" aria-labelledby="asset_insurance-tab"> <div class="tab-pane fade" id="asset_insurance" role="tabpanel" aria-labelledby="asset_insurance-tab">
<ul class="nav navbar-right panel_toolbox"> <ul class="nav navbar-right panel_toolbox">
<?php if(user()->action_permit != 'view' ) { ?>
<a type="button" class="asset_insurance" id="<?php echo $asset_id."_add"; ?>" data-toggle="modal" data-target=".bs-example-modal-sm" style=" text-align: center; font-size: 25px; color:#2A3F54; "> <a type="button" class="asset_insurance" id="<?php echo $asset_id."_add"; ?>" data-toggle="modal" data-target=".bs-example-modal-sm" style=" text-align: center; font-size: 25px; color:#2A3F54; ">
<li class="fa fa-plus-circle"></li></a> <li class="fa fa-plus-circle"></li></a>
<?php } ?>
</ul> </br> </ul> </br>
<div class="card-box table-responsive"> <div class="card-box table-responsive">
<table class="table table-bordered table-striped" cellspacing="0" width="100%"> <table class="table table-bordered table-striped" cellspacing="0" width="100%">
@ -198,6 +211,7 @@
<td class=" "><?php echo my_date_show($value->valid_to); ?></td> <td class=" "><?php echo my_date_show($value->valid_to); ?></td>
<td class=" "><?php echo day_different($value->valid_to)." days left"; ?></td> <td class=" "><?php echo day_different($value->valid_to)." days left"; ?></td>
<td class=" "><?php echo $value->description; ?></td> <td class=" "><?php echo $value->description; ?></td>
<?php if(user()->action_permit != 'view' ) { ?>
<td> <td>
&nbsp; &nbsp;
<a class="asset_insurance" id="<?php echo md5($value->id); ?>" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;"> <a class="asset_insurance" id="<?php echo md5($value->id); ?>" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;">
@ -205,6 +219,7 @@
&nbsp; &nbsp;
<a href="<?php echo base_url()?>Asset/deleteAssetInsurance/<?php echo md5($value->id)."_".$value->asset_id;?>" style="font-size: 16px;"><i class="fa fa-trash"></i></a> <a 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> </td>
<?php } ?>
</tr> </tr>
<?php } ?> <?php } ?>
</tbody> </tbody>
@ -216,8 +231,10 @@
<div class="tab-pane fade" id="asset_image" role="tabpanel" aria-labelledby="asset_image-tab"> <div class="tab-pane fade" id="asset_image" role="tabpanel" aria-labelledby="asset_image-tab">
<ul class="nav navbar-right panel_toolbox"> <ul class="nav navbar-right panel_toolbox">
<?php if(user()->action_permit != 'view' ) { ?>
<a type="button" class="asset_image" id="<?php echo $asset_id; ?>" data-toggle="modal" data-target=".bs-example-modal-sm" style=" text-align: center; font-size: 25px; color:#2A3F54; "> <a type="button" class="asset_image" id="<?php echo $asset_id; ?>" data-toggle="modal" data-target=".bs-example-modal-sm" style=" text-align: center; font-size: 25px; color:#2A3F54; ">
<li class="fa fa-plus-circle"></li></a> <li class="fa fa-plus-circle"></li></a>
<?php } ?>
</ul> </br> </br> </ul> </br> </br>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">

View File

@ -101,8 +101,7 @@
<div class="item form-group"> <div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Notes </label> <label class="control-label col-md-1 col-sm-1 " for="first-name"> Notes </label>
<div class="col-md-11 col-sm-11 "> <div class="col-md-11 col-sm-11 ">
<textarea id="notes" name="notes" value="<?php echo $editData->notes; ?>" class="form-control" type="text" <?php if(isset($viewData)) { echo "readonly"; } ?>></textarea> <textarea id="notes" name="notes" class="form-control" type="text" <?php if(isset($viewData)) { echo "readonly"; } ?> ><?php echo $editData->notes; ?></textarea></div>
</div>
</div> </div>
<br /> <h6>Order Related Information</h6> <div class="x_title"> </div> <br /> <br /> <h6>Order Related Information</h6> <div class="x_title"> </div> <br />
@ -159,13 +158,21 @@
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Main Image </label> <label class="control-label col-md-1 col-sm-1 " for="first-name"> Main Image </label>
<div class="col-md-5 col-sm-5 "> <div class="col-md-5 col-sm-5 ">
<?php if(isset($viewData)) { if($editData->asset_img == null || $editData->asset_img == '') { ?> <?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"> <img src="<?php echo base_url(); ?>assets/uploads/defauld-img.jpg" width="180" height="150">
<?php } else {?> <?php } else {?>
<img src="<?php echo base_url(); ?>assets/uploads/<?php echo $editData->asset_img; ?>" width="180" height="150"> <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" > <input id="formFile" name="asset_img" class="typeFile" type="file" >
<?php }?>
<?php 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 id="image" src="<?php echo base_url(); ?>assets/uploads/<?php echo $editData->asset_img; ?>" width="180" height="150">
<?php } } ?>
</div> </div>
@ -211,3 +218,27 @@
</div> </div>
</div> </div>
<!-- /Body page content --> <!-- /Body page content -->
<script>
$(document).on('change','#formFile',function(){
const file = this.files[0];
if (file){
let reader = new FileReader();
reader.onload = function(event){
$('#image').attr('src', event.target.result);
}
reader.readAsDataURL(file);
}
});
// $(document).ready(function(){
// $("#formFile").change(function(){
// $(".btn-success").click();
// });
// });
</script>

View File

@ -100,7 +100,7 @@ public function create_business()
$test = $this->audit->create_history('insert'); $test = $this->audit->create_history('insert');
} }
//print_r($create_business); die(); //print_r($create_business); die();
$create_business = 3; // $create_business = 3;
if($add_admin == 1) if($add_admin == 1)
{ {
redirect('user/addUser/'.$create_business); redirect('user/addUser/'.$create_business);

View File

@ -111,7 +111,7 @@
$date1 = new DateTime($value->valid_to); //current date or any date $date1 = new DateTime($value->valid_to); //current date or any date
$date2 = new DateTime(date('d-m-Y')); //Future date $date2 = new DateTime(date('d-m-Y')); //Future date
$diff = $date2->diff($date1)->format("%a"); //find difference $diff = $date2->diff($date1)->format("%a"); //find difference
$days = - intval($diff); //rounding days $days = "Expired"; //rounding days
$days_count = 100; $days_count = 100;
//it return 365 days omitting current day //it return 365 days omitting current day
} }
@ -143,7 +143,14 @@
</div> </div>
</div> </div>
<div class="w_right w_20"> <div class="w_right w_20">
<span style="font-size:15px"><?php echo $days,' days'?></span> <?php if ($days == 'Expired') { ?>
<span style="font-size:15px"><?php echo $days?></span>
<?php
} else { ?>
<span style="font-size:15px"><?php echo $days,' days'?></span> <?php
}
// <span style="font-size:15px"><?php echo $days,' days'?></span>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
@ -196,7 +203,7 @@
$date1 = new DateTime($value->valid_to); //current date or any date $date1 = new DateTime($value->valid_to); //current date or any date
$date2 = new DateTime(date('d-m-Y')); //Future date $date2 = new DateTime(date('d-m-Y')); //Future date
$diff = $date2->diff($date1)->format("%a"); //find difference $diff = $date2->diff($date1)->format("%a"); //find difference
$days = - intval($diff); //rounding days $days = "Expired";
$days_count = 100; $days_count = 100;
//it return 365 days omitting current day //it return 365 days omitting current day
} }
@ -228,7 +235,12 @@
</div> </div>
</div> </div>
<div class="w_right w_20"> <div class="w_right w_20">
<span style="font-size:15px"><?php echo $days,' days'?></span> <?php if ($days == 'Expired') { ?>
<span style="font-size:15px"><?php echo $days?></span>
<?php
} else { ?>
<span style="font-size:15px"><?php echo $days,' days'?></span> <?php
} ?>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>

View File

@ -53,7 +53,9 @@
<li><a><i class="fa fa-university"></i> Assets <span class="fa fa-chevron-down"></span></a> <li><a><i class="fa fa-university"></i> Assets <span class="fa fa-chevron-down"></span></a>
<ul class="nav child_menu"> <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/assetList">Assets List</a></li>
<?php if(user()->action_permit != 'view' ) { ?>
<li><a href="<?php echo base_url();?>asset/addAsset">Add Asset</a></li> <li><a href="<?php echo base_url();?>asset/addAsset">Add Asset</a></li>
<?php } ?>
</ul> </ul>
</li> </li>
<?php } ?> <?php } ?>
@ -66,11 +68,13 @@
</li> </li>
<?php } ?> <?php } ?>
<?php if(check_auth() && is_admin() || is_superadmin() ) { ?> <?php if(check_auth() && is_admin() || is_superadmin() || is_user() ) { ?>
<li><a><i class="fa fa-user"></i> Users <span class="fa fa-chevron-down"></span></a> <li><a><i class="fa fa-user"></i> Users <span class="fa fa-chevron-down"></span></a>
<ul class="nav child_menu"> <ul class="nav child_menu">
<li><a href="<?php echo base_url();?>user/userList">Users List</a></li> <li><a href="<?php echo base_url();?>user/userList">Users List</a></li>
<?php if(user()->action_permit != 'view' ) { ?>
<li><a href="<?php echo base_url();?>user/addUser">Add Users</a></li> <li><a href="<?php echo base_url();?>user/addUser">Add Users</a></li>
<?php } ?>
</ul> </ul>
</li> </li>
<?php } ?> <?php } ?>

View File

@ -46,7 +46,7 @@ public function userList()
if (is_superadmin()) { if (is_superadmin()) {
$user_list = $this->user_model->get_admin(); $user_list = $this->user_model->get_admin();
} }
else if(is_admin()) { else if(is_admin() || is_user()) {
$user_list = $this->user_model->get_user( md5(user()->id) , user()->business_id); $user_list = $this->user_model->get_user( md5(user()->id) , user()->business_id);
} }
$this->layout->set('tableData', $user_list); $this->layout->set('tableData', $user_list);
@ -203,11 +203,15 @@ public function check_password()
$data['password'] = hash_password($this->input->post('password')); $data['password'] = hash_password($this->input->post('password'));
$table="users"; $table="users";
$userData = $this->MY_Model->edit_option($data, user()->id, $table); $userData = $this->MY_Model->edit_option($data, user()->id, $table);
$this->session->sess_destroy(); // $this->session->sess_destroy();
echo "success"; $data1['status'] = 'success';
$data1['csrf_hash'] = $this->security->get_csrf_hash();
echo json_encode($data1);
} }
else{ else{
echo "fail"; $data['status'] = 'failed';
$data['csrf_hash'] = $this->security->get_csrf_hash();
echo json_encode($data);
} }
} }

View File

@ -17,8 +17,9 @@ public function get_user($id , $business_id)
public function get_admin() public function get_admin()
{ {
$this->db->select('*'); $this->db->select('a.* , business.business_name as business');
$this->db->from('users'); $this->db->from('users a');
$this->db->join('business', 'business.uid = a.business_id', 'left');
$this->db->where('role !=', 'sadmin'); $this->db->where('role !=', 'sadmin');
// $this->db->order_by('id','ASC'); // $this->db->order_by('id','ASC');
$query = $this->db->get(); $query = $this->db->get();

View File

@ -90,7 +90,7 @@
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Email<a style="color:red;">*</a> </label> <label class="control-label col-md-1 col-sm-1 " for="last-name"> Email<a style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 "> <div class="col-md-5 col-sm-5 ">
<input type="text" id="email" name="email" value="" required="required" class="form-control "> <input type="email" id="email" name="email" value="" required="required" class="form-control ">
</div> </div>
</div> </div>
@ -99,7 +99,8 @@
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Mobile<a style="color:red;">*</a> </label> <label class="control-label col-md-1 col-sm-1 " for="first-name"> Mobile<a style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 "> <div class="col-md-5 col-sm-5 ">
<input type="text" id="mobile" name="mobile" value="" required="required" class="form-control "> <input type="text" pattern="[7-9]{1}[0-9]{9}"
title="Phone number with 7-9 and remaing 9 digit with 0-9" id="mobile" name="mobile" value="" required="required" class="form-control ">
</div> </div>
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Permission<a style="color:red;">*</a> </label> <label class="control-label col-md-1 col-sm-1 " for="last-name"> Permission<a style="color:red;">*</a> </label>
@ -124,7 +125,7 @@
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Password<a style="color:red;">*</a> </label> <label class="control-label col-md-1 col-sm-1 " for="last-name"> Password<a style="color:red;">*</a> </label>
<div class="col-md-3 col-sm-3 "> <div class="col-md-3 col-sm-3 ">
<input type="password" id="password" name="password" value="" required="required" class="form-control " title="password must have alphabets &#013;password requires 6 characters minimum"> <input type="password" id="password" minlength="8" name="password" value="" required="required" class="form-control " title="password must have alphabets &#013;password requires 6 characters minimum">
<span toggle="#password" id="toggle-password" class="fa fa-fw fa-eye field-icon toggle-password"></span> <span toggle="#password" id="toggle-password" class="fa fa-fw fa-eye field-icon toggle-password"></span>
</div> </div>
@ -149,7 +150,7 @@
<div class="ln_solid"></div> <div class="ln_solid"></div>
<div class="item form-group"> <div class="item form-group">
<div class="col-md-3 col-sm-3 offset-md-9"> <div class="offset-md-8">
<button class="btn btn-secondary" onclick="history.back()">Cancel</button> <button class="btn btn-secondary" onclick="history.back()">Cancel</button>
<button class="btn btn-primary" type="reset">Reset</button> <button class="btn btn-primary" type="reset">Reset</button>
<button type="submit" class="btn btn-success">Submit</button> <button type="submit" class="btn btn-success">Submit</button>

View File

@ -45,7 +45,7 @@
<label class="control-label col-md-1 col-sm-1 " for="last-name"> New Password </label> <label class="control-label col-md-1 col-sm-1 " for="last-name"> New Password </label>
<div class="col-md-5 col-sm-5 "> <div class="col-md-5 col-sm-5 ">
<input type="password" id="password" name="password" value="" required="required" class="form-control " title="password must have alphabets &#013;password requires 6 characters minimum"> <input type="password" id="password" minlength="8" name="password" value="" required="required" class="form-control " title="password must have alphabets &#013;password requires 6 characters minimum">
<span toggle="#password" id="toggle-password" class="fa fa-fw fa-eye field-icon toggle-password"></span> <span toggle="#password" id="toggle-password" class="fa fa-fw fa-eye field-icon toggle-password"></span>
</div> </div>
@ -68,7 +68,7 @@
<div class="ln_solid"></div> <div class="ln_solid"></div>
<div class="item form-group"> <div class="item form-group">
<div class="col-md-3 col-sm-3 offset-md-9"> <div class="offset-md-8">
<button class="btn btn-secondary" onclick="history.back()">Cancel</button> <button class="btn btn-secondary" onclick="history.back()">Cancel</button>
<button class="btn btn-primary" type="reset">Reset</button> <button class="btn btn-primary" type="reset">Reset</button>
<button type="" id="submit" class="btn btn-success">Submit</button> <button type="" id="submit" class="btn btn-success">Submit</button>
@ -90,3 +90,32 @@
</div> </div>
</div> </div>
<!-- /Body page content --> <!-- /Body page content -->
<script>
console.log($("#change-pass").serialize());
$(document).on('click','#submit',function(){
var data = $("#change-pass").serialize();
$.ajax({
type: "post",
url: "<?php echo base_url();?>user/check_password",
data: data,
json: true,
success: function(response) {
response = jQuery.parseJSON(response);
if (response.status == "success") {
console.log("ssssssssss");
$('input[name=csrf_test_name]').val(response.csrf_hash);
location.href = "<?php echo base_url();?>auth/logout";
}
else {
$('input[name=csrf_test_name]').val(response.csrf_hash);
$('#message1').html('Worng password').css('color', 'red');
$('#password').val('');
$('#confirm_password').val('');
$('#message').html('');
}
},
error: function(jqXHR, textStatus, err) { alert('text status '+textStatus+', err '+err) }
});
});
</script>

View File

@ -6,7 +6,9 @@
<div class="x_title"> <div class="x_title">
<h2>User Details </h2> <h2>User Details </h2>
<ul class="nav navbar-right panel_toolbox"> <ul class="nav navbar-right panel_toolbox">
<?php if(user()->action_permit != 'view' ) { ?>
<a href="<?php echo base_url();?>user/addUser" class="btn btn-sm btn-primary">Add User</a> <a href="<?php echo base_url();?>user/addUser" class="btn btn-sm btn-primary">Add User</a>
<?php } ?>
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li> <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
</ul> </ul>
<div class="clearfix"></div> <div class="clearfix"></div>
@ -18,6 +20,10 @@
<thead> <thead>
<tr class="headings"> <tr class="headings">
<th class="column-title">Name </th> <th class="column-title">Name </th>
<?php if (is_superadmin()) { ?>
<th class="column-title">Company </th>
<?php
} ?>
<th class="column-title">Email </th> <th class="column-title">Email </th>
<th class="column-title">Mobile </th> <th class="column-title">Mobile </th>
<th class="column-title" >Role </th> <th class="column-title" >Role </th>
@ -29,17 +35,23 @@
<?php foreach ($tableData as $key => $value) { ?> <?php foreach ($tableData as $key => $value) { ?>
<tr class="even pointer"> <tr class="even pointer">
<td class=" "> <?php echo $value->name; ?> </td> <td class=" "> <?php echo $value->name; ?> </td>
<?php if (is_superadmin()) { ?>
<td class=" "> <?php echo $value->business ?> </td>
<?php
} ?>
<td class=" "><?php echo $value->email; ?> </td> <td class=" "><?php echo $value->email; ?> </td>
<td class=" "><?php echo $value->mobile; ?></td> <td class=" "><?php echo $value->mobile; ?></td>
<td class=" "><?php echo $value->role; ?></td> <td class=" "><?php echo $value->role; ?></td>
<td class=" "><?php echo $value->action_permit; ?></td> <td class=" "><?php echo $value->action_permit; ?></td>
<td style=" text-align: center; font-size: 16px;"> <td style=" text-align: center; font-size: 16px;">
<?php if ($value->is_active == 1) { ?> <?php if ($value->is_active == 1) { ?>
<?php if(user()->action_permit != 'view' ) { ?>
<a href="<?php echo base_url()?>user/editUser/<?php echo md5($value->id);?>" ><i class="fa fa-pencil"></i></a> <a href="<?php echo base_url()?>user/editUser/<?php echo md5($value->id);?>" ><i class="fa fa-pencil"></i></a>
&nbsp; &nbsp;
<a href="<?php echo base_url()?>user/deleteUser/<?php echo md5($value->id);?>" > <a href="<?php echo base_url()?>user/deleteUser/<?php echo md5($value->id);?>" >
<i class="#008000 fa fa-check-circle" style="font-size:20px;" title="deactivate"></i></a> <i class="#008000 fa fa-check-circle" style="font-size:20px;" title="deactivate"></i></a>
&nbsp; &nbsp;
<?php } ?>
<a> <i id="<?php echo md5($value->id);?>" class="bi bi-card-list" title="History"></i></a> <a> <i id="<?php echo md5($value->id);?>" class="bi bi-card-list" title="History"></i></a>
<?php } ?> <?php } ?>
<?php if ($value->is_active == 0) { ?> <?php if ($value->is_active == 0) { ?>

View File

@ -172,27 +172,33 @@ $(document).on('click','.asset_value_history',function(){
// show error msg for wrong password => file name : user/change_password.php // show error msg for wrong password => file name : user/change_password.php
$(document).on('click','#submit',function(){ // $(document).on('click','#submit',function(){
var data = $("#change-pass").serialize(); // var data = $("#change-pass").serialize();
$.ajax({ // $.ajax({
type: "post", // type: "post",
url: "<?php echo base_url();?>user/check_password", // url: "<?php echo base_url();?>user/check_password",
data: data, // data: data,
json: true, // json: true,
success: function(response) { // success: function(response) {
if (response === "success") { // console.log("aaaaaaa");
// location.href = "<?php echo base_url();?>auth"; // response = jQuery.parseJSON(response);
} // if (response.status === "success") {
else { // // location.href = "<?php echo base_url();?>auth";
$('#message1').html('Worng password').css('color', 'red'); // response = jQuery.parseJSON(response);
$('#password').val(''); // $('input[name=csrf_test_name]').val(response.csrf_hash);
$('#confirm_password').val(''); // }
$('#message').html(''); // else {
} // console.log("aaaaaaa");
}, // $('input[name=csrf_test_name]').val(response.csrf_hash);
error: function(jqXHR, textStatus, err) { alert('text status '+textStatus+', err '+err) } // $('#message1').html('Worng password').css('color', 'red');
}); // $('#password').val('');
}); // $('#confirm_password').val('');
// $('#message').html('');
// }
// },
// error: function(jqXHR, textStatus, err) { alert('text status '+textStatus+', err '+err) }
// });
// });
// hide err msg when the input is empty => file name : user/change_password.php , label name : Old Password // hide err msg when the input is empty => file name : user/change_password.php , label name : Old Password
$('#old_password').on('keyup', function () { $('#old_password').on('keyup', function () {

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 437 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 852 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB