143 lines
6.4 KiB
PHP
143 lines
6.4 KiB
PHP
<!-- Body page content -->
|
|
|
|
|
|
|
|
<div class="">
|
|
<div class="page-title">
|
|
|
|
<div class="title_left">
|
|
<h3>Edit User</h3>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
<div class="clearfix"></div>
|
|
<div class="row">
|
|
<div class="col-md-12 col-sm-12 ">
|
|
<div class="x_panel">
|
|
<!-- <div class="x_title"> -->
|
|
|
|
<!-- <ul class="nav navbar-right panel_toolbox">
|
|
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
|
|
</li>
|
|
</ul> -->
|
|
<!-- <h6>General Information</h6> -->
|
|
<!-- <div class="clearfix"></div> -->
|
|
<!-- </div> -->
|
|
<div class="x_content">
|
|
<br />
|
|
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post"
|
|
action="<?php echo base_url();?>User/editUsers" enctype="multipart/form-data">
|
|
|
|
<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 echo $editData->id; ?>">
|
|
<!-- --------------------------- -->
|
|
<div class="item form-group">
|
|
|
|
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Name </label>
|
|
<div class="col-md-5 col-sm-5 ">
|
|
<input type="text" id="name" name="name" value="<?php echo $editData->name; ?>"
|
|
required="required" class="form-control ">
|
|
</div>
|
|
|
|
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Email </label>
|
|
<div class="col-md-5 col-sm-5 ">
|
|
<input type="email" id="email" name="email" value="<?php echo $editData->email; ?>"
|
|
required="required" class="form-control" onkeyup="check_if_exists(this.id, this.value, this.name)">
|
|
</div>
|
|
|
|
</div>
|
|
<!-- --------------------------- -->
|
|
<div class="item form-group">
|
|
|
|
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Mobile </label>
|
|
<div class="col-md-5 col-sm-5 ">
|
|
<input type="text" pattern="[6-9]{1}[0-9]{9}"
|
|
title="Phone number with 6-9 and remaing 9 digit with 0-9" id="mobile" name="mobile"
|
|
value="<?php echo $editData->mobile; ?>" required="required" class="form-control" onkeyup="check_if_exists(this.id, this.value, this.name)">
|
|
</div>
|
|
|
|
<label class="control-label col-md-1 col-sm-1 " for="last-name">Permission </label>
|
|
<div class="col-md-5 col-sm-5 ">
|
|
<select id="action_permit" name="action_permit" required="required"
|
|
class="form-control">
|
|
<option value="<?php echo $editData->action_permit; ?>">
|
|
<?php echo $editData->action_permit; ?></option>
|
|
<?php
|
|
if ($editData->action_permit == "all") {
|
|
?>
|
|
<option value="view">view</option>
|
|
<?php
|
|
}
|
|
else{
|
|
?>
|
|
<option value="all">all</option>
|
|
<?php
|
|
}
|
|
?>
|
|
</select>
|
|
</div>
|
|
|
|
</div>
|
|
<!-- --------------------------- -->
|
|
<div class="item form-group">
|
|
|
|
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Username </label>
|
|
<div class="col-md-5 col-sm-5 ">
|
|
<input type="text" id="user_name" name="user_name"
|
|
value="<?php echo $editData->user_name; ?>" required="required"
|
|
class="form-control" onkeyup="check_if_exists(this.id, this.value, this.name)">
|
|
</div>
|
|
|
|
<label class="control-label col-md-1 col-sm-1 " for="last-name" hidden> Password </label>
|
|
<div class="col-md-5 col-sm-5 ">
|
|
<input type="hidden" minlength="8" id="password" name="password"
|
|
value="<?php echo $editData->password; ?>" required="required"
|
|
class="form-control ">
|
|
</div>
|
|
|
|
</div>
|
|
<!-- --------------------------- -->
|
|
|
|
|
|
<div class="ln_solid"></div>
|
|
<div class="item form-group">
|
|
<div class="col-md-6 col-sm-6 offset-md-10">
|
|
<button class="btn btn-primary" onclick="history.back()">Cancel</button>
|
|
<button type="submit" class="btn btn-success">Update</button>
|
|
</div>
|
|
</div>
|
|
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script>
|
|
function check_if_exists(id, value, name) {
|
|
// alert(name);
|
|
// var data = $(this).val();
|
|
$.ajax({
|
|
type:"get",
|
|
url: "<?php echo base_url(); ?>User/checkUniqueValue",
|
|
data: { value: value, name: name },
|
|
success:function(response)
|
|
{
|
|
if (response == true)
|
|
{
|
|
new PNotify({
|
|
title: 'Warning',
|
|
text: 'That given details Already Exists',
|
|
styling: 'bootstrap3'
|
|
});
|
|
$("#"+id).val('');
|
|
|
|
}
|
|
}
|
|
});
|
|
}
|
|
</script>
|