140 lines
5.7 KiB
PHP
140 lines
5.7 KiB
PHP
<link href="<?=base_url();?>bassets/select2/css/select2.css" rel="stylesheet" type="text/css" />
|
|
<link href="<?=base_url();?>bassets/select2/css/select2-bootstrap.min.css" rel="stylesheet" type="text/css" />
|
|
|
|
<?php $this->load->view('admin/includes/header');?>
|
|
<div class="page-container">
|
|
<?php $this->load->view('admin/includes/sidebar');?>
|
|
<!-- start page content -->
|
|
<div class="page-content-wrapper">
|
|
<div class="page-content">
|
|
<div class="page-bar">
|
|
<div class="page-title-breadcrumb">
|
|
<div class=" pull-left">
|
|
<div class="page-title">Staff Edit</div>
|
|
</div>
|
|
<ol class="breadcrumb page-breadcrumb pull-right">
|
|
<li><i class="fa fa-home"></i> <a class="parent-item" href="index.html">Home</a> <i class="fa fa-angle-right"></i>
|
|
</li>
|
|
<li><a class="parent-item" href="<?=base_url();?>admin/Staff">Staff</a> <i class="fa fa-angle-right"></i>
|
|
</li>
|
|
<li class="active">Staff Edit</li>
|
|
</ol>
|
|
</div>
|
|
</div>
|
|
<?php $this->load->view('admin/includes/msg');?>
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="card card-topline-orange">
|
|
<div class="white-box">
|
|
<div class="card card-box">
|
|
<div class="card-head">
|
|
<header>Edit Staff</header>
|
|
|
|
</div>
|
|
<?php
|
|
if(isset($staff)&& $staff->num_rows()>0)
|
|
{
|
|
$s=$staff->row();
|
|
$id=$s->id;
|
|
$name=$s->name;
|
|
$roles=$s->role;
|
|
$mobile=$s->mobile;
|
|
$rolename=$s->rolename;
|
|
$email=$s->email;
|
|
$username=$s->username;
|
|
$password=$s->password;
|
|
}?>
|
|
<div class="card-body ">
|
|
<?=form_open_multipart(base_url().'admin/edit-staff/'.$id);?>
|
|
<div class="row">
|
|
<div class="form-group col-md-6">
|
|
<label for="simpleFormEmail"> Name <span class="required">*</span></label>
|
|
<input type="text" value="<?=$name;?>" name="Name" autocomplete="off" class="form-control" data-validation="required" placeholder="Name">
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label for="simpleFormEmail"> Role <span class="required">*</span></label>
|
|
<select name="Role" autocomplete="off" class="select2 form-control" data-validation="required" placeholder="Role">
|
|
<option value="" >Select</option>
|
|
<?php if(isset($role)&& $role->num_rows()>0)
|
|
{ foreach($role->result() as $r)
|
|
{ $rid=$r->id;
|
|
$name=$r->name;
|
|
?>
|
|
<option value="<?=$rid;?>" <?php if($rid==$roles){ echo "selected"; }?> ><?=$name;?></option> <?php }} ?>
|
|
|
|
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="form-group col-md-6">
|
|
<label for="simpleFormEmail"> Mobile <span class="required">*</span></label>
|
|
<input type="text" value="<?=$mobile;?>" name="Mobile" autocomplete="off" class="form-control" data-validation="number length" data-validation-length="10" placeholder="Mobile">
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label for="simpleFormEmail"> Email <span class="required">*</span></label>
|
|
<input type="text" name="Email" value="<?=$email;?>" autocomplete="off" class="form-control" data-validation="required" placeholder="Email">
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="checkbox checkbox-orange">
|
|
<input id="checkboxbg4" type="checkbox" name="loginvalue" <?php if($username!="" && $password!=""){ ?> checked<?php } ?> >
|
|
<label for="checkboxbg4" style="font-weight:900;color:#ef7f1a;">
|
|
Give login credentials
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="logindiv" <?php if($username!="" && $password!=""){ ?> style="display:block" <?php } ?> >
|
|
<div class="row" >
|
|
<div class="form-group col-md-6">
|
|
<label for="simpleFormEmail"> username <span class="required">*</span></label>
|
|
<input type="text" name="username" value="<?=$username;?>" autocomplete="off" class="form-control" data-validation="required" placeholder="Username">
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label for="simpleFormEmail"> password </label>
|
|
<input type="password" name="password" autocomplete="off" class="form-control" placeholder="Password">
|
|
<input type="hidden" name="old_pass" value="<?=$password;?>">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<input type="submit" name="addstaff" class="btn btn-primary" value="Submit">
|
|
<?=form_close();?>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<?php $this->load->view('admin/includes/footer');?>
|
|
<script type="text/javascript" src="<?=base_url();?>bassets/admin/js/jquery.cookie.min.js"></script>
|
|
<!--select2-->
|
|
<script src="<?=base_url();?>bassets/select2/js/select2.js"></script>
|
|
<script src="<?=base_url();?>bassets/select2/js/select2-init.js"></script>
|
|
<script>
|
|
var base_path=$('body').attr('data-path');
|
|
|
|
$('input[type="checkbox"]').click(function(){
|
|
|
|
if($(this).prop("checked") == true){
|
|
$("#checkboxbg4").val(1);
|
|
$("#logindiv").css("display","block");
|
|
}
|
|
else if($(this).prop("checked") == false){
|
|
$("#checkboxbg4").val(0);
|
|
$("#logindiv").css("display","none");
|
|
}
|
|
|
|
|
|
});
|
|
|
|
</script>
|