fixes : ps
This commit is contained in:
parent
aa1feea067
commit
1ec0d90bca
@ -152,7 +152,7 @@ class Driver extends BaseController
|
||||
$data['page_driver_name'] = $this->driver_model->getDriverName($input_driver_id);
|
||||
$data['invoice_info'] = $this->driver_model->getInvoiceInfo();
|
||||
$data['datefordropdown'] = $input_month_year;
|
||||
$data['driver_id'] = $input_driver_id;
|
||||
$data['gobal_driver_id'] = $input_driver_id;
|
||||
|
||||
$this->global['pageTitle'] = 'Driver Attendance List';
|
||||
$this->loadViews("driverAttendance", $this->global, $data, NULL);
|
||||
@ -177,7 +177,6 @@ class Driver extends BaseController
|
||||
if ((int)$id == 0) {
|
||||
log_message('error', 'LAST DriverID : ' . $id);
|
||||
$driver_details = [
|
||||
|
||||
'date' => $date,
|
||||
'driver_id' =>$driver_id,
|
||||
'invoice_number' =>$inv,
|
||||
|
||||
@ -60,7 +60,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
||||
<div class="col-4">
|
||||
<?php $today = date('M-Y'); ?>
|
||||
<input type="text" name="monthyear" id="monthyear" value="<?php echo $datefordropdown; ?>" class="form-control" data-provide="datepicker" data-date-format="M-yyyy" data-date-min-view-mode="1">
|
||||
<input type="hidden" name="driver_id" id="driver_id" value="<?php echo $driver_id; ?>" >
|
||||
<input type="hidden" name="gobal_driver_id" id="gobal_driver_id" value="<?php echo $gobal_driver_id; ?>" >
|
||||
</div>
|
||||
|
||||
<div class="col-4">
|
||||
@ -123,13 +123,16 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
||||
<td><?= esc($record['quantity']) ?></td>
|
||||
<td><?= $record['isactive'] == 1 ? 'Active' : 'InActive' ?></td>
|
||||
<td><?php if ($record['isactive'] == 0) { ?>
|
||||
<!-- <a onclick="confirmReActivate(event)" style="cursor:pointer;" href="<?php echo base_url() . 'reActivateDriverAttendance?driverAttendanceId=' . esc($record['driver_attendance_id']).'&driverId='.esc($record['driver_id']); ?>">
|
||||
<i class="fa fa-key" style="color:#02a8b5;"></i>
|
||||
</a> -->
|
||||
|
||||
<?php }else{ ?>
|
||||
<a data-toggle="modal" href="#attendanceModal" data-arr='<?php echo json_encode($record); ?>' data-id='<?= esc($record['driver_attendance_id']) ?>'>
|
||||
<i class="fas fa-edit"></i>
|
||||
</a>
|
||||
</a>
|
||||
<!-- <a onclick="confirmDelete(event)" style="cursor:pointer;" href="<?php echo base_url() . 'deleteDriverAttendance?driverAttendanceId=' . esc($record['driver_attendance_id']).'&driverId='.esc($record['driver_id']); ?>">
|
||||
<i class="fa fa-trash"></i>
|
||||
</a> -->
|
||||
</a>
|
||||
<!-- <a onclick="confirmDelete(event)" style="cursor:pointer;" href="<?php echo base_url() . 'deleteDriverAttendance?driverAttendanceId=' . esc($record['driver_attendance_id']).'&driverId='.esc($record['driver_id']); ?>">
|
||||
<i class="fa fa-trash"></i>
|
||||
</a> -->
|
||||
@ -184,8 +187,8 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
||||
<input type="date" class="form-control" id="date" name="date" value="<?= $calendarCurrDate?>" min="<?= $calendarStartDate?>" max="<?= $calendarEndDate?>" required>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form" for="driver_id">Driver Name</label>
|
||||
<input type="text" class="form-control" id="driver_name" readonly>
|
||||
<label class="form" for="driver_name">Driver Name</label>
|
||||
<input type="text" class="form-control" id="driver_name" name="driver_name" readonly>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
@ -204,6 +207,19 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
||||
|
||||
|
||||
<!-- second row -->
|
||||
<div class="row mt-2">
|
||||
<div class="col-md-6">
|
||||
<label class="form" for="customer">Customer</label>
|
||||
<input type="text" class="form-control" id="customer" name="customer" readonly>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label class="form" for="quantity">Quantity</label>
|
||||
<input type="text" class="form-control" id="quantity" name="quantity" readonly>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row mt-2">
|
||||
|
||||
<div class="col-md-6">
|
||||
@ -224,28 +240,21 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
||||
|
||||
<!-- third row -->
|
||||
<div class="row mt-2">
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-4">
|
||||
<label class="form" for="salary_amount">Salary Amount</label>
|
||||
<input type="text" class="form-control" id="salary_amount" name="salary_amount" onkeypress="return isNumber(event);" readonly>
|
||||
<input type="text" class="form-control" id="salary_amount" name="salary_amount" onkeypress="return isNumber(event);" onchange="salary();">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-4">
|
||||
<label class="form" for="food_amount">Food Amount</label>
|
||||
<input type="text" class="form-control" id="food_amount" name="food_amount" onkeypress="return isNumber(event);">
|
||||
<input type="text" class="form-control" id="food_amount" name="food_amount" onkeypress="return isNumber(event);" onchange="salary();">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form" for="food_amount">Total Amount</label>
|
||||
<input type="text" class="form-control" id="total_amount" name="total_amount" onkeypress="return isNumber(event);" readonly>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-2">
|
||||
<div class="col-md-6">
|
||||
<label class="form" for="customer">Customer</label>
|
||||
<input type="text" class="form-control" id="customer" name="customer" readonly>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label class="form" for="quantity">Quantity</label>
|
||||
<input type="text" class="form-control" id="quantity" name="quantity" readonly>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
@ -286,16 +295,22 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
||||
|
||||
$("#driver_name").val("<?php echo $page_driver_name; ?>");
|
||||
let urlParams = new URLSearchParams(window.location.search);
|
||||
let driver_id = urlParams.get("driver_id");
|
||||
if (driver_id !== null) { $("#driver_id").val(driver_id);}
|
||||
else { $("#driver_id").val("<?php echo $driver_id; ?>"); }
|
||||
let gobal_driver_id = urlParams.get("driverId");
|
||||
if (gobal_driver_id !== null) {
|
||||
$("#gobal_driver_id").val(gobal_driver_id);
|
||||
$("#driver_id").val(gobal_driver_id);
|
||||
}
|
||||
else {
|
||||
$("#gobal_driver_id").val("<?php echo $gobal_driver_id; ?>");
|
||||
$("#driver_id").val("<?php echo $gobal_driver_id; ?>");
|
||||
}
|
||||
|
||||
|
||||
|
||||
$("#attendanceModal").on("shown.bs.modal", function (e) {
|
||||
|
||||
var id = $(e.relatedTarget).data('id');
|
||||
let fields = ['driver_attendance_id', 'date', 'driver_id', 'invoice_number', 'vehicle_number', 'load_type', 'salary_amount', 'food_amount','customer','quantity'];
|
||||
let fields = ['invoice_number', 'vehicle_number', 'load_type', 'salary_amount', 'food_amount','customer','quantity'];
|
||||
|
||||
fields.forEach(function(field) {
|
||||
$("#" + field).val("");
|
||||
@ -303,10 +318,23 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
||||
|
||||
if (id == 0) {
|
||||
$('#attendanceTitle').html("Add Driver Trip");
|
||||
$("#driver_attendance_id").val(0);
|
||||
} else {
|
||||
$("#driver_attendance_id").val(id);
|
||||
var arr = $(e.relatedTarget).data('arr');
|
||||
|
||||
fields.forEach(function(field) {
|
||||
$("#" + field).val(arr && arr[field] ? arr[field] : "");
|
||||
if(field == 'date'){
|
||||
$("#date").val(arr && arr['date']);
|
||||
}
|
||||
if(field == 'driver_id'){
|
||||
$("#driver_id").val(arr && arr['driver_id']);
|
||||
}
|
||||
if(field == 'salary_amount' || field == 'food_amount') {
|
||||
var ttl = parseFloat(arr['salary_amount']) + parseFloat(arr['food_amount']);
|
||||
$('#total_amount').val(ttl.toFixed(2));
|
||||
}
|
||||
});
|
||||
$('#attendanceTitle').html("Edit Driver Trip");
|
||||
}
|
||||
@ -335,13 +363,13 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
||||
return;
|
||||
}
|
||||
if ($('#salary_amount').val() === '') {
|
||||
alert('Please Choosen the Load Type Properly');
|
||||
alert('Please Enter Salary Amount');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var formData = {
|
||||
driver_attendance_id:$('#driver_attendance_id').val(),
|
||||
driver_attendance_id:$('#driver_attendance_id').val() ? $('#driver_attendance_id').val() : 0,
|
||||
date: $('#date').val(),
|
||||
driver_id: $('#driver_id').val(),
|
||||
invoice_number: $('#invoice_number').val(),
|
||||
@ -364,7 +392,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
||||
|
||||
if (response.status) {
|
||||
alert(response.message);
|
||||
$('#ddwizard').modal('hide');
|
||||
// $('#ddwizard').modal('hide');
|
||||
location.reload();
|
||||
} else {
|
||||
alert(response.message);
|
||||
@ -445,12 +473,17 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
||||
var type = $('#load_type').val();
|
||||
|
||||
if(type == 'Load'){
|
||||
var value = parseFloat(1300).toFixed(2);
|
||||
var value = parseFloat(1300);
|
||||
$('#salary_amount').val(value);
|
||||
}else if(type == 'Waste Core'){
|
||||
var value = parseFloat(1050).toFixed(2);
|
||||
var value = parseFloat(1050);
|
||||
$('#salary_amount').val(value);
|
||||
}
|
||||
var sa = parseFloat($('#salary_amount').val()) || 0;
|
||||
var fa = parseFloat($('#food_amount').val()) || 0;
|
||||
var ttl = sa + fa;
|
||||
|
||||
$('#total_amount').val(ttl.toFixed(2));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -790,6 +790,7 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a href="<?php echo base_url(); ?>DriverListing" class="dropdown-item"><i class="ri-file-settings-line align-middle mr-1"></i>Driver Details</a>
|
||||
|
||||
</div>
|
||||
</li>
|
||||
@ -849,7 +850,6 @@
|
||||
<!-- <a href="<?php echo base_url(); ?>rawmaterialListing" class="dropdown-item">Material Details</a> -->
|
||||
<a href="<?php echo base_url(); ?>userListing" class="dropdown-item"><i class="ri-file-settings-line align-middle mr-1"></i>Users</a>
|
||||
<a href="<?php echo base_url(); ?>readFactoryMachineMasterDetails" class="dropdown-item"><i class="ri-file-settings-line align-middle mr-1"></i>Factory Machines Details</a>
|
||||
<a href="<?php echo base_url(); ?>DriverListing" class="dropdown-item"><i class="ri-file-settings-line align-middle mr-1"></i>Driver Details</a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user