Forgot_pass and Delegation : RV
This commit is contained in:
parent
d0af316efd
commit
eb7a8c4afb
BIN
ams_vendor.zip
BIN
ams_vendor.zip
Binary file not shown.
@ -316,4 +316,15 @@ function editBusiness()
|
||||
$this->db->update('business',$data);
|
||||
return true;
|
||||
}
|
||||
|
||||
function checkUniqueValueInDataBase($table, $where, $data){
|
||||
|
||||
// echo $table, $where, $data; die;
|
||||
|
||||
$this->db->select('*');
|
||||
$this->db->from($table);
|
||||
$this->db->where($where, $data);
|
||||
return $this->db->get()->result_array();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,25 +41,22 @@ public function __construct()
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
//echo site_url();
|
||||
// Example
|
||||
if(check_auth())
|
||||
{
|
||||
if(check_auth()){
|
||||
redirect('Dashboard');
|
||||
}else{
|
||||
$this->layout->load_view('Auth/login');
|
||||
}
|
||||
else{
|
||||
$this->layout->load_view('Auth/login');
|
||||
}
|
||||
// $this->load->view('welcome/welcome_message');
|
||||
// $this->load->view('welcome_message');
|
||||
}
|
||||
|
||||
public function authendicate()
|
||||
{
|
||||
$user = $this->auth_model->validate_user();
|
||||
// print_r($user);die();
|
||||
// echo hash_password('password');die();
|
||||
$business = $this->auth_model->validateBusiness($user->business_id);
|
||||
|
||||
if ($user->business_id !== '0' && empty($business)) {
|
||||
$this->session->set_flashdata('msg', "Business Deactivated Contact Administrator");
|
||||
redirect('login');
|
||||
}
|
||||
if (empty($user)) {
|
||||
$this->session->set_flashdata('msg', "username not avaiable");
|
||||
redirect('login');
|
||||
@ -142,61 +139,73 @@ public function lost_your_password()
|
||||
$this->layout->load_view("Auth/otp_verification");
|
||||
}
|
||||
|
||||
public function send__mail(){
|
||||
public function sendMail(){
|
||||
// otp generator
|
||||
$otp = rand ( 1000 , 9999 );
|
||||
$otp = rand(100000, 999999);
|
||||
$data['otp'] = $otp;
|
||||
$mail = $this->input->post('email');
|
||||
$user = $this->auth_model->validate_user();
|
||||
$mail = $this->input->get('email');
|
||||
$where = 'email';
|
||||
$user = $this->auth_model->validateUserForOtp($mail, $where);
|
||||
|
||||
if (empty($user)) {
|
||||
$data['csrf_hash'] = $this->security->get_csrf_hash();
|
||||
$data['status'] = "failed";
|
||||
echo json_encode($data);
|
||||
}
|
||||
else{
|
||||
// $to = "suseendhiran1999@gmail.com"; // $mail
|
||||
// $subject = "OTP";
|
||||
// $message = $otp;
|
||||
// $success_msg = $this->auth_model->send_email($to, $subject, $message);
|
||||
$data['csrf_hash'] = $this->security->get_csrf_hash();
|
||||
$data['status'] = "success";
|
||||
$data['id'] = $user->id;
|
||||
$data['email'] = $mail;
|
||||
|
||||
$id = $user->id;
|
||||
$table="users";
|
||||
$datas['otp'] = $otp;
|
||||
$userData = $this->MY_Model->edit_option($datas, $id, $table);
|
||||
echo json_encode($data);
|
||||
}
|
||||
}
|
||||
|
||||
public function verify_otp(){
|
||||
$generate_otp = $this->input->post('hidden_otp');
|
||||
$user_entered_otp = $this->input->post('otp');
|
||||
$id = $this->input->post('id');
|
||||
if ($generate_otp == $user_entered_otp)
|
||||
{
|
||||
$data['generate_otp'] = $generate_otp;
|
||||
$data['user_entered_otp'] = $user_entered_otp;
|
||||
$data['csrf_hash'] = $this->security->get_csrf_hash();
|
||||
$data['status'] = "success";
|
||||
$data['id'] = $id;
|
||||
$htmlPage = $this->load->view('change_password_form.php',$data,true);
|
||||
$data['htmlPage'] = $htmlPage;
|
||||
echo json_encode($data);
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['csrf_hash'] = $this->security->get_csrf_hash();
|
||||
$data['status'] = "failed";
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
$id = $this->input->post('id');
|
||||
$email = $this->input->post('email');
|
||||
$where = 'id';
|
||||
$user_entered_otp = $this->input->post('otp');
|
||||
$user = $this->auth_model->validateUserForOtp($id, $where);
|
||||
|
||||
|
||||
if ($user->otp == $user_entered_otp)
|
||||
{
|
||||
$data['generate_otp'] = $generate_otp;
|
||||
$data['user_entered_otp'] = $user_entered_otp;
|
||||
$data['csrf_hash'] = $this->security->get_csrf_hash();
|
||||
$data['status'] = "success";
|
||||
$data['id'] = $id;
|
||||
$data['email'] = $email;
|
||||
$id = $id;
|
||||
$table = "users";
|
||||
$datas['otp'] = '';
|
||||
$userData = $this->MY_Model->edit_option($datas, $id, $table);
|
||||
$this->layout->load_view('Auth/change_password_form', $data);
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['csrf_hash'] = $this->security->get_csrf_hash();
|
||||
$data['status'] = "failed";
|
||||
$data['id'] = $id;
|
||||
$data['email'] = $email;
|
||||
$this->layout->load_view("Auth/otp_verification", $data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function change_password()
|
||||
{
|
||||
print_r($this->input->post('id')); die;
|
||||
$id = $this->input->post('id');
|
||||
$id = $this->input->post('id');
|
||||
$data['password'] = hash_password($this->input->post('password'));
|
||||
$table="users";
|
||||
|
||||
$userData = $this->MY_Model->edit_option($data, $id, $table);
|
||||
$table = "users";
|
||||
$userData = $this->MY_Model->edit_option($data, $id, $table);
|
||||
redirect('login');
|
||||
}
|
||||
}
|
||||
|
||||
@ -194,6 +194,41 @@ function validate_user()
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// check valid user
|
||||
function validateUserForOtp($data, $where)
|
||||
{
|
||||
|
||||
$this->db->select('*');
|
||||
$this->db->from('users');
|
||||
$this->db->where($where, $data);
|
||||
$this->db->limit(1);
|
||||
$query = $this->db->get();
|
||||
if($query->num_rows() == 1){
|
||||
return $query->row();
|
||||
}else{
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// check valid Business
|
||||
function validateBusiness($business_id)
|
||||
{
|
||||
|
||||
$this->db->select('*');
|
||||
$this->db->from('business');
|
||||
$this->db->where('is_active', 1);
|
||||
$this->db->where('uid', $business_id);
|
||||
$this->db->limit(1);
|
||||
$query = $this->db->get();
|
||||
if($query->num_rows() == 1){
|
||||
return $query->row();
|
||||
}else{
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// check valid staff
|
||||
|
||||
@ -35,6 +35,20 @@
|
||||
position: relative;
|
||||
z-index: 3;
|
||||
}
|
||||
body {
|
||||
/* Set the background image URL */
|
||||
background-image: url("<?php echo base_url(); ?>assets/appimg/bg-4.jpg") !important;
|
||||
background-position: center !important;
|
||||
background-repeat: no-repeat !important;
|
||||
background-color: rgba(255, 255, 255, 0.7) !important;
|
||||
|
||||
}
|
||||
|
||||
h1,
|
||||
a,
|
||||
p {
|
||||
color: #fff !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<body class="login">
|
||||
@ -42,20 +56,17 @@
|
||||
<div class="animate form login_form">
|
||||
<section class="login_content">
|
||||
<form id="otp-form" data-parsley-validate class="form-horizontal form-label-left" method="post"
|
||||
action="<?php echo base_url();?>auth/change_password" enctype="multipart/form-data">
|
||||
action="<?php echo base_url();?>Auth/change_password" 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" id="id" name="id" value="<?php echo $id ?>">
|
||||
<h1>Change Password</h1>
|
||||
<div>
|
||||
<input type="password" id="password" name="password" class="form-control" placeholder="Password"
|
||||
required="required" />
|
||||
<span toggle="#password" id="toggle-password"
|
||||
class="fa fa-fw fa-eye field-icon toggle-password"></span>
|
||||
<input type="password" id="password" name="password" class="form-control" placeholder="Password" required="required" />
|
||||
<span toggle="#password" id="toggle-password" class="fa fa-fw fa-eye field-icon toggle-password"></span>
|
||||
</div>
|
||||
<div>
|
||||
<input type="password" id="confirm_password" name="confirm_password" class="form-control"
|
||||
placeholder="Confrim Password" required="required" />
|
||||
<input type="password" id="confirm_password" name="confirm_password" class="form-control" placeholder="Confrim Password" required="required" />
|
||||
<p id='message'></p>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
@ -22,10 +22,28 @@
|
||||
|
||||
<!-- Custom Theme Style -->
|
||||
<link href="<?php echo base_url(); ?>/assets/default/build/css/custom.min.css" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
|
||||
body {
|
||||
/* Set the background image URL */
|
||||
background-image: url("<?php echo base_url(); ?>assets/appimg/bg-4.jpg") !important;
|
||||
background-position: center !important;
|
||||
background-repeat: no-repeat !important;
|
||||
background-color: rgba(255, 255, 255, 0.7) !important;
|
||||
|
||||
}
|
||||
h1, a, p {
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="login">
|
||||
|
||||
<body class="login">
|
||||
<p style="background-image: url('<?php echo base_url(); ?>assets/appimg/bg-1.jpg');">
|
||||
<div>
|
||||
<a class="hiddenanchor" id="signup"></a>
|
||||
<a class="hiddenanchor" id="signin"></a>
|
||||
@ -44,20 +62,16 @@
|
||||
<div>
|
||||
<input type="password" class="form-control" value="" name="password" placeholder="Password"
|
||||
required="" />
|
||||
<p id='message' style="color:red"><?php echo $this->session->flashdata('msg'); ?></p>
|
||||
<span id='message' style="color:#fff; font-weight:bolder;"><?php echo $this->session->flashdata('msg'); ?></span>
|
||||
</div>
|
||||
<div>
|
||||
<button type="submit" class="btn btn-primary">Log in</button>
|
||||
<a class="reset_pass" href="<?php echo base_url();?>Auth/lost_your_password">Lost your
|
||||
password?</a>
|
||||
<a class="reset_pass" href="<?php echo base_url();?>Auth/lost_your_password">Lost your password?</a>
|
||||
</div>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<div class="separator">
|
||||
<!-- <p class="change_link">New to site? -->
|
||||
<!-- <a href="<?php echo base_url().'Auth/lost_your_password'?>" class="to_register"> Create Account </a> </p> -->
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<br />
|
||||
|
||||
|
||||
@ -24,6 +24,12 @@
|
||||
|
||||
<!-- Custom Theme Style -->
|
||||
<link href="<?php echo base_url(); ?>/assets/default/build/css/custom.min.css" rel="stylesheet">
|
||||
|
||||
<!-- PNotify -->
|
||||
<link href="<?php echo base_url(); ?>/assets/default/pnotify/dist/pnotify.css" rel="stylesheet">
|
||||
<link href="<?php echo base_url(); ?>/assets/default/pnotify/dist/pnotify.buttons.css" rel="stylesheet">
|
||||
<link href="<?php echo base_url(); ?>/assets/default/pnotify/dist/pnotify.nonblock.css" rel="stylesheet">
|
||||
|
||||
</head>
|
||||
<style>
|
||||
.otp {
|
||||
@ -31,100 +37,120 @@
|
||||
clear: both;
|
||||
float: right;
|
||||
}
|
||||
|
||||
body {
|
||||
/* Set the background image URL */
|
||||
background-image: url("<?php echo base_url(); ?>assets/appimg/bg-4.jpg") !important;
|
||||
background-position: center !important;
|
||||
background-repeat: no-repeat !important;
|
||||
background-color: rgba(255, 255, 255, 0.7) !important;
|
||||
|
||||
}
|
||||
|
||||
h1,
|
||||
a,
|
||||
p {
|
||||
color: #fff !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<body class="login">
|
||||
<div class="login_wrapper">
|
||||
<div class="animate form login_form">
|
||||
<section class="login_content">
|
||||
<form id="otp-form" data-parsley-validate class="form-horizontal form-label-left" method="post"
|
||||
action="" enctype="multipart/form-data">
|
||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>"
|
||||
value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
<form id="otp-form" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Auth/verify_otp" enctype="multipart/form-data">
|
||||
|
||||
<input type="hidden" name="csrf_test_name" value="<?php echo $this->security->get_csrf_hash();?>">
|
||||
<input type="hidden" id="hidden_otp" name="hidden_otp" class="form-control" value="" />
|
||||
<input type="hidden" id="id" name="id" value="">
|
||||
<input type="hidden" id="email1" name="email" value="">
|
||||
<h1>Forgot Password</h1>
|
||||
<!-- <div>
|
||||
<input type="text" class="form-control" placeholder="Username" required="" />
|
||||
</div> -->
|
||||
<div>
|
||||
<a href="#" onclick="send_otp()" class="otp"> Send OTP </a>
|
||||
|
||||
<div>
|
||||
<input type="email" id="email" name="user_name" class="form-control" placeholder="Email"
|
||||
required="required" />
|
||||
<input type="email" id="email" name="user_name" class="form-control" placeholder="Email" required="required" />
|
||||
<p id="span_msg"></p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" id="otp" name="otp" class="form-control" placeholder="OTP"
|
||||
required="required" />
|
||||
<input type="text" id="otp" name="otp" class="form-control" placeholder="OTP" required="required" />
|
||||
<p id="otp_span_msg"></p>
|
||||
</div>
|
||||
<div>
|
||||
<button type="button" class="btn btn-primary">Submit</button>
|
||||
<!-- Button trigger modal -->
|
||||
<!-- <button type="button" class="btn btn-secondary" data-toggle="modal" data-target=".bs-example-modal-sm">
|
||||
Small modal
|
||||
</button> -->
|
||||
<button type="submit" id="submitButton" class="btn btn-primary">Submit</button>
|
||||
<button type="button" id="sendotpbtn" class="btn btn-info" onclick="send_otp(); startTimer(10);" class="otp"> Send OTP </button><p id="timer">Time remaining: 90 seconds</p>
|
||||
</div>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<div class="separator">
|
||||
<!-- <p class="change_link">Already a member ?
|
||||
<a href="<?php echo base_url().'auth/verify_user'?>" class="to_register"> Log in </a>
|
||||
</p> -->
|
||||
<div class="clearfix"></div>
|
||||
<br />
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<br />
|
||||
|
||||
<div>
|
||||
<!-- <h1><i class="fa fa-paw"></i> Gentelella Alela!</h1>
|
||||
<p>©2016 All Rights Reserved. Gentelella Alela! is a Bootstrap 4 template. Privacy and Terms</p> -->
|
||||
<div>
|
||||
<p><?php echo date('Y'). ' ' . "© ". " ".'BigBamboo Enterprise' ;?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="body"></div>
|
||||
|
||||
<!-- PNotify -->
|
||||
<script src="<?php echo base_url(); ?>/assets/default/pnotify/dist/pnotify.js"></script>
|
||||
<script src="<?php echo base_url(); ?>/assets/default/pnotify/dist/pnotify.buttons.js"></script>
|
||||
<script src="<?php echo base_url(); ?>/assets/default/pnotify/dist/pnotify.nonblock.js"></script>
|
||||
|
||||
<script>
|
||||
// $('#otp').hide();
|
||||
$('#submitButton').hide();
|
||||
$('#timer').hide();
|
||||
function send_otp() {
|
||||
if ($('#email').val()) {
|
||||
$('#span_msg').html('');
|
||||
var data = $("#otp-form").serialize();
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "<?php echo base_url();?>auth/send__mail",
|
||||
data: data,
|
||||
json: true,
|
||||
success: function(response) {
|
||||
// decode encoded json
|
||||
response = jQuery.parseJSON(response)
|
||||
if (response.status == "failed") {
|
||||
//update the csrf to the form
|
||||
$('input[name=csrf_test_name]').val(response.csrf_hash);
|
||||
$('#span_msg').html('invalid username').css('color', 'red');
|
||||
} else {
|
||||
//update the csrf to the form
|
||||
$('input[name=csrf_test_name]').val(response.csrf_hash);
|
||||
$('#hidden_otp').val(response.otp);
|
||||
$('#id').val(response.id);
|
||||
console.log(response.otp);
|
||||
console.log(response.id);
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, err) {
|
||||
alert('text status ' + textStatus + ', err ' + err)
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$('#span_msg').html('Enter Email').css('color', 'red');
|
||||
if ($('#email').val()) {
|
||||
|
||||
$('#span_msg').html('');
|
||||
var email = $('#email').val();
|
||||
$('#timer').show();
|
||||
$('#sendotpbtn').html('Resend OTP');
|
||||
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "<?php echo base_url();?>Auth/sendMail",
|
||||
data: {email : email},
|
||||
json: true,
|
||||
success: function(response) {
|
||||
response = jQuery.parseJSON(response)
|
||||
if (response.status == "failed") {
|
||||
$('input[name=csrf_test_name]').val(response.csrf_hash);
|
||||
$('#span_msg').html('invalid username').css('color', 'red');
|
||||
} else {
|
||||
//for OTP Send success Lable
|
||||
new PNotify({
|
||||
title: 'OTP Send Successfully',
|
||||
text: 'Check Your Mail',
|
||||
type: 'success',
|
||||
styling: 'bootstrap3',
|
||||
delay: 2000
|
||||
});
|
||||
|
||||
|
||||
//update the csrf to the form
|
||||
$('input[name=csrf_test_name]').val(response.csrf_hash);
|
||||
$('#hidden_otp').val(response.otp);
|
||||
$('#email1').val(response.email);
|
||||
$('#id').val(response.id);
|
||||
$('#submitButton').show();
|
||||
$('#email').prop('required', false);
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, err) {
|
||||
alert('text status ' + textStatus + ', err ' + err)
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$('#span_msg').html('Enter Email').css('color', 'red');
|
||||
}
|
||||
}
|
||||
|
||||
$('#email').on('keyup', function() {
|
||||
if (!$('#email').val())
|
||||
@ -136,43 +162,57 @@ function send_otp() {
|
||||
$('#otp_span_msg').html('');
|
||||
});
|
||||
|
||||
$(document).on('click', '#close-form', function() {
|
||||
$('.bs-example-modal-sm').css('display', 'none');
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
var id = `<?php echo $id; ?>`;
|
||||
var val = `<?php echo $id; ?>`;
|
||||
var email = `<?php echo $email; ?>`;
|
||||
var status = `<?php echo $status; ?>`;
|
||||
var csrf_hash = `<?php echo $csrf_hash; ?>`;
|
||||
|
||||
|
||||
$(document).on('click', '.btn-primary', function() {
|
||||
if ($('#otp').val()) {
|
||||
var data = $("#otp-form").serialize();
|
||||
console.log(data);
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "<?php echo base_url();?>auth/verify_otp",
|
||||
data: data,
|
||||
json: true,
|
||||
success: function(response) {
|
||||
// decode encoded json
|
||||
response = jQuery.parseJSON(response)
|
||||
if (response.status === "failed") {
|
||||
//update the csrf to the form
|
||||
$('input[name=csrf_test_name]').val(response.csrf_hash);
|
||||
$('#otp_span_msg').html('invalid otp').css('color', 'red');
|
||||
} else {
|
||||
//update the csrf to the form
|
||||
$('input[name=csrf_test_name]').val(response.csrf_hash);
|
||||
console.log(response.id);
|
||||
$('.form').html(response.htmlPage);
|
||||
// location.href = `<?php echo base_url();?>auth/change_password_view/${response.id}`;
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, err) {
|
||||
alert('text status ' + textStatus + ', err ' + err)
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$('#otp_span_msg').html('Pls enter OTP').css('color', 'red');
|
||||
if (status === "failed") {
|
||||
$('#id').val(id);
|
||||
$('#submitButton').show();
|
||||
$('#email1').val(email);
|
||||
$('#email').val(email);
|
||||
$('#email').prop('required', false);
|
||||
$('#otp_span_msg').html('Pls enter correct OTP').css('color', 'red');
|
||||
$('#sendotpbtn').html('Resend OTP');
|
||||
|
||||
} else if (response.status === "success") {
|
||||
|
||||
$('input[name=csrf_test_name]').val(csrf_hash);
|
||||
$('#id').val(id);
|
||||
$('#email1').val(email);
|
||||
$('#email').val(email);
|
||||
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
let timer;
|
||||
|
||||
function startTimer(seconds) {
|
||||
|
||||
if ($('#email').val()) {
|
||||
$('#sendotpbtn').prop('disabled', true);
|
||||
timer = setInterval(function() {
|
||||
seconds--;
|
||||
$('#timer').html('Time remaining: ' + seconds + ' seconds');
|
||||
|
||||
if (seconds <= 0) {
|
||||
clearInterval(timer);
|
||||
$('#timer').html('Did not Recive the OTP pleace click the Resend OTP Button');
|
||||
// Enable the button after the timer reaches zero
|
||||
$('#sendotpbtn').prop('disabled', false);
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
||||
@ -43,6 +43,8 @@ public function business_list()
|
||||
{
|
||||
|
||||
$business_list = $this->Business_model->get_business_details();
|
||||
// echo '<pre>';
|
||||
// print_r($business_list); die;
|
||||
$this->layout->set('tableData', $business_list);
|
||||
$this->layout->buffer('main_content', 'Business/business_list');
|
||||
$this->layout->render('default_layout');
|
||||
@ -248,11 +250,32 @@ public function edit_business()
|
||||
}
|
||||
|
||||
public function delete_business($id)
|
||||
{
|
||||
$Data = $this->Business_model->delete_by_md5_id($id,user()->business_id,'asset');
|
||||
{
|
||||
$data['is_active'] = 0;
|
||||
$Data = $this->Business_model->delete_by_md5_id($id,$data);
|
||||
redirect('Business/business_list');
|
||||
}
|
||||
|
||||
public function activate_business($id)
|
||||
{
|
||||
$data['is_active'] = 1;
|
||||
$Data = $this->Business_model->delete_by_md5_id($id,$data);
|
||||
redirect('Business/business_list');
|
||||
}
|
||||
|
||||
public function checkUniqueBusinessData()
|
||||
{
|
||||
$data = $this->input->get('value');
|
||||
$table = 'business';
|
||||
$where = $this->input->get('name');
|
||||
$result = $this->MY_Model->checkUniqueValueInDataBase($table, $where, $data);
|
||||
if(count($result)){
|
||||
$this->output->set_output(true);
|
||||
}else{
|
||||
$this->output->set_output(false);
|
||||
}
|
||||
}
|
||||
|
||||
//===================== MODULES =================================================
|
||||
|
||||
public function add_module()
|
||||
|
||||
@ -7,7 +7,7 @@ public function get_business_details()
|
||||
$this->db->from('business B');
|
||||
$this->db->join('state', 'state.id = B.state', 'left');
|
||||
$this->db->order_by('B.id','ASC');
|
||||
$this->db->where('B.is_active', 1);
|
||||
// $this->db->where('B.is_active', 1);
|
||||
$query = $this->db->get();
|
||||
$query = $query->result();
|
||||
return $query;
|
||||
@ -25,14 +25,12 @@ public function get_business_by_md5_id($id)
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function delete_by_md5_id($id,$business_id,$table)
|
||||
public function delete_by_md5_id($id,$data)
|
||||
{
|
||||
$this->db->where('md5(id)', $id);
|
||||
$this->db->where('business_id', $business_id);
|
||||
$this->db->set('is_active',0);
|
||||
$this->db->update($table);
|
||||
return;
|
||||
}
|
||||
$this->db->where('id', $id);
|
||||
$this->db->update('business', $data);
|
||||
|
||||
}
|
||||
|
||||
public function get_business_modules($business_id)
|
||||
{
|
||||
@ -99,8 +97,7 @@ public function get_group_id_by_module_id($module_id)
|
||||
$this->db->where('module_id', $module_id);
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -166,7 +166,7 @@ class="form-control" required>
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name">Email<a
|
||||
style="color:red;">*</a> </label>
|
||||
<div class="col-md-3 col-sm-3 ">
|
||||
<input type="email" id="email" name="email" class="form-control" required>
|
||||
<input type="email" id="email" name="email" onkeyup="check_if_exists(this.id, this.value, this.name)" class="form-control" required>
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Phone<a
|
||||
@ -174,7 +174,7 @@ class="form-control" required>
|
||||
<div class="col-md-3 col-sm-3 ">
|
||||
<input id="phone" type="text" pattern="[6-9]{1}[0-9]{9}"
|
||||
title="Phone number with 6-9 and remaing 9 digit with 0-9" name="phone"
|
||||
class="form-control">
|
||||
class="form-control" onkeyup="check_if_exists(this.id, this.value, this.name)">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -263,14 +263,31 @@ class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Body page content -->
|
||||
<!-- /Body page content -->
|
||||
|
||||
<script>
|
||||
function check_if_exists(id, value, name) {
|
||||
// alert(name);
|
||||
// var data = $(this).val();
|
||||
$.ajax({
|
||||
type:"get",
|
||||
url: "<?php echo base_url(); ?>Business/checkUniqueBusinessData",
|
||||
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>
|
||||
@ -1,78 +1,99 @@
|
||||
<head>
|
||||
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css'>
|
||||
</head>
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
<h2>Business Details </h2>
|
||||
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<a href="<?php echo base_url();?>Business/add_business" class="btn btn-sm btn-primary">Add Business</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">
|
||||
<div class="card-box table-responsive">
|
||||
|
||||
<table id="datatable" class="table table-striped table-bordered dataTable no-footer" width="100%">
|
||||
<thead>
|
||||
<tr class="headings">
|
||||
|
||||
|
||||
<th class="column-title">Business Name </th>
|
||||
<th class="column-title">Email </th>
|
||||
<th class="column-title">Phone </th>
|
||||
<th class="column-title">Address </th>
|
||||
<th class="column-title">City </th>
|
||||
<th class="column-title">State </th>
|
||||
<th class="column-title">Pincode </th>
|
||||
<th class="column-title">Country </th>
|
||||
<th class="column-title">Logo </th>
|
||||
<th class="column-title" >Action </th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css'>
|
||||
<style>
|
||||
.status-success {
|
||||
background-color: #c1ffc1;
|
||||
color: #008000;
|
||||
border-radius:1px;
|
||||
font-weight: bold;
|
||||
width: 300px;
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
<tbody>
|
||||
|
||||
<?php foreach ($tableData as $key => $value) { ?>
|
||||
<tr class="even pointer">
|
||||
|
||||
<td class=" "> <?php echo $value->business_name; ?> </td>
|
||||
<td class=" "><?php echo $value->email; ?> </td>
|
||||
<td class=" "><?php echo $value->phone; ?></td>
|
||||
<td class=" "><?php echo $value->address; ?></td>
|
||||
<td class=" "><?php echo $value->city; ?></td>
|
||||
<td class=" "><?php echo $value->state_name; ?></td>
|
||||
<td class=" "><?php echo $value->pincode; ?></td>
|
||||
<td class=" "><?php echo $value->country; ?> </td>
|
||||
<td class=" "><?php echo $value->logo; ?> </td>
|
||||
|
||||
<td style=" text-align: center; font-size: 16px;">
|
||||
<a href="<?php echo base_url()?>Business/get_business/<?php echo md5($value->id);?>/<?php echo($value->uid);?>" ><i class="fa fa-pencil"></i></a>
|
||||
|
||||
|
||||
<a href="<?php echo base_url()?>Business/delete_business/<?php echo md5($value->id);?>" ><i class="fa fa-trash"></i></a>
|
||||
|
||||
|
||||
<a> <i id="<?php echo md5($value->id);?>" class="bi bi-card-list" title="History"></i></a>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
.status-danger {
|
||||
background-color: #ffb6c1;
|
||||
color: #ff0000;
|
||||
border-radius: 1px;
|
||||
font-weight: bold;
|
||||
width: 300px;
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
<h2>Business Details </h2>
|
||||
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<a href="<?php echo base_url();?>Business/add_business" class="btn btn-sm btn-primary">Add Business</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">
|
||||
<div class="card-box table-responsive">
|
||||
|
||||
<table id="datatable" class="table table-striped table-bordered dataTable no-footer" width="100%">
|
||||
<thead>
|
||||
<tr class="headings">
|
||||
<th class="column-title">Business Name </th>
|
||||
<th class="column-title">Email </th>
|
||||
<th class="column-title">Phone </th>
|
||||
<th class="column-title">Address </th>
|
||||
<th class="column-title">City </th>
|
||||
<th class="column-title">State </th>
|
||||
<th class="column-title">Pincode </th>
|
||||
<th class="column-title">Country </th>
|
||||
<th class="column-title">Logo </th>
|
||||
<th class="column-title">status </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->business_name; ?> </td>
|
||||
<td class=" "><?php echo $value->email; ?> </td>
|
||||
<td class=" "><?php echo $value->phone; ?></td>
|
||||
<td class=" "><?php echo $value->address; ?></td>
|
||||
<td class=" "><?php echo $value->city; ?></td>
|
||||
<td class=" "><?php echo $value->state_name; ?></td>
|
||||
<td class=" "><?php echo $value->pincode; ?></td>
|
||||
<td class=" "><?php echo $value->country; ?> </td>
|
||||
<td class=" "><?php echo $value->logo; ?> </td>
|
||||
<td class=" ">
|
||||
<?php if ($value->is_active == 1) { ?>
|
||||
<span class="status-success">Active</span>
|
||||
<?php } else if ($value->is_active == 0){ ?>
|
||||
<span class="status-danger">In-active</span>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td style=" text-align: center; font-size: 16px;">
|
||||
<?php if ($value->is_active == 1) { ?>
|
||||
<a href="<?php echo base_url()?>Business/get_business/<?php echo md5($value->id);?>" ><i class="fa fa-pencil" title="Edit"></i></a>
|
||||
<a href="<?php echo base_url()?>Business/delete_business/<?php echo $value->id;?>" ><i class="fa fa-times-circle-o" aria-hidden="true" style="font-size:20px;" title="deactivate"></i></a>
|
||||
<?php } ?>
|
||||
<?php if ($value->is_active == 0) { ?>
|
||||
<a href="<?php echo base_url()?>Business/activate_business/<?php echo $value->id;?>" ><i class="green fa fa-check-circle" style="font-size:20px;" title="activate"></i></a>
|
||||
<?php } ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
@ -82,20 +103,20 @@
|
||||
</div>
|
||||
|
||||
<div class="modal fade bs-example-modal-lg" id="ItemModal" tabindex="-1" role="dialog" aria-hidden="true"></div>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).on('click','.bi-card-list',function(){
|
||||
var id = $(this).attr("id")
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "<?php echo base_url()?>User/view_business_history/"+id,
|
||||
success: function(response) {
|
||||
response = JSON.parse(response);
|
||||
console.log(response);
|
||||
$('.bs-example-modal-lg').html(response);
|
||||
$('.bs-example-modal-lg').modal("show");
|
||||
},
|
||||
error: function(jqXHR, textStatus, err) { alert('text status '+textStatus+', err '+err) }
|
||||
});
|
||||
var id = $(this).attr("id")
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "<?php echo base_url()?>User/view_business_history/"+id,
|
||||
success: function(response) {
|
||||
response = JSON.parse(response);
|
||||
console.log(response);
|
||||
$('.bs-example-modal-lg').html(response);
|
||||
$('.bs-example-modal-lg').modal("show");
|
||||
},
|
||||
error: function(jqXHR, textStatus, err) { alert('text status '+textStatus+', err '+err) }
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@ -165,7 +165,7 @@ class="form-control">
|
||||
style="color:red;">*</a> </label>
|
||||
<div class="col-md-3 col-sm-3">
|
||||
<input type="email" id="email" name="email" value="<?php echo $businessData->email; ?>"
|
||||
required="required" class="form-control ">
|
||||
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="first-name"> Phone<a
|
||||
@ -174,7 +174,7 @@ class="form-control">
|
||||
<input id="phone" type="text" pattern="[6-9]{1}[0-9]{9}"
|
||||
title="Phone number with 6-9 and remaing 9 digit with 0-9" name="phone"
|
||||
value="<?php echo $businessData->phone; ?>" required="required"
|
||||
class="form-control">
|
||||
class="form-control" onkeyup="check_if_exists(this.id, this.value, this.name)" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -269,26 +269,38 @@ class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
<script>
|
||||
|
||||
|
||||
function check_if_exists(id, value, name) {
|
||||
// alert(name);
|
||||
// var data = $(this).val();
|
||||
$.ajax({
|
||||
type:"get",
|
||||
url: "<?php echo base_url(); ?>Business/checkUniqueBusinessData",
|
||||
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('');
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
jQuery(document).ready(function($) {
|
||||
$('#people').multiSelect();
|
||||
});
|
||||
|
||||
// $(document).ready(function() {
|
||||
// $("#people").on("click", function() {
|
||||
// // Get the selected values as an array
|
||||
// var selectedValues = $("#people").val();
|
||||
|
||||
// // Do something with the selected values (e.g., display them)
|
||||
// if (selectedValues) {
|
||||
// var selectedValuesString = selectedValues.join(", ");
|
||||
// alert("Selected Values: " + selectedValuesString);
|
||||
// } else {
|
||||
// alert("No values selected.");
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
|
||||
var selected = [];
|
||||
for (var option of document.getElementById('people').options) {
|
||||
if (option.selected) {
|
||||
|
||||
@ -114,6 +114,18 @@ public function Delegation_list()
|
||||
$this->layout->render('Employee_Layout');
|
||||
}
|
||||
|
||||
public function checkUniqueValue()
|
||||
{
|
||||
$data = $this->input->get('emp_id');
|
||||
$table = 'delegation';
|
||||
$where = 'delegated_to';
|
||||
$result = $this->MY_Model->checkUniqueValueInDataBase($table, $where, $data);
|
||||
if(count($result)){
|
||||
$this->output->set_output(true);
|
||||
}else{
|
||||
$this->output->set_output(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -72,7 +72,7 @@
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="last-name">Delegated To<a style="color:red;">*</a> </label>
|
||||
<div class="col-md-7 col-sm-7 ">
|
||||
<select id="emp_id" name="delegated_to" required="required" class="form-control" >
|
||||
<select id="emp_id" name="delegated_to" required="required" onchange="get_emp_id(this.value, this.id)" class="form-control" >
|
||||
<option value="">--Select--</option>
|
||||
<?php foreach ($emp as $key => $value) { ?>
|
||||
<?php if($value->user_id != user()->id) { ?>
|
||||
@ -107,53 +107,73 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Initialize datepickers
|
||||
var dateFormat = "dd-mm-yy";
|
||||
var fromDateInput = $("#fromdate");
|
||||
var toDateInput = $("#todate");
|
||||
|
||||
fromDateInput.datepicker({
|
||||
dateFormat: dateFormat,
|
||||
changeYear: true,
|
||||
changeMonth: true,
|
||||
onSelect: function (dateText, inst) {
|
||||
toDateInput.datepicker("option", "minDate", dateText);
|
||||
validateDateRange();
|
||||
}
|
||||
});
|
||||
// Initialize datepickers
|
||||
var dateFormat = "dd-mm-yy";
|
||||
var fromDateInput = $("#fromdate");
|
||||
var toDateInput = $("#todate");
|
||||
|
||||
toDateInput.datepicker({
|
||||
dateFormat: dateFormat,
|
||||
changeYear: true,
|
||||
changeMonth: true,
|
||||
onSelect: function (dateText, inst) {
|
||||
validateDateRange();
|
||||
}
|
||||
});
|
||||
fromDateInput.datepicker({
|
||||
dateFormat: dateFormat,
|
||||
changeYear: true,
|
||||
changeMonth: true,
|
||||
onSelect: function (dateText, inst) {
|
||||
toDateInput.datepicker("option", "minDate", dateText);
|
||||
validateDateRange();
|
||||
}
|
||||
});
|
||||
|
||||
toDateInput.datepicker({
|
||||
dateFormat: dateFormat,
|
||||
changeYear: true,
|
||||
changeMonth: true,
|
||||
onSelect: function (dateText, inst) {
|
||||
validateDateRange();
|
||||
}
|
||||
});
|
||||
|
||||
// Function to validate the date range
|
||||
function validateDateRange() {
|
||||
var fromDate = fromDateInput.datepicker("getDate");
|
||||
var toDate = toDateInput.datepicker("getDate");
|
||||
// Function to validate the date range
|
||||
function validateDateRange() {
|
||||
var fromDate = fromDateInput.datepicker("getDate");
|
||||
var toDate = toDateInput.datepicker("getDate");
|
||||
|
||||
// Check if both dates are selected
|
||||
if (!fromDate || !toDate) {
|
||||
$("#error-msg").text("Please select both From Date and To Date");
|
||||
return false;
|
||||
}
|
||||
// Check if both dates are selected
|
||||
if (!fromDate || !toDate) {
|
||||
$("#error-msg").text("Please select both From Date and To Date");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Compare the dates
|
||||
if (fromDate > toDate) {
|
||||
$("#error-msg").text("From Date cannot be after To Date");
|
||||
return false;
|
||||
}
|
||||
// Compare the dates
|
||||
if (fromDate > toDate) {
|
||||
$("#error-msg").text("From Date cannot be after To Date");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Clear the error message if the date range is valid
|
||||
$("#error-msg").text("");
|
||||
return true;
|
||||
// Clear the error message if the date range is valid
|
||||
$("#error-msg").text("");
|
||||
return true;
|
||||
}
|
||||
|
||||
function get_emp_id(emp_id, id){
|
||||
$.ajax({
|
||||
type:"get",
|
||||
url: "<?php echo base_url(); ?>Delegation/checkUniqueValue",
|
||||
data: { emp_id: emp_id },
|
||||
success:function(response)
|
||||
{
|
||||
if (response == true)
|
||||
{
|
||||
new PNotify({
|
||||
title: 'Warning',
|
||||
text: 'This Employee Already Delegated by Other',
|
||||
styling: 'bootstrap3'
|
||||
});
|
||||
$("#"+id).val('');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -533,6 +533,19 @@ public function add_employee_history()
|
||||
|
||||
}
|
||||
|
||||
public function checkUniqueValue()
|
||||
{
|
||||
$data = $this->input->get('value');
|
||||
$table = 'users';
|
||||
$where = $this->input->get('name');
|
||||
$result = $this->MY_Model->checkUniqueValueInDataBase($table, $where, $data);
|
||||
if(count($result)){
|
||||
$this->output->set_output(true);
|
||||
}else{
|
||||
$this->output->set_output(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -180,7 +180,7 @@
|
||||
class="form-control" type="email"
|
||||
pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}"
|
||||
oninvalid="setCustomValidity('Enter a Valid E-mail Address.')"
|
||||
oninput="setCustomValidity('')">
|
||||
oninput="setCustomValidity('')" onkeyup="check_if_exists(this.id, this.value, this.name)">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -195,7 +195,7 @@ class="form-control" type="email"
|
||||
onkeypress="return matchnum(event)" required="required" class="form-control" type="text"
|
||||
pattern="[6-9][0-9]{9}" minlength="10" maxlength="10"
|
||||
oninvalid="setCustomValidity('cant start with number other than 6,7,8,9 or length must be 10.')"
|
||||
oninput="setCustomValidity('')">
|
||||
oninput="setCustomValidity('')" onkeyup="check_if_exists(this.id, this.value, this.name)">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name">Department</label>
|
||||
@ -256,7 +256,7 @@ class="form-control" type="email"
|
||||
style="color:red;">*</a> </label>
|
||||
<div class="col-md-3 col-sm-3 ">
|
||||
<input type="text" id="user_name" name="user_name" value="" required="required"
|
||||
class="form-control ">
|
||||
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"> Password<a
|
||||
@ -569,4 +569,29 @@ function validateFile(input) {
|
||||
var selectedOptions = Array.from(this.selectedOptions).map(option => option.value);
|
||||
console.log(selectedOptions); // You can perform further operations with the selected values
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function check_if_exists(id, value, name) {
|
||||
// alert(name);
|
||||
// var data = $(this).val();
|
||||
$.ajax({
|
||||
type:"get",
|
||||
url: "<?php echo base_url(); ?>Employee/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>
|
||||
@ -181,7 +181,7 @@ class="form-control " onkeypress="validateKeyPress(event)">
|
||||
class="form-control" type="email"
|
||||
pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}"
|
||||
oninvalid="setCustomValidity('Enter a Valid E-mail Address.')"
|
||||
oninput="setCustomValidity('')">
|
||||
oninput="setCustomValidity('')" onkeyup="check_if_exists(this.id, this.value, this.name)">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -196,7 +196,7 @@ class="form-control" type="email"
|
||||
onkeypress="return matchnum(event)" required="required" class="form-control" type="tel"
|
||||
pattern="[6-9][0-9]{9}" minlength="10" maxlength="10"
|
||||
oninvalid="setCustomValidity('cant start with number other than 6,7,8,9 or length must be 10.')"
|
||||
oninput="setCustomValidity('')">
|
||||
oninput="setCustomValidity('')" onkeyup="check_if_exists(this.id, this.value, this.name)">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="last-name">Department</label>
|
||||
@ -485,6 +485,13 @@ class="form-control " onchange="validateFile(this)">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Body page content -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$('#myDatepicker').datetimepicker({
|
||||
format: 'DD.MM.YYYY'
|
||||
@ -578,5 +585,27 @@ function validateFile(input) {
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<!-- /Body page content -->
|
||||
<script>
|
||||
function check_if_exists(id, value, name) {
|
||||
// alert(name);
|
||||
// var data = $(this).val();
|
||||
$.ajax({
|
||||
type:"get",
|
||||
url: "<?php echo base_url(); ?>Employee/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>
|
||||
|
||||
@ -51,7 +51,7 @@
|
||||
|
||||
<!-- <a href="<?php echo base_url()?>Employee/deleteEmployee/<?php echo md5($value->id);?>" ><i class="fa fa-trash" title="Edit"></i></a> -->
|
||||
|
||||
<a> <i id="<?php echo md5($value->user_id);?>" class="bi bi-card-list" title="History"></i></a>
|
||||
<!-- <a> <i id="<?php echo md5($value->user_id);?>" class="bi bi-card-list" title="History"></i></a> -->
|
||||
</td>
|
||||
</tr>
|
||||
<?php }}?>
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
div.dataTables_wrapper div.dataTables_filter{
|
||||
margin-top: -30px !important; //search to up
|
||||
margin-top: -30px !important;
|
||||
}
|
||||
|
||||
.alert-success {
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
.modal-content_default {
|
||||
background-color: #fefefe;
|
||||
margin: 15% auto;s
|
||||
margin: 15% auto;
|
||||
padding: 20px;
|
||||
border: 1px solid #888;
|
||||
width: 380px;
|
||||
@ -34,8 +34,8 @@
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_filter{
|
||||
margin-top: -30px !important; //search to up
|
||||
|
||||
margin-top: -30px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
|
||||
.modal-content_default {
|
||||
background-color: #fefefe;
|
||||
margin: 15% auto;s
|
||||
margin: 15% auto;
|
||||
padding: 20px;
|
||||
border: 1px solid #888;
|
||||
width: 380px;
|
||||
@ -35,7 +35,8 @@
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_filter{
|
||||
margin-top: -30px !important; //search to up
|
||||
margin-top: -30px !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
<!---ajax call--->
|
||||
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"> </script> -->
|
||||
|
||||
<title>Ams</title>
|
||||
<title>BigBamboo Enterprise</title>
|
||||
|
||||
<!-- Bootstrap -->
|
||||
<link href="<?php echo base_url(); ?>/assets/default/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
|
||||
@ -6,13 +6,14 @@
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="icon" href="images/favicon.ico" type="image/ico" />
|
||||
<!-- <link rel="icon" href="images/favicon.ico" type="image/ico" /> -->
|
||||
<link rel="icon" href="<?php echo base_url(); ?>/assets/appimg/default.ico" />
|
||||
|
||||
|
||||
<!---ajax call--->
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"> </script>
|
||||
|
||||
<title>Ams</title>
|
||||
<title>BigBamboo Enterprise</title>
|
||||
|
||||
<!-- Bootstrap -->
|
||||
<link href="<?php echo base_url(); ?>/assets/default/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
|
||||
@ -55,8 +55,6 @@ public function leaveList()
|
||||
|
||||
$business_id = user()->business_id;
|
||||
$leave_list = $this->Leave_model->get_leave_with_emp_name(user()->business_id);
|
||||
// echo '<pre>';
|
||||
// print_r($leave_list); die;
|
||||
$leave_type = $this->Leave_model->get_leave_type($business_id);
|
||||
$decline_dropdown = $this->Leave_model->decline_dropdown($business_id);
|
||||
$this->layout->set('tableData', $leave_list);
|
||||
@ -245,23 +243,23 @@ public function createLeave()
|
||||
}
|
||||
}
|
||||
|
||||
$get_from_date = $this->Leave_model->get_from_date($emp_id, $this->input->post('from_date'), $this->input->post('to_date'));
|
||||
$get_emp_join_date = $this->Leave_model->get_emp_join_date($emp_id, $this->input->post('from_date'), $this->input->post('to_date'));
|
||||
//print_r($get_emp_join_date); die;
|
||||
|
||||
$get_emp_data = $this->Leave_model->get_emp_data_by_emp_id($emp_id);
|
||||
// print_r($get_emp_data[0]->j_date); die;
|
||||
|
||||
if( $get_emp_join_date == 0 && $get_from_date == 0)
|
||||
{
|
||||
$from_date = new DateTime($this->input->post('from_date'));
|
||||
$j_date = new DateTime($get_emp_data[0]->j_date);
|
||||
$to_date = new DateTime($this->input->post('to_date'));
|
||||
|
||||
|
||||
if ($from_date >= $j_date && $from_date <= $to_date) {
|
||||
$table="leave_list";
|
||||
$create_leave = $this->MY_Model->insert($data,$table);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->session->set_flashdata('error', '1');
|
||||
redirect('Leave/applyLeave/'.'update');
|
||||
}
|
||||
$create_leave = $this->MY_Model->insert($data,$table);
|
||||
} else {
|
||||
$this->session->set_flashdata('error', '1');
|
||||
redirect('Leave/applyLeave/'.'update');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//audit
|
||||
if($create_leave)
|
||||
@ -527,7 +525,7 @@ public function LeaveHistory()
|
||||
{
|
||||
$business_id = user()->business_id;
|
||||
$leave_list = $this->Leave_model->get_leave_with_emp_name(user()->business_id);
|
||||
$leave_type = $this->Leave_model->get_leave_type($business_id);
|
||||
$leave_type = $this->Leave_model->get_leave_type($business_id);
|
||||
$this->layout->set('tableData', $leave_list);
|
||||
$this->layout->set('leave_type', $leave_type);
|
||||
$this->layout->buffer('main_content', 'Leave/leavehistory');
|
||||
@ -536,18 +534,20 @@ public function LeaveHistory()
|
||||
|
||||
|
||||
public function manager_approvel()
|
||||
{
|
||||
{
|
||||
|
||||
$business_id = user()->business_id;
|
||||
$user_id = user()->id;
|
||||
$manager = $this->Leave_model->under_emp_manager($user_id, $business_id);
|
||||
$get_delegation = $this->Leave_model->Get_delegation_id($business_id);
|
||||
$decline_dropdown = $this->Leave_model->decline_dropdown($business_id);
|
||||
$leave_list = $this->Leave_model->get_with_emp_name(user()->business_id);
|
||||
$leave_type = $this->Leave_model->get_leave_type($business_id);
|
||||
$this->layout->set('tableData', $leave_list);
|
||||
$this->layout->set('leave_type', $leave_type);
|
||||
$leave_list = $this->Leave_model->get_all_leave_request_by_manager_id(user()->business_id, user()->id);
|
||||
$leave_list_with_delegation = $this->Leave_model->get_all_leave_request_by_manager_id_with_delegation(user()->business_id, user()->id);
|
||||
if($leave_list_with_delegation == NULL){
|
||||
$leave_list_with_delegation = [];
|
||||
}
|
||||
$mergedArray = array_merge($leave_list, $leave_list_with_delegation);
|
||||
$this->layout->set('tableData', $mergedArray);
|
||||
$this->layout->set('dropdown', $decline_dropdown);
|
||||
$this->layout->set('get_delegation', $get_delegation);
|
||||
$this->layout->set('manager', $manager);
|
||||
$this->layout->buffer('main_content', 'Leave/manager_approvel');
|
||||
$this->layout->render('Employee_Layout');
|
||||
|
||||
@ -35,17 +35,69 @@ public function get_user_name($user_id){
|
||||
|
||||
}
|
||||
|
||||
public function get_with_emp_name($business_id, )
|
||||
public function get_all_leave_request_by_manager_id($business_id, $user_id)
|
||||
{
|
||||
$this->db->select('A.* , name', 'users.name');
|
||||
$this->db->select('A.* ,U1.name as emp_name, U2.name as ApproveBy, U3.name as DeclineBy, U4.name as Risedby, E.manager as manager_id, LM.type as leave_type');
|
||||
$this->db->from('leave_list A');
|
||||
$this->db->join('users', 'users.id = A.emp_id', 'left');
|
||||
$this->db->join('users U1', 'U1.id = A.emp_id', 'left');
|
||||
$this->db->join('users U2', 'U2.id = A.approved_by', 'left');
|
||||
$this->db->join('users U3', 'U3.id = A.declined_by', 'left');
|
||||
$this->db->join('users U4', 'U4.id = A.risedby', 'left');
|
||||
$this->db->join('employees E', 'E.user_id = A.emp_id', 'left');
|
||||
$this->db->join('leave_master LM', 'LM.id = A.type', 'left');
|
||||
$this->db->where('A.business_id', $business_id);
|
||||
$this->db->order_by('id','DESC');
|
||||
$this->db->where('E.manager', $user_id);
|
||||
$this->db->order_by('A.id','DESC');
|
||||
$this->db->where('A.is_active', 1);
|
||||
$query = $this->db->get();
|
||||
$query = $query->result();
|
||||
$query = $query->result();
|
||||
return $query;
|
||||
|
||||
}
|
||||
|
||||
public function get_delegated_user_id($business_id, $user_id){
|
||||
$this->db->select('emp_id');
|
||||
$this->db->from('delegation');
|
||||
$this->db->where('business_id', $business_id);
|
||||
$this->db->where('delegated_to', $user_id);
|
||||
$this->db->where('is_active', 1);
|
||||
$query = $this->db->get();
|
||||
$result_array = $query->result_array();
|
||||
$emp_ids = array_column($result_array, 'emp_id');
|
||||
return $emp_ids;
|
||||
}
|
||||
|
||||
public function get_all_leave_request_by_manager_id_with_delegation($business_id, $loggeduserid)
|
||||
{
|
||||
|
||||
$delegated_users_id_list = $this->get_delegated_user_id($business_id, $loggeduserid);
|
||||
$count = count($delegated_users_id_list);
|
||||
|
||||
if($count > 0)
|
||||
{
|
||||
foreach ($delegated_users_id_list as $user_id) {
|
||||
|
||||
$this->db->select('A.* ,U1.name as emp_name, U2.name as ApproveBy, U3.name as DeclineBy, U4.name as Risedby, E.manager as manager_id, LM.type as leave_type, D.from_date as delegate_f_date, D.to_date as delegate_t_date, D.delegated_to, D.emp_id');
|
||||
$this->db->from('leave_list A');
|
||||
$this->db->join('users U1', 'U1.id = A.emp_id', 'left');
|
||||
$this->db->join('users U2', 'U2.id = A.approved_by', 'left');
|
||||
$this->db->join('users U3', 'U3.id = A.declined_by', 'left');
|
||||
$this->db->join('users U4', 'U4.id = A.risedby', 'left');
|
||||
$this->db->join('employees E', 'E.user_id = A.emp_id', 'left');
|
||||
$this->db->join('delegation D', 'D.business_id = A.business_id', 'left');
|
||||
$this->db->join('leave_master LM', 'LM.id = A.type', 'left');
|
||||
$this->db->where('A.business_id', $business_id);
|
||||
$this->db->where('E.manager', $user_id); //User ID as Employee ID
|
||||
// $this->db->where('D.emp_id', $user_id);
|
||||
$this->db->order_by('A.id','DESC');
|
||||
$this->db->where('A.is_active', 1);
|
||||
$query = $this->db->get();
|
||||
$query = $query->result();
|
||||
return $query;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function get_count($emp_id, $business_id, $type_id)
|
||||
@ -310,7 +362,6 @@ public function Get_delegation_id($business_id)
|
||||
$this->db->select('*');
|
||||
$this->db->from('delegation');
|
||||
$this->db->where('business_id', $business_id);
|
||||
//$this->db->where('delegated_to', $emp_id);
|
||||
$this->db->where('is_active', 1);
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
@ -392,8 +443,17 @@ public function get_emp_join_date($emp_id, $from_date, $to_date)
|
||||
$this->db->select('*');
|
||||
$this->db->from('employees');
|
||||
$this->db->where('user_id', $emp_id);
|
||||
$this->db->where('j_date >=', $from_date);
|
||||
$this->db->where('j_date >', $from_date);
|
||||
$query = $this->db->count_all_results();
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function get_emp_data_by_emp_id($emp_id){
|
||||
$this->db->select('*');
|
||||
$this->db->from('employees');
|
||||
$this->db->where('user_id', $emp_id);
|
||||
$query = $this->db->get();
|
||||
$query = $query->result();
|
||||
return $query;
|
||||
}
|
||||
}
|
||||
@ -118,13 +118,8 @@
|
||||
|
||||
<?php if($value->status == 'pending') { ?>
|
||||
|
||||
<a><i class="fa fa-check approveleave" data-toggle="modal"
|
||||
data-target=".bs-example-modal-sm" title="Approve Leave"
|
||||
id="<?php echo $value->id;?>"></i></a>
|
||||
|
||||
|
||||
<a href="#"><i class="fa fa-times test" aria-hidden="true" title="Decline"
|
||||
onclick="showCustomPrompt()" id="<?php echo $value->id; ?>"></i></a>
|
||||
<a><i class="fa fa-check approveleave" data-toggle="modal" data-target=".bs-example-modal-sm" title="Approve Leave" id="<?php echo $value->id;?>"></i></a>
|
||||
<a href="#"><i class="fa fa-times test" aria-hidden="true" title="Decline" onclick="showCustomPrompt()" id="<?php echo $value->id; ?>"></i></a>
|
||||
|
||||
<?php } ?>
|
||||
</td>
|
||||
|
||||
@ -15,8 +15,8 @@
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_filter{
|
||||
margin-top: -30px !important; //search move to up
|
||||
|
||||
margin-top: -30px !important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
@ -104,10 +104,10 @@
|
||||
<td style="color:#e68a00"><?php echo $value->status; ?></td>
|
||||
<?php }
|
||||
else if($value->status == 'Approved'){ ?>
|
||||
<td style="color:green"><?php echo $value->status; ?> By <?php echo $value->approved_by; ?><br><?php echo $value->approved_at; ?></td>
|
||||
<td style="color:green"><?php echo $value->status; ?> By <?php echo $value->ApproveBy; ?><br><?php echo $value->approved_at; ?></td>
|
||||
<?php }
|
||||
else if($value->status == 'Declined'){ ?>
|
||||
<td style="color:red"><?php echo $value->status; ?> By <?php echo $value->declined_by; ?> <br> <?php echo $value->DReason; ?></td>
|
||||
<td style="color:red"><?php echo $value->status; ?> By <?php echo $value->DeclineBy; ?> <br> <?php echo $value->DReason; ?></td>
|
||||
<?php }
|
||||
else if($value->status == 'canceled'){ ?>
|
||||
<td style="color:darkcyan;"><?php echo $value->status; ?></td>
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_filter{
|
||||
margin-top: -30px !important; //search move to up
|
||||
margin-top: -30px !important;
|
||||
}
|
||||
|
||||
|
||||
@ -57,137 +57,81 @@
|
||||
<table id="datatables" class="table table-striped table-bordered" width="100%">
|
||||
<thead>
|
||||
<tr class="headings">
|
||||
<th hidden class="column-title">id</th>
|
||||
<th class="column-title">Created Date/Time</th>
|
||||
<th class="column-title">Employee Name </th>
|
||||
<th class="column-title">Note</th>
|
||||
<th class="column-title">Leave Duration </th>
|
||||
<th class="column-title">Leave Type </th>
|
||||
<th class="column-title">Leave Raised By</th>
|
||||
<th class="column-title">No of Days </th>
|
||||
<th class="column-title">Status </th>
|
||||
<th class="column-title" >Action </th>
|
||||
<th hidden class="column-title">id</th>
|
||||
<th class="column-title">Created Date/Time</th>
|
||||
<th class="column-title">Employee Name </th>
|
||||
<th class="column-title">Note</th>
|
||||
<th class="column-title">Leave Duration </th>
|
||||
<th class="column-title">Leave Type </th>
|
||||
<th class="column-title">Leave Raised By</th>
|
||||
<th class="column-title">No of Days </th>
|
||||
<th class="column-title">Status </th>
|
||||
<th class="column-title" >Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($tableData as $key => $value) { ?>
|
||||
<?php foreach ($leave_type as $leave => $type) { ?>
|
||||
<?php if($type->id === $value->type ) { ?>
|
||||
<tbody>
|
||||
<?php foreach ($tableData as $key => $value) { ?>
|
||||
|
||||
<?php
|
||||
if(isset($value->delegated_to)) {
|
||||
$data = $value->delegated_to;
|
||||
$f_date = $value->delegate_f_date;
|
||||
$t_date = $value->delegate_t_date;
|
||||
}else {
|
||||
$data = 0;
|
||||
$f_date = 0;
|
||||
$t_date = 0;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if(user()->id == $value->manager ) { ?>
|
||||
<?php if(user()->id == $data && user()->id !== $value->emp_id && date('d-m-Y') >= $f_date && date('d-m-Y') <= $t_date || user()->id == $value->manager) { ?>
|
||||
|
||||
<tr class="even pointer">
|
||||
<td hidden><?php echo $value->id; ?></td>
|
||||
<td class=" "><?php echo $value->created_date; ?><br><?php echo $value->created_time; ?></td>
|
||||
<td class=" "><?php echo $value->name; ?> (<?php echo $value->emp_id; ?>) </td>
|
||||
<td class=" "><?php echo $value->comments; ?></td>
|
||||
<?php if($value->from_date == "" && $value->to_date == "") { ?>
|
||||
<td class="">
|
||||
<?php echo dateFormat('d-m-Y',$value->perm_date);?><br>
|
||||
<?php echo timeFormat('h:i a', $value->from_time); ?> to
|
||||
<?php echo timeFormat('h:i a', $value->to_time);; ?>
|
||||
</td>
|
||||
<?php } else { ?>
|
||||
|
||||
<td class=" "> <?php echo dateFormat('d-m-Y',$value->from_date); echo ' to ';?> <?php echo dateFormat('d-m-Y',$value->to_date);?> </td>
|
||||
<?php } ?>
|
||||
<td class=" "><?php echo $type->type; ?></td>
|
||||
<td class=" "><?php echo $value->risedby; ?></td>
|
||||
<?php if($value->no_of_days == 0){ ?>
|
||||
<td class=" ">---</td>
|
||||
<?php } else { ?>
|
||||
<td class=""><?php echo $value->no_of_days; ?></td>
|
||||
<?php } ?>
|
||||
<?php if($value->status == 'pending'){ ?>
|
||||
<td style="color:#e68a00"><?php echo $value->status; ?></td>
|
||||
<?php }
|
||||
else if($value->status == 'Approved'){ ?>
|
||||
<td style="color:green"><?php echo $value->status; ?> By <?php echo $value->approved_by; ?><br><?php echo $value->approved_at; ?></td>
|
||||
<?php }
|
||||
else if($value->status == 'Declined'){ ?>
|
||||
<td style="color:red"><?php echo $value->status; ?> by <?php echo $value->declined_by; ?> <br>" <?php echo $value->DReason; ?> "</td>
|
||||
<?php }
|
||||
else if($value->status == 'canceled'){ ?>
|
||||
<td style="color:darkcyan;"><?php echo $value->status; ?></td>
|
||||
<?php }
|
||||
else{
|
||||
|
||||
}?>
|
||||
<td style=" text-align: center; font-size: 16px;">
|
||||
|
||||
<?php if($value->status == 'pending') { ?>
|
||||
|
||||
<a><i class="fa fa-check approveleave" data-toggle="modal" data-target=".bs-example-modal-sm" title="Approve Leave" id="<?php echo $value->id;?>"></i></a>
|
||||
|
||||
<a href="#"><i class="fa fa-times test" aria-hidden="true" title="Decline" id= "<?php echo $value->id; ?>" onclick="showCustomPrompt()"></i></a>
|
||||
|
||||
<?php } ?>
|
||||
<tr class="even pointer">
|
||||
<td hidden><?php echo $value->id; ?></td>
|
||||
<td class=" "><?php echo $value->created_date; ?><br><?php echo $value->created_time; ?></td>
|
||||
<td class=" "><?php echo $value->emp_name; ?></td>
|
||||
<td class=" "><?php echo $value->comments; ?></td>
|
||||
<?php if($value->from_date == "" && $value->to_date == "") { ?>
|
||||
<td class="">
|
||||
<?php echo dateFormat('d-m-Y',$value->perm_date);?><br>
|
||||
<?php echo timeFormat('h:i a', $value->from_time); ?> to
|
||||
<?php echo timeFormat('h:i a', $value->to_time);; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
<?php foreach ($get_delegation as $key => $val) { ?>
|
||||
|
||||
<?php if(user()->id == $val->delegated_to && date('d-m-Y') >= $val->from_date && date('d-m-Y') <= $val->to_date && $value->created_date >= $val->from_date && $value->created_date <= $val->to_date) { ?>
|
||||
|
||||
<tr class="even pointer">
|
||||
<td hidden><?php echo $value->comments; ?></td>
|
||||
<td class=" "><?php echo $value->created_date; ?><br><?php echo $value->created_time; ?></td>
|
||||
<td class=" "><?php echo $value->name; ?> (<?php echo $value->emp_id; ?>) </td>
|
||||
<td class=" "><?php echo $value->comments; ?></td>
|
||||
<?php if($value->from_date == "" && $value->to_date == "") { ?>
|
||||
<td class="">
|
||||
<?php echo dateFormat('d-m-Y',$value->perm_date);?><br>
|
||||
<?php echo timeFormat('h:i a', $value->from_time); ?> to
|
||||
<?php echo timeFormat('h:i a', $value->to_time);; ?>
|
||||
</td>
|
||||
<?php } else { ?>
|
||||
|
||||
<td class=" "> <?php echo dateFormat('d-m-Y',$value->from_date); echo ' to ';?> <?php echo dateFormat('d-m-Y',$value->to_date);?> </td>
|
||||
<?php } ?>
|
||||
<td class=" "><?php echo $type->type; ?></td>
|
||||
<td class=" "><?php echo $value->risedby; ?></td>
|
||||
<?php if($value->no_of_days == 0){ ?>
|
||||
<td class=" ">---</td>
|
||||
<?php } else { ?>
|
||||
<td class=""><?php echo $value->no_of_days; ?></td>
|
||||
<?php } ?>
|
||||
<?php if($value->status == 'pending'){ ?>
|
||||
<td style="color:#e68a00"><?php echo $value->status; ?></td>
|
||||
<?php }
|
||||
else if($value->status == 'Approved'){ ?>
|
||||
<td style="color:green"><?php echo $value->status; ?> By <?php echo $value->approved_by; ?><br><?php echo $value->approved_at; ?></td>
|
||||
<?php }
|
||||
else if($value->status == 'Declined'){ ?>
|
||||
<td style="color:red"><?php echo $value->status; ?> by <?php echo $value->declined_by; ?> <br>" <?php echo $value->DReason; ?> "</td>
|
||||
<?php }
|
||||
else if($value->status == 'canceled'){ ?>
|
||||
<td style="color:darkcyan;"><?php echo $value->status; ?></td>
|
||||
<?php }
|
||||
else{
|
||||
|
||||
}?>
|
||||
<td style=" text-align: center; font-size: 16px;">
|
||||
|
||||
<?php if($value->status == 'pending') { ?>
|
||||
|
||||
<a><i class="fa fa-check approveleave" data-toggle="modal" data-target=".bs-example-modal-sm" title="Approve Leave" id="<?php echo $value->id;?>"></i></a>
|
||||
|
||||
|
||||
<a href="#"><i class="fa fa-times test" aria-hidden="true" title="Decline" id= "<?php echo $value->id; ?>" onclick="showCustomPrompt()"></i></a>
|
||||
|
||||
<?php } ?>
|
||||
<?php } else { ?>
|
||||
<td class=" "> <?php echo dateFormat('d-m-Y',$value->from_date); echo ' to ';?> <?php echo dateFormat('d-m-Y',$value->to_date);?> </td>
|
||||
<?php } ?>
|
||||
<td class=" "><?php echo $value->leave_type; ?></td>
|
||||
<td class=" "><?php if($value->Risedby == ''){echo 'self'; }else{echo $value->Risedby; }; ?></td>
|
||||
<?php if($value->no_of_days == 0){ ?>
|
||||
<td class=" ">---</td>
|
||||
<?php } else { ?>
|
||||
<td class=""><?php echo $value->no_of_days; ?></td>
|
||||
<?php } ?>
|
||||
<?php if($value->status == 'pending'){ ?>
|
||||
<td style="color:#e68a00"><?php echo $value->status; ?></td>
|
||||
<?php } else if($value->status == 'Approved'){ ?>
|
||||
<td style="color:green"><?php echo $value->status; ?> By <?php echo $value->ApproveBy; ?><br><?php echo $value->approved_at; ?></td>
|
||||
<?php } else if($value->status == 'Declined'){ ?>
|
||||
<td style="color:red"><?php echo $value->status; ?> by <?php echo $value->DeclineBy; ?> <br>" <?php echo $value->DReason; ?> "</td>
|
||||
<?php } else if($value->status == 'canceled'){ ?>
|
||||
<td style="color:darkcyan;"><?php echo $value->status; ?></td>
|
||||
<?php } ?>
|
||||
<td style=" text-align: center; font-size: 16px;">
|
||||
<?php if($value->status == 'pending') { ?>
|
||||
<a><i class="fa fa-check approveleave" data-toggle="modal" data-target=".bs-example-modal-sm" title="Approve Leave" id="<?php echo $value->id;?>"></i></a>
|
||||
<a href="#"><i class="fa fa-times test" aria-hidden="true" title="Decline" id= "<?php echo $value->id; ?>" onclick="showCustomPrompt()"></i></a>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php } } } } } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php } } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="customPrompt" class="modal modal_first">
|
||||
<div class="modal-content modal-content_first">
|
||||
|
||||
@ -245,4 +245,19 @@ public function view_business_history($id)
|
||||
echo json_encode($htmlPage);
|
||||
}
|
||||
|
||||
public function checkUniqueValue()
|
||||
{
|
||||
$data = $this->input->get('value');
|
||||
$table = 'users';
|
||||
$where = $this->input->get('name');
|
||||
// echo $data, $where; die;
|
||||
$result = $this->MY_Model->checkUniqueValueInDataBase($table, $where, $data);
|
||||
// print_r($result); die;
|
||||
if(count($result)){
|
||||
$this->output->set_output(true);
|
||||
}else{
|
||||
$this->output->set_output(false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -31,7 +31,7 @@ public function get_user_by_md5_id($id,$business_id)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('users');
|
||||
if ($business_id != NULL) {
|
||||
if ($business_id != 0) {
|
||||
$this->db->where('business_id', $business_id);
|
||||
}
|
||||
$this->db->where('md5(id)', $id);
|
||||
@ -41,15 +41,17 @@ public function get_user_by_md5_id($id,$business_id)
|
||||
}
|
||||
|
||||
public function delete_user_by_md5_id($id,$business_id)
|
||||
{
|
||||
{
|
||||
// echo $id;
|
||||
// echo $business_id; die;
|
||||
$this->db->where('md5(id)', $id);
|
||||
if ($business_id != NULL) {
|
||||
if ($business_id != 0) {
|
||||
$this->db->where('business_id', $business_id);
|
||||
}
|
||||
$this->db->set('is_active',0);
|
||||
$this->db->update('users');
|
||||
$this->db->where('md5(user_id)', $id);
|
||||
if ($business_id != NULL) {
|
||||
if ($business_id != 0) {
|
||||
$this->db->where('business_id', $business_id);
|
||||
}
|
||||
$this->db->set('is_active',0);
|
||||
@ -60,13 +62,13 @@ public function delete_user_by_md5_id($id,$business_id)
|
||||
public function activate_inactive_users($id,$business_id)
|
||||
{
|
||||
$this->db->where('md5(id)', $id);
|
||||
if ($business_id != NULL) {
|
||||
if ($business_id != 0) {
|
||||
$this->db->where('business_id', $business_id);
|
||||
}
|
||||
$this->db->set('is_active',1);
|
||||
$this->db->update('users');
|
||||
$this->db->where('md5(user_id)', $id);
|
||||
if ($business_id != NULL) {
|
||||
if ($business_id != 0) {
|
||||
$this->db->where('business_id', $business_id);
|
||||
}
|
||||
$this->db->set('is_active',1);
|
||||
|
||||
@ -17,9 +17,9 @@
|
||||
<!-- <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> -->
|
||||
<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> -->
|
||||
@ -35,38 +35,37 @@ class="form-control " hidden>
|
||||
|
||||
|
||||
<!-- <?php if (is_superadmin()) { ?>
|
||||
<div class="item form-group">
|
||||
<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="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>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<?php } ?> -->
|
||||
<?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 ">
|
||||
@ -91,12 +90,9 @@ class="form-control " hidden>
|
||||
<option value="user">user</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php }
|
||||
|
||||
else if (is_admin() || user()->action_permit != 'view') { ?>
|
||||
<?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>
|
||||
@ -105,8 +101,6 @@ class="form-control " hidden>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <br /> <h6></h6> <div class="x_title"> </div> <br /> -->
|
||||
<!-- --------------------------- -->
|
||||
<div class="item form-group">
|
||||
@ -122,7 +116,7 @@ class="form-control ">
|
||||
style="color:red;">*</a> </label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input type="email" id="email" name="email" value="" required="required"
|
||||
class="form-control ">
|
||||
class="form-control" onkeyup="check_if_exists(this.id, this.value, this.name)">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -134,7 +128,7 @@ class="form-control ">
|
||||
<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="" required="required" class="form-control ">
|
||||
value="" 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<a
|
||||
@ -155,12 +149,11 @@ class="form-control">
|
||||
<div class="x_title"> </div> <br />
|
||||
|
||||
<div class="item form-group">
|
||||
|
||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Username<a
|
||||
style="color:red;">*</a> </label>
|
||||
<div class="col-md-3 col-sm-3 ">
|
||||
<input type="text" id="user_name" name="user_name" value="" required="required"
|
||||
class="form-control ">
|
||||
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"> Password<a
|
||||
@ -180,20 +173,8 @@ class="fa fa-fw fa-eye field-icon toggle-password"></span>
|
||||
required="required" class="form-control ">
|
||||
<span id='message'></span>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="ln_solid"></div>
|
||||
<div class="item form-group">
|
||||
<div class="offset-md-8">
|
||||
@ -207,14 +188,31 @@ class="fa fa-fw fa-eye field-icon toggle-password"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Body page content -->
|
||||
<!-- /Body page content -->
|
||||
|
||||
<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>
|
||||
@ -1,115 +1,143 @@
|
||||
|
||||
<!-- Body page content -->
|
||||
|
||||
|
||||
|
||||
<div class="">
|
||||
<div class="page-title">
|
||||
<div class="page-title">
|
||||
|
||||
<div class="title_left">
|
||||
<h3>Edit User</h3>
|
||||
<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>
|
||||
|
||||
|
||||
</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 ">
|
||||
</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 ">
|
||||
</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 ">
|
||||
</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>
|
||||
@ -1,5 +1,24 @@
|
||||
<head>
|
||||
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css'>
|
||||
<style>
|
||||
.status-success {
|
||||
background-color: #c1ffc1;
|
||||
color: #008000;
|
||||
border-radius:1px;
|
||||
font-weight: bold;
|
||||
width: 300px;
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
.status-danger {
|
||||
background-color: #ffb6c1;
|
||||
color: #ff0000;
|
||||
border-radius: 1px;
|
||||
font-weight: bold;
|
||||
width: 300px;
|
||||
height: 200px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<div class="col-md-12 col-sm-12 ">
|
||||
<div class="x_panel">
|
||||
@ -28,6 +47,7 @@
|
||||
<th class="column-title">Mobile </th>
|
||||
<th class="column-title" >Role </th>
|
||||
<th class="column-title" >Permit </th>
|
||||
<th class="column-title" >status </th>
|
||||
<th class="column-title" >Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -43,6 +63,13 @@
|
||||
<td class=" "><?php echo $value->mobile; ?></td>
|
||||
<td class=" "><?php echo $value->role; ?></td>
|
||||
<td class=" "><?php echo $value->action_permit; ?></td>
|
||||
<td class=" ">
|
||||
<?php if ($value->is_active == 1) { ?>
|
||||
<span class="status-success">Active</span>
|
||||
<?php } else if ($value->is_active == 0){ ?>
|
||||
<span class="status-danger">In-active</span>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td style=" text-align: center; font-size: 16px;">
|
||||
<?php if ($value->is_active == 1) { ?>
|
||||
<?php if(user()->action_permit != 'view' ) { ?>
|
||||
@ -52,13 +79,13 @@
|
||||
<i class="fa fa-times-circle-o" aria-hidden="true" style="font-size:20px;" title="deactivate"></i></a>
|
||||
|
||||
<?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 if ($value->is_active == 0) { ?>
|
||||
<a href="<?php echo base_url()?>User/activateUser/<?php echo md5($value->id);?>" >
|
||||
<i class="green fa fa-check-circle" style="font-size:20px;" title="activate"></i></a>
|
||||
|
||||
<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 } ?>
|
||||
</td>
|
||||
|
||||
BIN
assets/appimg/bg-1.jpg
Normal file
BIN
assets/appimg/bg-1.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
BIN
assets/appimg/bg-2.jpg
Normal file
BIN
assets/appimg/bg-2.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 523 KiB |
BIN
assets/appimg/bg-3.jpg
Normal file
BIN
assets/appimg/bg-3.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.3 MiB |
BIN
assets/appimg/bg-4.jpg
Normal file
BIN
assets/appimg/bg-4.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 700 KiB |
Loading…
Reference in New Issue
Block a user