tracker issue leave expence asset emp leave

This commit is contained in:
heama 2024-01-20 09:21:36 +05:30
parent 517611d8e4
commit 2f8556de64
11 changed files with 550 additions and 470 deletions

View File

@ -75,14 +75,14 @@
$db['default'] = array(
'dsn' => '',
// 'hostname' => 'localhost',
// 'username' => 'root',
// 'password' => '',
// 'database' => 'test',
'hostname' => '119.18.54.85',
'username' => 'venbaehn_ams',
'password' => 'L;nD7Z@f)1ZT',
'database' => 'venbaehn_ams',
'hostname' => 'localhost',
'username' => 'root',
'password' => '',
'database' => 'testbbone',
// 'hostname' => '119.18.54.85',
// 'username' => 'venbaehn_ams',
// 'password' => 'L;nD7Z@f)1ZT',
// 'database' => 'venbaehn_ams',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,

View File

@ -351,7 +351,7 @@ public function view_qrcode()
public function view_asset_details($id)
{
$tab = $this->session->flashdata();
// $tab = $this->session->flashdata();
// $tab = 1;
//print_r($tab);die();
// select asset value by id

View File

@ -27,7 +27,7 @@
</div>
<div class="x_content">
<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();?>">
@ -189,7 +189,7 @@
<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="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>
@ -226,3 +226,21 @@ function checkFileFormat() {
}
}
</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>

View File

@ -99,7 +99,8 @@
&nbsp;
<a href="<?php echo base_url()?>Asset/addAsset/<?php echo md5($value->id);?>" ><i class="fa fa-copy" title="Copy"></i></a>
&nbsp;
<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> -->
&nbsp;
<?php } ?>
@ -136,6 +137,7 @@ function myFunction() {
// var inputValue = document.getElementById("myInput").value;
var id = $(this).attr('id');
var url = "<?php echo base_url()?>Asset/deleteAsset";
console.log($(this).attr('id'));
console.log('before api call');
$.ajax({
url: "<?php echo base_url()?>Asset/getDeleteConfirmationPopup",
@ -169,7 +171,7 @@ function myFunction() {
$('.deleteAsset').click(function() {
alert("hello");
// alert($(this).attr('id'));
var id = $(this).attr('id');
var url = "<?php echo base_url()?>Asset/deleteAsset";
@ -178,8 +180,13 @@ function myFunction() {
type:"GET",
success:function(data){
$('#popup').html(JSON.parse(data));
$('#popup').modal('show');
console.log(data);
$('.delete_id').attr('value',id);
console.log(id);
$('.delete_url').attr('action',url);
console.log(url);
}
});
});
@ -295,4 +302,3 @@ function viewQr() {
</script>

View File

@ -168,7 +168,7 @@
<img src="<?php echo base_url(); ?>assets/uploads/<?php echo $editData->asset_img; ?>" width="180" height="150">
<?php } }
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 == '') { ?>
<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="item form-group">
<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>
</div>
</div>
@ -281,3 +281,19 @@
}
});
</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>

View File

@ -182,7 +182,7 @@
<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('')" onkeyup="check_if_exists(this.id, this.value, this.name)">
</div>
@ -652,3 +652,23 @@ function check_if_exists(id, value, name) {
});
</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>

View File

@ -362,11 +362,20 @@ public function Approve_Child_Expence()
{
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');
$expense_id=$this->input->post('expence_id');
$decline_action['status'] = 'Declined';
$decline_action['decline_by'] = user()->name;
$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);
if($is_decline == true)
@ -393,11 +402,12 @@ public function Approve_Child_Expence()
$status_update['status'] = 'Declined';
$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

View File

@ -90,7 +90,7 @@
<div class="x_panel">
<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">
<input type="radio" name="created_by" value="self (<?php echo user()->id;?>)"style="margin:10px;"checked /><b>Self</b>

View File

@ -317,7 +317,7 @@ public function edit_leave_function()
public function editleave()
{
if($this->input->post('type') === '9')
if($this->input->post('type') === '1')
{
$action = $this->input->post();
unset($action['from_date']);

View File

@ -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>
<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 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 foreach ($leavetype as $key => $value) { ?>
<?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 } ?>
</select>
@ -255,8 +255,10 @@
$('#type').on('change',function() {
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;
console.log('userID : ', id)
if (id)
@ -430,9 +432,13 @@ function calculateDateDifference() {
let type = $('#type').val();
var element = $('[name="leaveCode"]');
var id = element.attr('id');
console.log($('#showtime').val())
if( type === '1' ){
if( id === 'permission' ){
$('#hidedate').hide()
$('#balance').hide()
@ -464,6 +470,10 @@ function calculateDateDifference() {
$('#todate').val('');
var selectedOptionId = $(this).find(":selected").attr("id");
var element2 = $('[name="leaveCode2"]');
var id2 = element2.attr('id');
console.log('ID:', selectedOptionId);
if( selectedOptionId === 'permission'){
$('#hidedate').hide();