TEST_AND_FIXING_ALL_MODULES : RV

This commit is contained in:
VENKATESHWARAN 2023-12-18 10:37:59 +05:30
parent 8159b60810
commit d0af316efd
33 changed files with 4822 additions and 2705 deletions

BIN
ams_vendor.zip Normal file

Binary file not shown.

View File

@ -79,6 +79,10 @@
'username' => 'root', 'username' => 'root',
'password' => '', 'password' => '',
'database' => 'test', 'database' => 'test',
// 'hostname' => '119.18.54.85',
// 'username' => 'venbaehn_ams',
// 'password' => 'L;nD7Z@f)1ZT',
// 'database' => 'venbaehn_ams',
'dbdriver' => 'mysqli', 'dbdriver' => 'mysqli',
'dbprefix' => '', 'dbprefix' => '',
'pconnect' => FALSE, 'pconnect' => FALSE,

View File

@ -190,10 +190,12 @@ public function verify_otp(){
public function change_password() 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')); $data['password'] = hash_password($this->input->post('password'));
$table="users"; $table="users";
$userData = $this->MY_Model->edit_option($data, $id, $table); $userData = $this->MY_Model->edit_option($data, $id, $table);
redirect('login'); redirect('login');
} }

View File

@ -1,15 +1,18 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script> <head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Meta, title, CSS, favicons, etc. --> <!-- Meta, title, CSS, favicons, etc. -->
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>AMS </title> <link rel="icon" href="<?php echo base_url(); ?>/assets/appimg/default.ico" />
<title>BigBamboo Enterprise</title>
<!-- Bootstrap --> <!-- Bootstrap -->
<link href="<?php echo base_url(); ?>/assets/default/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"> <link href="<?php echo base_url(); ?>/assets/default/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
@ -22,9 +25,9 @@
<!-- Custom Theme Style --> <!-- Custom Theme Style -->
<link href="<?php echo base_url(); ?>/assets/default/build/css/custom.min.css" rel="stylesheet"> <link href="<?php echo base_url(); ?>/assets/default/build/css/custom.min.css" rel="stylesheet">
</head> </head>
<style> <style>
.field-icon { .field-icon {
float: right; float: right;
margin-left: -25px; margin-left: -25px;
margin-top: -45px; margin-top: -45px;
@ -32,71 +35,62 @@
position: relative; position: relative;
z-index: 3; z-index: 3;
} }
</style> </style>
<body class="login">
<div class="login_wrapper"> <body class="login">
<div class="login_wrapper">
<div class="animate form login_form"> <div class="animate form login_form">
<section class="login_content"> <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"> <form id="otp-form" data-parsley-validate class="form-horizontal form-label-left" method="post"
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>"> action="<?php echo base_url();?>auth/change_password" enctype="multipart/form-data">
<input type="hidden" id="id" name="id" value="<?php echo $id ?>"> <input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>"
<h1>Change Password</h1> value="<?php echo $this->security->get_csrf_hash();?>">
<div> <input type="hidden" id="id" name="id" value="<?php echo $id ?>">
<input type="password" id="password" name="password" class="form-control" placeholder="Password" required="required" /> <h1>Change Password</h1>
<span toggle="#password" id="toggle-password" class="fa fa-fw fa-eye field-icon toggle-password"></span> <div>
</div> <input type="password" id="password" name="password" class="form-control" placeholder="Password"
<div> required="required" />
<input type="password" id="confirm_password" name="confirm_password" class="form-control" placeholder="Confrim Password" required="required" /> <span toggle="#password" id="toggle-password"
<p id='message'></p> class="fa fa-fw fa-eye field-icon toggle-password"></span>
</div> </div>
<div> <div>
<button type="submit" class="btn btn-primary">Submit</button> <input type="password" id="confirm_password" name="confirm_password" class="form-control"
</div> placeholder="Confrim Password" required="required" />
<p id='message'></p>
</div>
<div>
<button type="submit" class="btn btn-primary">Submit</button>
</div>
<div class="clearfix"></div> <div class="clearfix"></div>
</form>
</section>
<!-- <div class="separator"> <script>
<p class="change_link">Already a member ? $("#toggle-password").click(function() {
<a href="<?php echo base_url().'auth/verify_user'?>" class="to_register"> Log in </a> $(this).toggleClass("fa-eye fa-eye-slash");
</p> var input = $($(this).attr("toggle"));
if (input.attr("type") == "password") {
input.attr("type", "text");
} else {
input.attr("type", "password");
}
});
<div class="clearfix"></div> $('#password, #confirm_password').on('keyup', function() {
<br /> $(':input[type="submit"]').prop('disabled', true);
if ($('#password').val() == $('#confirm_password').val() && $('#confirm_password').val()
<div> .length > 0) {
<h1><i class="fa fa-paw"></i> Gentelella Alela!</h1> $('#message').html('Matching').css('color', 'green');
<p>©2016 All Rights Reserved. Gentelella Alela! is a Bootstrap 4 template. Privacy and Terms</p> $('button[type="submit"]').attr("disabled", false);
</div> } else if ($('#password').val().length == 0 || $('#confirm_password').val().length == 0) {
</div> --> $('#message').html('');
</form> } else
</section> $('#message').html('Not Matching').css('color', 'red');
});
<script> </script>
$("#toggle-password").click(function() { </div>
$(this).toggleClass("fa-eye fa-eye-slash"); </div>
var input = $($(this).attr("toggle"));
if (input.attr("type") == "password") {
input.attr("type", "text");
}
else {
input.attr("type", "password");
}
});
$('#password, #confirm_password').on('keyup', function () {
$(':input[type="submit"]').prop('disabled', true);
if ($('#password').val() == $('#confirm_password').val() && $('#confirm_password').val().length > 0 ) {
$('#message').html('Matching').css('color', 'green');
$('button[type="submit"]').attr("disabled", false);
}
else if($('#password').val().length == 0 || $('#confirm_password').val().length == 0){
$('#message').html('');
}
else
$('#message').html('Not Matching').css('color', 'red');
});
</script>
</div>
</div>
</body> </body>
</html> </html>

View File

@ -1,13 +1,15 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Meta, title, CSS, favicons, etc. --> <!-- Meta, title, CSS, favicons, etc. -->
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="<?php echo base_url(); ?>/assets/appimg/default.ico" />
<title>AMS </title> <title>BigBamboo Enterprise</title>
<!-- Bootstrap --> <!-- Bootstrap -->
<link href="<?php echo base_url(); ?>/assets/default/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"> <link href="<?php echo base_url(); ?>/assets/default/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
@ -20,93 +22,58 @@
<!-- Custom Theme Style --> <!-- Custom Theme Style -->
<link href="<?php echo base_url(); ?>/assets/default/build/css/custom.min.css" rel="stylesheet"> <link href="<?php echo base_url(); ?>/assets/default/build/css/custom.min.css" rel="stylesheet">
</head> </head>
<body class="login"> <body class="login">
<div> <div>
<a class="hiddenanchor" id="signup"></a> <a class="hiddenanchor" id="signup"></a>
<a class="hiddenanchor" id="signin"></a> <a class="hiddenanchor" id="signin"></a>
<div class="login_wrapper"> <div class="login_wrapper">
<div class="animate form login_form"> <div class="animate form login_form">
<section class="login_content"> <section class="login_content">
<form method="post" action="<?php echo base_url().'Auth/authendicate'?>"> <form method="post" action="<?php echo base_url().'Auth/authendicate'?>">
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>"> <input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>"
<h1>Sign In</h1> value="<?php echo $this->security->get_csrf_hash();?>">
<div> <h1>Sign In</h1>
<input type="text" class="form-control" value="" name="user_name" placeholder="Username" required="" /> <div>
</div> <input type="text" class="form-control" value="" name="user_name" placeholder="Username"
<div> required="" />
<input type="password" class="form-control" value="" name="password" placeholder="Password" required="" /> </div>
<p id='message' style="color:red"><?php echo $this->session->flashdata('msg'); ?></p> <div>
</div> <input type="password" class="form-control" value="" name="password" placeholder="Password"
<div> required="" />
<button type="submit" class="btn btn-primary">Log in</button> <p id='message' style="color:red"><?php echo $this->session->flashdata('msg'); ?></p>
<a class="reset_pass" href="<?php echo base_url();?>Auth/lost_your_password">Lost your password?</a> </div>
</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>
</div>
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="separator"> <div class="separator">
<!-- <p class="change_link">New to site? --> <!-- <p class="change_link">New to site? -->
<!-- <a href="<?php echo base_url().'Auth/lost_your_password'?>" class="to_register"> Create Account </a> <!-- <a href="<?php echo base_url().'Auth/lost_your_password'?>" class="to_register"> Create Account </a> </p> -->
</p> -->
<div class="clearfix"></div> <div class="clearfix"></div>
<br /> <br />
<div>
<p><?php echo date('Y'). ' ' . "&copy; ". " ".'BigBamboo Enterprise' ;?></p>
</div>
</div>
</form>
</section>
</div>
<div>
<!-- <h1>Venba Infotech!</h1> -->
<p>All Rights Reserved.Privacy and Terms</p>
</div>
</div>
</form>
</section>
</div> </div>
<div id="register" class="animate form registration_form">
<section class="login_content">
<form>
<h1>Create Account</h1>
<div>
<input type="text" class="form-control" placeholder="Username" required="" />
</div>
<div>
<input type="email" class="form-control" placeholder="Email" required="" />
</div>
<div>
<input type="password" class="form-control" placeholder="Password" required="" />
</div>
<div>
<a class="btn btn-default submit" href="index.html">Submit</a>
</div>
<div class="clearfix"></div>
<div class="separator">
<p class="change_link">Already a member ?
<a href="#signin" class="to_register"> Log in </a>
</p>
<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>
</div>
</form>
</section>
</div>
</div>
</div> </div>
</body> </body>
</html> </html>

View File

