suseendhiran
This commit is contained in:
parent
19e7344dc8
commit
a159682e2f
@ -53,8 +53,8 @@ public function addUser($id='empty')
|
||||
{
|
||||
if($id != 'empty')
|
||||
{
|
||||
$assetData = $this->Asset_model->get_asset_by_md5_id($id,user()->business_id);
|
||||
$this->layout->set('assetData', $assetData);
|
||||
$userData = $this->Asset_model->get_asset_by_md5_id($id,user()->business_id);
|
||||
$this->layout->set('assetData', $userData);
|
||||
}
|
||||
|
||||
$this->layout->buffer('main_content', 'User/add_user');
|
||||
@ -67,7 +67,7 @@ public function createUser()
|
||||
$data=$this->input->post();
|
||||
$data['business_id'] = user()->business_id;
|
||||
$data['created_by'] = user()->id;
|
||||
$data['role'] = "user";
|
||||
// $data['role'] = "user";
|
||||
unset($data['confirm_password']);
|
||||
$data['password'] = hash_password($this->input->post('password'));
|
||||
$table="users";
|
||||
|
||||
@ -6,8 +6,9 @@ public function get_user($business_id)
|
||||
$this->db->select('*');
|
||||
$this->db->from('users');
|
||||
$this->db->where('business_id', $business_id);
|
||||
$this->db->where('role', 'user');
|
||||
$this->db->where('is_active', 1);
|
||||
// $this->db->where('role', 'admin');
|
||||
// $this->db->where('role', 'user');
|
||||
// $this->db->where('is_active', 1);
|
||||
$query = $this->db->get();
|
||||
$query = $query->result();
|
||||
return $query;
|
||||
|
||||
@ -3,6 +3,16 @@
|
||||
<head>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
|
||||
</head>
|
||||
<style>
|
||||
.field-icon {
|
||||
float: right;
|
||||
margin-left: -25px;
|
||||
margin-top: -25px;
|
||||
margin-right: 10px;
|
||||
position: relative;
|
||||
z-index: 3;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<div class="">
|
||||
@ -63,6 +73,14 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- <label class="control-label col-md-1 col-sm-1 " for="last-name" hidden>Role </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<select id="role" name="role" required="required" class="form-control" hidden>
|
||||
<option value="admin">Admin</option>
|
||||
<option value="user">User</option>
|
||||
</select>
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
<!-- --------------------------- -->
|
||||
<div class="item form-group">
|
||||
@ -74,36 +92,46 @@
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Password </label>
|
||||
<div class="col-md-3 col-sm-3 ">
|
||||
<input type="text" id="password" name="password" value="" required="required" class="form-control ">
|
||||
<input type="password" id="password" name="password" value="" required="required" class="form-control " title="password must have alphabets 
password requires 6 characters minimum">
|
||||
<span toggle="#password" class="fa fa-fw fa-eye field-icon toggle-password"></span>
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Confirm Password </label>
|
||||
<div class="col-md-3 col-sm-3 ">
|
||||
<input type="text" id="confirm_password" name="confirm_password" value="" required="required" class="form-control ">
|
||||
<input type="password" id="confirm_password" name="confirm_password" value="" required="required" class="form-control ">
|
||||
<span id='message'></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- --------------------------- -->
|
||||
<!-- <div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Confirm Password </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="text" id="confirm_password" name="confirm_password" value="" required="required" class="form-control ">
|
||||
<span id='message'></span>
|
||||
</div>
|
||||
|
||||
</div> -->
|
||||
<!-- --------------------------- -->
|
||||
|
||||
|
||||
<script>
|
||||
$('#password, #confirm_password').on('keyup', function () {
|
||||
// match the password and confirm password equal or not
|
||||
$('#password, #confirm_password').on('keyup', function () {
|
||||
$(':input[type="submit"]').prop('disabled', true);
|
||||
if ($('#password').val() == $('#confirm_password').val() && $('#confirm_password').val().length > 0 ) {
|
||||
$('#message').html('Matching').css('color', 'green');
|
||||
} else
|
||||
$('button[type="submit"]').attr("disabled", false);
|
||||
}
|
||||
else if($('#password').val().length == 0 || $('#confirm_password').val().length == 0){
|
||||
$('#message').html('');
|
||||
}
|
||||
else
|
||||
$('#message').html('Not Matching').css('color', 'red');
|
||||
});
|
||||
|
||||
// password eye icon
|
||||
$(".toggle-password").click(function() {
|
||||
$(this).toggleClass("fa-eye fa-eye-slash");
|
||||
var input = $($(this).attr("toggle"));
|
||||
if (input.attr("type") == "password") {
|
||||
input.attr("type", "text");
|
||||
}
|
||||
else {
|
||||
input.attr("type", "password");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@ -1,83 +1,54 @@
|
||||
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
<h2>User Details </h2>
|
||||
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<a href="<?php echo base_url();?>user/addUser" class="btn btn-sm btn-primary">Add User</a>
|
||||
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="x_content">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
|
||||
|
||||
<table id="datatable" class="table table-striped table-bordered" width="100%">
|
||||
<thead>
|
||||
<tr class="headings">
|
||||
|
||||
|
||||
<th class="column-title">Name </th>
|
||||
<th class="column-title">Email </th>
|
||||
<th class="column-title">Mobile </th>
|
||||
<!-- <th class="column-title">Serial </th>
|
||||
<th class="column-title">Model </th>
|
||||
<th class="column-title">Category </th>
|
||||
<th class="column-title">Status </th> -->
|
||||
<!-- <th class="column-title">Notes </th>
|
||||
<th class="column-title">Warranty </th>
|
||||
<th class="column-title">Order No </th>
|
||||
<th class="column-title">Purchase Date </th>
|
||||
<th class="column-title">Supplier </th>
|
||||
<th class="column-title">Cost </th>
|
||||
<th class="column-title">Location </th> -->
|
||||
<th class="column-title" >Action </th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
<?php foreach ($tableData as $key => $value) { ?>
|
||||
<tr class="even pointer">
|
||||
|
||||
|
||||
<td class=" "> <?php echo $value->name; ?> </td>
|
||||
<td class=" "><?php echo $value->email; ?> </td>
|
||||
<td class=" "><?php echo $value->mobile; ?></td>
|
||||
<!-- <td class=" "><?php echo $value->serial; ?></td>
|
||||
<td class=" "><?php echo $value->model; ?></td>
|
||||
<td class=" "><?php echo $value->category_name; ?></td>
|
||||
<td class=" "><?php echo $value->status; ?></td> -->
|
||||
<!--<td class=" "><?php echo $value->notes; ?> </td>
|
||||
<td class=" "><?php echo $value->warranty; ?> </td>
|
||||
<td class=" "><?php echo $value->order_no; ?></td>
|
||||
<td class=" "><?php echo $value->purchase_date; ?></td>
|
||||
<td class=" "><?php echo $value->supplier_name; ?></td>
|
||||
<td class=" "><?php echo $value->cost; ?></td>
|
||||
<td class=" "><?php echo $value->location_name; ?></td> -->
|
||||
<td style=" text-align: center; font-size: 16px;">
|
||||
<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/deleteAsset/<?php echo md5($value->id);?>" ><i class="fa fa-trash"></i></a>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
<h2>User Details </h2>
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<a href="<?php echo base_url();?>user/addUser" class="btn btn-sm btn-primary">Add User</a>
|
||||
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="x_content">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<table id="datatable" class="table table-striped table-bordered" width="100%">
|
||||
<thead>
|
||||
<tr class="headings">
|
||||
<th class="column-title">Name </th>
|
||||
<th class="column-title">Email </th>
|
||||
<th class="column-title">Mobile </th>
|
||||
<th class="column-title" >Role </th>
|
||||
<th class="column-title" >Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($tableData as $key => $value) { ?>
|
||||
<tr class="even pointer">
|
||||
<td class=" "> <?php echo $value->name; ?> </td>
|
||||
<td class=" "><?php echo $value->email; ?> </td>
|
||||
<td class=" "><?php echo $value->mobile; ?></td>
|
||||
<td class=" "><?php echo $value->role; ?></td>
|
||||
<td style=" text-align: center; font-size: 16px;">
|
||||
<?php if ($value->is_active == 1) { ?>
|
||||
<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/deleteAsset/<?php echo md5($value->id);?>" ><i class="fa fa-trash"></i></a>
|
||||
|
||||
<?php } ?>
|
||||
<?php if ($value->is_active == 0) { ?>
|
||||
<a href ><i class="fa fa-ban"></i></a>
|
||||
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
||||
BIN
assets/uploads/Screenshot_(241).png
Normal file
BIN
assets/uploads/Screenshot_(241).png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 316 KiB |
Loading…
Reference in New Issue
Block a user