tracker issue leave expence asset emp leave
This commit is contained in:
parent
517611d8e4
commit
2f8556de64
@ -75,14 +75,14 @@
|
|||||||
|
|
||||||
$db['default'] = array(
|
$db['default'] = array(
|
||||||
'dsn' => '',
|
'dsn' => '',
|
||||||
// 'hostname' => 'localhost',
|
'hostname' => 'localhost',
|
||||||
// 'username' => 'root',
|
'username' => 'root',
|
||||||
// 'password' => '',
|
'password' => '',
|
||||||
// 'database' => 'test',
|
'database' => 'testbbone',
|
||||||
'hostname' => '119.18.54.85',
|
// 'hostname' => '119.18.54.85',
|
||||||
'username' => 'venbaehn_ams',
|
// 'username' => 'venbaehn_ams',
|
||||||
'password' => 'L;nD7Z@f)1ZT',
|
// 'password' => 'L;nD7Z@f)1ZT',
|
||||||
'database' => 'venbaehn_ams',
|
// 'database' => 'venbaehn_ams',
|
||||||
'dbdriver' => 'mysqli',
|
'dbdriver' => 'mysqli',
|
||||||
'dbprefix' => '',
|
'dbprefix' => '',
|
||||||
'pconnect' => FALSE,
|
'pconnect' => FALSE,
|
||||||
|
|||||||
@ -351,7 +351,7 @@ public function view_qrcode()
|
|||||||
|
|
||||||
public function view_asset_details($id)
|
public function view_asset_details($id)
|
||||||
{
|
{
|
||||||
$tab = $this->session->flashdata();
|
// $tab = $this->session->flashdata();
|
||||||
// $tab = 1;
|
// $tab = 1;
|
||||||
//print_r($tab);die();
|
//print_r($tab);die();
|
||||||
// select asset value by id
|
// select asset value by id
|
||||||
|
|||||||
@ -27,7 +27,7 @@
|
|||||||
</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();?>Asset/createAssets" enctype="multipart/form-data">
|
<form id="myForm" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Asset/createAssets" 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();?>">
|
||||||
|
|
||||||
@ -189,7 +189,7 @@
|
|||||||
<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-secondary" onclick="history.back()">Cancel</button>
|
<button type="button" class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
||||||
<button class="btn btn-primary" type="reset">Reset</button>
|
<button class="btn btn-primary" type="reset">Reset</button>
|
||||||
<button type="submit" class="btn btn-success">Submit</button>
|
<button type="submit" class="btn btn-success">Submit</button>
|
||||||
</div>
|
</div>
|
||||||
@ -226,3 +226,21 @@ function checkFileFormat() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<script>
|
||||||
|
let formSubmitted = false;
|
||||||
|
|
||||||
|
document.getElementById('myForm').addEventListener('submit', function(event) {
|
||||||
|
if (formSubmitted) {
|
||||||
|
event.preventDefault(); // Prevent the form from being submitted again
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
formSubmitted = true;
|
||||||
|
document.getElementById('submitBtn').setAttribute('disabled', 'disabled');
|
||||||
|
|
||||||
|
// You might want to show a message or change button text to indicate submission
|
||||||
|
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|||||||
@ -99,7 +99,8 @@
|
|||||||
|
|
||||||
<a href="<?php echo base_url()?>Asset/addAsset/<?php echo md5($value->id);?>" ><i class="fa fa-copy" title="Copy"></i></a>
|
<a href="<?php echo base_url()?>Asset/addAsset/<?php echo md5($value->id);?>" ><i class="fa fa-copy" title="Copy"></i></a>
|
||||||
|
|
||||||
<a onclick="myFunction()"><i class="fa fa-trash " data-toggle="modal" data-target=".bs-example-modal-sm" id="<?php echo md5($value->id);?>" ></i></a>
|
<a href="#" class="deleteAsset" id="<?php echo md5($value->id); ?>"> <i class="fa fa-trash" title="Delete"></i></a>
|
||||||
|
|
||||||
<!-- <a href="<?php echo base_url()?>Asset/deleteAsset/<?php echo md5($value->id);?>" ><i class="fa fa-trash" title="Delete"></i></a> -->
|
<!-- <a href="<?php echo base_url()?>Asset/deleteAsset/<?php echo md5($value->id);?>" ><i class="fa fa-trash" title="Delete"></i></a> -->
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
@ -136,6 +137,7 @@ function myFunction() {
|
|||||||
// var inputValue = document.getElementById("myInput").value;
|
// var inputValue = document.getElementById("myInput").value;
|
||||||
var id = $(this).attr('id');
|
var id = $(this).attr('id');
|
||||||
var url = "<?php echo base_url()?>Asset/deleteAsset";
|
var url = "<?php echo base_url()?>Asset/deleteAsset";
|
||||||
|
console.log($(this).attr('id'));
|
||||||
console.log('before api call');
|
console.log('before api call');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "<?php echo base_url()?>Asset/getDeleteConfirmationPopup",
|
url: "<?php echo base_url()?>Asset/getDeleteConfirmationPopup",
|
||||||
@ -169,7 +171,7 @@ function myFunction() {
|
|||||||
|
|
||||||
|
|
||||||
$('.deleteAsset').click(function() {
|
$('.deleteAsset').click(function() {
|
||||||
alert("hello");
|
// alert($(this).attr('id'));
|
||||||
var id = $(this).attr('id');
|
var id = $(this).attr('id');
|
||||||
var url = "<?php echo base_url()?>Asset/deleteAsset";
|
var url = "<?php echo base_url()?>Asset/deleteAsset";
|
||||||
|
|
||||||
@ -178,8 +180,13 @@ function myFunction() {
|
|||||||
type:"GET",
|
type:"GET",
|
||||||
success:function(data){
|
success:function(data){
|
||||||
$('#popup').html(JSON.parse(data));
|
$('#popup').html(JSON.parse(data));
|
||||||
|
$('#popup').modal('show');
|
||||||
|
console.log(data);
|
||||||
|
|
||||||
$('.delete_id').attr('value',id);
|
$('.delete_id').attr('value',id);
|
||||||
|
console.log(id);
|
||||||
$('.delete_url').attr('action',url);
|
$('.delete_url').attr('action',url);
|
||||||
|
console.log(url);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -295,4 +302,3 @@ function viewQr() {
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
@ -168,7 +168,7 @@
|
|||||||
<img src="<?php echo base_url(); ?>assets/uploads/<?php echo $editData->asset_img; ?>" width="180" height="150">
|
<img src="<?php echo base_url(); ?>assets/uploads/<?php echo $editData->asset_img; ?>" width="180" height="150">
|
||||||
<?php } }
|
<?php } }
|
||||||
else { ?>
|
else { ?>
|
||||||
<input id="formFile" name="asset_img" class="typeFile" type="file" >
|
<input id="formFile" name="asset_img" class="typeFile" type="file"accept=".png, .jpg, .jpeg" onchange="checkFileFormat()" >
|
||||||
|
|
||||||
<?php if($editData->asset_img == null || $editData->asset_img == '') { ?>
|
<?php if($editData->asset_img == null || $editData->asset_img == '') { ?>
|
||||||
<img src="<?php echo base_url(); ?>assets/uploads/defauld-img.jpg" width="180" height="150">
|
<img src="<?php echo base_url(); ?>assets/uploads/defauld-img.jpg" width="180" height="150">
|
||||||
@ -201,7 +201,7 @@
|
|||||||
<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 type="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>
|
||||||
@ -281,3 +281,19 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
<script>
|
||||||
|
function checkFileFormat() {
|
||||||
|
var input = document.getElementById('formFile');
|
||||||
|
var fileName = input.value;
|
||||||
|
var allowedFormats = ['.png', '.jpg', '.jpeg'];
|
||||||
|
|
||||||
|
if (fileName) {
|
||||||
|
var fileExtension = fileName.slice((fileName.lastIndexOf(".") - 1 >>> 0) + 2);
|
||||||
|
|
||||||
|
if (allowedFormats.indexOf(fileExtension.toLowerCase()) === -1) {
|
||||||
|
alert('Please choose a valid image file (PNG, JPG, JPEG).');
|
||||||
|
input.value = ''; // Clear the file input to allow choosing a new file
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|||||||
@ -182,7 +182,7 @@
|
|||||||
<input id="email" name="email"
|
<input id="email" name="email"
|
||||||
value="<?php if(isset($editData)){ echo $editData->email; } ?>" required="required"
|
value="<?php if(isset($editData)){ echo $editData->email; } ?>" required="required"
|
||||||
class="form-control" type="email"
|
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.')"
|
oninvalid="setCustomValidity('Enter a Valid E-mail Address.')"
|
||||||
oninput="setCustomValidity('')" onkeyup="check_if_exists(this.id, this.value, this.name)">
|
oninput="setCustomValidity('')" onkeyup="check_if_exists(this.id, this.value, this.name)">
|
||||||
</div>
|
</div>
|
||||||
@ -652,3 +652,23 @@ function check_if_exists(id, value, name) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
<script>
|
||||||
|
function validateEmail(email) {
|
||||||
|
const regex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
||||||
|
return regex.test(email);
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).on('blur', '#email', function() {
|
||||||
|
const emailValue = $(this).val();
|
||||||
|
|
||||||
|
if (!validateEmail(emailValue)) {
|
||||||
|
new PNotify({
|
||||||
|
text: 'Enter a valid email address.',
|
||||||
|
type: 'error',
|
||||||
|
styling: 'bootstrap3'
|
||||||
|
});
|
||||||
|
$(this).val('');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -362,11 +362,20 @@ public function Approve_Child_Expence()
|
|||||||
{
|
{
|
||||||
if($this->input->post('declinedata'))
|
if($this->input->post('declinedata'))
|
||||||
{
|
{
|
||||||
|
// echo $this->input->post('expence_id');
|
||||||
|
// var_dump($this->input->post('expence_id'));
|
||||||
|
// print_r($this->input->post('declinedata'));
|
||||||
|
// echo $this->input->post('expence_id');
|
||||||
|
// die;
|
||||||
|
|
||||||
$id=$this->input->post('id');
|
$id=$this->input->post('id');
|
||||||
$expense_id=$this->input->post('expence_id');
|
$expense_id=$this->input->post('expence_id');
|
||||||
$decline_action['status'] = 'Declined';
|
$decline_action['status'] = 'Declined';
|
||||||
$decline_action['decline_by'] = user()->name;
|
$decline_action['decline_by'] = user()->name;
|
||||||
$decline_action['decline_reason'] = $this->input->post('declinedata');
|
$decline_action['decline_reason'] = $this->input->post('declinedata');
|
||||||
|
|
||||||
|
// echo $this->input->post('expence_id');
|
||||||
|
|
||||||
$is_decline = $this->Expence_model->approve_child_expense_2($decline_action, $id);
|
$is_decline = $this->Expence_model->approve_child_expense_2($decline_action, $id);
|
||||||
|
|
||||||
if($is_decline == true)
|
if($is_decline == true)
|
||||||
@ -393,11 +402,12 @@ public function Approve_Child_Expence()
|
|||||||
|
|
||||||
$status_update['status'] = 'Declined';
|
$status_update['status'] = 'Declined';
|
||||||
$status_update['decline_by'] = user()->name;
|
$status_update['decline_by'] = user()->name;
|
||||||
return $this->MY_Model->edit_option($status_update, $expense_id, $table);
|
$this->MY_Model->edit_option($status_update, $expense_id, $table);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
redirect('Expence/expence_list_view/'.$this->input->post('expence_id'));
|
redirect(base_url('Expence/expence_list_view/'.$this->input->post('expence_id')));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -90,7 +90,7 @@
|
|||||||
|
|
||||||
<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 Requested For</label>
|
||||||
<div class="col-md-4 col-sm-4">
|
<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="self (<?php echo user()->id;?>)"style="margin:10px;"checked /><b>Self</b>
|
||||||
|
|||||||
@ -317,7 +317,7 @@ public function edit_leave_function()
|
|||||||
public function editleave()
|
public function editleave()
|
||||||
{
|
{
|
||||||
|
|
||||||
if($this->input->post('type') === '9')
|
if($this->input->post('type') === '1')
|
||||||
{
|
{
|
||||||
$action = $this->input->post();
|
$action = $this->input->post();
|
||||||
unset($action['from_date']);
|
unset($action['from_date']);
|
||||||
|
|||||||
@ -126,15 +126,15 @@
|
|||||||
|
|
||||||
<label class="control-label col-md-2 col-sm-2 " for="last-name">Leave Type<a style="color:red;">*</a> </label>
|
<label class="control-label col-md-2 col-sm-2 " for="last-name">Leave Type<a style="color:red;">*</a> </label>
|
||||||
<div class="col-md-5 col-sm-5 ">
|
<div class="col-md-5 col-sm-5 ">
|
||||||
<select id="type" name="type" required class="form-control" onchange="permission(this.id)" >
|
<select id="type" name="type" required class="form-control" >
|
||||||
<?php foreach ($leavetype as $key => $val) { ?>
|
<?php foreach ($leavetype as $key => $val) { ?>
|
||||||
<?php if ($leave->type == $val->id) { ?>
|
<?php if ($leave->type == $val->id) { ?>
|
||||||
<option value="<?php echo $leave->type; ?>" selected><?php echo $val->type; ?></option>
|
<option name="leaveCode" id="<?php echo $val->code; ?>" value="<?php echo $leave->type; ?>" selected><?php echo $val->type; ?></option>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php foreach ($leavetype as $key => $value) { ?>
|
<?php foreach ($leavetype as $key => $value) { ?>
|
||||||
<?php if ($leave->type != $value->id) { ?>
|
<?php if ($leave->type != $value->id) { ?>
|
||||||
<option id="<?php echo $value->id; ?>" value="<?php echo $value->id; ?>"><?php echo $value->type; ?></option>
|
<option name="leaveCode2" id="<?php echo $value->code; ?>" value="<?php echo $value->id; ?>"><?php echo $value->type; ?></option>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</select>
|
</select>
|
||||||
@ -255,8 +255,10 @@
|
|||||||
$('#type').on('change',function() {
|
$('#type').on('change',function() {
|
||||||
let id = $("#user_dropdown").val();
|
let id = $("#user_dropdown").val();
|
||||||
|
|
||||||
var type_id = $('option:selected', this).attr('id');
|
var type_id = $('option:selected', this).val();
|
||||||
|
console.log('type_id : ', type_id)
|
||||||
var fromdate = document.getElementById("fromdate").value;
|
var fromdate = document.getElementById("fromdate").value;
|
||||||
|
console.log('userID : ', id)
|
||||||
|
|
||||||
|
|
||||||
if (id)
|
if (id)
|
||||||
@ -430,9 +432,13 @@ function calculateDateDifference() {
|
|||||||
|
|
||||||
let type = $('#type').val();
|
let type = $('#type').val();
|
||||||
|
|
||||||
|
|
||||||
|
var element = $('[name="leaveCode"]');
|
||||||
|
var id = element.attr('id');
|
||||||
|
|
||||||
console.log($('#showtime').val())
|
console.log($('#showtime').val())
|
||||||
|
|
||||||
if( type === '1' ){
|
if( id === 'permission' ){
|
||||||
|
|
||||||
$('#hidedate').hide()
|
$('#hidedate').hide()
|
||||||
$('#balance').hide()
|
$('#balance').hide()
|
||||||
@ -464,6 +470,10 @@ function calculateDateDifference() {
|
|||||||
$('#todate').val('');
|
$('#todate').val('');
|
||||||
|
|
||||||
var selectedOptionId = $(this).find(":selected").attr("id");
|
var selectedOptionId = $(this).find(":selected").attr("id");
|
||||||
|
var element2 = $('[name="leaveCode2"]');
|
||||||
|
var id2 = element2.attr('id');
|
||||||
|
console.log('ID:', selectedOptionId);
|
||||||
|
|
||||||
if( selectedOptionId === 'permission'){
|
if( selectedOptionId === 'permission'){
|
||||||
|
|
||||||
$('#hidedate').hide();
|
$('#hidedate').hide();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user