@ -1,15 +1,17 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script> <head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Meta, title, CSS, favicons, etc. --> <!-- Meta, title, CSS, favicons, etc. -->
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="<?php echo base_url(); ?>/assets/appimg/default.ico" />
<title>AMS </title> <title>BigBamboo Enterprise</title>
<!-- Bootstrap --> <!-- Bootstrap -->
<link href="<?php echo base_url(); ?>/assets/default/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"> <link href="<?php echo base_url(); ?>/assets/default/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
@ -22,153 +24,156 @@
<!-- Custom Theme Style --> <!-- Custom Theme Style -->
<link href="<?php echo base_url(); ?>/assets/default/build/css/custom.min.css" rel="stylesheet"> <link href="<?php echo base_url(); ?>/assets/default/build/css/custom.min.css" rel="stylesheet">
</head> </head>
<style> <style>
.otp{ .otp {
text-align: right; text-align: right;
clear: both; clear: both;
float:right; float: right;
} }
</style> </style>
<body class="login"> <body class="login">
<div class="login_wrapper"> <div class="login_wrapper">
<div class="animate form login_form"> <div class="animate form login_form">
<section class="login_content"> <section class="login_content">
<form id="otp-form" data-parsley-validate class="form-horizontal form-label-left" method="post" action="" enctype="multipart/form-data"> <form id="otp-form" data-parsley-validate class="form-horizontal form-label-left" method="post"
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>"> action="" enctype="multipart/form-data">
<input type="hidden" id="hidden_otp" name="hidden_otp" class="form-control" value="" /> <input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>"
<input type="hidden" id="id" name="id" value=""> value="<?php echo $this->security->get_csrf_hash();?>">
<h1>Forgot Password</h1> <input type="hidden" id="hidden_otp" name="hidden_otp" class="form-control" value="" />
<!-- <div> <input type="hidden" id="id" name="id" value="">
<h1>Forgot Password</h1>
<!-- <div>
<input type="text" class="form-control" placeholder="Username" required="" /> <input type="text" class="form-control" placeholder="Username" required="" />
</div> --> </div> -->
<div> <div>
<a href="#" onclick="send_otp()" class="otp"> Send OTP </a> <a href="#" onclick="send_otp()" class="otp"> Send OTP </a>
<div> <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"
<p id="span_msg"></p> required="required" />
</div> <p id="span_msg"></p>
</div> </div>
<div> </div>
<input type="text" id="otp" name="otp" class="form-control" placeholder="OTP" required="required" /> <div>
<p id="otp_span_msg"></p> <input type="text" id="otp" name="otp" class="form-control" placeholder="OTP"
</div> required="required" />
<div> <p id="otp_span_msg"></p>
<button type="button" class="btn btn-primary">Submit</button> </div>
<!-- Button trigger modal --> <div>
<!-- <button type="button" class="btn btn-secondary" data-toggle="modal" data-target=".bs-example-modal-sm"> <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 Small modal
</button> --> </button> -->
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="separator"> <div class="separator">
<!-- <p class="change_link">Already a member ? <!-- <p class="change_link">Already a member ?
<a href="<?php echo base_url().'auth/verify_user'?>" class="to_register"> Log in </a> <a href="<?php echo base_url().'auth/verify_user'?>" class="to_register"> Log in </a>
</p> --> </p> -->
<div class="clearfix"></div> <div class="clearfix"></div>
<br /> <br />
<div> <div>
<!-- <h1><i class="fa fa-paw"></i> Gentelella Alela!</h1> <!-- <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> --> <p>©2016 All Rights Reserved. Gentelella Alela! is a Bootstrap 4 template. Privacy and Terms</p> -->
</div> </div>
</div> </div>
</form> </form>
</section> </section>
</div> </div>
</div> </div>
<div class="body"></div> <div class="body"></div>
<script> <script>
function send_otp(){ function send_otp() {
if ($('#email').val()) if ($('#email').val()) {
{ $('#span_msg').html('');
$('#span_msg').html(''); var data = $("#otp-form").serialize();
var data = $("#otp-form").serialize(); $.ajax({
$.ajax({ type: "post",
type: "post", url: "<?php echo base_url();?>auth/send__mail",
url: "<?php echo base_url();?>auth/send__mail", data: data,
data: data, json: true,
json: true, success: function(response) {
success: function (response) { // decode encoded json
// decode encoded json response = jQuery.parseJSON(response)
response = jQuery.parseJSON(response) if (response.status == "failed") {
if (response.status == "failed") { //update the csrf to the form
//update the csrf to the form $('input[name=csrf_test_name]').val(response.csrf_hash);
$('input[name=csrf_test_name]').val(response.csrf_hash); $('#span_msg').html('invalid username').css('color', 'red');
$('#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');
} }
else{ }
//update the csrf to the form
$('input[name=csrf_test_name]').val(response.csrf_hash); $('#email').on('keyup', function() {
$('#hidden_otp').val(response.otp); if (!$('#email').val())
$('#id').val(response.id); $('#span_msg').html('');
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');
}
}
$('#email').on('keyup', function () { $('#otp').on('keyup', function() {
if (!$('#email').val()) if (!$('#otp').val())
$('#span_msg').html(''); $('#otp_span_msg').html('');
});
$('#otp').on('keyup', function () {
if (!$('#otp').val())
$('#otp_span_msg').html('');
});
$(document).on('click','#close-form',function(){
$('.bs-example-modal-sm').css('display', 'none');
});
$(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{ $(document).on('click', '#close-form', function() {
$('#otp_span_msg').html('Pls enter OTP').css('color', 'red'); $('.bs-example-modal-sm').css('display', 'none');
} });
});
</script>
$(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');
}
});
</script>
</body> </body>
</html> </html>

View File

@ -42,8 +42,8 @@ public function index()
public function business_list() public function business_list()
{ {
$business_list = $this->Business_model->get_business_details(); $business_list = $this->Business_model->get_business_details();
$this->layout->set('tableData', $business_list); $this->layout->set('tableData', $business_list);
$this->layout->buffer('main_content', 'Business/business_list'); $this->layout->buffer('main_content', 'Business/business_list');
$this->layout->render('default_layout'); $this->layout->render('default_layout');
@ -52,7 +52,7 @@ public function business_list()
public function add_business() public function add_business()
{ {
$this->layout->set('stateData', $this->MY_Model->select('state')); $this->layout->set('stateData', $this->MY_Model->select('state'));
$this->layout->set('ModuleData', $this->MY_Model->select('modules')); $this->layout->set('ModuleData', $this->MY_Model->select('modules'));
$this->layout->buffer('main_content', 'Business/add_business'); $this->layout->buffer('main_content', 'Business/add_business');
$this->layout->render('default_layout'); $this->layout->render('default_layout');
@ -87,14 +87,20 @@ public function create_business()
$add_admin = $this->input->post('add_admin'); $add_admin = $this->input->post('add_admin');
unset($data['add_admin']); unset($data['add_admin']);
} }
$count = count($this->input->post('module_id'));
for($i=0;$i<$count;$i++) $modules = $this->input->post('module_id');
{ if($modules !== NULL && $modules !== ''){
$mdata['module_id'] = $this->input->post('module_id')[$i];
$mdata['uid'] = $this->input->post('uid'); $count = count($modules);
$mdata['is_active'] = 1;
$add_module = $this->MY_Model->insert($mdata, "permit_modules"); for($i=0;$i<$count;$i++)
} {
$mdata['module_id'] = $this->input->post('module_id')[$i];
$mdata['uid'] = $this->input->post('uid');
$mdata['is_active'] = 1;
$add_module = $this->MY_Model->insert($mdata, "permit_modules");
}
}
unset($data['module_id']); unset($data['module_id']);
$create_business = $this->MY_Model->insert($data,$table); $create_business = $this->MY_Model->insert($data,$table);
@ -187,12 +193,7 @@ public function edit_business()
$differentValues1 = array_diff($module_id_array , $DbData); $differentValues1 = array_diff($module_id_array , $DbData);
$differentValues2 = array_diff($DbData , $module_id_array); $differentValues2 = array_diff($DbData , $module_id_array);
$final_array = array_merge($differentValues1, $differentValues2); $final_array = array_merge($differentValues1, $differentValues2);
// echo "<pre>";
// print_r($DbData); print_r($this->input->post('module_id')); print_r($final_array);
// echo "<pre>";
// die;
if(count($final_array) != 0) if(count($final_array) != 0)
{ {
foreach($final_array as $key => $value){ foreach($final_array as $key => $value){
@ -250,7 +251,7 @@ public function delete_business($id)
{ {
$Data = $this->Business_model->delete_by_md5_id($id,user()->business_id,'asset'); $Data = $this->Business_model->delete_by_md5_id($id,user()->business_id,'asset');
redirect('Business/business_list'); redirect('Business/business_list');
} }
//===================== MODULES ================================================= //===================== MODULES =================================================
@ -305,15 +306,4 @@ public function getDeleteConfirmationPopup()
} }
} }

View File

@ -1,18 +1,17 @@
<!-- Body page content --> <!-- Body page content -->
<script src="<?php echo base_url(); ?>/assets/default/jquery/dist/jquery.min.js"></script> <script src="<?php echo base_url(); ?>/assets/default/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>/assets/jquery.multi-select.js"></script> <script type="text/javascript" src="<?php echo base_url(); ?>/assets/jquery.multi-select.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(document).ready(function($){ jQuery(document).ready(function($) {
$('#people').multiSelect(); $('#people').multiSelect();
}); });
</script> </script>
<style type="text/css"> <style type="text/css">
.multi-select-container { .multi-select-container {
display: inline-block; display: inline-block;
position: relative; position: relative;
width:100%; width: 100%;
} }
.multi-select-menu { .multi-select-menu {
@ -57,7 +56,7 @@
width: 1px; width: 1px;
} }
.multi-select-menuitem + .multi-select-menuitem { .multi-select-menuitem+.multi-select-menuitem {
padding-top: 0; padding-top: 0;
} }
@ -73,9 +72,9 @@
.multi-select-button { .multi-select-button {
display: block; display: block;
margin-top:2px; margin-top: 2px;
width:100%; width: 100%;
max-width: 100%!important; max-width: 100% !important;
font-size: 0.875em; font-size: 0.875em;
padding: 0.85em 0.6em; padding: 0.85em 0.6em;
white-space: nowrap; white-space: nowrap;
@ -98,8 +97,8 @@
border-color: #999 transparent transparent transparent; border-color: #999 transparent transparent transparent;
margin-left: 0.4em; margin-left: 0.4em;
vertical-align: 0.1em; vertical-align: 0.1em;
right:5px; right: 5px;
top:17px; top: 17px;
} }
.multi-select-container--open .multi-select-menu { .multi-select-container--open .multi-select-menu {
@ -120,152 +119,158 @@
/* Allow labels to line wrap when menu is artificially narrowed */ /* Allow labels to line wrap when menu is artificially narrowed */
white-space: normal; white-space: normal;
} }
</style> </style>
<div class=""> <div class="">
<div class="page-title"> <div class="page-title">
<div class="title_left"> <div class="title_left">
<h3>Add Business</h3> <h3>Add Business</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>Business 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();?>Business/create_business" 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="uid" value="<?php echo rand(100000,999999); ?>">
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name">Business Name<a
style="color:red;">*</a> </label>
<div class="col-md-3 col-sm-3 ">
<input type="text" id="business_name" name="business_name"
class="form-control" required>
</div>
<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>
</div>
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Phone<a
style="color:red;">*</a> </label>
<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">
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="last-name">Select Modules</label>
<div class="col-md-5 col-sm-5 ">
<select id="people" name="module_id[]" class="form-control select2_multiple" multiple>
<?php foreach ($ModuleData as $key => $value) { ?>
<option value="<?php echo $value->id; ?>"><?php echo $value->modules; ?></option>
<?php } ?>
</select>
</div>
<label class="control-label col-md-1 col-sm-1 " for="last-name">Select Logo </label>
<div class="col-md-5 col-sm-5 ">
<input id="logo" name="logo" class="typeFile" type="file">
</div>
</div>
<div class="x_title"> </div> <br />
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name">Address</label>
<div class="col-md-5 col-sm-5 ">
<input id="address" name="address" class="form-control" type="text">
</div>
<label class="control-label col-md-1 col-sm-1 " for="first-name">City</label>
<div class="col-md-5 col-sm-5 ">
<input id="city" name="city" class="form-control" type="text">
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="last-name">State</label>
<div class="col-md-5 col-sm-5 ">
<select id="state" name="state" class="form-control">
<option value=""> Select state </option>
<?php foreach ($stateData as $key => $value) { ?>
<option value="<?php echo $value->id; ?>"><?php echo $value->name; ?></option>
<?php } ?>
</select>
</div>
<label class="control-label col-md-1 col-sm-1 " for="first-name">country</label>
<div class="col-md-5 col-sm-5 ">
<input id="country" name="country" class="form-control" type="text">
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name">Pin code</label>
<div class="col-md-5 col-sm-5">
<input id="pincode" name="pincode" class="form-control" type="text">
</div>
</div>
<div class="ln_solid"></div>
<div class="item form-group">
<div class="col-md-6 col-sm-6">
<div class="col-md-1 col-sm-1">
<input type="checkbox" name="add_admin" class="form-control" value="1">
</div>
<label class="control-label col-md-5 col-sm-5" for="first-name"> add admin</label>
</div>
<div class="col-md-5 col-sm-5 offset-md-1">
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
<button class="btn btn-primary" type="reset">Reset</button>
<button type="submit" class="btn btn-success">Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div> </div>
<!-- /Body page content -->
</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>Business 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();?>Business/create_business" 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="uid" value="<?php echo rand(100000,999999); ?>">
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name">Business Name<a style="color:red;">*</a> </label>
<div class="col-md-3 col-sm-3 ">
<input type="text" id="business_name" name="business_name" required="required" class="form-control ">
</div>
<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" required="required" class="form-control ">
</div>
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Phone<a style="color:red;">*</a> </label>
<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" required="required" class="form-control" >
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="last-name">Select Modules<a style="color:red;">*</a></label>
<div class="col-md-5 col-sm-5 ">
<select id="people" name="module_id[]" class="form-control select2_multiple" multiple>
<?php foreach ($ModuleData as $key => $value) { ?>
<option value="<?php echo $value->id; ?>"><?php echo $value->modules; ?></option>
<?php } ?>
</select>
</div>
<label class="control-label col-md-1 col-sm-1 " for="last-name">Select Logo </label>
<div class="col-md-5 col-sm-5 ">
<input id="logo" name="logo" class="typeFile" type="file" >
</div>
</div>
<div class="x_title"> </div> <br />
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name">Address<a style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 ">
<input id="address" name="address" required="required" class="form-control" type="text" >
</div>
<label class="control-label col-md-1 col-sm-1 " for="first-name">City<a style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 ">
<input id="city" name="city" required="required" class="form-control" type="text" >
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="last-name">State<a style="color:red;">*</a></label>
<div class="col-md-5 col-sm-5 ">
<select id="state" name="state" required="required" class="form-control" >
<option value=""> Select state </option>
<?php foreach ($stateData as $key => $value) { ?>
<option value="<?php echo $value->id; ?>"><?php echo $value->name; ?></option>
<?php } ?>
</select>
</div>
<label class="control-label col-md-1 col-sm-1 " for="first-name">country<a style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 ">
<input id="country" name="country" required="required" class="form-control" type="text" >
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name">Pin code<a style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5">
<input id="pincode" name="pincode" required="required" class="form-control" type="text" >
</div>
</div>
<div class="ln_solid"></div>
<div class="item form-group">
<div class="col-md-6 col-sm-6">
<div class="col-md-1 col-sm-1">
<input type="checkbox" name="add_admin" class="form-control" value="1" >
</div>
<label class="control-label col-md-5 col-sm-5" for="first-name"> add admin</label>
</div>
<div class="col-md-5 col-sm-5 offset-md-1">
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
<button class="btn btn-primary" type="reset">Reset</button>
<button type="submit" class="btn btn-success">Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- /Body page content -->

View File

@ -1,49 +1,48 @@
<!-- Body page content --> <!-- Body page content -->
<div class=""> <div class="">
<div class="page-title"> <div class="page-title">
<div class="title_left"> <div class="title_left">
<h3>Add Module</h3> <h3>Add Module</h3>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="x_panel"> <div class="x_panel">
<div class="x_title"> <div class="x_title">
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<div class="x_content"> <div class="x_content">
<br /> <br />
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Business/create_add_module" enctype="multipart/form-data"> <form id="" data-parsley-validate class="form-horizontal form-label-left" method="post"
action="<?php echo base_url();?>Business/create_add_module" 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="<?php echo $this->security->get_csrf_token_name();?>"
value="<?php echo $this->security->get_csrf_hash();?>">
<div class="item form-group"> <div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name">Create Module<a style="color:red;">*</a> </label> <label class="control-label col-md-1 col-sm-1 " for="first-name">Create Module<a
<div class="col-md-5 col-sm-5 "> style="color:red;">*</a> </label>
<input type="text" id="modules" name="modules" class="form-control"required> <div class="col-md-5 col-sm-5 ">
</div> <input type="text" id="modules" name="modules" class="form-control" required>
</div>
</div>
<div class="col-md-5 col-sm-5 offset-md-1">
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
<button type="submit" class="btn btn-success">Submit</button>
</div>
</div>
</form>
</div>
</div>
</div> </div>
<div class="col-md-5 col-sm-5 offset-md-1">
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
<button type="submit" class="btn btn-success">Submit</button>
</div> </div>
</div> </div>
<!-- /Body page content -->
</form>
</div>
</div>
</div>
</div>
</div>
<!-- /Body page content -->

View File

@ -1,4 +1,3 @@
<!-- Body page content --> <!-- Body page content -->
<script src="<?php echo base_url(); ?>/assets/default/jquery/dist/jquery.min.js"></script> <script src="<?php echo base_url(); ?>/assets/default/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>/assets/jquery.multi-select.js"></script> <script type="text/javascript" src="<?php echo base_url(); ?>/assets/jquery.multi-select.js"></script>
@ -8,7 +7,7 @@
.multi-select-container { .multi-select-container {
display: inline-block; display: inline-block;
position: relative; position: relative;
width:100%; width: 100%;
} }
.multi-select-menu { .multi-select-menu {
@ -53,7 +52,7 @@
width: 1px; width: 1px;
} }
.multi-select-menuitem + .multi-select-menuitem { .multi-select-menuitem+.multi-select-menuitem {
padding-top: 0; padding-top: 0;
} }
@ -69,9 +68,9 @@
.multi-select-button { .multi-select-button {
display: block; display: block;
margin-top:2px; margin-top: 2px;
width:100%; width: 100%;
max-width: 100%!important; max-width: 100% !important;
font-size: 0.875em; font-size: 0.875em;
padding: 0.85em 0.6em; padding: 0.85em 0.6em;
white-space: nowrap; white-space: nowrap;
@ -94,8 +93,8 @@
border-color: #999 transparent transparent transparent; border-color: #999 transparent transparent transparent;
margin-left: 0.4em; margin-left: 0.4em;
vertical-align: 0.1em; vertical-align: 0.1em;
right:5px; right: 5px;
top:17px; top: 17px;
} }
.multi-select-container--open .multi-select-menu { .multi-select-container--open .multi-select-menu {
@ -116,189 +115,187 @@
/* Allow labels to line wrap when menu is artificially narrowed */ /* Allow labels to line wrap when menu is artificially narrowed */
white-space: normal; white-space: normal;
} }
</style> </style>
<div class=""> <div class="">
<div class="page-title"> <div class="page-title">
<div class="title_left"> <div class="title_left">
<h3>Edit Business</h3> <h3>Edit Business</h3>
</div> </div>
<a class="btn btn-sm btn-primary" style="float: right;" href="<?php echo base_url();?>Business/business_list">Business List</a> <a class="btn btn-sm btn-primary" style="float: right;"
</div> href="<?php echo base_url();?>Business/business_list">Business List</a>
<div class="clearfix"></div> </div>
<div class="row"> <div class="clearfix"></div>
<div class="col-md-12 col-sm-12 "> <div class="row">
<div class="x_panel"> <div class="col-md-12 col-sm-12 ">
<div class="x_title"> <div class="x_panel">
<div class="x_title">
<ul class="nav navbar-right panel_toolbox"> <ul class="nav navbar-right panel_toolbox">
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li> <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
</li> </li>
</ul> </ul>
<h6>Business Information</h6> <h6>Business Information</h6>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<div class="x_content"> <div class="x_content">
<br /> <br />
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Business/edit_business" enctype="multipart/form-data"> <form id="" data-parsley-validate class="form-horizontal form-label-left" method="post"
action="<?php echo base_url();?>Business/edit_business" 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="<?php echo $this->security->get_csrf_token_name();?>"
<input type="hidden" name="id" value="<?php echo $businessData->id; ?>"> value="<?php echo $this->security->get_csrf_hash();?>">
<input type="hidden" name="uid" value="<?php echo $businessData->uid; ?>"> <input type="hidden" name="id" value="<?php echo $businessData->id; ?>">
<input type="hidden" name="uid" value="<?php echo $businessData->uid; ?>">
<div class="item form-group"> <div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name">Business Name<a style="color:red;">*</a> </label> <label class="control-label col-md-1 col-sm-1 " for="first-name">Business Name<a
<div class="col-md-3 col-sm-3"> style="color:red;">*</a> </label>
<input type="text" id="business_name" name="business_name" value="<?php echo $businessData->business_name; ?>" required="required" class="form-control"> <div class="col-md-3 col-sm-3">
</div> <input type="text" id="business_name" name="business_name"
value="<?php echo $businessData->business_name; ?>" required="required"
class="form-control">
</div>
<label class="control-label col-md-1 col-sm-1 " for="last-name">Email<a style="color:red;">*</a> </label> <label class="control-label col-md-1 col-sm-1 " for="last-name">Email<a
<div class="col-md-3 col-sm-3"> style="color:red;">*</a> </label>
<input type="email" id="email" name="email" value="<?php echo $businessData->email; ?>" required="required" class="form-control "> <div class="col-md-3 col-sm-3">
</div> <input type="email" id="email" name="email" value="<?php echo $businessData->email; ?>"
required="required" class="form-control ">
</div>
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Phone<a style="color:red;">*</a> </label> <label class="control-label col-md-1 col-sm-1 " for="first-name"> Phone<a
<div class="col-md-3 col-sm-3"> style="color:red;">*</a> </label>
<input id="phone" type="text" pattern="[6-9]{1}[0-9]{9}" <div class="col-md-3 col-sm-3">
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"> <input id="phone" type="text" pattern="[6-9]{1}[0-9]{9}"
</div> title="Phone number with 6-9 and remaing 9 digit with 0-9" name="phone"
</div> value="<?php echo $businessData->phone; ?>" required="required"
class="form-control">
</div>
</div>
<div class="item form-group"> <div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="last-name">Select Modules</label>
<div class="col-md-5 col-sm-5 ">
<select id="people" name="module_id[]" class="form-control select2_multiple" multiple>
<?php
<label class="control-label col-md-1 col-sm-1 " for="last-name">Select Modules<a style="color:red;">*</a></label> $modulesArray = [];
<div class="col-md-5 col-sm-5 ">
foreach ($businessModuleData as $object) {
<select id="people" name="module_id[]" class="form-control select2_multiple" multiple > if (isset($object->modules)) {
$modulesArray[] = $object->modules;
}
<?php ?> }
<?php foreach ($ModuleData as $key => $data) { ?>
<?php if(in_array($data->modules, $modulesArray)) { ?>
$modulesArray = []; <option value="<?php echo $data->id; ?>" selected> <?php echo $data->modules; ?></option>
<?php } else { ?>
foreach ($businessModuleData as $object) { <option value="<?php echo $data->id; ?>"><?php echo $data->modules;?> </option>
if (isset($object->modules)) { <?php } ?>
$modulesArray[] = $object->modules; <?php } ?>
} </select>
</div>
}
foreach ($ModuleData as $key => $data) { ?>
<?php if(in_array($data->modules, $modulesArray)) { ?>
<option value="<?php echo $data->id; ?>" selected> <?php echo $data->modules; ?> </option>
<?php } else { ?>
<option value="<?php echo $data->id; ?>"><?php echo $data->modules;?> </option>
<?php } ?>
<?php } ?>
</select>
</div>
<label class="control-label col-md-1 col-sm-1 " for="last-name">Select Logo<a style="color:red;">*</a> </label> <label class="control-label col-md-1 col-sm-1 " for="last-name">Select Logo</label>
<div class="col-md-5 col-sm-5 "> <div class="col-md-5 col-sm-5 ">
<input id="logo" name="logo" class="typeFile" type="file" value="<?php echo $businessData->logo; ?>"> <input id="logo" name="logo" class="typeFile" type="file"
</div> value="<?php echo $businessData->logo; ?>">
</div> </div>
</div>
<br /> <div class="x_title"> </div> <br /> <br />
<div class="x_title"> </div> <br />
<div class="item form-group"> <div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name">Address<a style="color:red;">*</a> </label> <label class="control-label col-md-1 col-sm-1 " for="first-name">Address</label>
<div class="col-md-5 col-sm-5"> <div class="col-md-5 col-sm-5">
<input id="address" name="address" value="<?php echo $businessData->address; ?>" required="required" class="form-control" type="text"> <input id="address" name="address" value="<?php echo $businessData->address; ?>"
</div> class="form-control" type="text">
</div>
<label class="control-label col-md-1 col-sm-1 " for="first-name">City<a style="color:red;">*</a> </label> <label class="control-label col-md-1 col-sm-1 " for="first-name">City</label>
<div class="col-md-5 col-sm-5 "> <div class="col-md-5 col-sm-5 ">
<input id="city" name="city" value="<?php echo $businessData->city; ?>" required="required" class="form-control" type="text" > <input id="city" name="city" value="<?php echo $businessData->city; ?>"
</div> required="required" class="form-control" type="text">
</div> </div>
</div>
<div class="item form-group"> <div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="last-name">State<a style="color:red;">*</a></label> <label class="control-label col-md-1 col-sm-1 " for="last-name">State</label>
<div class="col-md-5 col-sm-5 "> <div class="col-md-5 col-sm-5 ">
<select id="state" name="state" required="required" class="form-control" > <select id="state" name="state" class="form-control">
<option value="<?php echo $businessData->state; ?>"> <?php echo $businessData->state_name; ?> </option> <option value="<?php echo $businessData->state; ?>">
<?php foreach ($stateData as $key => $value) { ?> <?php echo $businessData->state_name; ?> </option>
<option value="<?php echo $value->id; ?>"><?php echo $value->name;?></option> <?php foreach ($stateData as $key => $value) { ?>
<?php } ?> <option value="<?php echo $value->id; ?>"><?php echo $value->name;?></option>
</select> <?php } ?>
</div> </select>
</div>
<label class="control-label col-md-1 col-sm-1 " for="first-name">country<a style="color:red;">*</a> </label> <label class="control-label col-md-1 col-sm-1 " for="first-name">country</label>
<div class="col-md-5 col-sm-5 "> <div class="col-md-5 col-sm-5 ">
<input id="country" name="country" value="<?php echo $businessData->country; ?>" required="required" class="form-control" type="text" > <input id="country" name="country" value="<?php echo $businessData->country; ?>"
</div> class="form-control" type="text">
</div> </div>
</div>
<div class="item form-group"> <div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name">Pin code<a style="color:red;">*</a> </label> <label class="control-label col-md-1 col-sm-1 " for="first-name">Pin code</label>
<div class="col-md-5 col-sm-5"> <div class="col-md-5 col-sm-5">
<input id="pincode" name="pincode" value="<?php echo $businessData->pincode; ?>" required="required" class="form-control" type="text" > <input id="pincode" name="pincode" value="<?php echo $businessData->pincode; ?>"
</div> class="form-control" type="text">
</div> </div>
</div>
<div class="ln_solid"></div> <div class="ln_solid"></div>
<div class="item form-group"> <div class="item form-group">
<div class="offset-md-8"> <div class="offset-md-8">
<button class="btn btn-primary" onclick="history.back()">Cancel</button> <button class="btn btn-primary" onclick="history.back()">Cancel</button>
<button type="submit" class="btn btn-success">Update</button> <button type="submit" class="btn btn-success">Update</button>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
jQuery(document).ready(function($){ jQuery(document).ready(function($) {
$('#people').multiSelect(); $('#people').multiSelect();
}); });
// $(document).ready(function() { // $(document).ready(function() {
// $("#people").on("click", function() { // $("#people").on("click", function() {
// // Get the selected values as an array // // Get the selected values as an array
// var selectedValues = $("#people").val(); // var selectedValues = $("#people").val();
// // Do something with the selected values (e.g., display them) // // Do something with the selected values (e.g., display them)
// if (selectedValues) { // if (selectedValues) {
// var selectedValuesString = selectedValues.join(", "); // var selectedValuesString = selectedValues.join(", ");
// alert("Selected Values: " + selectedValuesString); // alert("Selected Values: " + selectedValuesString);
// } else { // } else {
// alert("No values selected."); // alert("No values selected.");
// } // }
// }); // });
// }); // });
var selected = []; var selected = [];
for (var option of document.getElementById('people').options) for (var option of document.getElementById('people').options) {
{ if (option.selected) {
if (option.selected) { selected.push(option.value);
selected.push(option.value); }
} }
} </script>
</script> </div>
</div> </div>
</div> <!-- /Body page content -->
<!-- /Body page content -->

View File

@ -1,53 +1,53 @@
<!-- Body page content --> <!-- Body page content -->
<div class=""> <div class="">
<div class="page-title"> <div class="page-title">
<div class="title_left">
<h3>Edit Module</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">
<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();?>Business/edit_module_data" 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 $module_data->id;?>">
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name">Module Name<a
style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 ">
<input type="text" id="modules" name="modules" class="form-control" required
value="<?php echo $module_data->modules ?>">
</div>
</div>
<div class="col-md-5 col-sm-5 offset-md-1">
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
<button type="submit" class="btn btn-success">Update</button>
</div>
</div>
</form>
</div>
</div>
</div>
<div class="title_left">
<h3>Edit Module</h3>
</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">
<div class="clearfix"></div>
</div> </div>
<div class="x_content"> <!-- /Body page content -->
<br />
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Business/edit_module_data" 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 $module_data->id;?>">
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name">Module Name<a style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 ">
<input type="text" id="modules" name="modules" class="form-control"required value="<?php echo $module_data->modules ?>">
</div>
</div>
<div class="col-md-5 col-sm-5 offset-md-1">
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
<button type="submit" class="btn btn-success">Update</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- /Body page content -->

View File

@ -70,52 +70,7 @@ public function addEmployee($businessId = 0)
} }
public function add_employee_education()
{
$id = $this->input->post('id');
if ($id) {
$data = $this->input->post();
// $id = $this->input->post('id');
$data['business_id'] = user()->business_id;
$table="employee_qualification";
$create_user = $this->MY_Model->update_md5($data,md5($id),$table);
redirect('Employee/editEmployee/'.md5($this->input->post('emp_id')));
}
else{
$data = $this->input->post();
// $id = $this->input->post('id');
$data['business_id'] = user()->business_id;
$table="employee_qualification";
$create_user = $this->MY_Model->insert($data,$table);
redirect('Employee/editEmployee/'.md5($this->input->post('emp_id')));
}
}
public function add_employee_history()
{
$id = $this->input->post('id');
if ($id) {
$data = $this->input->post();
// $id = $this->input->post('id');
$data['business_id'] = user()->business_id;
$table="employee_history";
$create_user = $this->MY_Model->update_md5($data,md5($id),$table);
redirect('Employee/editEmployee/'.md5($this->input->post('emp_id')));
}
else{
$data = $this->input->post();
// $id = $this->input->post('id');
$data['business_id'] = user()->business_id;
$table="employee_history";
$create_user = $this->MY_Model->insert($data,$table);
redirect('Employee/editEmployee/'.md5($this->input->post('emp_id')));
}
}
public function createEmp() public function createEmp()
{ {
//insert in users table //insert in users table
@ -532,5 +487,52 @@ public function editEmp_history($id)
} }
public function add_employee_education()
{
$id = $this->input->post('id');
if ($id) {
$data = $this->input->post();
// $id = $this->input->post('id');
$data['business_id'] = user()->business_id;
$table="employee_qualification";
$create_user = $this->MY_Model->update_md5($data,md5($id),$table);
redirect('Employee/editEmployee/'.md5($this->input->post('emp_id')));
}
else{
$data = $this->input->post();
// $id = $this->input->post('id');
$data['business_id'] = user()->business_id;
$table="employee_qualification";
$create_user = $this->MY_Model->insert($data,$table);
redirect('Employee/editEmployee/'.md5($this->input->post('emp_id')));
}
}
public function add_employee_history()
{
$id = $this->input->post('id');
if ($id) {
$data = $this->input->post();
// $id = $this->input->post('id');
$data['business_id'] = user()->business_id;
$table="employee_history";
$create_user = $this->MY_Model->update_md5($data,md5($id),$table);
redirect('Employee/editEmployee/'.md5($this->input->post('emp_id')));
}
else{
$data = $this->input->post();
// $id = $this->input->post('id');
$data['business_id'] = user()->business_id;
$table="employee_history";
$create_user = $this->MY_Model->insert($data,$table);
redirect('Employee/editEmployee/'.md5($this->input->post('emp_id')));
}
}
} }

View File

@ -1,26 +1,25 @@
<!-- Body page content --> <!-- Body page content -->
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script> <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>/assets/jquery.multi-select.js"></script> <script type="text/javascript" src="<?php echo base_url(); ?>/assets/jquery.multi-select.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(document).ready(function($){ jQuery(document).ready(function($) {
$('#people').multiSelect(); $('#people').multiSelect();
}); });
</script> </script>
<style type="text/css"> <style type="text/css">
.multi-select-container { .multi-select-container {
display: inline-block; display: inline-block;
position: relative; position: relative;
width:100%; width: 100%;
} }
.multi-select-menu { .multi-select-menu {
@ -65,7 +64,7 @@
width: 1px; width: 1px;
} }
.multi-select-menuitem + .multi-select-menuitem { .multi-select-menuitem+.multi-select-menuitem {
padding-top: 0; padding-top: 0;
} }
@ -81,9 +80,9 @@
.multi-select-button { .multi-select-button {
display: block; display: block;
margin-top:2px; margin-top: 2px;
width:100%; width: 100%;
max-width: 100%!important; max-width: 100% !important;
font-size: 0.875em; font-size: 0.875em;
padding: 0.85em 0.6em; padding: 0.85em 0.6em;
white-space: nowrap; white-space: nowrap;
@ -106,8 +105,8 @@
border-color: #999 transparent transparent transparent; border-color: #999 transparent transparent transparent;
margin-left: 0.4em; margin-left: 0.4em;
vertical-align: 0.1em; vertical-align: 0.1em;
right:5px; right: 5px;
top:17px; top: 17px;
} }
.multi-select-container--open .multi-select-menu { .multi-select-container--open .multi-select-menu {
@ -128,19 +127,20 @@
/* Allow labels to line wrap when menu is artificially narrowed */ /* Allow labels to line wrap when menu is artificially narrowed */
white-space: normal; white-space: normal;
} }
</style> </style>
<div class=""> <div class="">
<div class="page-title"> <div class="page-title">
<div class="title_left"><h3>Add Employee</h3></div> <div class="title_left">
</div> <h3>Add Employee</h3>
<div class="clearfix"></div> </div>
<div class="row"> </div>
<div class="col-md-12 col-sm-12 "> <div class="clearfix"></div>
<div class="row">
<div class="col-md-12 col-sm-12 ">
<!-- <div class="x_title"> <!-- <div class="x_title">
<ul class="nav navbar-right panel_toolbox"> <ul class="nav navbar-right panel_toolbox">
<li><a class="collapse-link"><i id="chevron" class="fa fa-chevron-up"></i></a></li> <li><a class="collapse-link"><i id="chevron" class="fa fa-chevron-up"></i></a></li>
@ -149,377 +149,424 @@
<h6>Add Employee Information</h6> <h6>Add Employee Information</h6>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> --> </div> -->
<!-- <div class="x_content"> --> <!-- <div class="x_content"> -->
<br /> <br />
<form id="form" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Employee/createEmp" enctype="multipart/form-data"> <form id="form" data-parsley-validate class="form-horizontal form-label-left" method="post"
action="<?php echo base_url();?>Employee/createEmp" 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="<?php echo $this->security->get_csrf_token_name();?>"
value="<?php echo $this->security->get_csrf_hash();?>">
<div class="x_panel"> <div class="x_panel">
<div class="x_title"> <div class="x_title">
<h5>Personal Information<a style="color:red;">*</a> <h5>Personal Information<a style="color:red;">*</a>
</div><br /> </div><br />
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Name<a
style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 ">
<input type="text" id="name" name="name"
value="<?php if(isset($editData)) { echo $editData->name; } ?>" required="required"
onkeypress="validateKeyPress(event)" class="form-control ">
</div>
<label class="control-label col-md-1 col-sm-1 " for="email"> Email<a style="color:red;">*</a>
</label>
<div class="col-md-5 col-sm-5 ">
<input id="email" name="email"
value="<?php if(isset($editData)){ echo $editData->email; } ?>" required="required"
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('')">
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="email"> Mobile<a style="color:red;">*</a>
</label>
<div class="col-md-5 col-sm-5 ">
<input id="mobile" name="mobile"
value="<?php if(isset($editData)) { echo $editData->mobile; } ?>"
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('')">
</div>
<label class="control-label col-md-1 col-sm-1 " for="first-name">Department</label>
<div class="col-md-5 col-sm-5 ">
<select id="department" name="department" required="required" class="form-control">
<option value="">--Select--</option>
<!-- <option value="<?php if(isset($editData)) { echo $editData->department; } ?>"> -->
<?php if(isset($assetData)) { echo $editData->department; } ?></option>
<?php foreach ($departmentData as $key => $value) { ?>
<option value="<?php echo $value->name; ?>"><?php echo $value->name; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="email">Join date</label>
<div class="col-md-5 col-sm-5 ">
<input id="j_date" name="j_date"
value="<?php if(isset($editData)) { echo $editData->email; } ?>" class="form-control"
type="text" placeholder="DD-MM-YYYY" onkeypress="validateKeyPress(event)"
autocomplete="off">
</div>
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Manager</label>
<div class="col-md-5 col-sm-5 ">
<select id="manager" name="manager" class="form-control">
<option value="">--Select--</option>
<?php foreach ($manager as $key => $value) { ?>
<option value="<?php echo $value->id;?>"><?php echo $value->name; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name">Marital Status</label>
<div class="col-md-5 col-sm-5 ">
<select id="marital_status" name="marital_status" class="form-control">
<option value="">--Select--</option>
<option value="single">Single</option>
<option value="married">Married</option>
<option value="others">Others</option>
</select>
</div>
</div>
<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 ">
</div>
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Password<a
style="color:red;">*</a> </label>
<div class="col-md-3 col-sm-3 ">
<input type="password" id="password" minlength="8" name="password" value=""
required="required" class="form-control "
title="password must have alphabets &#013;password requires 6 characters minimum">
<span toggle="#password" id="toggle-password"
class="fa fa-fw fa-eye field-icon toggle-password"></span>
</div>
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Confirm Password<a
style="color:red;">*</a> </label>
<div class="col-md-3 col-sm-3 ">
<input type="password" id="confirm_password" name="confirm_password" value=""
required="required" class="form-control ">
<span id='message'></span>
</div>
</div>
</div>
<!-- ----------------------------------------- -->
<div class="x_panel">
<div class="x_title">
<h5>Emergency Contact </h5>
<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="relation_name" name="relation_name"
value="<?php if(isset($editData)) { echo $editData->name; } ?>"
onkeypress="validateKeyPress(event)" class="form-control ">
</div>
<label class="control-label col-md-1 col-sm-1 " for="email"> Relationship</label>
<div class="col-md-5 col-sm-5 ">
<input id="relationship" name="relationship"
value="<?php if(isset($editData)) { echo $editData->email; } ?>"
class="form-control" onkeypress="validateKeyPress(event)" type="text">
</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" id="relation_mobile" name="relation_mobile"
onkeypress="return matchnum(event)"
value="<?php if(isset($editData)) { echo $editData->name; } ?>"
class="form-control " 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('')">
</div>
<label class="control-label col-md-1 col-sm-1 " for="email"> Home Tel</label>
<div class="col-md-5 col-sm-5 ">
<input id="relation_tel" name="relation_tel" onkeypress="return matchnum(event)"
value="<?php if(isset($editData)) { echo $editData->relation_tel; } ?>"
class="form-control" type="text">
</div>
</div>
</div>
</div>
<!-- ----------------------------------------- -->
<div class="x_panel">
<div class="x_title">
<h5>Address Details</h5>
</div><br />
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Address</label>
<div class="col-md-5 col-sm-5 ">
<input type="text" id="address" name="address"
value="<?php if(isset($editData)) { echo $editData->address; } ?>"
class="form-control ">
</div>
<label class="control-label col-md-1 col-sm-1 " for="email"> City</label>
<div class="col-md-5 col-sm-5 ">
<input id="city" name="city" value="<?php if(isset($editData)) { echo $editData->city; } ?>"
class="form-control" type="text">
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> State</label>
<div class="col-md-5 col-sm-5 ">
<input type="text" id="state" name="state"
value="<?php if(isset($editData)) { echo $editData->state; } ?>" class="form-control ">
</div>
<label class="control-label col-md-1 col-sm-1 " for="email"> Pincode</label>
<div class="col-md-5 col-sm-5 ">
<input id="pincode" name="pincode" onkeypress="return matchnum(event)"
value="<?php if(isset($editData)) { echo $editData->pincode; } ?>" class="form-control"
type="text">
</div>
</div>
</div>
<!-- ----------------------------------------------------------------------------------->
<div class="x_panel">
<div class="x_title">
<h5>Additional Information</h5>
<div class="clearfix"></div>
</div><br />
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Employee Id</label>
<div class="col-md-5 col-sm-5 ">
<input type="text" id="employee_id" name="emp_id"
value="<?php if(isset($editData)) { echo $editData->name; } ?>" class="form-control">
</div>
<label class="control-label col-md-1 col-sm-1 " for="email"> Salary</label>
<div class="col-md-5 col-sm-5 ">
<input id="salary" name="salary"
value="<?php if(isset($editData)) { echo $editData->mobile; } ?>" class="form-control"
type="text">
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Comment</label>
<div class="col-md-5 col-sm-5 ">
<input id="comment" name="comment"
value="<?php if(isset($editData)) { echo $editData->mobile; } ?>" class="form-control"
type="text">
</div>
<label class="control-label col-md-1 col-sm-1 " for="email"> Gender</label>
<div class="col-md-5 col-sm-5 " style="padding:10px;">
<input type="radio" name="gender" value="male" />Male
<input type="radio" name="gender" value="female" />Female
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Photo Upload</label>
<div class="col-md-5 col-sm-5 ">
<input type="file" id="image" name="image"
value="<?php if(isset($editData)) { echo $editData->profile_pic; } ?>"
class="form-control typeFile" onchange="validateFile(this)"
accept="image/png, image/jpeg, image/jpg, application/pdf">
<img class="profilepic__image" style="width: 50%; display: block;padding:10px;" src="">
</div>
</div>
</div>
<!-- ----------------------------------------- -->
<div class="x_panel">
<div class="x_title">
<h5>Permission</h5>
<div class="clearfix"></div>
</div><br />
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="last-name">Modules List</label>
<div class="col-md-5 col-sm-5 ">
<select id="people" name="group_id[]" class="form-control select2_multiple" multiple>
<?php foreach ($get_group_list as $key => $value) { ?>
<option value="<?php echo $value->id; ?>"><?php echo $value->group_name; ?></option>
<?php } ?>
</select>
</div>
</div>
</div>
<div class="x_panel"><br>
<div class="item form-group">
<div class="offset-md-8">
<a href="<?php echo base_url();?>Employee/empList" class="btn btn-secondary">Cancel</a>
<button type="submit" class="btn btn-success">Submit</button>
</div>
</div>
</div>
</form>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Name<a style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 ">
<input type="text" id="name" name="name" value="<?php if(isset($editData)) { echo $editData->name; } ?>" required="required" onkeypress="validateKeyPress(event)" class="form-control ">
</div> </div>
<label class="control-label col-md-1 col-sm-1 " for="email"> Email<a style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 ">
<input id="email" name="email" value="<?php if(isset($editData)){ echo $editData->email; } ?>" required="required" 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('')">
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="email"> Mobile<a style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 ">
<input id="mobile" name="mobile" value="<?php if(isset($editData)) { echo $editData->mobile; } ?>" 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('')">
</div>
<label class="control-label col-md-1 col-sm-1 " for="first-name">Department<a style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 ">
<select id="department" name="department" required="required" class="form-control" >
<option value="">--Select--</option>
<option value="<?php if(isset($editData)) { echo $editData->department; } ?>"><?php if(isset($assetData)) { echo $editData->department; } ?></option>
<?php foreach ($departmentData as $key => $value) { ?>
<option value="<?php echo $value->name; ?>"><?php echo $value->name; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="email">Join date<a style="color:red;">*</a></label>
<div class="col-md-5 col-sm-5 ">
<input id="j_date" name="j_date" value="<?php if(isset($editData)) { echo $editData->email; } ?>" class="form-control" type="text" required placeholder="DD-MM-YYYY" onkeypress="validateKeyPress(event)" autocomplete="off">
</div>
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Manager</label>
<div class="col-md-5 col-sm-5 ">
<select id="manager" name="manager" class="form-control">
<option value="">--Select--</option>
<?php foreach ($manager as $key => $value) { ?>
<option value="<?php echo $value->id;?>"><?php echo $value->name; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name">Marital Status<a style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 ">
<select id="marital_status" name="marital_status" required="required" class="form-control" >
<option value="">--Select--</option>
<option value="single">Single</option>
<option value="married">Married</option>
<option value="others">Others</option>
</select>
</div>
</div>
<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 ">
</div>
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Password<a style="color:red;">*</a> </label>
<div class="col-md-3 col-sm-3 ">
<input type="password" id="password" minlength="8" name="password" value="" required="required" class="form-control " title="password must have alphabets &#013;password requires 6 characters minimum">
<span toggle="#password" id="toggle-password" class="fa fa-fw fa-eye field-icon toggle-password"></span>
</div>
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Confirm Password<a style="color:red;">*</a> </label>
<div class="col-md-3 col-sm-3 ">
<input type="password" id="confirm_password" name="confirm_password" value="" required="required" class="form-control ">
<span id='message'></span>
</div>
</div>
</div>
<!-- ----------------------------------------- -->
<div class="x_panel">
<div class="x_title">
<h5>Emergency Contact </h5>
<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="relation_name" name="relation_name" value="<?php if(isset($editData)) { echo $editData->name; } ?>" onkeypress="validateKeyPress(event)" class="form-control ">
</div>
<label class="control-label col-md-1 col-sm-1 " for="email"> Relationship</label>
<div class="col-md-5 col-sm-5 ">
<input id="relationship" name="relationship" value="<?php if(isset($editData)) { echo $editData->email; } ?>" class="form-control" onkeypress="validateKeyPress(event)" type="text" >
</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" id="relation_mobile" name="relation_mobile" onkeypress = "return matchnum(event)" value="<?php if(isset($editData)) { echo $editData->name; } ?>" class="form-control " 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('')">
</div>
<label class="control-label col-md-1 col-sm-1 " for="email"> Home Tel</label>
<div class="col-md-5 col-sm-5 ">
<input id="relation_tel" name="relation_tel" onkeypress = "return matchnum(event)" value="<?php if(isset($editData)) { echo $editData->relation_tel; } ?>" class="form-control" type="text">
</div>
</div> </div>
</div> </div>
</div>
<!-- ----------------------------------------- -->
<div class="x_panel">
<div class="x_title">
<h5>Address Details</h5>
</div><br />
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Address</label>
<div class="col-md-5 col-sm-5 ">
<input type="text" id="address" name="address" value="<?php if(isset($editData)) { echo $editData->address; } ?>" class="form-control ">
</div>
<label class="control-label col-md-1 col-sm-1 " for="email"> City</label>
<div class="col-md-5 col-sm-5 ">
<input id="city" name="city" value="<?php if(isset($editData)) { echo $editData->city; } ?>" class="form-control" type="text" >
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> State</label>
<div class="col-md-5 col-sm-5 ">
<input type="text" id="state" name="state" value="<?php if(isset($editData)) { echo $editData->state; } ?>" class="form-control ">
</div>
<label class="control-label col-md-1 col-sm-1 " for="email"> Pincode</label>
<div class="col-md-5 col-sm-5 ">
<input id="pincode" name="pincode" onkeypress = "return matchnum(event)" value="<?php if(isset($editData)) { echo $editData->pincode; } ?>" class="form-control" type="text" >
</div>
</div>
</div>
<!-- ----------------------------------------------------------------------------------->
<div class="x_panel">
<div class="x_title">
<h5>Additional Information</h5>
<div class="clearfix"></div>
</div><br/>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Employee Id</label>
<div class="col-md-5 col-sm-5 ">
<input type="text" id="employee_id" name="emp_id" value="<?php if(isset($editData)) { echo $editData->name; } ?>" class="form-control">
</div>
<label class="control-label col-md-1 col-sm-1 " for="email"> Salary</label>
<div class="col-md-5 col-sm-5 ">
<input id="salary" name="salary" value="<?php if(isset($editData)) { echo $editData->mobile; } ?>" class="form-control" type="text">
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Comment</label>
<div class="col-md-5 col-sm-5 ">
<input id="comment" name="comment" value="<?php if(isset($editData)) { echo $editData->mobile; } ?>" class="form-control" type="text">
</div>
<label class="control-label col-md-1 col-sm-1 " for="email"> Gender</label>
<div class="col-md-5 col-sm-5 " style="padding:10px;">
<input type="radio" name="gender" value="male" />Male
<input type="radio" name="gender" value="female" />Female
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Photo Upload</label>
<div class="col-md-5 col-sm-5 ">
<input type="file" id="image" name="image" value="<?php if(isset($editData)) { echo $editData->profile_pic; } ?>" class="form-control typeFile" onchange="validateFile(this)" accept="image/png, image/jpeg, image/jpg, application/pdf">
<img class="profilepic__image" style="width: 50%; display: block;padding:10px;" src="" >
</div>
</div>
</div>
<!-- ----------------------------------------- -->
<div class="x_panel">
<div class="x_title">
<h5>Permission</h5>
<div class="clearfix"></div>
</div><br/>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="last-name">Modules List<a style="color:red;">*</a></label>
<div class="col-md-5 col-sm-5 ">
<select id="people" name="group_id[]" class="form-control select2_multiple" multiple >
<?php foreach ($get_group_list as $key => $value) { ?>
<option value="<?php echo $value->id; ?>"><?php echo $value->group_name; ?></option>
<?php } ?>
</select>
</div>
</div>
</div>
<div class="x_panel"><br>
<div class="item form-group">
<div class="offset-md-8">
<a href="<?php echo base_url();?>Employee/empList" class="btn btn-secondary">Cancel</a>
<button type="submit" class="btn btn-success">Submit</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- /Body page content --> <!-- /Body page content -->
<script> <script>
function matchnum(event) {
var charcode;
function matchnum(event) charcode = event.which || event.keyCode;
{
var charcode;
charcode = event.which || event.keyCode; if (charcode >= 48 && charcode <= 57) return true; //only numbers
return false;
if(charcode>= 48 && charcode <= 57)return true; //only numbers
return false;
} }
function validateKeyPress(event) { function validateKeyPress(event) {
var key = event.key; var key = event.key;
var allowedCharacters = /^[A-Za-z.]$/; var allowedCharacters = /^[A-Za-z.]$/;
if (!allowedCharacters.test(key)) { if (!allowedCharacters.test(key)) {
event.preventDefault(); event.preventDefault();
} }
} }
$(document).ready(function(){ $(document).ready(function() {
// $('.fa fa-chevron-up').click(); // $('.fa fa-chevron-up').click();
// setTimeout(() => { $('#chevron1').click(); }, 500); // setTimeout(() => { $('#chevron1').click(); }, 500);
}); });
$(document).on('change','#image',function(){ $(document).on('change', '#image', function() {
const file = this.files[0]; const file = this.files[0];
if (file){ if (file) {
let reader = new FileReader(); let reader = new FileReader();
reader.onload = function(event){ reader.onload = function(event) {
$('#image').attr('src', event.target.result); $('#image').attr('src', event.target.result);
$('.profilepic__image').attr('src', event.target.result); $('.profilepic__image').attr('src', event.target.result);
} }
reader.readAsDataURL(file); reader.readAsDataURL(file);
} }
}); });
</script> </script>
<script> <script>
var dateFormat = "dd-mm-yy";
var fromDateInput = $("#j_date");
console.log(fromDateInput);
var dateFormat = "dd-mm-yy"; fromDateInput.datepicker({
var fromDateInput = $("#j_date"); dateFormat: dateFormat,
console.log(fromDateInput); changeYear: true,
changeMonth: true,
yearRange: "1990:c",
maxDate: new Date(),
onSelect: function(dateText, inst) {
fromDateInput.datepicker({ }
dateFormat: dateFormat, });
changeYear: true,
changeMonth: true,
yearRange: "1990:c",
maxDate: new Date(),
onSelect: function (dateText, inst) {
}
});
function validateKeyPress(event) { function validateKeyPress(event) {
var key = event.key; var key = event.key;
var allowedCharacters = /^[A-Za-z._/]$/; var allowedCharacters = /^[A-Za-z._/]$/;
if (!allowedCharacters.test(key)) { if (!allowedCharacters.test(key)) {
event.preventDefault(); event.preventDefault();
} }
} }
</script> </script>
<script> <script>
function validateFile(input) { function validateFile(input) {
const file = input.files[0]; const file = input.files[0];
const allowedExtensions = ["jpg", "jpeg", "png", "pdf"]; const allowedExtensions = ["jpg", "jpeg", "png", "pdf"];
const fileExtension = file.name.split(".").pop().toLowerCase(); const fileExtension = file.name.split(".").pop().toLowerCase();
if (!allowedExtensions.includes(fileExtension)) { if (!allowedExtensions.includes(fileExtension)) {
// Invalid file type // Invalid file type
new PNotify({ new PNotify({
text: 'Invalid file type. Only JPG, JPEG, PNG, and PDF files are allowed.', text: 'Invalid file type. Only JPG, JPEG, PNG, and PDF files are allowed.',
type: 'error', type: 'error',
styling: 'bootstrap3' styling: 'bootstrap3'
}); });
input.value = ""; input.value = "";
return; return;
} }
if (fileExtension === "pdf") { if (fileExtension === "pdf") {
// Preview PDF // Preview PDF
const reader = new FileReader(); const reader = new FileReader();
reader.onload = function(e) { reader.onload = function(e) {
const pdfObject = `<embed src="${e.target.result}" width="500" height="600" type="application/pdf">`; const pdfObject = `<embed src="${e.target.result}" width="500" height="600" type="application/pdf">`;
document.getElementById("previewContainer").innerHTML = pdfObject; document.getElementById("previewContainer").innerHTML = pdfObject;
}; };
reader.readAsDataURL(file); reader.readAsDataURL(file);
} else { } else {
// Preview image // Preview image
const reader = new FileReader(); const reader = new FileReader();
reader.onload = function(e) { reader.onload = function(e) {
const imageObject = `<img src="${e.target.result}" alt="Preview" width="500">`; const imageObject = `<img src="${e.target.result}" alt="Preview" width="500">`;
document.getElementById("previewContainer").innerHTML = imageObject; document.getElementById("previewContainer").innerHTML = imageObject;
}; };
reader.readAsDataURL(file); reader.readAsDataURL(file);
} }
} }
</script> </script>
<script> <script>
// Get the select element // Get the select element
var select = document.getElementById("module"); var select = document.getElementById("module");
// Add event listener to handle checkbox selection // Add event listener to handle checkbox selection
select.addEventListener("change", function() { select.addEventListener("change", function() {
var selectedOptions = Array.from(this.selectedOptions).map(option => option.value); var selectedOptions = Array.from(this.selectedOptions).map(option => option.value);
console.log(selectedOptions); // You can perform further operations with the selected values console.log(selectedOptions); // You can perform further operations with the selected values
}); });
</script> </script>

View File

@ -1,23 +1,21 @@
<!-- Body page content --> <!-- Body page content -->
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script> <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>/assets/jquery.multi-select.js"></script> <script type="text/javascript" src="<?php echo base_url(); ?>/assets/jquery.multi-select.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(document).ready(function($){ jQuery(document).ready(function($) {
$('#people').multiSelect(); $('#people').multiSelect();
}); });
</script> </script>
<style type="text/css"> <style type="text/css">
.multi-select-container { .multi-select-container {
display: inline-block; display: inline-block;
position: relative; position: relative;
width:100%; width: 100%;
} }
.multi-select-menu { .multi-select-menu {
@ -62,7 +60,7 @@
width: 1px; width: 1px;
} }
.multi-select-menuitem + .multi-select-menuitem { .multi-select-menuitem+.multi-select-menuitem {
padding-top: 0; padding-top: 0;
} }
@ -78,9 +76,9 @@
.multi-select-button { .multi-select-button {
display: block; display: block;
margin-top:2px; margin-top: 2px;
width:100%; width: 100%;
max-width: 100%!important; max-width: 100% !important;
font-size: 0.875em; font-size: 0.875em;
padding: 0.85em 0.6em; padding: 0.85em 0.6em;
white-space: nowrap; white-space: nowrap;
@ -103,8 +101,8 @@
border-color: #999 transparent transparent transparent; border-color: #999 transparent transparent transparent;
margin-left: 0.4em; margin-left: 0.4em;
vertical-align: 0.1em; vertical-align: 0.1em;
right:5px; right: 5px;
top:17px; top: 17px;
} }
.multi-select-container--open .multi-select-menu { .multi-select-container--open .multi-select-menu {
@ -125,25 +123,24 @@
/* Allow labels to line wrap when menu is artificially narrowed */ /* Allow labels to line wrap when menu is artificially narrowed */
white-space: normal; white-space: normal;
} }
</style> </style>
<div class=""> <div class="">
<div class="page-title"> <div class="page-title">
<div class="title_left"> <div class="title_left">
<h3>Edit Employee</h3> <h3>Edit Employee</h3>
</div> </div>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="row"> <div class="row">
<div class="col-md-12 col-sm-12 "> <div class="col-md-12 col-sm-12 ">
<div class="x_panel"> <div class="x_panel">
<!-- <div class="x_title"> <!-- <div class="x_title">
<ul class="nav navbar-right panel_toolbox"> <ul class="nav navbar-right panel_toolbox">
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li> <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
@ -153,390 +150,433 @@
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<div class="x_content"> --> <div class="x_content"> -->
<br />
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post"
action="<?php echo base_url();?>Employee/editEmployees" 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; ?>">
<input type="hidden" name="user_id" value="<?php echo $editData->user_id; ?>">
<div class="x_title">
<h5>Personal Information<a style="color:red;">*</a></h5>
<div class="clearfix"></div>
</div><br />
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Name<a
style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 ">
<input type="text" id="name" name="name"
value="<?php if(isset($editData)) { echo $editData->name; } ?>" required="required"
class="form-control " onkeypress="validateKeyPress(event)">
</div>
<label class="control-label col-md-1 col-sm-1 " for="email"> Email<a style="color:red;">*</a>
</label>
<div class="col-md-5 col-sm-5 ">
<input id="email" name="email"
value="<?php if(isset($editData)) { echo $editData->email; } ?>" required="required"
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('')">
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="email"> Mobile<a style="color:red;">*</a>
</label>
<div class="col-md-5 col-sm-5 ">
<input id="mobile" name="mobile"
value="<?php if(isset($editData)) { echo $editData->mobile; } ?>"
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('')">
</div>
<label class="control-label col-md-1 col-sm-1 " for="last-name">Department</label>
<div class="col-md-5 col-sm-5 ">
<select id="department" name="department" class="form-control"
placeholder="choose" <?php if(isset($viewData)) { echo "readonly"; } ?>>
<option value="<?php echo $editData->department; ?>">
<?php echo $editData->department; ?></option>
<?php foreach ($departmentData as $key => $value) { ?>
<option value="<?php echo $value->name; ?>"><?php echo $value->name; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="email"> Join Date</label>
<div class="col-md-5 col-sm-5 ">
<input id="j_date" name="j_date"
value="<?php if(isset($editData)) { echo $editData->j_date; } ?>" class="form-control"
type="text" placeholder="DD-MM-YYYY" onkeypress="validateKeyPress(event)"
autocomplete="off">
</div>
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Manager</label>
<div class="col-md-5 col-sm-5 ">
<select id="manager" name="manager" class="form-control">
<?php
if(isset($manager_name[0]->id))
{ foreach ($manager_name as $key => $val) { ?>
<option value="<?php if($val->id !== ''){echo $val->id;}else{echo '';} ?>"><?php if($val->name !== ''){echo $val->name;}else{echo '--select--';} ?></option>
<?php foreach ($manager as $key => $value) { ?>
<?php if ($val->name !== $value->name) { ?>
<option value="<?php echo $value->user_id; ?>"><?php echo $value->name; ?></option>
<?php } }?>
<?php } } else { ?>
<?php foreach ($manager as $key => $value) { ?>
<?php if ($val->name !== $value->name) { ?>
<option value="<?php echo $value->user_id; ?>"><?php echo $value->name; ?></option>
<?php } } } ?>
</select>
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name">Marital Status</label>
<div class="col-md-5 col-sm-5 ">
<select id="marital_status" name="marital_status" class="form-control"
placeholder="choose" <?php if(isset($viewData)) { echo "readonly"; } ?>>
<option value="<?php echo $editData->marital_status; ?>">
<?php echo ucfirst($editData->marital_status); ?></option>
<?php
if ($editData->marital_status != 'single')
{
echo '<option value="single">Single</option>';
}
if ($editData->marital_status != 'married')
{
echo '<option value="married">Married</option>';
}
if ($editData->marital_status != 'others')
{
echo '<option value="others">Others</option>';
}
?>
</select>
</div>
</div>
</div>
<!-- ----------------------------------------- -->
<div class="x_panel">
<div class="x_title">
<h5>Emergency Contact </h5>
<div class=""></div>
</div><br />
<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="relation_name" name="relation_name"
value="<?php if(isset($editData)) { echo $editData->relation_name; } ?>"
onkeypress="validateKeyPress(event)" class="form-control ">
</div>
<label class="control-label col-md-1 col-sm-1 " for="email"> Relationship</label>
<div class="col-md-5 col-sm-5 ">
<input id="relationship" name="relationship"
value="<?php if(isset($editData)) { echo $editData->relationship; } ?>" class="form-control"
type="text">
</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" id="relation_mobile" name="relation_mobile"
value="<?php if(isset($editData)) { echo $editData->relation_mobile; } ?>"
class="form-control " onkeypress="return matchnum(event)" 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('')">
</div>
<label class="control-label col-md-1 col-sm-1 " for="email"> Home Tel</label>
<div class="col-md-5 col-sm-5 ">
<input id="relation_tel" name="relation_tel"
value="<?php if(isset($editData)) { echo $editData->relation_tel; } ?>"
onkeypress="return matchnum(event)" class="form-control" type="text">
</div>
</div>
</div>
<!-- ------------------------------------------->
<div class="x_panel">
<div class="x_title">
<h5>Address Detail</h5>
<div class=""></div>
</div><br />
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Address</label>
<div class="col-md-5 col-sm-5 ">
<input type="text" id="address" name="address"
value="<?php if(isset($editData)) { echo $editData->address; } ?>" class="form-control ">
</div>
<label class="control-label col-md-1 col-sm-1 " for="email"> City</label>
<div class="col-md-5 col-sm-5 ">
<input id="city" name="city" value="<?php if(isset($editData)) { echo $editData->city; } ?>"
class="form-control" type="text">
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> State</label>
<div class="col-md-5 col-sm-5 ">
<input type="text" id="state" name="state"
value="<?php if(isset($editData)) { echo $editData->state; } ?>" class="form-control ">
</div>
<label class="control-label col-md-1 col-sm-1 " for="email"> Pincode</label>
<div class="col-md-5 col-sm-5 ">
<input id="pincode" name="pincode"
value="<?php if(isset($editData)) { echo $editData->pincode; } ?>"
onkeypress="return matchnum(event)" class="form-control" type="text">
</div>
</div>
</div>
<!-- ----------------------------------------- -->
<div class="x_panel">
<div class="x_title">
<h5>Additional Information</h5>
<div class="clearfix"></div>
</div><br />
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Employee Id</label>
<div class="col-md-5 col-sm-5 ">
<input type="text" id="emp_id" name="emp_id"
value="<?php if(isset($editData)) { echo $editData->emp_id; } ?>" class="form-control ">
</div>
<label class="control-label col-md-1 col-sm-1 " for="email"> Salary</label>
<div class="col-md-5 col-sm-5 ">
<input id="salary" name="salary"
value="<?php if(isset($editData)) { echo $editData->salary; } ?>" class="form-control"
type="text">
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Comment</label>
<div class="col-md-5 col-sm-5 ">
<input id="comment" name="comment"
value="<?php if(isset($editData)) { echo $editData->comment; } ?>" class="form-control"
type="text">
</div>
<label class="control-label col-md-1 col-sm-1 " for="email"> Gender</label>
<div class="col-md-5 col-sm-5 " style="padding:10px;">
<?php
if ($editData->gender == 'male')
{
echo '<input type="radio" name="gender" value="male" checked/>Male';
echo '&nbsp&nbsp';
echo '<input type="radio" name="gender" value="female" />Female';
}
else
{
echo '<input type="radio" name="gender" value="male"/>Male';
echo '&nbsp&nbsp';
echo '<input type="radio" name="gender" value="female" checked/>Female';
} ?>
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Photo Upload</label>
<div class="col-md-5 col-sm-5 ">
<input type="file" id="image" name="image"
value="<?php if(isset($editData->profile_pic)) { echo $editData->profile_pic; } ?>"
class="form-control " onchange="validateFile(this)">
<img class="profilepic__image" style="width: 50%; display: block;padding:10px;"
src="<?php echo base_url();?>/assets/uploads/<?php echo $editData->profile_pic ?>"
alt="Avatar" title="Change the avatar">
</div>
</div>
</div>
<!-- ----------------------------------------- -->
<div class="x_panel">
<div class="x_title">
<h5>Permissions</h5>
<div class=""></div>
</div><br />
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="last-name">Modules List</label>
<div class="col-md-5 col-sm-5 ">
<select id="people" name="group_id[]" class="form-control select2_multiple" multiple>
<?php
$modulesArray = [];
foreach ($get_members_list as $object) {
if (isset($object->group_name)) {
$modulesArray[] = $object->group_name;
}
}
foreach ($get_group_list as $key => $data) { ?>
<?php if(in_array($data->group_name, $modulesArray)) { ?>
<option value="<?php echo $data->id; ?>" selected> <?php echo $data->group_name; ?>
</option>
<?php } else { ?>
<option value="<?php echo $data->id; ?>"><?php echo $data->group_name;?> </option>
<?php } ?>
<?php } ?>
</select>
</div>
</div>
</div>
<!-- <div class="ln_solid"></div> -->
<div class="x_panel"><br>
<div class="item form-group">
<div class=" offset-md-8">
<a href="<?php echo base_url();?>Employee/empList" class="btn btn-secondary">Cancel</a>
<button type="submit" class="btn btn-success">Update</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<br /> <br />
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Employee/editEmployees" enctype="multipart/form-data">
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>"> <!-- <div id="sub-value" class="col-md-12 col-sm-12">
<input type="hidden" name="id" value="<?php echo $editData->id; ?>"> <?php echo $emp_sub_list_htmlPage; ?>
<input type="hidden" name="user_id" value="<?php echo $editData->user_id; ?>"> </div> -->
<div class="x_title">
<h5>Personal Information<a style="color:red;">*</a></h5>
<div class="clearfix"></div>
</div><br />
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Name<a style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 ">
<input type="text" id="name" name="name" value="<?php if(isset($editData)) { echo $editData->name; } ?>" required="required" class="form-control " onkeypress="validateKeyPress(event)">
</div>
<label class="control-label col-md-1 col-sm-1 " for="email"> Email<a style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 ">
<input id="email" name="email" value="<?php if(isset($editData)) { echo $editData->email; } ?>" required="required" 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('')">
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="email"> Mobile<a style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 ">
<input id="mobile" name="mobile" value="<?php if(isset($editData)) { echo $editData->mobile; } ?>" 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('')" >
</div>
<label class="control-label col-md-1 col-sm-1 " for="last-name">Department<a style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 ">
<select id="department" name="department" required="required" class="form-control" placeholder="choose" <?php if(isset($viewData)) { echo "readonly"; } ?>>
<option value="<?php echo $editData->department; ?>"><?php echo $editData->department; ?></option>
<?php foreach ($departmentData as $key => $value) { ?>
<option value="<?php echo $value->name; ?>"><?php echo $value->name; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="email"> Joining Date<a style="color:red;">*</a></label>
<div class="col-md-5 col-sm-5 ">
<input id="j_date" name="j_date" value="<?php if(isset($editData)) { echo $editData->j_date; } ?>" class="form-control" type="text" placeholder="DD-MM-YYYY" required onkeypress="validateKeyPress(event)" autocomplete="off">
</div>
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Manager</label>
<div class="col-md-5 col-sm-5 ">
<select id="manager" name="manager" class="form-control">
<?php
if(isset($manager_name[0]->id))
{ foreach ($manager_name as $key => $val) { ?>
<option value="<?php echo $val->id; ?>"><?php echo $val->name; ?></option>
<?php foreach ($manager as $key => $value) { ?>
<?php if ($val->name !== $value->name) { ?>
<option value="<?php echo $value->user_id; ?>"><?php echo $value->name; ?></option>
<?php } }?>
<?php } } else { ?>
<?php foreach ($manager as $key => $value) { ?>
<?php if ($val->name !== $value->name) { ?>
<option value="<?php echo $value->user_id; ?>"><?php echo $value->name; ?></option>
<?php } } } ?>
</select>
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="email"> Gender</label>
<div class="col-md-5 col-sm-5 " style="padding:10px;">
<?php
if ($editData->gender == 'male')
{
echo '<input type="radio" name="gender" value="male" checked/>Male';
echo '&nbsp&nbsp';
echo '<input type="radio" name="gender" value="female" />Female';
}
else
{
echo '<input type="radio" name="gender" value="male"/>Male';
echo '&nbsp&nbsp';
echo '<input type="radio" name="gender" value="female" checked/>Female';
} ?>
</div>
<label class="control-label col-md-1 col-sm-1 " for="first-name">Marital Status<a style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 ">
<select id="marital_status" name="marital_status" required="required" class="form-control" placeholder="choose" <?php if(isset($viewData)) { echo "readonly"; } ?>>
<option value="<?php echo $editData->marital_status; ?>"><?php echo ucfirst($editData->marital_status); ?></option>
<?php
if ($editData->marital_status != 'single')
{
echo '<option value="single">Single</option>';
}
if ($editData->marital_status != 'married')
{
echo '<option value="married">Married</option>';
}
if ($editData->marital_status != 'others')
{
echo '<option value="others">Others</option>';
}
?>
</select>
</div>
</div>
</div> </div>
<!-- ----------------------------------------- -->
<div class="x_panel">
<div class="x_title">
<h5>Emergency Contact </h5>
<div class=""></div>
</div><br />
<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="relation_name" name="relation_name" value="<?php if(isset($editData)) { echo $editData->relation_name; } ?>" onkeypress="validateKeyPress(event)" class="form-control ">
</div>
<label class="control-label col-md-1 col-sm-1 " for="email"> Relationship</label>
<div class="col-md-5 col-sm-5 ">
<input id="relationship" name="relationship" value="<?php if(isset($editData)) { echo $editData->relationship; } ?>" class="form-control" type="text" >
</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" id="relation_mobile" name="relation_mobile" value="<?php if(isset($editData)) { echo $editData->relation_mobile; } ?>" class="form-control " onkeypress = "return matchnum(event)" 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('')">
</div>
<label class="control-label col-md-1 col-sm-1 " for="email"> Home Tel</label>
<div class="col-md-5 col-sm-5 ">
<input id="relation_tel" name="relation_tel" value="<?php if(isset($editData)) { echo $editData->relation_tel; } ?>" onkeypress = "return matchnum(event)" class="form-control" type="text" >
</div>
</div>
</div>
<!-- ----------------------------------------- -->
<div class="x_panel">
<div class="x_title">
<h5>Address Detail</h5>
<div class=""></div>
</div><br />
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Address</label>
<div class="col-md-5 col-sm-5 ">
<input type="text" id="address" name="address" value="<?php if(isset($editData)) { echo $editData->address; } ?>" class="form-control ">
</div>
<label class="control-label col-md-1 col-sm-1 " for="email"> City</label>
<div class="col-md-5 col-sm-5 ">
<input id="city" name="city" value="<?php if(isset($editData)) { echo $editData->city; } ?>" class="form-control" type="text" >
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> State</label>
<div class="col-md-5 col-sm-5 ">
<input type="text" id="state" name="state" value="<?php if(isset($editData)) { echo $editData->state; } ?>" class="form-control ">
</div>
<label class="control-label col-md-1 col-sm-1 " for="email"> Pincode</label>
<div class="col-md-5 col-sm-5 ">
<input id="pincode" name="pincode" value="<?php if(isset($editData)) { echo $editData->pincode; } ?>" onkeypress = "return matchnum(event)" class="form-control" type="text" >
</div>
</div>
</div>
<!-- ----------------------------------------- -->
<div class="x_panel">
<div class="x_title">
<h5>Additional Information</h5>
<div class="clearfix"></div>
</div><br />
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Employee Id</label>
<div class="col-md-5 col-sm-5 ">
<input type="text" id="emp_id" name="emp_id" value="<?php if(isset($editData)) { echo $editData->emp_id; } ?>"class="form-control ">
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="email"> Salary</label>
<div class="col-md-5 col-sm-5 ">
<input id="salary" name="salary" value="<?php if(isset($editData)) { echo $editData->salary; } ?>" class="form-control" type="text">
</div>
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Comment</label>
<div class="col-md-5 col-sm-5 ">
<input id="comment" name="comment" value="<?php if(isset($editData)) { echo $editData->comment; } ?>" class="form-control" type="text">
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Photo Upload</label>
<div class="col-md-5 col-sm-5 ">
<input type="file" id="image" name="image" value="<?php if(isset($editData->profile_pic)) { echo $editData->profile_pic; } ?>" class="form-control " onchange="validateFile(this)">
<img class="profilepic__image" style="width: 50%; display: block;padding:10px;" src="<?php echo base_url();?>/assets/uploads/<?php echo $editData->profile_pic ?>" alt="Avatar" title="Change the avatar">
</div>
</div>
</div>
<!-- ----------------------------------------- -->
<div class="x_panel">
<div class="x_title">
<h5>Permissions</h5>
<div class=""></div>
</div><br />
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="last-name">Modules List<a style="color:red;">*</a></label>
<div class="col-md-5 col-sm-5 ">
<select id="people" name="group_id[]" class="form-control select2_multiple" multiple >
<?php
$modulesArray = [];
foreach ($get_members_list as $object) {
if (isset($object->group_name)) {
$modulesArray[] = $object->group_name;
}
}
foreach ($get_group_list as $key => $data) { ?>
<?php if(in_array($data->group_name, $modulesArray)) { ?>
<option value="<?php echo $data->id; ?>" selected> <?php echo $data->group_name; ?> </option>
<?php } else { ?>
<option value="<?php echo $data->id; ?>"><?php echo $data->group_name;?> </option>
<?php } ?>
<?php } ?>
</select>
</div>
</div>
</div>
<!-- <div class="ln_solid"></div> -->
<div class="x_panel"><br>
<div class="item form-group">
<div class=" offset-md-8">
<a href="<?php echo base_url();?>Employee/empList" class="btn btn-secondary">Cancel</a>
<button type="submit" class="btn btn-success">Update</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<br/>
<div id="sub-value" class="col-md-12 col-sm-12">
<?php echo $emp_sub_list_htmlPage; ?>
</div>
</div>
</div> </div>
<script> <script>
$('#myDatepicker').datetimepicker({ $('#myDatepicker').datetimepicker({
format: 'DD.MM.YYYY' format: 'DD.MM.YYYY'
});
</script>
<script>
function matchnum(event)
{
var charcode;
charcode = event.which || event.keyCode;
if(charcode>= 48 && charcode <= 57)return true; //only numbers
return false;
}
function validateKeyPress(event) {
var key = event.key;
var allowedCharacters = /^[A-Za-z.]$/;
if (!allowedCharacters.test(key)) {
event.preventDefault();
}
}
$(document).on('change','#image',function(){
const file = this.files[0];
if (file){
let reader = new FileReader();
reader.onload = function(event){
$('#image').attr('src', event.target.result);
$('.profilepic__image').attr('src', event.target.result);
}
reader.readAsDataURL(file);
}
}); });
</script> </script>
<script> <script>
function matchnum(event) {
var charcode;
var dateFormat = "dd-mm-yy"; charcode = event.which || event.keyCode;
var fromDateInput = $("#j_date");
console.log(fromDateInput);
fromDateInput.datepicker({ if (charcode >= 48 && charcode <= 57) return true; //only numbers
dateFormat: dateFormat, return false;
changeYear: true,
changeMonth: true,
maxDate: new Date(),
onSelect: function (dateText, inst) {
} }
});
function validateKeyPress(event) {
var key = event.key;
var allowedCharacters = /^[A-Za-z.]$/;
if (!allowedCharacters.test(key)) {
event.preventDefault();
}
}
$(document).on('change', '#image', function() {
const file = this.files[0];
if (file) {
let reader = new FileReader();
reader.onload = function(event) {
$('#image').attr('src', event.target.result);
$('.profilepic__image').attr('src', event.target.result);
}
reader.readAsDataURL(file);
}
});
</script>
<script>
var dateFormat = "dd-mm-yy";
var fromDateInput = $("#j_date");
console.log(fromDateInput);
fromDateInput.datepicker({
dateFormat: dateFormat,
changeYear: true,
changeMonth: true,
maxDate: new Date(),
onSelect: function(dateText, inst) {
}
});
</script> </script>
<script> <script>
function validateFile(input) { function validateFile(input) {
const file = input.files[0]; const file = input.files[0];
const allowedExtensions = ["jpg", "jpeg", "png", "pdf"]; const allowedExtensions = ["jpg", "jpeg", "png", "pdf"];
const fileExtension = file.name.split(".").pop().toLowerCase(); const fileExtension = file.name.split(".").pop().toLowerCase();
if (!allowedExtensions.includes(fileExtension)) { if (!allowedExtensions.includes(fileExtension)) {
// Invalid file type // Invalid file type
new PNotify({ new PNotify({
text: 'Invalid file type. Only JPG, JPEG, PNG, and PDF files are allowed.', text: 'Invalid file type. Only JPG, JPEG, PNG, and PDF files are allowed.',
type: 'error', type: 'error',
styling: 'bootstrap3' styling: 'bootstrap3'
}); });
input.value = ""; input.value = "";
return; return;
} }
if (fileExtension === "pdf") { if (fileExtension === "pdf") {
// Preview PDF // Preview PDF
const reader = new FileReader(); const reader = new FileReader();
reader.onload = function(e) { reader.onload = function(e) {
const pdfObject = `<embed src="${e.target.result}" width="500" height="600" type="application/pdf">`; const pdfObject = `<embed src="${e.target.result}" width="500" height="600" type="application/pdf">`;
document.getElementById("previewContainer").innerHTML = pdfObject; document.getElementById("previewContainer").innerHTML = pdfObject;
}; };
reader.readAsDataURL(file); reader.readAsDataURL(file);
} else { } else {
// Preview image // Preview image
const reader = new FileReader(); const reader = new FileReader();
reader.onload = function(e) { reader.onload = function(e) {
const imageObject = `<img src="${e.target.result}" alt="Preview" width="500">`; const imageObject = `<img src="${e.target.result}" alt="Preview" width="500">`;
document.getElementById("previewContainer").innerHTML = imageObject; document.getElementById("previewContainer").innerHTML = imageObject;
}; };
reader.readAsDataURL(file); reader.readAsDataURL(file);
} }
} }
</script> </script>
<!-- /Body page content --> <!-- /Body page content -->

View File

@ -121,10 +121,10 @@
<div class="item form-group"> <div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name">Expense Name<a style="color:red;">*</a></label> <label class="control-label col-md-1 col-sm-1 " for="first-name">Expense Name</label>
<div class="col-md-5 col-sm-5 "> <div class="col-md-5 col-sm-5 ">
<div class="form-group"> <div class="form-group">
<input type='text' class="form-control" name="expense_name" value="<?php if(isset($expense_data[0]->id)){echo $expense_data[0]->expense_name; } ?>" autocomplete='off' required /> <input type='text' class="form-control" name="expense_name" value="<?php if(isset($expense_data[0]->id)){echo $expense_data[0]->expense_name; } ?>" autocomplete='off' />
</div> </div>
@ -181,7 +181,7 @@
</div> </div>
<label class="control-label col-md-1 col-sm-1" required for="first-name">Recipt<a style="color:red;">*</a></label> <label class="control-label col-md-1 col-sm-1" required for="first-name">Recipt</label>
<div class="col-md-5 col-sm-5 "> <div class="col-md-5 col-sm-5 ">
<input id="formFile" name="bill[]" onchange="validateFile(this)" class="typeFile" type="file" value="<?php echo $value->bill ?>" multiple><br> <input id="formFile" name="bill[]" onchange="validateFile(this)" class="typeFile" type="file" value="<?php echo $value->bill ?>" multiple><br>

View File

@ -8,10 +8,10 @@
<style> <style>
.alert-success { .alert-success {
background-color: #dff0d8; background-color: #dff0d8;
color: #3c763d; color: #3c763d;
border-color: #d6e9c6; border-color: #d6e9c6;
} }
.flash-message { .flash-message {
@ -22,8 +22,8 @@
} }
.hide-arrow { .hide-arrow {
-webkit-appearance: none; -webkit-appearance: none;
-moz-appearance: none; -moz-appearance: none;
appearance: none; appearance: none;
background-image: none; background-image: none;
@ -32,282 +32,311 @@
} }
.drop-zone { .drop-zone {
border: 2px dashed #ccc; border: 2px dashed #ccc;
padding: 20px; padding: 20px;
width: 257px; width: 257px;
height:300px; height: 300px;
text-align: center; text-align: center;
cursor: pointer; cursor: pointer;
} }
.preview-container { .preview-container {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
margin-top: 19px; margin-top: 19px;
margin-left: -18px !important; margin-left: -18px !important;
} }
.preview-item { .preview-item {
width: 100%; width: 100%;
margin-right: 10px; margin-right: 10px;
margin-bottom: 10px; margin-bottom: 10px;
} }
.preview-item img, .preview-item img,
.preview-item object { .preview-item object {
width: 290px; width: 290px;
height: 280px; height: 280px;
} }
</style> </style>
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="row"> <div class="row">
<div class="col-md-12 col-sm-12 "> <div class="col-md-12 col-sm-12 ">
<div class="x_title"> <div class="x_title">
<ul class="nav navbar-right panel_toolbox"> <ul class="nav navbar-right panel_toolbox">
<a href="<?php echo base_url();?>Expence/emp_expence_list" class="btn btn-primary" style="margin-top: 20px; font-size: small;">Back</a> <a href="<?php echo base_url();?>Expence/emp_expence_list" class="btn btn-primary"
</ul> style="margin-top: 20px; font-size: small;">Back</a>
<h3>Expense Claim</h3> </ul>
<h3>Expense Claim</h3>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<div class="x_content"> <div class="x_content">
<br /> <br />
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Expence/rise_expence_request" enctype="multipart/form-data"> <form id="" data-parsley-validate class="form-horizontal form-label-left" method="post"
action="<?php echo base_url();?>Expence/rise_expence_request" 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="<?php echo $this->security->get_csrf_token_name();?>"
value="<?php echo $this->security->get_csrf_hash();?>">
<div class="x_panel"> <div class="x_panel">
<div class="item form-group"> <div class="item form-group">
<label class="control-label col-md-2 col-sm-2 label-align" for="last-name">Expense Requisted For</label> <label class="control-label col-md-2 col-sm-2 label-align" for="last-name">Expense Requisted
<div class="col-md-4 col-sm-4"> For</label>
<div class="col-md-4 col-sm-4">
<input type="radio" name="created_by" value="self (<?php echo user()->id;?>)"style="margin:10px;"checked /><b>Self</b>
<input type="radio" name="created_by" value="<?php echo user()->name;?> (<?php echo user()->id;?>)" style="margin: 10px;" /><b>Others</b> <input type="radio" name="created_by" value="self (<?php echo user()->id;?>)"
style="margin:10px;" checked /><b>Self</b>
</div>
<label class="control-label col-md-1 col-sm-1 label-align" for="last-name"> Employee Name <a style="color:red;">*</a></label>
<div class="col-md-5 col-sm-5 ">
<select id="user_dropdown" name="emp_id" style="margin-top: 10px;padding-bottom: 10px;" class="form-control manager" > </select>
</div>
</div> <input type="radio" name="created_by"
value="<?php echo user()->name;?> (<?php echo user()->id;?>)"
style="margin: 10px;" /><b>Others</b>
</div>
<label class="control-label col-md-1 col-sm-1 label-align" for="last-name"> Employee Name <a
style="color:red;">*</a></label>
<div class="col-md-5 col-sm-5 ">
<select id="user_dropdown" name="emp_id" style="margin-top: 10px;padding-bottom: 10px;"
class="form-control manager"> </select>
</div>
</div>
<div class="item form-group"> <div class="item form-group">
<label class="control-label col-md-1 col-sm-1 label-align" for="first-name">Expense Name<a style="color:red;">*</a></label> <label class="control-label col-md-1 col-sm-1 label-align" for="first-name">Expense Name</label>
<div class="col-md-5 col-sm-5 "> <div class="col-md-5 col-sm-5 ">
<div class="form-group"> <div class="form-group">
<input type='text' class="form-control" name="expense_name" value="<?php if(isset($expense_data[0]->id)){echo $expense_data[0]->expense_name; } ?>" autocomplete='off' required /> <input type='text' class="form-control" name="expense_name"
value="<?php if(isset($expense_data[0]->id)){echo $expense_data[0]->expense_name; } ?>"
autocomplete='off' />
</div> </div>
</div>
<label class="control-label col-md-1 col-sm-1 label-align" for="first-name">Business Reason</label> </div>
<div class="col-md-5 col-sm-5 ">
<div class="form-group"> <label class="control-label col-md-1 col-sm-1 label-align" for="first-name">Business
<input type='text' class="form-control" name="business_reason" value="<?php if(isset($expense_data[0]->id)){echo $expense_data[0]->business_reason; } ?>" autocomplete='off'/> Reason</label>
</div> <div class="col-md-5 col-sm-5 ">
<div class="form-group">
</div> <input type='text' class="form-control" name="business_reason"
</div> value="<?php if(isset($expense_data[0]->id)){echo $expense_data[0]->business_reason; } ?>"
</div> autocomplete='off' />
</div>
</div>
</div>
</div>
<div class="x_panel"> <div class="x_panel">
<div class="x_title"> <div class="x_title">
<!-- <ul class="nav navbar-right panel_toolbox"> <!-- <ul class="nav navbar-right panel_toolbox">
<button type="button" id="add-button" onclick="createAndAppendFormGroup()" class="btn btn-info" style="font-size:small;" >Add</button> <button type="button" id="add-button" onclick="createAndAppendFormGroup()" class="btn btn-info" style="font-size:small;" >Add</button>
</ul> --> </ul> -->
<div class="clearfix"></div> <div class="clearfix"></div>
</div><br> </div><br>
<?php if(isset($expense_child_data[0]->id)) { foreach ($expense_child_data as $key => $value) { ?> <?php if(isset($expense_child_data[0]->id)) { foreach ($expense_child_data as $key => $value) { ?>
<div class="item form-group"> <div class="item form-group">
<label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Date of Expense<a style="color:red;">*</a></label> <label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Date of Expense<a
<div class="col-md-5 col-sm-5 "> style="color:red;">*</a></label>
<div class="form-group"> <div class="col-md-5 col-sm-5 ">
<input type='date' id='ExpenseDate' class="form-control" placeholder="DD-MM-YYYY" required name="date_of_expence[]" value="<?php echo $value->date_of_expense ?>" autocomplete='off' /> <div class="form-group">
</div> <input type='date' id='ExpenseDate' class="form-control" placeholder="DD-MM-YYYY"
required name="date_of_expence[]" value="<?php echo $value->date_of_expense ?>"
<input type="hidden" name="expense_pid" value="<?php echo $expense_data[0]->id; ?>"> autocomplete='off' />
</div>
</div> <input type="hidden" name="expense_pid" value="<?php echo $expense_data[0]->id; ?>">
<label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Expense Cost <a style="color:red;">*</a></label>
<div class="col-md-5 col-sm-5 "> </div>
<input id="cost" name="amount[]" required value="<?php echo $value->amount ?>" class="form-control" onkeypress = "return matchnum(event)" type="number" name="middle-name" autocomplete='off'> <label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Expense Cost <a
</div> style="color:red;">*</a></label>
</div> <div class="col-md-5 col-sm-5 ">
<input id="cost" name="amount[]" required value="<?php echo $value->amount ?>"
class="form-control" onkeypress="return matchnum(event)" type="number"
name="middle-name" autocomplete='off'>
</div>
</div>
<div class="item form-group flex-wrap"> <div class="item form-group flex-wrap">
<label class="control-label col-md-1 col-sm-1 label-align" for="last-name">Description</label> <label class="control-label col-md-1 col-sm-1 label-align" for="last-name">Description</label>
<div class="col-md-5 col-sm-3"> <div class="col-md-5 col-sm-3">
<textarea id="comments" name="description[]" value="" class="form-control" style="height:50px !important;" type="text" ><?php echo $value->description ?></textarea> <textarea id="comments" name="description[]" value="" class="form-control"
style="height:50px !important;" type="text"><?php echo $value->description ?></textarea>
<!-- <input type="hidden" id="manager_id" name="manager" value=""> -->
<!-- <input type="hidden" id="manager_id" name="manager" value=""> -->
</div>
<label class="control-label col-md-1 col-sm-1 label-align"
for="first-name">Recipt</label>
<div class="col-md-5 col-sm-5 ">
<input id="formFile" name="bill[]" onchange="validateFile(this)" class="typeFile"
type="file" value="<?php echo $value->bill ?>" multiple>
</div>
<div class="col-12"><button type="button" class="float-right btn btn-danger"
onclick="remove_row(<?php echo $value->id ?>)" id="remove-button2"><i
class="fa fa-trash"></i></button></div>
</div>
<?php } } else { ?>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Date of Expense<a
style="color:red;">*</a></label>
<div class="col-md-5 col-sm-5 ">
<div class="form-group">
<input type='text' id='ExpenseDate' class="form-control" placeholder="DD-MM-YYYY"
required name="date_of_expence[]" value="" autocomplete='off' />
</div>
</div>
<label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Amount <a
style="color:red;">*</a></label>
<div class="col-md-5 col-sm-5 ">
<input id="cost" name="amount[]" required value="" class="form-control"
onkeypress="return matchnum(event)" type="number" name="middle-name" autocomplete='off'>
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 label-align" for="last-name">Description</label>
<div class="col-md-5 col-sm-3">
<textarea id="comments" name="description[]" value="" class="form-control"
style="height:50px !important;" type="text"></textarea>
</div>
<label class="control-label col-md-1 col-sm-1 label-align" required for="first-name">Recipt</label>
<div class="col-md-5 col-sm-5 ">
<input id="formFile" name="bill[]" onchange="validateFile(this)" class="typeFile"
type="file" value="" multiple>
</div>
</div>
<div class="col-12"><button type="button" id="add-button" onclick="createAndAppendFormGroup()"
class="btn btn-primary float-right">Add</button></div>
<?php } ?>
<div id="formContainer"></div>
</div>
<div class="ln_solid"></div>
<div class="item form-group">
<div class=" offset-md-8">
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
<button type="submit" class="btn btn-primary" name="save">Save</button>
<?php if(isset($expense_data[0]->id)) { ?>
<button type="submit" class="btn btn-success" name="submit">Submit</button>
<button type="submit" class="btn btn-warning" name="update">Update</button>
<?php } ?>
</div>
</div>
</form>
</div>
</div> </div>
<label class="control-label col-md-1 col-sm-1 label-align" required for="first-name">Recipt<a style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 ">
<input id="formFile" name="bill[]" onchange="validateFile(this)" class="typeFile" type="file" value="<?php echo $value->bill ?>" required multiple>
</div>
<div class="col-12"><button type="button" class="float-right btn btn-danger" onclick="remove_row(<?php echo $value->id ?>)" id="remove-button2"><i class="fa fa-trash"></i></button></div></div>
<?php } } else { ?>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Date of Expense<a style="color:red;">*</a></label>
<div class="col-md-5 col-sm-5 ">
<div class="form-group">
<input type='text' id='ExpenseDate' class="form-control" placeholder="DD-MM-YYYY" required name="date_of_expence[]" value="" autocomplete='off' />
</div>
</div>
<label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Amount <a style="color:red;">*</a></label>
<div class="col-md-5 col-sm-5 ">
<input id="cost" name="amount[]" required value="" class="form-control" onkeypress = "return matchnum(event)" type="number" name="middle-name" autocomplete='off'>
</div>
</div> </div>
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 label-align" for="last-name">Description</label>
<div class="col-md-5 col-sm-3">
<textarea id="comments" name="description[]" value="" class="form-control" style="height:50px !important;" type="text" ></textarea>
</div>
<label class="control-label col-md-1 col-sm-1 label-align" required for="first-name">Recipt<a style="color:red;">*</a></label>
<div class="col-md-5 col-sm-5 ">
<input id="formFile" name="bill[]" onchange="validateFile(this)" class="typeFile" type="file" value="" required multiple></div>
</div><div class="col-12"><button type="button" id="add-button" onclick="createAndAppendFormGroup()" class="btn btn-primary float-right">Add</button></div>
<?php } ?>
<div id="formContainer"></div>
</div> </div>
<div class="ln_solid"></div>
<div class="item form-group">
<div class=" offset-md-8">
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
<button type="submit" class="btn btn-primary" name="save">Save</button>
<?php if(isset($expense_data[0]->id)) { ?>
<button type="submit" class="btn btn-success" name="submit">Submit</button>
<button type="submit" class="btn btn-warning" name="update">Update</button>
<?php } ?>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div> </div>
<!-- /Body page content --> <!-- /Body page content -->
<script> <script>
// hide the dropdown arrow
// hide the dropdown arrow
$(document).ready(function() {
$("#user_dropdown").addClass("hide-arrow"); $(document).ready(function() {
$("input[name='created_by']").on("change", function() {
var inputValue = $(this).val();
if (inputValue === "<?php echo user()->name;?> (<?php echo user()->id;?>)") {
$("#user_dropdown").removeClass("hide-arrow");
} else {
$("#user_dropdown").addClass("hide-arrow");
}
});
}) $("#user_dropdown").addClass("hide-arrow");
$("input[name='created_by']").on("change", function() {
var inputValue = $(this).val();
if (inputValue === "<?php echo user()->name;?> (<?php echo user()->id;?>)") {
$("#user_dropdown").removeClass("hide-arrow");
} else {
$("#user_dropdown").addClass("hide-arrow");
}
});
})
</script> </script>
<script> <script>
const datepickerInput = document.getElementById('ExpenseDate'); const datepickerInput = document.getElementById('ExpenseDate');
flatpickr(datepickerInput, { flatpickr(datepickerInput, {
dateFormat: 'd-m-Y', dateFormat: 'd-m-Y',
maxDate: new Date(), maxDate: new Date(),
onChange: function(selectedDates, dateStr) { onChange: function(selectedDates, dateStr) {
console.log('Selected date: ', dateStr); console.log('Selected date: ', dateStr);
} }
}); });
function validateFile(input) { function validateFile(input) {
const file = input.files[0]; const file = input.files[0];
const allowedExtensions = ["jpg", "jpeg", "png", "pdf"]; const allowedExtensions = ["jpg", "jpeg", "png", "pdf"];
const fileExtension = file.name.split(".").pop().toLowerCase(); const fileExtension = file.name.split(".").pop().toLowerCase();
if (!allowedExtensions.includes(fileExtension)) { if (!allowedExtensions.includes(fileExtension)) {
new PNotify({ new PNotify({
title: 'Invalid file type.', title: 'Invalid file type.',
text: 'Only JPG, JPEG, PNG, and PDF files are allowed.', text: 'Only JPG, JPEG, PNG, and PDF files are allowed.',
styling: 'bootstrap3' styling: 'bootstrap3'
}); });
input.value = ""; input.value = "";
return; return;
} }
} }
</script> </script>
<script> <script>
function matchnum(event) {
var charcode;
function matchnum(event) charcode = event.which || event.keyCode;
{
var charcode;
charcode = event.which || event.keyCode; if (charcode >= 48 && charcode <= 57) return true; //only numbers
return false;
if(charcode>= 48 && charcode <= 57)return true; //only numbers
return false;
} }
$(document).ready(function(){
var currentUserName = '<?php echo user()->name; ?>'; $(document).ready(function() {
var currentUserId = '<?php echo user()->id; ?>';
$('#user_dropdown').append('<option value="' + currentUserId + '">' + var currentUserName = '<?php echo user()->name; ?>';
var currentUserId = '<?php echo user()->id; ?>';
$('#user_dropdown').append('<option value="' + currentUserId + '">' +
currentUserName + '</option>'); currentUserName + '</option>');
$('#user_dropdown').prop('disabled', true); $('#user_dropdown').prop('disabled', true);
$('#user_dropdown').on('change',function() { $('#user_dropdown').on('change', function() {
});
$('input[type="radio"][name="created_by"]').change(function() { });
$('input[type="radio"][name="created_by"]').change(function() {
var selectedValue = $(this).val(); var selectedValue = $(this).val();
@ -316,20 +345,21 @@ function matchnum(event)
$userDropdown.empty(); $userDropdown.empty();
if (selectedValue === 'self (<?php echo user()->id;?>)') { if (selectedValue === 'self (<?php echo user()->id;?>)') {
var currentUserName = '<?php echo user()->name; ?>'; var currentUserName = '<?php echo user()->name; ?>';
var currentUserId = '<?php echo user()->id; ?>'; var currentUserId = '<?php echo user()->id; ?>';
$userDropdown.append('<option value="' + currentUserId + '">' + currentUserName + '</option>'); $userDropdown.append('<option value="' + currentUserId + '">' + currentUserName +
'</option>');
$userDropdown.prop('disabled', true); $userDropdown.prop('disabled', true);
} else if (selectedValue === '<?php echo user()->name; ?> (<?php echo user()->id;?>)') { } else if (selectedValue === '<?php echo user()->name; ?> (<?php echo user()->id;?>)') {
$.ajax({ $.ajax({
url: '<?php echo base_url('Expence/get_emp_name/')?>"', url: '<?php echo base_url('Expence/get_emp_name/')?>"',
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
success: function(response) { success: function(response) {
$('#user_dropdown').append(response); $('#user_dropdown').append(response);
$('#user_dropdown').prop('disabled', false); $('#user_dropdown').prop('disabled', false);
}, },
error: function(xhr, status, error) { error: function(xhr, status, error) {
@ -338,77 +368,85 @@ function matchnum(event)
}); });
} }
}); });
});
});
</script> </script>
<script> <script>
//get manager id from the dropdown employee assign the value to $("#manager_id") input field //get manager id from the dropdown employee assign the value to $("#manager_id") input field
$("#user_dropdown").on("change", function(){ $("#user_dropdown").on("change", function() {
let manager_id = $(this).children(":selected").attr("id"); let manager_id = $(this).children(":selected").attr("id");
console.log(manager_id); console.log(manager_id);
$("#manager_id").val(manager_id);
$("#manager_id").val(manager_id);
}) })
</script> </script>
<script>
var i = 1;
<script>
var i=1;
function createAndAppendFormGroup() { function createAndAppendFormGroup() {
var html1 = ''; var html1 = '';
i++ i++
html1 += '<div id="removeChild'+i+'">' html1 += '<div id="removeChild' + i + '">'
html1 += '<br><div class="x_title">'+i+'</div><br>' html1 += '<br><div class="x_title">' + i + '</div><br>'
html1 += '<div class="item form-group">'; html1 += '<div class="item form-group">';
html1 += '<label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Date of Expense<a style="color:red;">*</a></label>'; html1 +=
html1 += '<div class="col-md-5 col-sm-5 "><div class="form-group"><input type="text" id="datepicker'+i+'" class="form-control date-picker" placeholder="DD-MM-YYYY" required name="date_of_expence[]" value="" autocomplete="off"/></div></div>'; '<label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Date of Expense<a style="color:red;">*</a></label>';
html1 += '<label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Expense Cost <a style="color:red;">*</a></label>'; html1 += '<div class="col-md-5 col-sm-5 "><div class="form-group"><input type="text" id="datepicker' + i +
html1 += '<div class="col-md-5 col-sm-5 "><input id="cost" name="amount[]" required class="form-control" onkeypress="return matchnum(event)" type="number" name="middle-name" autocomplete="off"></div>'; '" class="form-control date-picker" placeholder="DD-MM-YYYY" required name="date_of_expence[]" value="" autocomplete="off"/></div></div>';
html1 += '</div>'; html1 +=
'<label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Expense Cost <a style="color:red;">*</a></label>';
html1 +=
'<div class="col-md-5 col-sm-5 "><input id="cost" name="amount[]" required class="form-control" onkeypress="return matchnum(event)" type="number" name="middle-name" autocomplete="off"></div>';
html1 += '</div>';
html1 += '<div class="item form-group flex-wrap">' html1 += '<div class="item form-group flex-wrap">'
html1 += '<label class="control-label col-md-1 col-sm-1 label-align" for="last-name">Description</label>' html1 += '<label class="control-label col-md-1 col-sm-1 label-align" for="last-name">Description</label>'
html1 += '<div class="col-md-5 col-sm-3"><textarea id="comments" name="description[]" value="" class="form-control" style="height:50px !important;" type="text" ></textarea></div>' html1 +=
'<div class="col-md-5 col-sm-3"><textarea id="comments" name="description[]" value="" class="form-control" style="height:50px !important;" type="text" ></textarea></div>'
html1 += '<label class="control-label col-md-1 col-sm-1 label-align" required for="first-name">Upload Bill </label>' html1 += '<label class="control-label col-md-1 col-sm-1 label-align" for="first-name">Recipt </label>'
html1 += '<div class="col-md-5 col-sm-5 "><input id="formFile" name="bill[]" multiple onchange="validateFile(this)" class="typeFile" type="file" value="" required></div>' html1 +=
html1 += '</div>' '<div class="col-md-5 col-sm-5 "><input id="formFile" name="bill[]" multiple onchange="validateFile(this)" class="typeFile" type="file" value="" ></div>'
html1 += '<div class="col-12"><button type="button" class="float-right btn btn-danger"" id="remove-button" onclick="removebutton('+i+')"><i class="fa fa-trash"></i></button></div><button type="button" id="add-button" onclick="createAndAppendFormGroup()" class="btn btn-primary float-right">Add</button></div>' html1 += '</div>'
html1 +=
'<div class="col-12"><button type="button" class="float-right btn btn-danger"" id="remove-button" onclick="removebutton(' +
i +
')"><i class="fa fa-trash"></i></button></div><button type="button" id="add-button" onclick="createAndAppendFormGroup()" class="btn btn-primary float-right">Add</button></div>'
var formContainer = document.getElementById('formContainer'); var formContainer = document.getElementById('formContainer');
//formContainer.innerHTML += html1; //formContainer.innerHTML += html1;
formContainer.insertAdjacentHTML('beforeend', html1); formContainer.insertAdjacentHTML('beforeend', html1);
const datepickerInput = document.getElementById('datepicker'+i); const datepickerInput = document.getElementById('datepicker' + i);
flatpickr(datepickerInput, { flatpickr(datepickerInput, {
dateFormat: 'd-m-Y', dateFormat: 'd-m-Y',
maxDate: new Date(), maxDate: new Date(),
autoclose:true, autoclose: true,
onChange: function(selectedDates, dateStr) { onChange: function(selectedDates, dateStr) {
console.log('Selected date: ', dateStr); console.log('Selected date: ', dateStr);
} }
}); });
} }
function removebutton(index) { function removebutton(index) {
//console.log(index) //console.log(index)
var element = document.getElementById('removeChild'+ index); var element = document.getElementById('removeChild' + index);
//console.log(element) //console.log(element)
if (element) { if (element) {
element.remove(); element.remove();
} }
} }
// function date(date){ // function date(date){
@ -424,11 +462,9 @@ function removebutton(index) {
// todayHighlight: true, // todayHighlight: true,
// }); // });
// } // }
</script> </script>
<!-- <script> <!-- <script>
function PreviewImage() { function PreviewImage() {
var oFReader = new FileReader(); var oFReader = new FileReader();
oFReader.readAsDataURL(document.getElementById("formFile").files[0]); oFReader.readAsDataURL(document.getElementById("formFile").files[0]);
@ -440,26 +476,24 @@ function PreviewImage() {
</script> --> </script> -->
<script> <script>
function remove_row(id) {
function remove_row(id) $.ajax({
{
$.ajax({
data:{id : id}, data: {
url:"<?php echo base_url('Expence/remove_row');?>", id: id
type:"get", },
url: "<?php echo base_url('Expence/remove_row');?>",
type: "get",
success: function(response) { success: function(response) {
if(response==true);
{
location.reload(true)
}
} if (response == true); {
location.reload(true)
}
});
}
</script> }
});
}
</script>

View File

@ -6,13 +6,13 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="images/favicon.ico" type="image/ico" /> <link rel="icon" href="<?php echo base_url(); ?>/assets/appimg/default.ico" />
<!---ajax call---> <!---ajax call--->
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"> </script> --> <!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"> </script> -->
<title>Ams</title> <title>Ams</title>
<!-- Bootstrap --> <!-- Bootstrap -->
<link href="<?php echo base_url(); ?>/assets/default/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"> <link href="<?php echo base_url(); ?>/assets/default/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
@ -112,7 +112,7 @@
<?php if (is_admin() || is_user() || Employee_group()) { ?> <?php if (is_admin() || is_user() || Employee_group()) { ?>
<a class="dropdown-item" href="<?php echo base_url()?>Asset/masterDataList/">Masters</a> <a class="dropdown-item" href="<?php echo base_url()?>Asset/masterDataList/">Masters</a>
<?php } ?> <?php } ?>
<a class="dropdown-item" href="#">Settings</a> <!-- <a class="dropdown-item" href="#">Settings</a> -->
<!-- <a class="dropdown-item" href="javascript:;">Help</a> --> <!-- <a class="dropdown-item" href="javascript:;">Help</a> -->
<a class="dropdown-item" href="<?php echo base_url();?>Auth/logout"><i class="fa fa-sign-out pull-right"></i> Log Out</a> <a class="dropdown-item" href="<?php echo base_url();?>Auth/logout"><i class="fa fa-sign-out pull-right"></i> Log Out</a>
</div> </div>

View File

@ -1,178 +1,186 @@
<div class="col-md-3 left_col menu_fixed"> <div class="col-md-3 left_col menu_fixed">
<div class="left_col scroll-view"> <div class="left_col scroll-view">
<div class="navbar nav_title" style="border: 0;"> <div class="navbar nav_title" style="border: 0;">
<a class="site_title"> <a class="site_title">
<?php if(check_auth() && is_superadmin()) { ?> <?php if(check_auth() && is_superadmin()) { ?>
<img src="<?php echo base_url(); ?>/assets/uploads/logo/<?php echo $settings->logo;?>" class="img-circle logo"> <img src="<?php echo base_url(); ?>/assets/uploads/logo/<?php echo $settings->logo;?>"
class="img-circle logo">
<?php } else if(check_auth() && is_admin() || !is_null(is_user())) { ?> <?php } else if(check_auth() && is_admin() || !is_null(is_user())) { ?>
<img src="<?php echo base_url(); ?>/assets/uploads/logo/<?php echo $business->logo;?>" class="img-circle logo"> <img src="<?php echo base_url(); ?>/assets/uploads/logo/<?php echo $business->logo;?>"
<?php } ?> class="img-circle logo">
<span> <?php } ?>
<?php if(check_auth() && is_admin() || !is_null(is_user())) <span>
<?php if(check_auth() && is_admin() || !is_null(is_user()))
{echo $business->business_name;} {echo $business->business_name;}
else if(check_auth() && is_superadmin()) else if(check_auth() && is_superadmin())
{ echo $settings->site_name; }?> { echo $settings->site_name; }?>
</span></a> </span></a>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
<!-- menu profile quick info --> <!-- menu profile quick info -->
<div class="profile clearfix"> <div class="profile clearfix">
<div class="profile_pic"> <div class="profile_pic">
<?php if(user()->profile_image == '' || user()->profile_image == null) { ?> <?php if(user()->profile_image == '' || user()->profile_image == null) { ?>
<img src="<?php echo base_url(); ?>/assets/uploads/profile_picture/profile.jpg" alt="..." class="img-circle profile_img"> <img src="<?php echo base_url(); ?>/assets/uploads/profile_picture/profile.jpg" alt="..."
<?php } else { ?> class="img-circle profile_img">
<img src="<?php echo base_url(); ?>/assets/uploads/profile_picture/<?php echo user()->profile_image; ?>" <?php } else { ?>
alt="..." class="img-circle profile_img"> <img src="<?php echo base_url(); ?>/assets/uploads/profile_picture/<?php echo user()->profile_image; ?>"
alt="..." class="img-circle profile_img">
<?php } ?>
</div>
<div class="profile_info">
<span>Welcome,</span>
<h2> <?php if(check_auth() && is_admin() || is_user()){echo user()->name;}else{echo user()->name; }?></h2>
</div>
</div>
<!-- /menu profile quick info -->
<br /> <?php } ?>
<!-- sidebar menu --> </div>
<div id="sidebar-menu" class="main_menu_side hidden-print main_menu"> <div class="profile_info">
<div class="menu_section"> <span>Welcome,</span>
<h3>General</h3> <h2> <?php if(check_auth() && is_admin() || is_user()){echo user()->name;}else{echo user()->name; }?>
<ul class="nav side-menu"> </h2>
<li><a><i class="fa fa-home"></i> Home <span class="fa fa-chevron-down"></span></a> </div>
<ul class="nav child_menu"> </div>
<li><a href="<?php echo base_url();?>Auth/">Dashboard</a></li> <!-- /menu profile quick info -->
</ul>
</li>
<?php if(check_auth() && is_superadmin() ) { ?> <br />
<li><a><i class="fa fa-archive"></i> Business <span class="fa fa-chevron-down"></span></a>
<ul class="nav child_menu"> <!-- sidebar menu -->
<li><a href="<?php echo base_url();?>Business/business_list">Business List</a></li> <div id="sidebar-menu" class="main_menu_side hidden-print main_menu">
<li><a href="<?php echo base_url();?>Business/add_business">Add Business</a></li> <div class="menu_section">
</ul> <h3>General</h3>
</li> <ul class="nav side-menu">
<?php } ?> <li><a><i class="fa fa-home"></i> Home <span class="fa fa-chevron-down"></span></a>
<ul class="nav child_menu">
<li><a href="<?php echo base_url();?>Auth/">Dashboard</a></li>
</ul>
</li>
<?php if(check_auth() && is_superadmin() ) { ?>
<li><a><i class="fa fa-archive"></i> Business <span class="fa fa-chevron-down"></span></a>
<ul class="nav child_menu">
<li><a href="<?php echo base_url();?>Business/business_list">Business List</a></li>
<li><a href="<?php echo base_url();?>Business/add_business">Add Business</a></li>
</ul>
</li>
<?php } ?>
<?php if(check_auth() && is_superadmin() ) { ?> <?php if(check_auth() && is_superadmin() ) { ?>
<li><a><i class="fa fa-user"></i> Module <span class="fa fa-chevron-down"></span></a>
<ul class="nav child_menu">
<li><a href="<?php echo base_url();?>Business/module_list">Module List</a></li>
<li><a href="<?php echo base_url();?>Business/add_module">Add Module</a></li>
</ul>
</li>
<?php } ?>
<?php if(check_auth() && is_admin() ) { ?>
<li><a><i class="fa fa-user"></i>Group <span class="fa fa-chevron-down"></span></a>
<ul class="nav child_menu">
<li><a href="<?php echo base_url();?>Group/Group_list">Group List</a></li>
<li><a href="<?php echo base_url();?>Group/Create_Group_Form">Add Group</a></li>
</ul>
</li>
<?php } ?>
<li><a><i class="fa fa-user"></i> Module <span class="fa fa-chevron-down"></span></a>
<ul class="nav child_menu">
<?php if(check_auth() && is_admin() && Asset_module() || Employee_group() ) { ?> <li><a href="<?php echo base_url();?>Business/module_list">Module List</a></li>
<li><a><i class="fa fa-university"></i> Assets <span class="fa fa-chevron-down"></span></a> <li><a href="<?php echo base_url();?>Business/add_module">Add Module</a></li>
<ul class="nav child_menu"> </ul>
<li><a href="<?php echo base_url();?>Asset/assetLandingPage">Assets List</a></li> </li>
<?php if(user()->action_permit != 'view' ) { ?> <?php } ?>
<li><a href="<?php echo base_url();?>Asset/addAsset">Add Asset</a></li>
<?php } ?>
</ul>
</li>
<?php } ?>
<!-- <?php if(check_auth() && is_admin() ) { ?>
<li><a><i class="fa fa-user"></i>Group <span class="fa fa-chevron-down"></span></a>
<?php if(check_auth() && is_admin() || is_superadmin() || is_user() ) { ?> <ul class="nav child_menu">
<li><a><i class="fa fa-user"></i> Users <span class="fa fa-chevron-down"></span></a> <li><a href="<?php echo base_url();?>Group/Group_list">Group List</a></li>
<ul class="nav child_menu"> <li><a href="<?php echo base_url();?>Group/Create_Group_Form">Add Group</a></li>
<li><a href="<?php echo base_url();?>User/userList">Users List</a></li> </ul>
<?php if(user()->action_permit != 'view' ) { ?> </li>
<li><a href="<?php echo base_url();?>User/addUser">Add Users</a></li> <?php } ?> -->
<?php } ?>
</ul>
</li>
<?php } ?>
<?php if(check_auth() && is_admin() && Asset_module()) { ?>
<li><a><i class="fa fa-clipboard"></i> Reports <span class="fa fa-chevron-down"></span></a>
<ul class="nav child_menu">
<li><a href="<?php echo base_url();?>Asset/depreciation_report">Depreciation Reports</a></li>
<li><a href="<?php echo base_url();?>Asset/amc_report">AMC Reports</a></li>
<li><a href="<?php echo base_url();?>Asset/insurance_report">Insurance Reports</a></li>
</ul>
</li>
<?php } ?>
<?php if(check_auth() && is_admin() || is_user() ) { ?> <?php if(check_auth() && is_admin() && Asset_module() || Employee_group() ) { ?>
<li><a><i class="fa fa-university"></i> Assets <span class="fa fa-chevron-down"></span></a>
<br><br> <ul class="nav child_menu">
<h3>Employee</h3> <li><a href="<?php echo base_url();?>Asset/assetLandingPage">Assets List</a></li>
<br> <?php if(user()->action_permit != 'view' ) { ?>
<li><a href="<?php echo base_url();?>Asset/addAsset">Add Asset</a></li>
<?php } ?>
</ul>
</li>
<?php } ?>
<li><a href="<?php echo base_url();?>Employee/empList"><i class="fa fa-group"></i> Employee</a></li>
<?php } ?>
<?php if(check_auth() && is_user() || user()->role == null ) { ?> <?php if(check_auth() && is_admin() || is_superadmin() || is_user() ) { ?>
<li><a><i class="fa fa-user"></i> Users <span class="fa fa-chevron-down"></span></a>
<ul class="nav child_menu">
<li><a href="<?php echo base_url();?>User/userList">Users List</a></li>
<?php if(user()->action_permit != 'view' ) { ?>
<li><a href="<?php echo base_url();?>User/addUser">Add Users</a></li>
<?php } ?>
</ul>
</li>
<?php } ?>
<li><a href="<?php echo base_url();?>Leave/leavehistory"><i class="fa fa-calendar-times-o"></i>Leaves</a></li>
<?php } ?> <?php if(check_auth() && is_admin() && Asset_module()) { ?>
<li><a><i class="fa fa-clipboard"></i> Reports <span class="fa fa-chevron-down"></span></a>
<ul class="nav child_menu">
<li><a href="<?php echo base_url();?>Asset/depreciation_report">Depreciation
Reports</a></li>
<li><a href="<?php echo base_url();?>Asset/amc_report">AMC Reports</a></li>
<li><a href="<?php echo base_url();?>Asset/insurance_report">Insurance Reports</a>
</li>
</ul>
</li>
<?php } ?>
<?php if(check_auth() && is_user() || user()->role == null ) { ?>
<li><a href="<?php echo base_url();?>Expence/emp_expence_list"><i class="fa fa-money"></i> Expense </a></li>
<?php } ?> <?php if(check_auth() && is_admin() || is_user() ) { ?>
<?php if(check_auth() && is_user() || user()->role == null ) { ?> <br><br>
<h3>Employee</h3>
<br>
<li><a href="<?php echo base_url();?>Delegation/Delegation_list"><i class="fa fa-tasks" aria-hidden="true"></i> Delegation</a></li>
<?php } ?>
</ul>
</div>
</div>
<li><a href="<?php echo base_url();?>Employee/empList"><i class="fa fa-group"></i>
Employee</a></li>
<?php } ?>
<?php if(check_auth() && is_user() || user()->role == null ) { ?>
<li><a href="<?php echo base_url();?>Leave/leavehistory"><i
class="fa fa-calendar-times-o"></i>Leaves</a></li>
<?php } ?>
<?php if(check_auth() && is_user() || user()->role == null ) { ?>
<li><a href="<?php echo base_url();?>Expence/emp_expence_list"><i class="fa fa-money"></i>
Expense </a></li>
<?php } ?>
<?php if(check_auth() && is_user() || user()->role == null ) { ?>
<li><a href="<?php echo base_url();?>Delegation/Delegation_list"><i class="fa fa-tasks"
aria-hidden="true"></i> Delegation</a></li>
<?php } ?>
</ul>
</div>
</div>
</div> </div>
<!-- /sidebar menu --> <!-- /sidebar menu -->
<!-- /menu footer buttons --> <!-- /menu footer buttons -->
<div class="sidebar-footer hidden-small"> <div class="sidebar-footer hidden-small">
<a data-toggle="tooltip" data-placement="top" title="Settings"> <a data-toggle="tooltip" data-placement="top" title="Settings">
<span class="glyphicon glyphicon-cog" aria-hidden="true"></span> <span class="glyphicon glyphicon-cog" aria-hidden="true"></span>
</a> </a>
<a data-toggle="tooltip" data-placement="top" title="FullScreen"> <a data-toggle="tooltip" data-placement="top" title="FullScreen">
<span class="glyphicon glyphicon-fullscreen" aria-hidden="true"></span> <span class="glyphicon glyphicon-fullscreen" aria-hidden="true"></span>
</a> </a>
<a data-toggle="tooltip" data-placement="top" title="Lock"> <a data-toggle="tooltip" data-placement="top" title="Lock">
<span class="glyphicon glyphicon-eye-close" aria-hidden="true"></span> <span class="glyphicon glyphicon-eye-close" aria-hidden="true"></span>
</a> </a>
<a data-toggle="tooltip" data-placement="top" title="Logout" href="<?php echo base_url();?>Auth/logout"> <a data-toggle="tooltip" data-placement="top" title="Logout" href="<?php echo base_url();?>Auth/logout">
<span class="glyphicon glyphicon-off" aria-hidden="true"></span> <span class="glyphicon glyphicon-off" aria-hidden="true"></span>
</a> </a>
</div> </div>
<!-- /menu footer buttons --> <!-- /menu footer buttons -->
</div> </div>

View File

@ -55,6 +55,8 @@ public function leaveList()
$business_id = user()->business_id; $business_id = user()->business_id;
$leave_list = $this->Leave_model->get_leave_with_emp_name(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); $leave_type = $this->Leave_model->get_leave_type($business_id);
$decline_dropdown = $this->Leave_model->decline_dropdown($business_id); $decline_dropdown = $this->Leave_model->decline_dropdown($business_id);
$this->layout->set('tableData', $leave_list); $this->layout->set('tableData', $leave_list);
@ -448,7 +450,7 @@ public function ApproveLeave()
if($remaining_days[0]->remaining_days <= 0){ if($remaining_days[0]->remaining_days <= 0){
$data['status'] = 'Declined'; $data['status'] = 'Declined';
$data['declined_by']= user()->name; $data['declined_by']= user()->id;
$data['declined_at'] = date('d-m-Y H:i:s'); $data['declined_at'] = date('d-m-Y H:i:s');
$data['DReason'] = 'No sufficient leave balance'; $data['DReason'] = 'No sufficient leave balance';
$this->Leave_model->LeaveDecline($id, $data); $this->Leave_model->LeaveDecline($id, $data);
@ -462,8 +464,9 @@ public function ApproveLeave()
$this->Leave_model->emp_leave_days_update($emp_id, $days, $leave_year, $business_id, $no_of_days->type); $this->Leave_model->emp_leave_days_update($emp_id, $days, $leave_year, $business_id, $no_of_days->type);
$data['status'] = 'Approved'; $data['status'] = 'Approved';
$data['approved_by']= user()->name; $data['approved_by']= user()->id;
$data['approved_at'] = date('d-m-Y H:i:s'); $data['approved_at'] = date('d-m-Y H:i:s');
// print_r($data); die;
$this->Leave_model->LeaveApprove($id, $data); $this->Leave_model->LeaveApprove($id, $data);
redirect('Leave/leaveList'); redirect('Leave/leaveList');
} }
@ -550,4 +553,4 @@ public function manager_approvel()
$this->layout->render('Employee_Layout'); $this->layout->render('Employee_Layout');
} }
} }

View File

@ -3,9 +3,12 @@ class Leave_model extends MY_Model {
public function get_leave_with_emp_name($business_id) public function get_leave_with_emp_name($business_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');
$this->db->from('leave_list A'); $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->where('A.business_id', $business_id); $this->db->where('A.business_id', $business_id);
$this->db->order_by('A.id','DESC'); $this->db->order_by('A.id','DESC');
$this->db->where('A.is_active', 1); $this->db->where('A.is_active', 1);
@ -13,6 +16,23 @@ public function get_leave_with_emp_name($business_id)
$query = $query->result(); $query = $query->result();
return $query; return $query;
}
public function get_user_name($user_id){
$this->db->select('name');
$this->db->from('users');
$this->db->where('id', $user_id);
$query = $this->db->get();
// $query = $query->result();
if ($query->num_rows() > 0) {
$row = $query->row();
return $row->name;
} else {
return false;
}
// return $query;
} }
public function get_with_emp_name($business_id, ) public function get_with_emp_name($business_id, )

View File

@ -145,17 +145,16 @@
<label class="control-label col-md-2 col-sm-2 " for="last-name">Leave Applied For</label> <label class="control-label col-md-2 col-sm-2 " for="last-name">Leave Applied For</label>
<div class="col-md-5 col-sm-5 "> <div class="col-md-5 col-sm-5 ">
<input type="radio" id="self" name="risedby" value="self(<?php echo user()->id;?>)"style="margin:10px;"checked /><b>Self</b>
<input type="radio" id="others" name="risedby" value="<?php echo user()->name;?>(<?php echo user()->id;?>)" style="margin: 10px;" /><b>Others</b> <input type="radio" id="self" name="risedby" value="self(<?php echo user()->id;?>)"style="margin:10px;"checked /><b>Self</b>
<input type="radio" id="others" name="risedby" value="<?php echo user()->name;?>" style="margin: 10px;" /><b>Others</b>
</div> </div>
</div> </div>
<div class="item form-group"> <div class="item form-group">
<label class="control-label col-md-2 col-sm-2 " for="last-name"> Employee Name </label> <label class="control-label col-md-2 col-sm-2 " for="last-name"> Employee Name </label>
<div class="col-md-5 col-sm-5 "> <div class="col-md-5 col-sm-5 ">
<select id="user_dropdown" name="emp_id" style="margin-top: 10px;padding-bottom: 10px;" class="form-control manager"> </select> <select id="user_dropdown" name="emp_id" style="margin-top: 10px;padding-bottom: 10px;" class="form-control manager" required></select>
</div> </div>
</div> </div>
@ -271,7 +270,7 @@
$("#user_dropdown").addClass("hide-arrow"); $("#user_dropdown").addClass("hide-arrow");
$("input[name='risedby']").on("change", function() { $("input[name='risedby']").on("change", function() {
var inputValue = $(this).val(); var inputValue = $(this).val();
if (inputValue === "<?php echo user()->name;?>(<?php echo user()->id;?>)") { if (inputValue === "<?php echo user()->name;?>") {
$("#user_dropdown").removeClass("hide-arrow"); $("#user_dropdown").removeClass("hide-arrow");
} else { } else {
$("#user_dropdown").addClass("hide-arrow"); $("#user_dropdown").addClass("hide-arrow");
@ -360,7 +359,7 @@
var currentUserId = '<?php echo user()->id; ?>'; var currentUserId = '<?php echo user()->id; ?>';
$userDropdown.append('<option value="' + currentUserId + '">' + currentUserName + '</option>'); $userDropdown.append('<option value="' + currentUserId + '">' + currentUserName + '</option>');
$userDropdown.prop('disabled', true); $userDropdown.prop('disabled', true);
} else if (selectedValue === '<?php echo user()->name; ?>(<?php echo user()->id;?>)') { } else if (selectedValue === '<?php echo user()->name; ?>') {
$.ajax({ $.ajax({
@ -555,112 +554,15 @@ function calculateDateDifference() {
} }
// $(document).ready(function() {
// $('#type').change(function() {
// var leave_type_id = $('#type').val();
// console.log(leave_type_id);
// let employee_id = $('#user_dropdown').val();
// DateDifferenceOthers(leave_type_id, employee_id);
// });
// }); $('#subimt').click(function() {
let val = $('#user_dropdown').val()
console.log(val);
});
// function DateDifferenceOthers( leave_type_id, employee_id ) {
// let type_id = leave_type_id;
// let emp_id = employee_id;
// // var type_id = $('option:selected', this).attr('id');
// // let emp_id = $('#user_dropdown').val();
// var fromDate = fromDateInput.datepicker("getDate");
// var toDate = toDateInput.datepicker("getDate");
// $.ajax({
// data: {emp_id : emp_id, type_id : type_id},
// url : "<?php echo base_url()?>Leave/get_emp_leave_count/",
// type: "get",
// success: function(response) {
// response = JSON.parse(response);
// if (fromDate && toDate) {
// var difference = Math.ceil((toDate - fromDate) / (1000 * 60 * 60 * 24) + 1);
// if(response.length == 0)
// {
// $.ajax({
// type: "get",
// url: "<?php echo base_url()?>Leave/get_leave_master_count/",
// data: {type_id: type_id},
// success: function(response) {
// response = JSON.parse(response);
// if (difference > response[0].days)
// {
// Swal.fire('No sufficient leave balance please check the Date');
// $("#todate").val('');
// $("#dateDifference").val("");
// }
// },
// });
// }
// else{
// if (difference > response[0].remaining_days)
// {
// Swal.fire('No sufficient leave balance please check the Date' );
// $("#todate").val('');
// $("#dateDifference").val("");
// }
// }
// }
// }
// });
// }
// $('#user_dropdown').on('change', function(){
// let emp_id = $('#user_dropdown').val();
// DateValidate(emp_id);
// });
// function DateValidate(emp_id) {
// var fromDate = fromDateInput.datepicker("getDate");
// var toDate = toDateInput.datepicker("getDate");
// $.ajax({
// data: {emp_id : emp_id, fromDate : fromDate, toDate : toDate},
// url : "<?php echo base_url()?>Leave/get_from_to_date_count/",
// type: "get",
// success: function(response) {
// alert(response);
// response = JSON.parse(response);
// }
// });
// }
</script> </script>
@ -673,4 +575,3 @@ function calculateDateDifference() {

View File

@ -42,7 +42,7 @@
color: black; color: black;
} }
input[type=date]::-webkit-datetime-edit, input::-webkit-inner-spin-button, input::-webkit-clear-button { /* input[type=date]::-webkit-datetime-edit, input::-webkit-inner-spin-button, input::-webkit-clear-button {
display: none;s display: none;s
} }
@ -52,7 +52,7 @@
right: 0; right: 0;
color: black; color: black;
opacity: 1; opacity: 1;
} } */
</style> </style>

View File

@ -1,157 +1,162 @@
<head> <head>
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css'> <link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css'>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script> <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<style> <style>
.modal_default { .modal_default {
display: none; display: none;
position: fixed; position: fixed;
/* z-index: 1;*/ /* z-index: 1;*/
left: 0; left: 0;
top: 0; top: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: auto; overflow: auto;
background-color: rgba(0, 0, 0, 0.4); background-color: rgba(0, 0, 0, 0.4);
} }
.modal-content_default { .modal-content_default {
background-color: #fefefe; background-color: #fefefe;
margin: 15% auto; margin: 15% auto;
padding: 20px; padding: 20px;
border: 1px solid #888; border: 1px solid #888;
width: 380px; width: 380px;
height: 280px; height: 280px;
text-align: center; text-align: center;
} }
button { button {
margin-top: 10px; margin-top: 10px;
} }
div.dataTables_wrapper div.dataTables_filter{ div.dataTables_wrapper div.dataTables_filter {
margin-top: -30px !important; //search move to up margin-top: -30px !important;
} }
</style>
</style>
</head> </head>
<div class="col-md-12 col-sm-12 "> <div class="col-md-12 col-sm-12 ">
<div class="x_panel"> <div class="x_panel">
<div class="x_title"> <div class="x_title">
<ul class="nav navbar-right panel_toolbox">
<a href="<?php echo base_url();?>Leave/LeaveHistory" class="btn btn-sm btn-primary" style="margin-top: 20px;" >Back</a>
</ul>
<h1>My Approvals</h1> <ul class="nav navbar-right panel_toolbox">
<div class="clearfix"></div> <a href="<?php echo base_url();?>Leave/LeaveHistory" class="btn btn-sm btn-primary"
</div> style="margin-top: 20px;">Back</a>
<div class="x_content"> </ul>
<div class="row">
<div class="col-sm-12" style="overflow: auto;">
<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>
</tr>
</thead>
<tbody>
<?php foreach ($tableData as $key => $value) { ?>
<?php foreach ($leave_type as $leave => $type) { ?> <h1>My Approvals</h1>
<?php if($type->id === $value->type ) { ?> <div class="clearfix"></div>
<tr class="even pointer"> </div>
<td hidden ><?php echo $value->id; ?></td> <div class="x_content">
<td class=" "><?php echo $value->created_date; ?><br><?php echo $value->created_time; ?></td> <div class="row">
<td class=" "><?php echo $value->name; ?> (<?php echo $value->emp_id; ?>) </td> <div class="col-sm-12" style="overflow: auto;">
<td class=" "><?php echo $value->comments; ?></td> <table id="datatables" class="table table-striped table-bordered" width="100%">
<?php if($value->from_date == "" && $value->to_date == "") { ?> <thead>
<td class=""> <tr class="headings">
<?php echo dateFormat('d-m-Y',$value->perm_date);?><br> <th hidden class="column-title">id</th>
<?php echo timeFormat('h:i a', $value->from_time); ?> to <th class="column-title">Created Date/Time</th>
<?php echo timeFormat('h:i a', $value->to_time);?> <th class="column-title">Employee Name </th>
</td> <th class="column-title">Note</th>
<?php } else { ?> <th class="column-title">Leave Duration </th>
<th class="column-title">Leave Type </th>
<td class=" "> <?php echo dateFormat('d-m-Y',$value->from_date); echo ' to ';?> <?php echo dateFormat('d-m-Y',$value->to_date);?> </td> <th class="column-title">Leave Raised By</th>
<?php } ?> <th class="column-title">No of Days </th>
<th class="column-title">Status </th>
<td class=" "><?php echo $type->type; ?></td> <th class="column-title">Action </th>
</tr>
<td class=" "><?php echo $value->risedby; ?></td> </thead>
<?php if($value->no_of_days == 0){ ?> <tbody>
<td class=" ">---</td> <?php foreach ($tableData as $key => $value) { ?>
<?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{
}?> <?php foreach ($leave_type as $leave => $type) { ?>
<td style=" text-align: center; font-size: 16px;"> <?php if($type->id === $value->type ) { ?>
<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>
<?php } else { ?>
<?php if($value->status == 'pending') { ?> <td class=" "> <?php echo dateFormat('d-m-Y',$value->from_date); echo ' to ';?>
<?php echo dateFormat('d-m-Y',$value->to_date);?> </td>
<?php } ?>
<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>&nbsp; <td class=" "><?php echo $type->type; ?></td>
<td class=" "><?php echo $value->Risedby; ?></td>
<a href="#"><i class="fa fa-times test" aria-hidden="true" title="Decline" onclick="showCustomPrompt()" <?php if($value->no_of_days == 0){ ?>
id= "<?php echo $value->id; ?>"></i></a>&nbsp; <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 }
else{
}?>
<td style=" text-align: center; font-size: 16px;">
<?php } ?> <?php if($value->status == 'pending') { ?>
</td>
</tr> <a><i class="fa fa-check approveleave" data-toggle="modal"
<?php } } } ?> data-target=".bs-example-modal-sm" title="Approve Leave"
</tbody> id="<?php echo $value->id;?>"></i></a>&nbsp;
</table>
<a href="#"><i class="fa fa-times test" aria-hidden="true" title="Decline"
onclick="showCustomPrompt()" id="<?php echo $value->id; ?>"></i></a>&nbsp;
<?php } ?>
</td>
</tr>
<?php } } } ?>
</tbody>
</table>
</div>
</div>
</div>
</div> </div>
</div>
</div>
</div>
</div> </div>
<div id="customPrompt" class="modal modal_default"> <div id="customPrompt" class="modal modal_default">
<div class="modal-content modal-content_default"> <div class="modal-content modal-content_default">
<span style="text-align: right;" onclick="$('#customPrompt').hide()"><i class="fa fa-times" aria-hidden="true"></i></span> <span style="text-align: right;" onclick="$('#customPrompt').hide()"><i class="fa fa-times"
<h3>Decline Reason</h3> aria-hidden="true"></i></span>
<input list="browsers" onfocus id="decline_reason" required name="myBrowser" style="margin-top: 10%;padding: 10px;"/> <h3>Decline Reason</h3>
<datalist id="browsers" > <input list="browsers" onfocus id="decline_reason" required name="myBrowser"
<?php foreach ($dropdown as $key => $value) { ?> style="margin-top: 10%;padding: 10px;" />
<option value="<?php echo $value->enum_value; ?>"><?php echo $value->enum_value; ?></option> <datalist id="browsers">
<?php } ?> <?php foreach ($dropdown as $key => $value) { ?>
</datalist> <option value="<?php echo $value->enum_value; ?>"><?php echo $value->enum_value; ?></option>
<?php } ?>
</datalist>
<button onclick="submitCustomPrompt()" type="button" class="btn btn-primary">Submit</button> <button onclick="submitCustomPrompt()" type="button" class="btn btn-primary">Submit</button>
</div> </div>
</div> </div>
<br/> <br />
<!-- Large modal --> <!-- Large modal -->
<!-- <button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-lg" hidden>Large modal</button> --> <!-- <button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-lg" hidden>Large modal</button> -->
@ -160,103 +165,106 @@
<div style="display:none" id="sub-value"> <div style="display:none" id="sub-value">
<script> <script>
$('.approveleave').click(function() { $('.approveleave').click(function() {
var id = $(this).attr('id'); var id = $(this).attr('id');
var url = "<?php echo base_url()?>Leave/ApproveLeave"; var url = "<?php echo base_url()?>Leave/ApproveLeave";
$.ajax({ $.ajax({
url: "<?php echo base_url()?>Leave/getDeleteConfirmationPopup", url: "<?php echo base_url()?>Leave/getDeleteConfirmationPopup",
type:"GET", type: "GET",
success:function(data){ success: function(data) {
$('#popup').html(JSON.parse(data)); $('#popup').html(JSON.parse(data));
$('.delete_id').attr('value',id); $('.delete_id').attr('value', id);
$('.delete_url').attr('action',url); $('.delete_url').attr('action', url);
} }
});
}); });
});
$(document).on('click','.bi-card-list',function(){ $(document).on('click', '.bi-card-list', function() {
var id = $(this).attr("id") var id = $(this).attr("id")
$.ajax({ $.ajax({
type: "get", type: "get",
url: "<?php echo base_url()?>Employee/view_emp_history/"+id, url: "<?php echo base_url()?>Employee/view_emp_history/" + id,
success: function(response) { success: function(response) {
response = JSON.parse(response); response = JSON.parse(response);
console.log(response); console.log(response);
$('.bs-example-modal-lg').html(response); $('.bs-example-modal-lg').html(response);
$('.bs-example-modal-lg').modal("show"); $('.bs-example-modal-lg').modal("show");
}, },
error: function(jqXHR, textStatus, err) { alert('text status '+textStatus+', err '+err) } error: function(jqXHR, textStatus, err) {
alert('text status ' + textStatus + ', err ' + err)
}
});
}); });
}); </script>
</script>
<script> <script>
function showCustomPrompt() {
var customPrompt = document.getElementById("customPrompt");
customPrompt.style.display = "block";
}
function showCustomPrompt() { function submitCustomPrompt() {
var customPrompt = document.getElementById("customPrompt");
customPrompt.style.display = "block";
}
function submitCustomPrompt() { var id = $('.test').attr("id");
var reason = document.getElementById("decline_reason").value;
var id = $('.test').attr("id");
var reason = document.getElementById("decline_reason").value;
if( reason != "") if (reason != "")
$.ajax( $.ajax({
{ data: {
data:{id : id , reason : reason }, id: id,
url:"<?php echo base_url('Leave/Decline');?>", reason: reason
type:"get", },
success: function(response) { url: "<?php echo base_url('Leave/Decline');?>",
type: "get",
window.location ='<?php echo base_url('Leave/leaveList');?>'; success: function(response) {
}
window.location = '<?php echo base_url('Leave/leaveList');?>';
}
}); });
else else
alert('Decline Reason is required'); alert('Decline Reason is required');
} }
</script>
</script> <script>
<script> $(document).ready(function() {
$(document).ready(function() { $('#datatables').DataTable({
$('#datatables').DataTable({ "order": [
"order": [[0, 'desc']], // Set initial sorting to descending on the first column [0, 'desc']
"dom": 'Bfrtip', // Show export buttons ], // Set initial sorting to descending on the first column
"buttons": [ 'excel', 'pdf'], // Enable export options "dom": 'Bfrtip', // Show export buttons
"language": { "buttons": ['excel', 'pdf'], // Enable export options
"search": "Search: " // Customize search label "language": {
} "search": "Search: " // Customize search label
}
});
}); });
}); </script>
</script>
<script> <script>
function showConfirmationPopup() { function showConfirmationPopup() {
var popup = document.getElementById('confirmationPopup'); var popup = document.getElementById('confirmationPopup');
popup.style.display = 'flex'; popup.style.display = 'flex';
} }
function hideConfirmationPopup() { function hideConfirmationPopup() {
var popup = document.getElementById('confirmationPopup'); var popup = document.getElementById('confirmationPopup');
popup.style.display = 'none'; popup.style.display = 'none';
} }
function confirmAction() { function confirmAction() {
// Handle the action to be performed on confirmation // Handle the action to be performed on confirmation
hideConfirmationPopup(); hideConfirmationPopup();
// ... // ...
} }
</script>
</script>
@ -270,6 +278,4 @@ function confirmAction() {
</div> </div>

View File

@ -204,14 +204,15 @@ public function check_password()
$table="users"; $table="users";
$userData = $this->MY_Model->edit_option($data, user()->id, $table); $userData = $this->MY_Model->edit_option($data, user()->id, $table);
// $this->session->sess_destroy(); // $this->session->sess_destroy();
$data1['status'] = 'success'; // $data1['status'] = 'success';
$data1['csrf_hash'] = $this->security->get_csrf_hash(); // $data1['csrf_hash'] = $this->security->get_csrf_hash();
echo json_encode($data1); // echo json_encode($data1);
redirect('logout');
} }
else{ else{
$data['status'] = 'failed'; // $data['status'] = 'failed';
$data['csrf_hash'] = $this->security->get_csrf_hash(); // $data['csrf_hash'] = $this->security->get_csrf_hash();
echo json_encode($data); // echo json_encode($data);
} }
} }
@ -244,4 +245,4 @@ public function view_business_history($id)
echo json_encode($htmlPage); echo json_encode($htmlPage);
} }
} }

View File

@ -1,38 +1,40 @@
<!-- Body page content --> <!-- Body page content -->
<div class=""> <div class="">
<div class="page-title"> <div class="page-title">
<div class="title_left"> <div class="title_left">
<h3>Add User</h3> <h3>Add User</h3>
</div> </div>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="row"> <div class="row">
<div class="col-md-12 col-sm-12 "> <div class="col-md-12 col-sm-12 ">
<div class="x_panel"> <div class="x_panel">
<!-- <div class="x_title"> --> <!-- <div class="x_title"> -->
<!-- <ul class="nav navbar-right panel_toolbox"> <!-- <ul class="nav navbar-right panel_toolbox">
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li> <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
</li> </li>
</ul> --> </ul> -->
<!-- <h6>General Information</h6> --> <!-- <h6>General Information</h6> -->
<!-- <div class="clearfix"></div> --> <!-- <div class="clearfix"></div> -->
<!-- </div> --> <!-- </div> -->
<div class="x_content"> <div class="x_content">
<br /> <br />
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>User/createUser" enctype="multipart/form-data"> <form id="" data-parsley-validate class="form-horizontal form-label-left" method="post"
action="<?php echo base_url();?>User/createUser" 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="<?php echo $this->security->get_csrf_token_name();?>"
<input type="text" id="created_by" name="created_by" value="<?php echo $data->created_by ?>" class="form-control " hidden> value="<?php echo $this->security->get_csrf_hash();?>">
<input type="text" id="created_by" name="created_by" value="<?php echo $data->created_by ?>"
class="form-control " hidden>
<!-- <?php if (is_superadmin()) { ?> <!-- <?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> <label class="control-label col-md-1 col-sm-1 " for="first-name"> Business<a style="color:red;">*</a> </label>
@ -61,136 +63,158 @@
<?php } ?> --> <?php } ?> -->
<?php if (is_superadmin()) { ?> <?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> <label class="control-label col-md-1 col-sm-1 " for="first-name"> Business<a
<div class="col-md-5 col-sm-5 "> style="color:red;">*</a> </label>
<select id="business_id" name="business_id" required="required" class="form-control" > <div class="col-md-5 col-sm-5 ">
<option value="<?php if(isset($businessData)) { echo $businessData->uid; } ?>"> <select id="business_id" name="business_id" required="required" class="form-control">
<?php if(isset($businessData)) { echo $businessData->business_name; }else{ echo "Select business"; } ?> <option value="<?php if(isset($businessData)) { echo $businessData->uid; } ?>">
</option> <?php if(isset($businessData)) { echo $businessData->business_name; }else{ echo "Select business"; } ?>
<?php foreach ($business_dropdown as $key => $value) { ?> </option>
<option value="<?php echo $value->uid; ?>"><?php echo $value->business_name; echo $value->uid; ?></option> <?php foreach ($business_dropdown as $key => $value) { ?>
<?php } ?> <option value="<?php echo $value->uid; ?>">
</select> <?php echo $value->business_name; echo $value->uid; ?></option>
</div> <?php } ?>
</select>
</div>
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Role<a style="color:red;">*</a> </label> <label class="control-label col-md-1 col-sm-1 " for="last-name"> Role<a
<div class="col-md-5 col-sm-5 "> style="color:red;">*</a> </label>
<select id="role" name="role" required="required" class="form-control" > <div class="col-md-5 col-sm-5 ">
<option value="">Select role</option> <select id="role" name="role" required="required" class="form-control">
<option value="admin">Admin</option> <option value="">Select role</option>
<option value="user">user</option> <option value="admin">Admin</option>
</select> <option value="user">user</option>
</div> </select>
</div>
</div> </div>
<?php } <?php }
else if (is_admin() || user()->action_permit != 'view') { ?> else if (is_admin() || user()->action_permit != 'view') { ?>
<div class="item form-group" hidden> <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> <input type="text" id="business_id" name="business_id"
<input type="text" id="role" name="role" value="user" class="form-control " hidden> value="<?php echo $data->business_id ?>" class="form-control " hidden>
<input type="text" id="role" name="role" value="user" class="form-control " hidden>
</div>
<?php } ?>
<!-- <br /> <h6></h6> <div class="x_title"> </div> <br /> -->
<!-- --------------------------- -->
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Name<a
style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 ">
<input type="text" id="name" name="name" value="" required="required"
class="form-control ">
</div>
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Email<a
style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 ">
<input type="email" id="email" name="email" value="" 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<a
style="color:red;">*</a> </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="" required="required" class="form-control ">
</div>
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Permission<a
style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 ">
<select id="action_permit" name="action_permit" required="required"
class="form-control">
<option value="">Select Permission</option>
<option value="all">All</option>
<option value="view">View</option>
</select>
</div>
</div>
<!-- --------------------------- -->
<br />
<h6></h6>
<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 ">
</div>
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Password<a
style="color:red;">*</a> </label>
<div class="col-md-3 col-sm-3 ">
<input type="password" id="password" minlength="8" name="password" value=""
required="required" class="form-control "
title="password must have alphabets &#013;password requires 6 characters minimum">
<span toggle="#password" id="toggle-password"
class="fa fa-fw fa-eye field-icon toggle-password"></span>
</div>
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Confirm Password<a
style="color:red;">*</a> </label>
<div class="col-md-3 col-sm-3 ">
<input type="password" id="confirm_password" name="confirm_password" value=""
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">
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
<button class="btn btn-primary" type="reset">Reset</button>
<button type="submit" class="btn btn-success">Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div> </div>
<?php } ?> <!-- /Body page content -->
<!-- <br /> <h6></h6> <div class="x_title"> </div> <br /> -->
<!-- --------------------------- -->
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Name<a style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 ">
<input type="text" id="name" name="name" value="" required="required" class="form-control ">
</div>
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Email<a style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 ">
<input type="email" id="email" name="email" value="" 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<a style="color:red;">*</a> </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="" required="required" class="form-control ">
</div>
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Permission<a style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 ">
<select id="action_permit" name="action_permit" required="required" class="form-control" >
<option value="">Select Permission</option>
<option value="all">All</option>
<option value="view">View</option>
</select>
</div>
</div>
<!-- --------------------------- -->
<br /> <h6></h6> <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 ">
</div>
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Password<a style="color:red;">*</a> </label>
<div class="col-md-3 col-sm-3 ">
<input type="password" id="password" minlength="8" name="password" value="" required="required" class="form-control " title="password must have alphabets &#013;password requires 6 characters minimum">
<span toggle="#password" id="toggle-password" class="fa fa-fw fa-eye field-icon toggle-password"></span>
</div>
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Confirm Password<a style="color:red;">*</a> </label>
<div class="col-md-3 col-sm-3 ">
<input type="password" id="confirm_password" name="confirm_password" value="" 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">
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
<button class="btn btn-primary" type="reset">Reset</button>
<button type="submit" class="btn btn-success">Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- /Body page content -->

View File

@ -1,121 +1,119 @@
<!-- Body page content --> <!-- Body page content -->
<div class=""> <div class="">
<div class="page-title"> <div class="page-title">
<div class="title_left"> <div class="title_left">
<h3>Change Password</h3> <h3>Change Password</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_content">
<br />
<form id="change-pass" data-parsley-validate class="form-horizontal form-label-left" method="post"
action="<?php echo base_url();?>User/check_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();?>">
<!-- --------------------------- -->
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Old Password <a
style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 ">
<input type="password" id="old_password" name="old_password" value=""
required="required" class="form-control ">
<span id='message1'></span>
</div>
</div>
<!-- --------------------------- -->
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="last-name"> New Password <a
style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 ">
<input type="password" id="password" minlength="8" name="password" value=""
required="required" class="form-control "
title="password must have alphabets &#013;password requires 6 characters minimum">
<span toggle="#password" id="toggle-password"
class="fa fa-fw fa-eye field-icon toggle-password"></span>
</div>
</div>
<!-- --------------------------- -->
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Confirm Password <a
style="color:red;">*</a> </label>
<div class="col-md-5 col-sm-5 ">
<input type="password" id="confirm_password" name="confirm_password" value=""
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">
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
<button type="reset" class="btn btn-primary" >Reset</button>
<button type="submit" id="submit" class="btn btn-success">Submit</button>
</div>
</div>
<!-- --------------------------- -->
</form>
</div>
</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="change-pass" 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();?>">
<!-- --------------------------- -->
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Old Password </label>
<div class="col-md-5 col-sm-5 ">
<input type="password" id="old_password" name="old_password" value="" required="required" class="form-control ">
<span id='message1'></span>
</div>
</div>
<!-- --------------------------- -->
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="last-name"> New Password </label>
<div class="col-md-5 col-sm-5 ">
<input type="password" id="password" minlength="8" name="password" value="" required="required" class="form-control " title="password must have alphabets &#013;password requires 6 characters minimum">
<span toggle="#password" id="toggle-password" class="fa fa-fw fa-eye field-icon toggle-password"></span>
</div>
</div>
<!-- --------------------------- -->
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Confirm Password </label>
<div class="col-md-5 col-sm-5 ">
<input type="password" id="confirm_password" name="confirm_password" value="" required="required" class="form-control ">
<span id='message'></span>
</div>
</div>
<!-- --------------------------- -->
</form>
<div class="ln_solid"></div>
<div class="item form-group">
<div class="offset-md-8">
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
<button class="btn btn-primary" type="reset">Reset</button>
<button type="" id="submit" class="btn btn-success">Submit</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /Body page content --> <!-- /Body page content -->
<script> <script>
console.log($("#change-pass").serialize()); console.log($("#change-pass").serialize());
$(document).on('click','#submit',function(){ $(document).on('click', '#submit', function() {
var data = $("#change-pass").serialize(); var data = $("#change-pass").serialize();
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<?php echo base_url();?>User/check_password", url: "<?php echo base_url();?>User/check_password",
data: data, data: data,
json: true, json: true,
success: function(response) { success: function(response) {
response = jQuery.parseJSON(response); response = jQuery.parseJSON(response);
if (response.status == "success") { if (response.status == "success") {
console.log("ssssssssss"); console.log("ssssssssss");
$('input[name=csrf_test_name]').val(response.csrf_hash); $('input[name=csrf_test_name]').val(response.csrf_hash);
location.href = "<?php echo base_url();?>Auth/logout"; location.href = "<?php echo base_url();?>Auth/logout";
} } else {
else { $('input[name=csrf_test_name]').val(response.csrf_hash);
$('input[name=csrf_test_name]').val(response.csrf_hash); $('#message1').html('Worng password').css('color', 'red');
$('#message1').html('Worng password').css('color', 'red'); $('#password').val('');
$('#password').val(''); $('#confirm_password').val('');
$('#confirm_password').val(''); $('#message').html('');
$('#message').html(''); }
},
error: function(jqXHR, textStatus, err) {
alert('text status ' + textStatus + ', err ' + err)
} }
},
error: function(jqXHR, textStatus, err) { alert('text status '+textStatus+', err '+err) }
}); });
}); });
</script> </script>

View File

@ -1,65 +1,69 @@
<!-- Body page content --> <!-- Body page content -->
<div class=""> <div class="">
<div class="page-title"> <div class="page-title">
<div class="title_left"> <div class="title_left">
<h3>Edit Profile</h3> <h3>Edit Profile</h3>
</div> </div>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="row"> <div class="row">
<div class="col-md-12 col-sm-12 "> <div class="col-md-12 col-sm-12 ">
<div class="x_panel"> <div class="x_panel">
<!-- <div class="x_title"> --> <!-- <div class="x_title"> -->
<!-- <ul class="nav navbar-right panel_toolbox"> <!-- <ul class="nav navbar-right panel_toolbox">
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li> <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
</li> </li>
</ul> --> </ul> -->
<!-- <h6>General Information</h6> --> <!-- <h6>General Information</h6> -->
<!-- <div class="clearfix"></div> --> <!-- <div class="clearfix"></div> -->
<!-- </div> --> <!-- </div> -->
<div class="x_content"> <div class="x_content">
<br /> <br />
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>User/editprofiles" enctype="multipart/form-data"> <form id="" data-parsley-validate class="form-horizontal form-label-left" method="post"
action="<?php echo base_url();?>User/editprofiles" 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="<?php echo $this->security->get_csrf_token_name();?>"
<input type="hidden" name="id" value="<?php echo $editData->id; ?>"> value="<?php echo $this->security->get_csrf_hash();?>">
<!-- --------------------------- --> <input type="hidden" name="id" value="<?php echo $editData->id; ?>">
<div class="item form-group"> <!-- --------------------------- -->
<div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Name </label> <label class="control-label col-md-1 col-sm-1 " for="first-name"> Name </label>
<div class="col-md-5 col-sm-5 "> <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 "> <input type="text" id="name" name="name" value="<?php echo $editData->name; ?>"
</div> required="required" class="form-control ">
</div>
</div> </div>
<!-- --------------------------- --> <!-- --------------------------- -->
<div class="item form-group"> <div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="last-name"> Email </label> <label class="control-label col-md-1 col-sm-1 " for="last-name"> Email </label>
<div class="col-md-5 col-sm-5 "> <div class="col-md-5 col-sm-5 ">
<input type="text" id="email" name="email" value="<?php echo $editData->email; ?>" required="required" class="form-control "> <input type="text" id="email" name="email" value="<?php echo $editData->email; ?>"
</div> required="required" class="form-control ">
</div>
</div> </div>
<!-- --------------------------- --> <!-- --------------------------- -->
<div class="item form-group"> <div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Mobile </label> <label class="control-label col-md-1 col-sm-1 " for="first-name"> Mobile </label>
<div class="col-md-5 col-sm-5 "> <div class="col-md-5 col-sm-5 ">
<input type="text" id="mobile" name="mobile" value="<?php echo $editData->mobile; ?>" required="required" class="form-control "> <input type="text" id="mobile" name="mobile" value="<?php echo $editData->mobile; ?>"
</div> required="required" class="form-control ">
</div>
</div> </div>
<!-- --------------------------- --> <!-- --------------------------- -->
<!-- <div class="item form-group"> <!-- <div class="item form-group">
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Profile </label> <label class="control-label col-md-1 col-sm-1 " for="first-name"> Profile </label>
<div class="col-md-5 col-sm-5 "> <div class="col-md-5 col-sm-5 ">
@ -67,21 +71,21 @@
</div> </div>
</div> --> </div> -->
<!-- --------------------------- --> <!-- --------------------------- -->
<div class="ln_solid"></div> <div class="ln_solid"></div>
<div class="item form-group"> <div class="item form-group">
<div class="col-md-3 col-sm-3 offset-md-9"> <div class="col-md-3 col-sm-3 offset-md-9">
<button class="btn btn-primary" onclick="history.back()">Cancel</button> <button class="btn btn-primary" onclick="history.back()">Cancel</button>
<button type="submit" class="btn btn-success">Update</button> <button type="submit" class="btn btn-success">Update</button>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
</div> </div>
@ -90,5 +94,5 @@
</div> </div>
</div> </div>

View File

@ -1,13 +1,12 @@
<!-- page content -->
<!-- page content --> <div class="" role="main">
<div class="" role="main"> <div class="">
<div class=""> <div class="page-title">
<div class="page-title"> <div class="title_left">
<div class="title_left">
<h3>User Profile</h3> <h3>User Profile</h3>
</div> </div>
<div class="title_right"> <div class="title_right">
<!-- <div class="col-md-5 col-sm-5 form-group pull-right top_search"> <!-- <div class="col-md-5 col-sm-5 form-group pull-right top_search">
<div class="input-group"> <div class="input-group">
<input type="text" class="form-control" placeholder="Search for..."> <input type="text" class="form-control" placeholder="Search for...">
@ -16,101 +15,100 @@
</span> </span>
</div> </div>
</div> --> </div> -->
</div>
</div> </div>
</div>
<div class="clearfix"></div>
<div class="row"> <div class="clearfix"></div>
<div class="col-md-12 col-sm-12 ">
<div class="row">
<div class="col-md-12 col-sm-12 ">
<div class="x_panel"> <div class="x_panel">
<div class="x_title"> <div class="x_title">
<h2>User Details <h2>User Details</h2>
<!-- <small>Activity report</small> -->
</h2>
<!-- <ul class="nav navbar-right panel_toolbox">
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">Settings 1</a>
<a class="dropdown-item" href="#">Settings 2</a>
</div>
</li>
<li><a class="close-link"><i class="fa fa-close"></i></a>
</li>
</ul> -->
<div class="clearfix"></div>
</div>
<div class="x_content">
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>User/editprofiles" 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 user()->id; ?>">
<button type="submit" class="btn btn-success" hidden>Update</button>
<div class="col-md-3 col-sm-3 profile_left"> <div class="clearfix"></div>
<div class="profile_img"> </div>
<div id="crop-avatar"> <div class="x_content">
<!-- Current avatar --> <form id="" data-parsley-validate class="form-horizontal form-label-left" method="post"
<?php action="<?php echo base_url();?>User/editprofiles" enctype="multipart/form-data">
if ($userData->profile_image == NULL) { <input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>"
?> value="<?php echo $this->security->get_csrf_hash();?>">
<div class="profilepic"> <input type="hidden" name="id" value="<?php echo user()->id; ?>">
<img style="width: 100%;height: 100%; display: block;" src="<?php echo base_url(); ?>/assets/uploads/profile_picture/profile.jpg" alt="Avatar" title="Change the avatar"> <button type="submit" class="btn btn-success" hidden>Update</button>
<input id="file_profile" name="profile_image" class="typeFile1" type="file" hidden/>
<div class="profilepic__content"> <div class="col-md-3 col-sm-3 profile_left">
<span class="profilepic__icon"><i class="fa fa-camera" style="font-size:25px;color:black"></i></span> <div class="profile_img">
<span class="profilepic__text"><b>Edit Profile</b></span> <div id="crop-avatar">
</div> <!-- Current avatar -->
</div> <?php
<?php if ($userData->profile_image == NULL) {
?>
<div class="profilepic">
<img style="width: 100%;height: 100%; display: block;"
src="<?php echo base_url(); ?>/assets/uploads/profile_picture/profile.jpg"
alt="Avatar" title="Change the avatar">
<input id="file_profile" name="profile_image" class="typeFile1" type="file"
hidden />
<div class="profilepic__content">
<span class="profilepic__icon"><i class="fa fa-camera"
style="font-size:25px;color:black"></i></span>
<span class="profilepic__text"><b>Edit Profile</b></span>
</div>
</div>
<?php
} else { } else {
?> ?>
<div class="profilepic"> <div class="profilepic">
<img class="profilepic__image" style="width: 100%; display: block;border-radius:50%" src="<?php echo base_url();?>/assets/uploads/profile_picture/<?php echo $userData->profile_image ?>" alt="Avatar" title="Change the avatar"> <img class="profilepic__image"
<input id="file_profile" name="profile_image" class="typeFile1" type="file" hidden/> style="width: 100%; display: block;border-radius:50%"
<div class="profilepic__content"> src="<?php echo base_url();?>/assets/uploads/profile_picture/<?php echo $userData->profile_image ?>"
<span class="profilepic__icon"><i class="fa fa-camera" style="font-size:25px;color:black"></i></span> alt="Avatar" title="Change the avatar">
<span class="profilepic__text"><b>Edit Profile</b></span> <input id="file_profile" name="profile_image" class="typeFile1" type="file"
</div> hidden />
</div> <div class="profilepic__content">
<?php <span class="profilepic__icon"><i class="fa fa-camera"
style="font-size:25px;color:black"></i></span>
<span class="profilepic__text"><b>Edit Profile</b></span>
</div>
</div>
<?php
} }
?> ?>
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-9 col-sm-9 "> <div class="col-md-9 col-sm-9 ">
<h3><?php echo user()->name ?></h3> <h3><?php echo user()->name ?></h3>
<ul class="list-unstyled user_data"> <ul class="list-unstyled user_data">
<li><i class="fa fa-envelope user-profile-icon"></i> <?php echo user()->email ?> <li><i class="fa fa-envelope user-profile-icon"></i> <?php echo user()->email ?>
</li> </li>
<li> <li>
<i class="fa fa-phone user-profile-icon"></i> <?php echo user()->mobile ?> <i class="fa fa-phone user-profile-icon"></i> <?php echo user()->mobile ?>
</li> </li>
</ul> </ul>
<?php <?php
if (is_superadmin()) { if (is_superadmin()) {
?> ?>
<a class="btn btn-success" href="<?php echo base_url()?>User/editprofile/<?php echo md5(user()->id);?>"><i class="fa fa-edit m-right-xs"></i>Edit Profile</a> <a class="btn btn-success"
<br /> href="<?php echo base_url()?>User/editprofile/<?php echo md5(user()->id);?>"><i
<?php class="fa fa-edit m-right-xs"></i>Edit Profile</a>
<br />
<?php
} }
?> ?>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
</div>
</div> </div>
</div>
</div> </div>
<!-- /page content --> </div>
</div>
<!-- /page content -->
<!-- <script> <!-- <script>

BIN
assets/appimg/default.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 383 KiB

100
composer.lock generated
View File

@ -62,31 +62,34 @@
}, },
{ {
"name": "chillerlan/php-qrcode", "name": "chillerlan/php-qrcode",
"version": "4.3.4", "version": "4.4.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/chillerlan/php-qrcode.git", "url": "https://github.com/chillerlan/php-qrcode.git",
"reference": "2ca4bf5ae048af1981d1023ee42a0a2a9d51e51d" "reference": "52889cd7ab1b78e6a345edafe24aa74bc5becc08"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/chillerlan/php-qrcode/zipball/2ca4bf5ae048af1981d1023ee42a0a2a9d51e51d", "url": "https://api.github.com/repos/chillerlan/php-qrcode/zipball/52889cd7ab1b78e6a345edafe24aa74bc5becc08",
"reference": "2ca4bf5ae048af1981d1023ee42a0a2a9d51e51d", "reference": "52889cd7ab1b78e6a345edafe24aa74bc5becc08",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"chillerlan/php-settings-container": "^2.1.4", "chillerlan/php-settings-container": "^2.1.4 || ^3.1",
"ext-mbstring": "*", "ext-mbstring": "*",
"php": "^7.4 || ^8.0" "php": "^7.4 || ^8.0"
}, },
"require-dev": { "require-dev": {
"phan/phan": "^5.3", "phan/phan": "^5.4",
"phpunit/phpunit": "^9.5", "phpmd/phpmd": "^2.13",
"setasign/fpdf": "^1.8.2" "phpunit/phpunit": "^9.6",
"setasign/fpdf": "^1.8.2",
"squizlabs/php_codesniffer": "^3.7"
}, },
"suggest": { "suggest": {
"chillerlan/php-authenticator": "Yet another Google authenticator! Also creates URIs for mobile apps.", "chillerlan/php-authenticator": "Yet another Google authenticator! Also creates URIs for mobile apps.",
"setasign/fpdf": "Required to use the QR FPDF output." "setasign/fpdf": "Required to use the QR FPDF output.",
"simple-icons/simple-icons": "SVG icons that you can use to embed as logos in the QR Code"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@ -113,7 +116,7 @@
"homepage": "https://github.com/chillerlan/php-qrcode/graphs/contributors" "homepage": "https://github.com/chillerlan/php-qrcode/graphs/contributors"
} }
], ],
"description": "A QR code generator. PHP 7.4+", "description": "A QR code generator with a user friendly API. PHP 7.4+",
"homepage": "https://github.com/chillerlan/php-qrcode", "homepage": "https://github.com/chillerlan/php-qrcode",
"keywords": [ "keywords": [
"phpqrcode", "phpqrcode",
@ -124,7 +127,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/chillerlan/php-qrcode/issues", "issues": "https://github.com/chillerlan/php-qrcode/issues",
"source": "https://github.com/chillerlan/php-qrcode/tree/4.3.4" "source": "https://github.com/chillerlan/php-qrcode/tree/4.4.0"
}, },
"funding": [ "funding": [
{ {
@ -136,29 +139,31 @@
"type": "ko_fi" "type": "ko_fi"
} }
], ],
"time": "2022-07-25T09:12:45+00:00" "time": "2023-11-23T23:53:20+00:00"
}, },
{ {
"name": "chillerlan/php-settings-container", "name": "chillerlan/php-settings-container",
"version": "2.1.4", "version": "3.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/chillerlan/php-settings-container.git", "url": "https://github.com/chillerlan/php-settings-container.git",
"reference": "1beb7df3c14346d4344b0b2e12f6f9a74feabd4a" "reference": "4d02944424fa1f48abca96353257c93cbac856c1"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/chillerlan/php-settings-container/zipball/1beb7df3c14346d4344b0b2e12f6f9a74feabd4a", "url": "https://api.github.com/repos/chillerlan/php-settings-container/zipball/4d02944424fa1f48abca96353257c93cbac856c1",
"reference": "1beb7df3c14346d4344b0b2e12f6f9a74feabd4a", "reference": "4d02944424fa1f48abca96353257c93cbac856c1",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-json": "*", "ext-json": "*",
"php": "^7.4 || ^8.0" "php": "^8.1"
}, },
"require-dev": { "require-dev": {
"phan/phan": "^5.3", "phan/phan": "^5.4",
"phpunit/phpunit": "^9.5" "phpmd/phpmd": "^2.13",
"phpunit/phpunit": "^10.2",
"squizlabs/php_codesniffer": "^3.7"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@ -177,10 +182,9 @@
"homepage": "https://github.com/codemasher" "homepage": "https://github.com/codemasher"
} }
], ],
"description": "A container class for immutable settings objects. Not a DI container. PHP 7.4+", "description": "A container class for immutable settings objects. Not a DI container.",
"homepage": "https://github.com/chillerlan/php-settings-container", "homepage": "https://github.com/chillerlan/php-settings-container",
"keywords": [ "keywords": [
"PHP7",
"Settings", "Settings",
"configuration", "configuration",
"container", "container",
@ -200,20 +204,20 @@
"type": "ko_fi" "type": "ko_fi"
} }
], ],
"time": "2022-07-05T22:32:14+00:00" "time": "2023-07-17T20:46:37+00:00"
}, },
{ {
"name": "dasprid/enum", "name": "dasprid/enum",
"version": "1.0.4", "version": "1.0.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/DASPRiD/Enum.git", "url": "https://github.com/DASPRiD/Enum.git",
"reference": "8e6b6ea76eabbf19ea2bf5b67b98e1860474012f" "reference": "6faf451159fb8ba4126b925ed2d78acfce0dc016"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/DASPRiD/Enum/zipball/8e6b6ea76eabbf19ea2bf5b67b98e1860474012f", "url": "https://api.github.com/repos/DASPRiD/Enum/zipball/6faf451159fb8ba4126b925ed2d78acfce0dc016",
"reference": "8e6b6ea76eabbf19ea2bf5b67b98e1860474012f", "reference": "6faf451159fb8ba4126b925ed2d78acfce0dc016",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -248,27 +252,27 @@
], ],
"support": { "support": {
"issues": "https://github.com/DASPRiD/Enum/issues", "issues": "https://github.com/DASPRiD/Enum/issues",
"source": "https://github.com/DASPRiD/Enum/tree/1.0.4" "source": "https://github.com/DASPRiD/Enum/tree/1.0.5"
}, },
"time": "2023-03-01T18:44:03+00:00" "time": "2023-08-25T16:18:39+00:00"
}, },
{ {
"name": "endroid/qr-code", "name": "endroid/qr-code",
"version": "4.8.2", "version": "4.8.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/endroid/qr-code.git", "url": "https://github.com/endroid/qr-code.git",
"reference": "2436c2333a3931c95e2b96eb82f16f53143d6bba" "reference": "0db25b506a8411a5e1644ebaa67123a6eb7b6a77"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/endroid/qr-code/zipball/2436c2333a3931c95e2b96eb82f16f53143d6bba", "url": "https://api.github.com/repos/endroid/qr-code/zipball/0db25b506a8411a5e1644ebaa67123a6eb7b6a77",
"reference": "2436c2333a3931c95e2b96eb82f16f53143d6bba", "reference": "0db25b506a8411a5e1644ebaa67123a6eb7b6a77",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"bacon/bacon-qr-code": "^2.0.5", "bacon/bacon-qr-code": "^2.0.5",
"php": "^8.0" "php": "^8.1"
}, },
"conflict": { "conflict": {
"khanamiryan/qrcode-detector-decoder": "^1.0.6" "khanamiryan/qrcode-detector-decoder": "^1.0.6"
@ -317,7 +321,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/endroid/qr-code/issues", "issues": "https://github.com/endroid/qr-code/issues",
"source": "https://github.com/endroid/qr-code/tree/4.8.2" "source": "https://github.com/endroid/qr-code/tree/4.8.5"
}, },
"funding": [ "funding": [
{ {
@ -325,20 +329,20 @@
"type": "github" "type": "github"
} }
], ],
"time": "2023-03-30T18:46:02+00:00" "time": "2023-09-29T14:03:20+00:00"
}, },
{ {
"name": "filp/whoops", "name": "filp/whoops",
"version": "2.15.2", "version": "2.15.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/filp/whoops.git", "url": "https://github.com/filp/whoops.git",
"reference": "aac9304c5ed61bf7b1b7a6064bf9806ab842ce73" "reference": "a139776fa3f5985a50b509f2a02ff0f709d2a546"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/filp/whoops/zipball/aac9304c5ed61bf7b1b7a6064bf9806ab842ce73", "url": "https://api.github.com/repos/filp/whoops/zipball/a139776fa3f5985a50b509f2a02ff0f709d2a546",
"reference": "aac9304c5ed61bf7b1b7a6064bf9806ab842ce73", "reference": "a139776fa3f5985a50b509f2a02ff0f709d2a546",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -388,7 +392,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/filp/whoops/issues", "issues": "https://github.com/filp/whoops/issues",
"source": "https://github.com/filp/whoops/tree/2.15.2" "source": "https://github.com/filp/whoops/tree/2.15.4"
}, },
"funding": [ "funding": [
{ {
@ -396,7 +400,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2023-04-12T12:00:00+00:00" "time": "2023-11-03T12:00:00+00:00"
}, },
{ {
"name": "psr/log", "name": "psr/log",
@ -1626,16 +1630,16 @@
}, },
{ {
"name": "symfony/polyfill-ctype", "name": "symfony/polyfill-ctype",
"version": "v1.27.0", "version": "v1.28.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git", "url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "5bbc823adecdae860bb64756d639ecfec17b050a" "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb",
"reference": "5bbc823adecdae860bb64756d639ecfec17b050a", "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1650,7 +1654,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-main": "1.27-dev" "dev-main": "1.28-dev"
}, },
"thanks": { "thanks": {
"name": "symfony/polyfill", "name": "symfony/polyfill",
@ -1688,7 +1692,7 @@
"portable" "portable"
], ],
"support": { "support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0"
}, },
"funding": [ "funding": [
{ {
@ -1704,7 +1708,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2022-11-03T14:55:06+00:00" "time": "2023-01-26T09:26:14+00:00"
}, },
{ {
"name": "symfony/yaml", "name": "symfony/yaml",

File diff suppressed because it is too large Load Diff