FEAT_INSURER_ADD_ADDITION_SWITCH_AND_NUMBER_FORMATE_AND_OTHERS : RV

This commit is contained in:
VENKATESHWARAN 2024-06-04 17:08:19 +05:30
parent 926f29ca38
commit 20a1cdfda1
8 changed files with 342 additions and 210 deletions

View File

@ -1221,6 +1221,7 @@ class EmpDataServiceController extends BaseController
//Endorsement Correction
public function importCorrectionValidation($params)
{

View File

@ -190,6 +190,11 @@ class MasterController extends AdminController
$uploadFilePath = ROOTPATH . 'public/uploads/logo/';
$file_name = file_Upload($this->request->getFile('insurer_logo'), $uploadFilePath);
$data = $this->request->getPost();
if($this->request->getPost('addition_add_day')){
$data['addition_add_day'] = 1;
}
$data['created_by'] = get_session_userid();
$data['insurer_logo'] = $file_name;
@ -265,6 +270,12 @@ class MasterController extends AdminController
$data['insurer_logo'] = $file_name;
}
if($this->request->getPost('addition_add_day')){
$data['addition_add_day'] = 1;
}else{
$data['addition_add_day'] = 0;
}
$update = $this->insurerModel->update($id,$data);
if($update){
echo json_encode(array("status" => true , 'data' => $data));

View File

@ -212,10 +212,10 @@ if (! function_exists('transform_objects_to_array_for_si_enhancement')) {
$obj->no_of_days,
$obj->old_si_premium,
$obj->new_si_premium,
$obj->difference_premium,
round($obj->difference_premium, 2),
$obj->pro_rata_premimum,
$obj->gst,
$obj->total ,
round($obj->total, 2),
$endorsement_id,
];

View File

@ -18,7 +18,7 @@
</div>
<div class="table-responsive">
<table id="datatable-buttons" class="table table-hover m-0 table-centered dt-responsive nowrap w-100">
<table id="datatable-buttons" class="table table-hover m-0 table-centered dt-responsive w-100">
<thead class="bg-light">
<tr>
<th class="font-weight-medium">SNO</th>
@ -48,7 +48,7 @@
<td><?php echo $file['batch_code'] ?></td>
<td class="reload" data-toggle="tooltip" data-placement="top"
title="<?php echo $file['file_name'] ?>">
<?php echo strlen($file['file_name']) > 5 ? substr($file['file_name'], 0, 10) . "..." : $file['file_name'] ?>
<?php echo $file['file_name'] ?>
</td>
<td><?php echo $file['client_short_name'] ?></td>
<td><?php echo $file['branch_name'] ?></td>
@ -58,11 +58,9 @@
<td><?php echo $file['actions'] ?></td>
<td><?php echo $file['count'] == null ? '-' : $file['count'] ?></td>
<td class="indian-number"><?php echo intval($file['amount']) ?></td>
<td class="reload" data-toggle="tooltip" data-placement="top" title="<?php echo date('d-M-Y H:i:a', strtotime($file['created_at'])) ?> by <?php echo get_username($file['created_by']) ?>">
<?php echo strlen($file['created_at']) > 5 ? substr(date('d-M-Y H:i:a', strtotime($file['created_at'])), 0, 6) . "..." : $file['created_at'] ?>
<td><?php echo format_indian_number($file['amount'])?></td>
<td class="reload">
<?php echo date('d-M-Y H:i:a', strtotime($file['created_at'])) ?> by <?php echo get_username($file['created_by']) ?>
</td>
<td>
<?php if ($file['status'] == 'failed') { ?>

View File

@ -24,8 +24,16 @@
.table-responsive {
overflow-x: auto;
}
.word-wrap {
word-wrap: break-word;
white-space: normal;
}
</style>
<?php $pro_rata_total = 0; $gst_total = 0 ?>
<div class="row" id="client_list">
<div class="col-12">
<div class="card">
@ -37,7 +45,7 @@
</div>
<div class="table-responsive">
<table class="table table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0"
<table class="table table-hover m-0 table-centered dt-responsive w-100" cellspacing="0"
id="tickets-table">
<thead class="bg-light">
<tr>
@ -67,8 +75,7 @@
<tr>
<td><b><?php echo ($key + 1)?></b></td>
<td><?php echo $employee['name']?>( <?php echo $employee['emp_code']?> -
<?php echo $employee['relationship']?> )</td>
<td><?php echo $employee['name']?>( <?php echo $employee['emp_code']?> - <?php echo $employee['relationship']?> )</td>
<td><?php echo $employee['policy_name']?></td>
<td><?php echo $employee['insurer_short_name']?></td>
<td><?php echo $employee['tpa_id']?></td>
@ -90,10 +97,10 @@
}
?>
</td>
<td class="indian-number"> <?php echo $employee['basic_cover_si']?> </td>
<td class="indian-number"><?php echo $employee['premium']?></td>
<td class="indian-number"><?php echo $employee['rata_premimum']?></td>
<td class="indian-number"><?php echo $employee['gst']?></td>
<td><?php echo format_indian_number($employee['basic_cover_si'])?> </td>
<td><?php echo format_indian_number($employee['premium'])?></td>
<td><?php $pro_rata_total = $pro_rata_total + $employee['rata_premimum']; echo format_indian_number($employee['rata_premimum'])?></td>
<td><?php $gst_total = $gst_total + $employee['gst']; echo format_indian_number($employee['gst'])?></td>
<!-- <td>
<div class="btn-group dropdown">
<a href="javascript: void(0);"
@ -128,9 +135,8 @@
<th></th>
<th></th>
<th>Total</th>
<th class="indian-number"></th>
<th class="indian-number"></th>
<th></th>
<th><?php echo format_indian_number($pro_rata_total) ?></th>
<th><?php echo format_indian_number($gst_total) ?></th>
</tr>
</tfoot>
</table>
@ -152,19 +158,20 @@ $(document).ready(function() {
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
"buttons": [{
"extend": 'csv',
"text": 'CSV',
"title": 'Employee-List',
"className": 'my_class',
"exportOptions": {
"columns": ':not(:last-child)'
},
buttons: [{
extend: 'csv',
text: 'CSV',
title: 'Employee-List',
className: 'my_class',
exportOptions: {
columns: ':not(:last-child)', // Adjust as needed
footer: true // Include the footer in the export
}
}],
"initComplete": function(settings, json) {
initComplete: function(settings, json) {
$('.my_class').css({
"position": "relative",
"left": "82px"
position: "relative",
left: "82px"
});
},
language: {
@ -173,70 +180,80 @@ $(document).ready(function() {
},
paging: true,
// pagingType: 'full_numbers'
});
});
});
</script>
<script>
// Function to format a number in Indian Rupees format
function formatNumberInIndianRupees(number) {
// // Function to format a number in Indian Rupees format
// function formatNumberInIndianRupees(number) {
// const maxLength = 24;
// let value = number.toString().replace(/[^\d.]/g, ''); // Remove non-numeric characters
const maxLength = 16;
let value = number.toString().replace(/\D/g, ''); // Remove non-numeric characters
// // Limit the number of digits before the decimal point
// if (value.includes('.')) {
// let parts = value.split('.');
// parts[0] = parts[0].slice(0, maxLength); // Limit the integer part
// value = parts.join('.');
// } else {
// value = value.slice(0, maxLength);
// }
// Limit the number of digits
value = value.slice(0, maxLength);
// // Convert to a number and format with commas using the Indian numbering system
// const formattedNumber = Number(value).toLocaleString('en-IN', {
// maximumFractionDigits: 2 // Optional: limit to 2 decimal places if required
// });
// Format the number with commas using Indian numbering system
const formattedNumber = Number(value).toLocaleString('en-IN');
// return formattedNumber;
// }
return formattedNumber;
}
// Function to format numbers based on a class
function formatNumbersByClass(className) {
const elements = document.querySelectorAll(`.${className}`);
elements.forEach(element => {
const number = parseFloat(element.innerText.replace(/,/g, ''));
// // Function to format numbers based on a class
// function formatNumbersByClass(className) {
// const elements = document.querySelectorAll(`.${className}`);
// elements.forEach(element => {
// const number = parseFloat(element.innerText.replace(/,/g, ''));
if (!isNaN(number)) {
element.innerText = formatNumberInIndianRupees(number);
}
});
}
// if (!isNaN(number)) {
// element.innerText = formatNumberInIndianRupees(number);
// }
// });
// }
// Format numbers when the DOM content is loaded
document.addEventListener("DOMContentLoaded", function() {
setTimeout(() => {
// // Format numbers when the DOM content is loaded
// document.addEventListener("DOMContentLoaded", function() {
// setTimeout(() => {
// formatNumbersByClass('indian-number');
// }, 500);
// });
formatNumbersByClass('indian-number');
}, 500);
});
</script>
<script>
$(document).ready(function() {
// $(document).ready(function() {
var table = $('#tickets-table').DataTable({
"footer": true
});
// var table = $('#tickets-table').DataTable({
// "footer": true
// });
var sumColumn9 = table.column(9).data().reduce(function(a, b) {
return parseFloat(a) + parseFloat(b);
}, 0);
// var sumColumn9 = table.column(9).data().reduce(function(a, b) {
// return parseFloat(a) + parseFloat(b);
// }, 0);
console.log(sumColumn9)
// console.log(sumColumn9)
var sumColumn10 = table.column(10).data().reduce(function(a, b) {
return parseFloat(a) + parseFloat(b);
}, 0);
// var sumColumn10 = table.column(10).data().reduce(function(a, b) {
// return parseFloat(a) + parseFloat(b);
// }, 0);
console.log(sumColumn10)
// console.log(sumColumn10)
$('#tickets-table tfoot th:eq(9)').html(sumColumn9);
$('#tickets-table tfoot th:eq(10)').html(sumColumn10);
});
// $('#tickets-table tfoot th:eq(9)').html(sumColumn9);
// $('#tickets-table tfoot th:eq(10)').html(sumColumn10);
// });
</script>

View File

@ -214,10 +214,27 @@ $(document).ready(function() {
// console.log('submit called');
if(!checkValues()){
if(checkValues() == 'client'){
toastr.warning('Form is Empty', 'warning')
toastr.warning('Client is Required', 'warning')
return false;
}else if(checkValues() == 'policy'){
toastr.warning('Policy is Required', 'warning')
return false;
}else if(checkValues() == 'branch'){
toastr.warning('Branch is Required', 'warning')
return false;
}else if(checkValues() == 'event'){
toastr.warning('Event is Required', 'warning')
return false;
}else{
}
@ -999,26 +1016,26 @@ function checkValues() {
if (!clientId || clientId == '0') {
// alert('Client ID is empty or zero');
return false;
return 'client';
}
if (!branchId || branchId == '0') {
// alert('Branch ID is empty or zero');
return 'branch';
}
if (!policyId || policyId == '0') {
// alert('Policy ID is empty or zero');
return false;
}
if (!branchId || branchId == '0') {
// alert('Branch ID is empty or zero');
return false;
return 'policy';
}
if (!uploadActionType || uploadActionType == '0') {
// alert('Upload action type is empty or zero');
return false;
return 'event';
}
// If all values are valid, return true
return true;
// return true;
}
//---------------------------------------------------------------------------------------------------------

View File

@ -18,7 +18,7 @@
</div>
</div>
<table class="table table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0"
<table class="table table-hover m-0 table-centered dt-responsive w-100" cellspacing="0"
id="tickets-table">
<thead class="bg-light">
<tr>
@ -35,43 +35,49 @@
</thead>
<tbody class="font-12">
<?php
if(isset($fileList))
{
<?php
if (isset($fileList)) {
foreach ($fileList as $key => $file) { //print_r((json_decode($file['reason'])));
// $reason = json_decode(($file['reason']));
// $reason = "{'date':'value data kbckl kcn/aksl'}";
// echo $reason;
?>
// $reason = json_decode(($file['reason']));
// $reason = "{'date':'value data kbckl kcn/aksl'}";
// echo $reason;
?>
<tr>
<td><b><?php echo ($key + 1)?></b></td>
<td><?php echo $file['file_name']?></td>
<td><?php echo $file['short_name']?></td>
<td><?php echo $file['branch_name']?></td>
<td><?php echo $file['policy_name']?></td>
<td><?php echo $file['action']?></td>
<td><?php echo fancy_date_time_format($file['created_at']).' by <strong>'.$file['first_name'].'</strong>'?>
<td><b><?php echo ($key + 1) ?></b></td>
<td><?php echo $file['file_name'] ?></td>
<td><?php echo $file['short_name'] ?></td>
<td><?php echo $file['branch_name'] ?></td>
<td><?php echo $file['policy_name'] ?></td>
<td><?php echo $file['action'] ?></td>
<td><?php echo fancy_date_time_format($file['created_at']) . ' by <strong>' . $file['first_name'] . '</strong>' ?>
</td>
<td>
<?php
if($file['status'] == 'failed')
{
echo $file['status'] . " <span class='col-xl-3 col-lg-4 col-sm-6'> <i class='fe-alert-circle' data-toggle='modal' data-target='#file-err-modal' data-err=".$file['id']."></i></span>";
}else if( $file['status'] == 'inprogress'){
<?php
if ($file['status'] == 'failed') {
echo $file['status'] . " <span class='col-xl-3 col-lg-4 col-sm-6'> <i class='fe-alert-circle' data-toggle='modal' data-target='#file-err-modal' data-err=" . $file['id'] . "></i></span>";
} else if ($file['status'] == 'inprogress') {
$tool_tip_text = "Live(s) : {$file['employee_count']}" . " | Total premium : ₹ " . format_indian_number($file['total'],2,',') ." | Click to reload";
echo '<a data-toggle="tooltip" data-placement="top" data-id="' . $file['status'] . '" class="reload" title="'.$tool_tip_text.'" href="#">' . $file['status'] . '</a>';
}else{
if ($file['action'] == 'inception' || $file['action'] == 'addition' || $file['action'] == 'dependent_addtion') {
$tool_tip_text = "Live(s) : {$file['employee_count']}" . " | Total premium : ₹ " . format_indian_number($file['total'],2,',') ;
// $tool_tip_text = "dssd";
// Total Amount : $file['total']";
echo '<span data-toggle="tooltip" data-placement="top" data-id="' . $file['status'] . '" title=" '. $tool_tip_text.' ">' . $file['status'] . '</span>';
}
?>
$tool_tip_text = "Live(s) : {$file['employee_count']}" . " | Total premium : ₹ " . format_indian_number($file['total'], 2, ',') . " | Click to reload";
echo '<a data-toggle="tooltip" data-placement="top" data-id="' . $file['status'] . '" class="reload" title="' . $tool_tip_text . '" href="#">' . $file['status'] . '</a>';
}
} else if ($file['status'] == 'success') {
if ($file['action'] == 'inception' || $file['action'] == 'addition' || $file['action'] == 'dependent_addtion') {
$tool_tip_text = "Live(s) : {$file['employee_count']}" . " | Total premium : ₹ " . format_indian_number($file['total'], 2, ',');
// $tool_tip_text = "dssd";
// Total Amount : $file['total']";
echo '<span data-toggle="tooltip" data-placement="top" data-id="' . $file['status'] . '" title=" ' . $tool_tip_text . ' ">' . $file['status'] . '</span>';
}else{
echo '<span data-id="' . $file['status'] . '" >' . $file['status'] . '</span>';
}
}else{
echo '<span data-id="' . $file['status'] . '" >' . $file['status'] . '</span>';
}
?>
</td>
<td>
@ -80,30 +86,34 @@
data-toggle="dropdown" aria-expanded="false"><i
class="mdi mdi-dots-horizontal"></i></a>
<div class="dropdown-menu dropdown-menu-right">
<?php if($file['status'] == 'failed') { ?>
<a data-id="<?= htmlspecialchars(json_encode(['client_id' => $file['client_id'], 'client_policy_id' => $file['client_policy_id'], 'action' => $file['action']])) ?>" data-toggle="modal"
data-target="#file-upload-modal" class="dropdown-item upload_button" href="#"><i
<?php if ($file['status'] == 'failed') { ?>
<a data-id="<?= htmlspecialchars(json_encode(['client_id' => $file['client_id'], 'client_policy_id' => $file['client_policy_id'], 'client_branch_id' => $file['client_branch_id'], 'action' => $file['action']])) ?>"
data-toggle="modal" data-target="#file-upload-modal"
class="dropdown-item upload_button" href="#"><i
class="mdi mdi-upload mr-2 text-muted font-18 vertical-middle"></i>Re-Upload</a>
<?php } ?>
<a class="dropdown-item"
href="<?= base_url("util/download-file-list/").$file['id']; ?>"><i
href="<?= base_url("util/download-file-list/") . $file['id']; ?>"><i
class="mdi mdi-download mr-2 text-muted font-18 vertical-middle"></i>Download</a>
<a data-id="<?php echo $file['id']?>" data-toggle="modal"
<a data-id="<?php echo $file['id'] ?>" data-toggle="modal"
data-target="#full-width-modal-emp-list" class="dropdown-item view_emp_list"
href="#"><i
class="mdi mdi-eye mr-2 text-muted font-18 vertical-middle"></i>View</a>
<?php if($file['status'] == 'success'){?>
<a data-id="<?php echo $file['id']?>" class="dropdown-item truncate"
href="#"><i
<?php if ($file['status'] == 'success') { ?>
<a data-id="<?php echo $file['id'] ?>" class="dropdown-item truncate" href="#"><i
class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Truncate</a>
<?php } ?>
<?php
} ?>
</div>
</div>
</td>
</tr>
<?php }}?>
<?php }
} ?>
</tbody>
</table>
@ -117,7 +127,8 @@
<div class="modal-dialog modal-full-width">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="fullWidthModalLabel">Upload Employee List <span id="title_header_name"></span></h4>
<h4 class="modal-title" id="fullWidthModalLabel">Upload Employee List <span
id="title_header_name"></span></h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body" id="emp_data_success">
@ -140,10 +151,11 @@
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<form class="parsley-examples" id="uploadForm" action="<?php echo base_url().'employee/upload'?>"
<form class="parsley-examples" id="uploadForm" action="<?php echo base_url() . 'employee/upload' ?>"
enctype="multipart/form-data">
<input type="hidden" id="file_client_id" name="client_id">
<input type="hidden" id="file_policy_id" name="policy_id">
<input type="hidden" id="file_branch_id" name="branch_id">
<input type="hidden" id="file_upload_actions" name="upload-action-type">
<input type="file" id="fileInput" name="emplist" required
accept=" application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel,application/vnd.oasis.opendocument.spreadsheet">
@ -174,7 +186,7 @@ $('body').on('click', '.view_emp_list', function() {
$('.loader').fadeIn();
$('.loader-mask').fadeIn();
var uri = '<?= base_url('util/view-success-emp-list')?>?' + queryString
var uri = '<?= base_url('util/view-success-emp-list') ?>?' + queryString
console.log(uri)
$.ajax({
@ -234,79 +246,81 @@ $('body').on('click', '.upload_button', function() {
console.log(fileId); // Use fileId as needed
$('#file_client_id').val(fileId.client_id)
$('#file_policy_id').val(fileId.client_policy_id)
$('#file_branch_id').val(fileId.client_branch_id)
$('#file_upload_actions').val(fileId.action)
})
$('body').on('click', '.truncate', function() {
$('body').on('click', '.truncate', function(event) {
event.preventDefault();
// console.log(event);
var fileId = JSON.parse(this.getAttribute('data-id'));
// alert('Hi' + fileId);
Swal.fire({
title: "Do you want to truncate data from uploaded file?",
showCancelButton: true,
confirmButtonText: "Delete",
confirmButtonColor: "#ff3333",
}).then((result) => {
console.log(result);
if (result.isConfirmed) {
$('.loader').fadeIn();
$('.loader-mask').fadeIn();
var apiURL = '<?php echo base_url();?>' + 'employee/truncate/' + fileId;
$.ajax({
url: apiURL,
method: 'GET',
headers: {
// "Content-Type": "application/json",
"X-Requested-With": "XMLHttpRequest"
},
success: function(response) {
// console.log(response.code);
// console.log(response.dataStatus);
// console.log(response.data);
setTimeout(function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
}, 1000);
Swal.fire({
title: "Do you want to truncate data from uploaded file?",
showCancelButton: true,
confirmButtonText: "Delete",
confirmButtonColor: "#ff3333",
}).then((result) => {
console.log(result);
if (result.isConfirmed) {
$('.loader').fadeIn();
$('.loader-mask').fadeIn();
var apiURL = '<?php echo base_url(); ?>' + 'employee/truncate/' + fileId;
$.ajax({
url: apiURL,
method: 'GET',
headers: {
// "Content-Type": "application/json",
"X-Requested-With": "XMLHttpRequest"
},
success: function(response) {
// console.log(response.code);
// console.log(response.dataStatus);
// console.log(response.data);
setTimeout(function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
}, 1000);
if (response.code === 200 && response.dataStatus === true && response.data !== "") {
Swal.fire({
title: "Deleted!",
// text: "Data from truncated",
icon: "success"
});
} else if (response.code === 404 && response.dataStatus === false) {
console.error('no data found', response);
Swal.fire({
title: "Failed!",
text: response.message,
icon: "error"
});
} else {
Swal.fire({
title: "Failed!",
text: 'Something went wrong! Try later',
icon: "error"
});
}
},
error: function(xhr, status, error) {
setTimeout(function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
}, 1000);
if (response.code === 200 && response.dataStatus === true && response
.data !== "") {
Swal.fire({
title: "Deleted!",
// text: "Data from truncated",
icon: "success"
});
} else if (response.code === 404 && response.dataStatus === false) {
console.error('no data found', response);
Swal.fire({
title: "Failed!",
text: response.message,
icon: "error"
});
} else {
console.error('Error fetching data from API:', error);
toastr.error('Something went wrong! Try later', 'Error');
}
});
}
});
Swal.fire({
title: "Failed!",
text: 'Something went wrong! Try later',
icon: "error"
});
}
},
error: function(xhr, status, error) {
setTimeout(function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
}, 1000);
console.error('Error fetching data from API:', error);
toastr.error('Something went wrong! Try later', 'Error');
}
});
}
});
})
@ -347,7 +361,7 @@ $('#uploadForm').submit(function() {
toastr.success(
'File upload successs, Data validation is in-progress',
'success');
$('.close').click()
window.location.reload(true);
} else if (response.code === 404 && response.dataStatus === false) {
console.error('no data found', response);
@ -383,32 +397,32 @@ $('body').on('click', '.reload', function() {
}
})
$(document).ready(function(){
$(document).ready(function() {
$('#tickets-table').DataTable({
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
"buttons": [{
"extend": 'csv',
"text": 'CSV',
"title": 'Employee-Upload-List',
"className": 'my_class',
"exportOptions": {
"columns": ':not(:last-child)'
},
}],
"initComplete": function(settings, json) {
$('.my_class').css({
"position": "relative",
"left": "79px"
});
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
"buttons": [{
"extend": 'csv',
"text": 'CSV',
"title": 'Employee-Upload-List',
"className": 'my_class',
"exportOptions": {
"columns": ':not(:last-child)'
},
}],
"initComplete": function(settings, json) {
$('.my_class').css({
"position": "relative",
"left": "79px"
});
},
language: {
search: "_INPUT_",
searchPlaceholder: "Search..."
},
paging: true ,
paging: true,
});
});

View File

@ -1,3 +1,67 @@
<style>
.switch {
position: relative;
display: inline-block;
width: 54px;
height: 34px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
-webkit-transition: .4s;
transition: .4s;
}
.slider:before {
position: absolute;
content: "";
height: 19px;
width: 19px;
left: 4px;
bottom: 4px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
input:checked + .slider {
background-color: #2196F3;
}
input:focus + .slider {
box-shadow: 0 0 1px #2196F3;
}
input:checked + .slider:before {
-webkit-transform: translateX(26px);
-ms-transform: translateX(26px);
transform: translateX(26px);
}
/* Rounded sliders */
.slider.round {
border-radius: 34px;
}
.slider.round:before {
border-radius: 50%;
}
</style>
<div class="tab-pane fade active show" id="general-q-tab">
<div class="row">
<div class="col-12">
@ -16,10 +80,20 @@
</div>
<div class="form-row">
<div class="form-group col-md-2">
<label for="short_name">Insurer Short Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="short_name" placeholder="Enter Short Name" value="<?= isset($insurer['short_name']) ? $insurer['short_name'] : '' ?>" name="short_name" required minlength="3" maxlength="8">
</div>
<div class="form-group col-md-2">
<label class="switch" style="position: absolute;top: 32px;left: 17px;">
<input id="addition_add_day" type="checkbox" name="addition_add_day" <?= (isset($insurer['addition_add_day']) && $insurer['addition_add_day'] == 1) ? 'checked' : '' ?>>
<span class="slider round" style="height: 27px;"></span>
</label>
<label for="is_download_btn" style="position: relative;top: 30px;left: 82px;">Add one day to date of coverage when Addition/Dependent addition</label>
</div>
</div>
<div class="form-row">