tracker issue leave expence asset

This commit is contained in:
heama 2024-01-17 10:55:20 +05:30
parent 58029bb5c7
commit 517611d8e4
19 changed files with 218 additions and 61 deletions

View File

@ -23,7 +23,7 @@
| a PHP script and you can easily do that on your own.
|
*/
$base = "https://".$_SERVER['HTTP_HOST'];
$base = "http://".$_SERVER['HTTP_HOST'];
$base .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);
$config['base_url'] = $base;

View File

@ -170,9 +170,9 @@
</div>
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Main Image </label>
<div class="col-md-5 col-sm-5 ">
<input id="formFile" name="asset_img" class="typeFile" type="file" >
<label class="control-label col-md-1 col-sm-1" for="first-name"> Main Image </label>
<div class="col-md-5 col-sm-5">
<input id="formFile" name="asset_img" class="typeFile" type="file" accept=".png, .jpg, .jpeg" onchange="checkFileFormat()">
</div>
@ -210,3 +210,19 @@
</div>
</div>
<!-- /Body page content -->
<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

@ -29,7 +29,7 @@
<input type="hidden" name="category" value="<?php echo $tableData[0]->category; ?>" >
<fieldset>
<div class="col-md-5 col-sm-5 " for="first-name"> </div>
<div class="col-md-3 col-sm-3 " for="first-name"><h2> &nbsp; &nbsp;Filter with purchase date : </h2> </div>
<div class="col-md-3 col-sm-3 " for="first-name"><h2> &nbsp; &nbsp;Filter with purchase date </h2> </div>
<div class="col-md-3 col-sm-3 ">
<div class="control-group ">
<div class="controls">
@ -99,7 +99,7 @@
&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><i class="fa fa-trash deleteAsset" data-toggle="modal" data-target=".bs-example-modal-sm" id="<?php echo md5($value->id);?>" ></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="<?php echo base_url()?>Asset/deleteAsset/<?php echo md5($value->id);?>" ><i class="fa fa-trash" title="Delete"></i></a> -->
&nbsp;
<?php } ?>
@ -121,7 +121,8 @@
</div>
<br/>
<!-- <input type="text" id="myInput"> -->
<!-- <button onclick="myFunction()">Click me</button> -->
<div class="modal fade bs-example-modal-lg" id="ItemModal" tabindex="-1" role="dialog" aria-hidden="true"></div>
<div style="display:none" id="sub-value">
@ -129,6 +130,29 @@
</div>
<div class="modal bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" id="popup"> </div>
<script>
function myFunction() {
console.log('entered');
// Get the input value
// var inputValue = document.getElementById("myInput").value;
var id = $(this).attr('id');
var url = "<?php echo base_url()?>Asset/deleteAsset";
console.log('before api call');
$.ajax({
url: "<?php echo base_url()?>Asset/getDeleteConfirmationPopup",
type:"GET",
success:function(data){
console.log('api success');
$('#popup').html(JSON.parse(data));
$('.delete_id').attr('value',id);
$('.delete_url').attr('action',url);
}
});
// Do something with the input value (for example, alert it)
console.log("end of the function ");
}
$("input[type='checkbox']").change(function(){
if($('input[type="checkbox"]:not(:checked)').length == $('input[type="checkbox"]').length){
@ -145,6 +169,7 @@
$('.deleteAsset').click(function() {
alert("hello");
var id = $(this).attr('id');
var url = "<?php echo base_url()?>Asset/deleteAsset";
@ -235,6 +260,39 @@ function viewQr() {
$('input:checkbox').not(this).prop('checked', this.checked);
});
</script>
$(document).ready(function () {
$('#datatable-buttons').DataTable({
"order": [
[0, 'desc']
],
"dom": 'Bfrtip',
buttons: [
{
extend: 'pdfHtml5',
title: 'Asset Details',
text: 'PDF',
customize: function(doc) {
doc.content[1].table.body.forEach(function(row) {
// Remove the first and last columns
row.splice(0, 1);
row.pop();
});
}
},
{
extend: 'excelHtml5',
text: 'Excel',
title: 'Asset Details',
exportOptions: {
columns: ':not(:last-child)'
}
}
]
});
});
</script>

View File

@ -1,6 +1,3 @@
<div class="modal-dialog modal-sm">
<div class="modal-content">

View File

@ -12,7 +12,7 @@
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<!-- jQuery -->
<script src="<?php echo base_url(); ?>/assets/default/jquery/dist/jquery.min.js"></script>
<!-- Bootstrap -->

View File

@ -28,6 +28,8 @@
<!-- Custom Theme Style -->
<link href="<?php echo base_url(); ?>/assets/default/build/css/custom.min.css" rel="stylesheet">
<!-- jquery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
</head>
<body class="nav-md">

View File

@ -54,7 +54,7 @@ public function expence_form()
public function get_emp_name()
{
$emp = $this->Expence_model->get_employee_name(user()->business_id);
$html = '<option>--select Employee--</option>';
$html = '<option value="">--select Employee--</option>';
foreach($emp as $val)
{
if($val->user_id != user()->id)

View File

@ -59,7 +59,7 @@
<div class="x_title">
<button hidden id="button" class="btn btn-secondary source" onclick="new PNotify({
text: '<html><h2>Submmited for Approvel.<h2></html>',
text: '<html><h2>Submmited for Approval.<h2></html>',
type: 'success',
styling: 'bootstrap3'
});">Success</button>

View File

@ -328,14 +328,17 @@ function matchnum(event)
$userDropdown.append('<option value="' + currentUserId + '">' + currentUserName + '</option>');
$userDropdown.prop('disabled', true);
} else if (selectedValue === '<?php echo user()->name; ?> (<?php echo user()->id;?>)') {
console.log("REQUIRED CALL");
// $('#user_dropdown').prop('required', true);
$('#user_dropdown').attr('required', true);
console.log($('#user_dropdown').prop('required'));
$.ajax({
url: '<?php echo base_url('Expence/get_emp_name/')?>"',
method: 'GET',
dataType: 'json',
success: function(response) {
$('#user_dropdown').append(response);
$('#user_dropdown').prop('required', true);
$('#user_dropdown').prop('disabled', false);

View File

@ -14,7 +14,7 @@
</div>
<!-- jQuery -->
<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> -->
<!-- Bootstrap -->
<script src="<?php echo base_url(); ?>/assets/default/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<!-- FastClick ------->

View File

@ -10,7 +10,7 @@
<!---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>BigBamboo Enterprise</title>

View File

@ -146,7 +146,10 @@ public function createLeave()
$perm_data['status'] = 'pending';
$perm_data['created_date'] = date('d-m-Y');
$perm_data['created_time'] = date('H:i A');
unset($perm_data['from_date']);
unset($perm_data['to_date']);
$table="leave_list";
// print_r($perm_data);die;
$create_permission = $this->MY_Model->insert($perm_data,$table);
//for notification
@ -296,7 +299,13 @@ public function edit_leave_function()
$emp = $this->Emp_model->get_employee(user()->business_id);
$business_id = user()->business_id;
$leavetype = $this->Leave_model->getLeaveType($business_id);
$editleave = $this->Leave_model->editleave($id);
// print_r($leavetype);
// print_r($id);
// print_r($editleave);
// // // print_r($emp);
// die;
$this->layout->set('emp', $emp);
$this->layout->set('editleave', $editleave);
$this->layout->set('count', $emp_leave_count);

View File

@ -403,6 +403,7 @@ function get_all_count(id) {
$('#leave_bal').hide();
$('#fromdate').removeAttr('required');
$('#todate').removeAttr('required');
$('#perm_id').prop('required', true);
$('#showtime').show();
$('#showdate').show();
$('#from_time').prop('required', true);

View File

@ -16,11 +16,20 @@
&nbsp; &nbsp; &nbsp; &nbsp;
<input type="hidden" class="delete_id" name="id" value="">
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>" >
<button type="submit" class="btn btn-sm btn-primary" id="">Yes</button>
<button type="submit" class="btn btn-sm btn-primary" id="submit-btn">Yes</button>
</form>
</center>
</br>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
<script>
$(document).ready(function(){
$('#submit-btn').click(function(){
$(this).prop('disabled', true); // Disable the submit button
$('.delete_url').submit(); // Submit the form
});
});
</script>

View File

@ -1,27 +1,30 @@
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title" id="myModalLabel2">Decline Reason</h6>
<!-- <button type="button" id="close-form" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span> -->
</button>
</div>
</br>
<center>
<form class="delete_url" method="post" action="" id="">
<input list="browsers" onfocus id="decline_reason" required name="declinedata" autocomplete="off" style="width:90%; height: 45px;" />
<datalist id="browsers">
<?php foreach ($dropdown as $key => $value) { ?>
<option value="<?php echo $value->enum_value; ?>"><?php echo $value->enum_value; ?></option>
<?php } ?>
</datalist><br><br>
<input type="hidden" class="delete_id" name="id" value="">
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>" >
<button type="submit" class="btn btn-sm btn-primary" id="">Yes</button><button type="button" class="btn btn-sm btn-secondary" id="close-form" data-dismiss="modal" aria-label="Close">No</button>
</form>
</center>
</br>
</div>
</div>
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title" id="myModalLabel2">Decline Reason</h6>
</div>
</br>
<center>
<form class="delete_url" method="post" action="" id="declineForm">
<input list="browsers" onfocus id="decline_reason" required name="declinedata" autocomplete="off" style="width:90%; height: 45px;" />
<datalist id="browsers">
<?php foreach ($dropdown as $key => $value) { ?>
<option value="<?php echo $value->enum_value; ?>"><?php echo $value->enum_value; ?></option>
<?php } ?>
</datalist><br><br>
<input type="hidden" class="delete_id" name="id" value="">
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name(); ?>" value="<?php echo $this->security->get_csrf_hash(); ?>" >
<button type="submit" class="btn btn-sm btn-primary" id="submitBtn">Yes</button>
<button type="button" class="btn btn-sm btn-secondary" id="close-form" data-dismiss="modal" aria-label="Close">No</button>
</form>
</center>
</br>
</div>
</div>
<script>
document.getElementById('declineForm').addEventListener('submit', function() {
document.getElementById('submitBtn').disabled = true;
// Optionally, you can display a loading spinner or other indication here
});
</script>

View File

@ -126,16 +126,19 @@
<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" class="form-control" >
<select id="type" name="type" required class="form-control" onchange="permission(this.id)" >
<?php foreach ($leavetype as $key => $val) { ?>
<?php if($leave->type == $val->id) { ?>
<option value="<?php echo $leave->type; ?>"><?php echo $val->type; ?></option>
<?php } }?>
<?php foreach ($leavetype as $key => $value) { ?>
<option id="<?php echo $value->id; ?>" value="<?php echo $value->id; ?>"><?php echo $value->type; ?></option>
<?php if ($leave->type == $val->id) { ?>
<option value="<?php echo $leave->type; ?>" selected><?php echo $val->type; ?></option>
<?php } ?>
<?php } ?>
</select>
<?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>
<?php } ?>
<?php } ?>
</select>
</div>
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Balance</label>
@ -354,22 +357,27 @@ function get_all_count(id) {
fromDateInput.datepicker({
dateFormat: dateFormat,
changeYear: true,
changeMonth: true,
minDate: 0,
onSelect: function (dateText, inst) {
toDateInput.datepicker("option", "minDate", dateText);
validateDateRange();
calculateDateDifference();
DateValidate();
}
});
toDateInput.datepicker({
dateFormat: dateFormat,
changeYear: true,
changeMonth: true,
minDate: 0,
onSelect: function (dateText, inst) {
validateDateRange();
calculateDateDifference();
DateValidate();
}
});
// Function to validate the date range
function validateDateRange() {
var fromDate = fromDateInput.datepicker("getDate");
@ -424,7 +432,7 @@ function calculateDateDifference() {
console.log($('#showtime').val())
if( type === '9' ){
if( type === '1' ){
$('#hidedate').hide()
$('#balance').hide()
@ -447,6 +455,41 @@ function calculateDateDifference() {
}
});
$('#showtime').hide()
$('#showdate').hide()
$('#type').change(function() {
$('#fromdate').val('');
$('#todate').val('');
var selectedOptionId = $(this).find(":selected").attr("id");
if( selectedOptionId === 'permission'){
$('#hidedate').hide();
$('#balance').hide();
$('#leave_bal').hide();
$('#fromdate').removeAttr('required');
$('#todate').removeAttr('required');
$('#myDatepicker').prop('required', true);
$('#showtime').show();
$('#showdate').show();
$('#from_time').prop('required', true);
$('#to_time').prop('required', true);
}
else{
$('#from_time').removeAttr('required');
$('#to_time').removeAttr('required');
$('#perm_id').removeAttr('required');
$('#hidedate').show();
$('#showtime').hide();
$('#showdate').hide();
$('#balance').show();
$('#leave_bal').show();
$('#fromdate').prop('required', true);
$('#todate').prop('required', true);
}
});
</script>

View File

@ -118,7 +118,7 @@
<?php if($value->status == 'pending') { ?>
<a><i class="fa fa-check approveleave" data-toggle="modal" data-target=".bs-example-modal-sm" title="Approve" id="<?php echo $value->id;?>"></i></a>&nbsp;
<a><i class="fa fa-times test" data-toggle="modal" data-target=".bs-example-modal-sm" title="Decline" id="<?php echo $value->id;?>"></i></a>&nbsp;
<a><i class="fa fa-times test" data-toggle="modal" data-target=".bs-example-modal-sm" title="Decline" id="<?php echo $value->id;?>"></i></a>&nbsp;
<!-- <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>

View File

@ -295,7 +295,7 @@ function submitCustomPrompt() {
text: 'Excel',
title: 'Leave',
exportOptions: {
columns: ':not(:last-child)'
// columns: ':not(:last-child)'
}
}
]

View File

@ -64,7 +64,7 @@
src="<?php echo base_url();?>/assets/uploads/profile_picture/<?php echo $userData->profile_image ?>"
alt="Avatar" title="Change the avatar">
<input id="file_profile" name="profile_image" class="typeFile1" type="file"
accept=".png, .jpg, .jpeg" hidden />
accept=".png, .jpg, .jpeg" onchange="checkFileFormat()" hidden />
<div class="profilepic__content">
<span class="profilepic__icon"><i class="fa fa-camera"
style="font-size:25px;color:black"></i></span>
@ -123,4 +123,20 @@ class="fa fa-edit m-right-xs"></i>Edit Profile</a>
$(".btn-success").click();
});
});
</script> -->
</script> -->
<script>
function checkFileFormat() {
var input = document.getElementById('file_profile');
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>