650 lines
37 KiB
PHP
650 lines
37 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
@include('layouts.shared/title-meta', ['title' => 'Form'])
|
|
@include('layouts.shared/head-css', ['mode' => $mode ?? '', 'demo' => $demo ?? ''])
|
|
<link href="{{ asset('assets/libs/sweetalert2/sweetalert2.min.css') }}" rel="stylesheet" type="text/css" />
|
|
<link href="{{ asset('assets/libs/flatpickr/flatpickr.min.css') }}" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<div id="pageloader">
|
|
<img src="/images/loader-large.gif" alt="processing..." />
|
|
</div>
|
|
|
|
<body class="loading">
|
|
<div class="account-pages">
|
|
<div class="container">
|
|
<div class="row justify-content-center">
|
|
<div class="col-md-8 col-lg-6 col-xl-5 p-0">
|
|
<div class="card">
|
|
<div class="card-body p-3 row">
|
|
|
|
@if (Session::has('error'))
|
|
<div class="alert alert-danger">{{ Session::get('error') }}</div>
|
|
<br>
|
|
@endif
|
|
@if (session('success'))
|
|
<div class=" alert alert-success">{{ session('success') }}
|
|
</div>
|
|
<br>
|
|
@endif
|
|
<div class="col-8">
|
|
<h4 class="page-title">Planned HBA1C Camps</h4>
|
|
</div>
|
|
@if (!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != 'yes'))
|
|
<div class="col-4">
|
|
@if ($form->link_type == 'form')
|
|
<!-- <a href="/form/history" class="float-end pt-1">View History</a> -->
|
|
<button type="button" class="btn btn-primary btn-xs" id="add-camp-btn">Add
|
|
Plan</button>
|
|
@else
|
|
<a href="{{ url()->previous() }}" class="float-end pt-1">Back</a>
|
|
@endif
|
|
</div>
|
|
@endif
|
|
|
|
@php
|
|
$history = Formhelper::getMultiformData($form->partition, $form->form_id, $form->user_id);
|
|
@endphp
|
|
|
|
<div class="col-12" id="table-wrapper">
|
|
|
|
|
|
<div class="table-responsive">
|
|
<table class="table table-borderless table-nowrap table-hover table-centered m-0">
|
|
|
|
<thead class="table-light">
|
|
<tr>
|
|
<th>Action</th>
|
|
<th>Execution Done</th>
|
|
<th>Date of Camp finalised</th>
|
|
<th>Doctor</th>
|
|
<th>Gforce ID/UID No.</th>
|
|
<th>Time</th>
|
|
<th>Document</th>
|
|
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($history->data->submissions as $sub)
|
|
@php
|
|
$sub->formdata->id = $sub->id;
|
|
@endphp
|
|
<tr>
|
|
<td>
|
|
<button type="button" class="btn btn-xs btn-info edit-btn" plan_details="{{ json_encode($sub->formdata) }}"><i class="mdi mdi-pencil"></i> Edit</button>
|
|
</td>
|
|
<td>{{ isset($sub->formdata->hba1c_total_rx) && $sub->formdata->hba1c_total_rx > 0 ? 'Yes' : 'No' }}
|
|
</td>
|
|
<td>{{ $sub->formdata->camp_date }}</td>
|
|
<td>
|
|
<h5 class="m-0 fw-normal">{{ $sub->formdata->contact_id }}</h5>
|
|
</td>
|
|
<td>{{ $sub->formdata->gforce_id }}</td>
|
|
<td>{{ $sub->formdata->start_time_of_camp }}</td>
|
|
<td>{{ $sub->formdata->camp_to_be_executed_by }}</td>
|
|
<td>
|
|
<a target="_blank" href="{{ isset($sub->formdata->supported_document) ? $sub->formdata->supported_document : '' }}" download="{{ isset($sub->formdata->supported_document) ? $sub->formdata->supported_document : '' }}" class="btn btn-dark btn-xs"><i class="mdi mdi-cloud-download me-1"></i> Download</a>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="form-wrapper">
|
|
<form method="POST" action="/form/submit" id="report-form" enctype="multipart/form-data">
|
|
<input type="hidden" name="form_id" value="{{ $form_id }}">
|
|
@csrf
|
|
@if ($id)
|
|
<input type="hidden" name="id" value="{{ $id }}">
|
|
@endif
|
|
|
|
@foreach ($questions as $question)
|
|
@if (in_array($question->code, [
|
|
'record_date',
|
|
'no_of_patients',
|
|
'hba1c_zitamet_zita_rx',
|
|
'hba1c_zita_pio_met_rx',
|
|
'hba1c_zita_d_rx',
|
|
'hba1c_telma_ln_range_rx',
|
|
'hba1c_total_rx',
|
|
'hba1c_zita_dm_rx',
|
|
'executed_as_planned',
|
|
'supported_document',
|
|
'upload_support_docimage',
|
|
|
|
'upload_any_other_supporting_document'
|
|
|
|
]))
|
|
@continue
|
|
@endif
|
|
<div class="col-md-12 mb-2">
|
|
|
|
<label for="field-{{ $question->code }}" class="form-label">{{ $question->question }} {!! $question->required == 'yes' ? '<span class="text-danger">*</span>' : '' !!}
|
|
</label>
|
|
@switch($question->type)
|
|
@case('hidden')
|
|
<input type="{{ $question->type }}" id="field-{{ $question->code }}" name="{{ $question->code }}" value="{{ isset($question->value) ? $question->value : '' }}">
|
|
@break
|
|
|
|
@case('text')
|
|
@case('email')
|
|
|
|
@case('tel')
|
|
<input type="{{ $question->type }}" id="field-{{ $question->code }}" name="{{ $question->code }}" class="form-control" {{ $question->required == 'yes' ? 'required' : '' }} {{-- {{ $question->code == 'camp_location_pincode' ? 'pattern="\d*" maxlength="6"' : '' }} --}} {{ $question->code == 'camp_date' ? 'min="' . date('Y-m-d', strtotime('now') + 604800) . '"' : '' }} value="{{ isset($question->value) ? $question->value : '' }}">
|
|
@break
|
|
|
|
@case('date')
|
|
<input type="{{ $question->type }}" id="field-{{ $question->code }}" name="{{ $question->code }}" class="form-control datepicker" {{ $question->required == 'yes' ? 'required' : '' }} value="{{ isset($question->value) ? $question->value : '' }}">
|
|
@break
|
|
|
|
@case('number')
|
|
<input type="{{ $question->type }}" min="0" max="9999999999" step="1" id="field-{{ $question->code }}" name="{{ $question->code }}" class="form-control" {{ $question->required == 'yes' ? 'required' : '' }} value="{{ isset($question->value) ? $question->value : 0 }}">
|
|
@break
|
|
|
|
@case('textarea')
|
|
<textarea id="field-{{ $question->code }}" name="{{ $question->code }}" class="form-control" {{ $question->required == 'yes' ? 'required' : '' }}>{{ isset($question->value) ? $question->value : '' }}</textarea>
|
|
@break
|
|
|
|
@case('dropdown')
|
|
<select class="form-control" id="field-{{ $question->code }}" name="{{ $question->code }}" {{ $question->required == 'yes' ? 'required' : '' }}>
|
|
<option value=""> -- Select -- </option>
|
|
@foreach ($question->options as $option)
|
|
<option value="{{ $option->value }}" {{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }} {{ $question->code == 'contact_id' ? 'msl_code= ' . $option->contact->msl_code . ' ' : '' }}>{{ $option->display }}</option>
|
|
@endforeach
|
|
</select>
|
|
@break
|
|
|
|
@case('checkbox')
|
|
@foreach ($question->options as $option)
|
|
<div class="form-check mb-2 form-check-primary">
|
|
<input class="form-check-input" type="checkbox" id="field-{{ $question->code }}-{{ $option->value }}" name="{{ $question->code }}[]" value="{{ $option->value }}" {{ isset($question->value) && $question->value != '' && in_array($option->value, $question->value) ? 'checked' : '' }}>
|
|
<label class="form-check-label" for="field-{{ $question->code }}-{{ $option->value }}">{{ $option->display }}</label>
|
|
</div>
|
|
@endforeach
|
|
@break
|
|
|
|
@case('file')
|
|
<input type="file" id="field-{{ $question->code }}" name="{{ $question->code }}" class="form-control" value="" accept="image/jpg, image/jpeg, image/png">
|
|
@break
|
|
@endswitch
|
|
</div>
|
|
@endforeach
|
|
@if (!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != 'yes'))
|
|
<div class="text-center d-grid mt-3">
|
|
<button class="btn btn-primary" type="submit" id="submit-btn"> Submit
|
|
</button>
|
|
</div>
|
|
@endif
|
|
</form>
|
|
</div>
|
|
|
|
<div id="execution-form-wrapper">
|
|
<form method="POST" action="/form/submit" id="execution-form" enctype="multipart/form-data">
|
|
<input type="hidden" name="form_id" value="{{ $form_id }}">
|
|
@csrf
|
|
<input type="hidden" name="id" value="" id="execution-id">
|
|
@foreach ($questions as $question)
|
|
@if (in_array($question->code, [
|
|
'hba1c_zitamet_zita_rx',
|
|
'hba1c_zita_pio_met_rx',
|
|
'hba1c_zita_d_rx',
|
|
'hba1c_telma_ln_range_rx',
|
|
'hba1c_total_rx',
|
|
'hba1c_zita_dm_rx',
|
|
'supported_document',
|
|
|
|
]))
|
|
@continue
|
|
@endif
|
|
<div class="col-md-12 mb-2">
|
|
|
|
<label for="execution-{{ $question->code }}" class="form-label">{{ $question->question }} {!! $question->required == 'yes' ? '<span class="text-danger">*</span>' : '' !!}
|
|
</label>
|
|
@switch($question->type)
|
|
@case('hidden')
|
|
<input type="{{ $question->type }}" id="execution-{{ $question->code }}" name="{{ $question->code }}" value="{{ isset($question->value) ? $question->value : '' }}">
|
|
@break
|
|
|
|
@case('text')
|
|
@case('email')
|
|
|
|
@case('tel')
|
|
@case('date')
|
|
<input type="{{ $question->type }}" id="execution-{{ $question->code }}" name="{{ $question->code }}" class="form-control" {{ $question->required == 'yes' ? 'required' : '' }} value="{{ isset($question->value) ? $question->value : '' }}">
|
|
@break
|
|
|
|
@case('number')
|
|
<input type="{{ $question->type }}" {{ $question->code == 'camp_location_pincode' ? 'min=0 max=999999' : 'min=0 max=9999999999' }} step="1" id="execution-{{ $question->code }}" name="{{ $question->code }}" class="form-control" {{ $question->required == 'yes' ? 'required' : '' }} value="{{ isset($question->value) ? $question->value : 0 }}">
|
|
@break
|
|
|
|
@case('textarea')
|
|
<textarea id="execution-{{ $question->code }}" name="{{ $question->code }}" class="form-control" {{ $question->required == 'yes' ? 'required' : '' }}>{{ isset($question->value) ? $question->value : '' }}</textarea>
|
|
@break
|
|
|
|
@case('dropdown')
|
|
<select class="form-control" id="execution-{{ $question->code }}" name="{{ $question->code }}" {{ $question->required == 'yes' ? 'required' : '' }}>
|
|
<option value=""> -- Select -- </option>
|
|
@foreach ($question->options as $option)
|
|
<option value="{{ $option->value }}" {{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }}>
|
|
{{ $option->display }}
|
|
</option>
|
|
@endforeach
|
|
</select>
|
|
@break
|
|
|
|
@case('checkbox')
|
|
@foreach ($question->options as $option)
|
|
<div class="form-check mb-2 form-check-primary">
|
|
<input class="form-check-input" type="checkbox" id="execution-{{ $question->code }}-{{ $option->value }}" name="{{ $question->code }}[]" value="{{ $option->value }}" {{ isset($question->value) && $question->value != '' && in_array($option->value, $question->value) ? 'checked' : '' }}>
|
|
<label class="form-check-label" for="execution-{{ $question->code }}-{{ $option->value }}">{{ $option->display }}</label>
|
|
</div>
|
|
@endforeach
|
|
@break
|
|
|
|
@case('file')
|
|
<input type="file" id="execution-{{ $question->code }}" name="{{ $question->code }}" class="form-control" value="" accept="image/jpg, image/jpeg, image/png">
|
|
@break
|
|
@endswitch
|
|
</div>
|
|
@endforeach
|
|
|
|
<div class="col-md-12 mb-2 p-1" style="background-color: #C8E6C9; border: 1px solid black !important">
|
|
<h6>Focus Brands / SKU</h6>
|
|
@foreach ($questions as $question)
|
|
@if (in_array($question->code, [
|
|
'record_date',
|
|
'no_of_patients',
|
|
'doctor_email',
|
|
'camp_location_pincode',
|
|
'camp_date',
|
|
'camp_to_be_executed_by',
|
|
'hba1c_zita_pio_met_rx',
|
|
'hba1c_zita_d_rx',
|
|
'hba1c_telma_ln_range_rx',
|
|
'hba1c_total_rx',
|
|
'fso_mobile_no',
|
|
'fso_whatsapp_no',
|
|
'contact_id',
|
|
'speciality',
|
|
'gforce_id',
|
|
'camp_address',
|
|
'start_time_of_camp',
|
|
'tentative_closing_time',
|
|
'expected_no_of_testing',
|
|
'hba1c_zita_dm_rx',
|
|
'executed_as_planned',
|
|
'supported_document',
|
|
'upload_support_docimage',
|
|
'upload_any_other_supporting_document'
|
|
|
|
|
|
]))
|
|
@continue
|
|
@endif
|
|
<div class="col-md-12 mb-2">
|
|
<label for="execution-{{ $question->code }}" class="form-label">{{ $question->question }}
|
|
{!! $question->required == 'yes' ? '<span class="text-danger">*</span>' : '' !!}
|
|
</label>
|
|
@switch($question->type)
|
|
@case('hidden')
|
|
<input type="{{ $question->type }}" id="execution-{{ $question->code }}" name="{{ $question->code }}" value="{{ isset($question->value) ? $question->value : '' }}">
|
|
@break
|
|
|
|
@case('number')
|
|
<input type="{{ $question->type }}" min="0" max="9999999999" step="1" id="execution-{{ $question->code }}" name="{{ $question->code }}" class="form-control" {{ $question->required == 'yes' ? 'required' : '' }} value="{{ isset($question->value) ? $question->value : 0 }}">
|
|
@break
|
|
@endswitch
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
|
|
<div class="col-md-12 mb-2 p-1" style="border: 1px solid black !important">
|
|
<h6>Other Brands / SKU</h6>
|
|
@foreach ($questions as $question)
|
|
@if (in_array($question->code, [
|
|
'record_date',
|
|
'no_of_patients',
|
|
'doctor_email',
|
|
'camp_location_pincode',
|
|
'camp_date',
|
|
'camp_to_be_executed_by',
|
|
'fso_mobile_no',
|
|
'fso_whatsapp_no',
|
|
'contact_id',
|
|
'speciality',
|
|
'gforce_id',
|
|
'camp_address',
|
|
'start_time_of_camp',
|
|
'tentative_closing_time',
|
|
'expected_no_of_testing',
|
|
'hba1c_zitamet_zita_rx',
|
|
'hba1c_total_rx',
|
|
'executed_as_planned',
|
|
'supported_document',
|
|
'upload_support_docimage',
|
|
|
|
'upload_any_other_supporting_document'
|
|
|
|
|
|
]))
|
|
@continue
|
|
@endif
|
|
<div class="col-md-12 mb-2">
|
|
<label for="execution-{{ $question->code }}" class="form-label">{{ $question->question }}
|
|
{!! $question->required == 'yes' ? '<span class="text-danger">*</span>' : '' !!}
|
|
</label>
|
|
@switch($question->type)
|
|
@case('hidden')
|
|
<input type="{{ $question->type }}" id="execution-{{ $question->code }}" name="{{ $question->code }}" value="{{ isset($question->value) ? $question->value : '' }}">
|
|
@break
|
|
|
|
@case('number')
|
|
<input type="{{ $question->type }}" min="0" max="9999999999" step="1" id="execution-{{ $question->code }}" name="{{ $question->code }}" class="form-control" {{ $question->required == 'yes' ? 'required' : '' }} value="{{ isset($question->value) ? $question->value : 0 }}">
|
|
@break
|
|
|
|
@endswitch
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
|
|
@foreach ($questions as $question)
|
|
@if (in_array($question->code, [
|
|
'record_date',
|
|
'no_of_patients',
|
|
'doctor_email',
|
|
'camp_location_pincode',
|
|
'camp_date',
|
|
'camp_to_be_executed_by',
|
|
'hba1c_zita_pio_met_rx',
|
|
'hba1c_zita_d_rx',
|
|
'hba1c_telma_ln_range_rx',
|
|
'fso_mobile_no',
|
|
'fso_whatsapp_no',
|
|
'contact_id',
|
|
'speciality',
|
|
'gforce_id',
|
|
'camp_address',
|
|
'start_time_of_camp',
|
|
'tentative_closing_time',
|
|
'expected_no_of_testing',
|
|
'hba1c_zitamet_zita_rx',
|
|
'hba1c_zita_dm_rx',
|
|
'executed_as_planned',
|
|
'upload_support_docimage',
|
|
'upload_any_other_supporting_document'
|
|
|
|
]))
|
|
@continue
|
|
@endif
|
|
<div class="col-md-12 mb-2">
|
|
<label for="execution-{{ $question->code }}" class="form-label">{{ $question->question }}
|
|
{!! $question->required == 'yes' ? '<span class="text-danger">*</span>' : '' !!}
|
|
</label>
|
|
@switch($question->type)
|
|
@case('hidden')
|
|
<input type="{{ $question->type }}" id="execution-{{ $question->code }}" name="{{ $question->code }}" value="{{ isset($question->value) ? $question->value : '' }}">
|
|
@break
|
|
|
|
@case('number')
|
|
<input type="{{ $question->type }}" min="0" max="9999999999" step="1" id="execution-{{ $question->code }}" name="{{ $question->code }}" class="form-control" {{ $question->required == 'yes' ? 'required' : '' }} value="{{ isset($question->value) ? $question->value : 0 }}">
|
|
@break
|
|
@case('file')
|
|
<input type="file" id="field-{{ $question->code }}" name="{{ $question->code }}" class="form-control" value="" accept="image/jpg, image/jpeg, image/png">
|
|
@break
|
|
@endswitch
|
|
</div>
|
|
@endforeach
|
|
|
|
@if (!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != 'yes'))
|
|
<div class="text-center d-grid mt-3">
|
|
<button class="btn btn-primary" type="submit" id="submit-btn"> Submit
|
|
</button>
|
|
</div>
|
|
@endif
|
|
</form>
|
|
</div>
|
|
|
|
</div> <!-- end card-body -->
|
|
</div>
|
|
<!-- end card -->
|
|
|
|
<!-- end row -->
|
|
|
|
</div> <!-- end col -->
|
|
</div>
|
|
<!-- end row -->
|
|
</div>
|
|
<!-- end container -->
|
|
</div>
|
|
<!-- end page -->
|
|
<style type="text/css">
|
|
#pageloader {
|
|
background: rgba(255, 255, 255, 0.8);
|
|
display: none;
|
|
height: 100%;
|
|
position: fixed;
|
|
width: 100%;
|
|
z-index: 9999;
|
|
}
|
|
|
|
#pageloader img {
|
|
left: 50%;
|
|
margin-left: -32px;
|
|
margin-top: -32px;
|
|
position: absolute;
|
|
top: 50%;
|
|
}
|
|
</style>
|
|
@include('layouts.shared/footer-script')
|
|
<script src="{{ asset('assets/libs/sweetalert2/sweetalert2.min.js') }}"></script>
|
|
<script src="{{ asset('assets/libs/flatpickr/flatpickr.min.js') }}"></script>
|
|
<script type="text/javascript">
|
|
function restrictAlphabets(e) {
|
|
var x = e.which || e.keycode;
|
|
if ((x >= 48 && x <= 57))
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
|
|
|
|
|
|
jQuery(document).ready(function($) {
|
|
|
|
$('#field-contact_id').change(function() {
|
|
$('#field-gforce_id').val($('option:selected', this).attr('msl_code'))
|
|
})
|
|
|
|
$('#field-camp_location_pincode').on('change', function() {
|
|
let pincode = document.getElementById("field-camp_location_pincode").value;
|
|
if (pincode.length < 6 || pincode.length > 6) {
|
|
alert('Pincode must have 6 digit numeric value');
|
|
$('#field-camp_location_pincode').val('');
|
|
return false;
|
|
}
|
|
if (!/^[0-9]+$/.test(pincode)) {
|
|
alert("Please only enter numeric characters only");
|
|
$('#field-camp_location_pincode').val('');
|
|
return false;
|
|
}
|
|
})
|
|
|
|
|
|
$('#form-wrapper').hide()
|
|
$('#execution-form-wrapper').hide()
|
|
|
|
$('#add-camp-btn').click(function() {
|
|
$('#form-wrapper').show()
|
|
$('#table-wrapper').hide()
|
|
})
|
|
|
|
$('.edit-btn').click(function() {
|
|
$('#execution-fso_mobile_no').prop('readonly', true)
|
|
$('#execution-fso_whatsapp_no').prop('readonly', true)
|
|
$('#execution-doctor_email').prop('readonly', true)
|
|
$('#execution-contact_id').prop('readonly', true)
|
|
$('#execution-speciality').prop('readonly', true)
|
|
$('#execution-gforce_id').prop('readonly', true)
|
|
$('#execution-camp_address').prop('readonly', true)
|
|
$('#execution-camp_location_pincode').prop('readonly', true)
|
|
$('#execution-start_time_of_camp').prop('readonly', true)
|
|
$('#execution-tentative_closing_time').prop('readonly', true)
|
|
$('#execution-expected_no_of_testing').prop('readonly', true)
|
|
$('#execution-camp_date').prop('readonly', true)
|
|
$('#execution-camp_to_be_executed_by').prop('readonly', true)
|
|
//$('#execution-time').prop('disabled', true)
|
|
|
|
let selected = JSON.parse($(this).attr('plan_details'))
|
|
console.log(selected)
|
|
for (let k of Object.keys(selected)) {
|
|
if (selected[k] != '') {
|
|
if (k == 'contact_id') {
|
|
console.log(selected['cont_id'])
|
|
//$("#execution-contact_id option:contains(" + selected[k] + ")").prop('selected', true)
|
|
// console.log($("#execution-contact_id option:contains(" + selected[k] + ")").attr('value'))
|
|
//$('#execution-contact_id').val($("#execution-contact_id option:contains(" + selected[k] + ")").attr('value'));
|
|
//$('#execution-contact_id').val(selected['cont_id']).trigger("change");
|
|
//$('#execution-contact_id option [value='+selected['cont_id']+']').attr('selected', 'true');
|
|
$('#execution-contact_id').append('<option value="'+selected['cont_id']+'" selected>'+selected['contact_id']+'</option>')
|
|
} else
|
|
$('#execution-' + k).val(selected[k]);
|
|
}
|
|
// if(selected[k] != '')
|
|
// $('#execution-'+k).val(selected[k]);
|
|
}
|
|
let docid = $('#execution-contact_id option').map(function() {
|
|
if ($(this).text() == selected['contact_id']) return this;
|
|
}).attr('value')
|
|
$('#execution-contact_id').val(docid)
|
|
$('#execution-id').val(selected['id'])
|
|
|
|
$('#execution-form-wrapper').show()
|
|
$('#table-wrapper').hide()
|
|
})
|
|
|
|
$('#execution-hba1c_total_rx').prop('readonly', true);
|
|
|
|
$('#execution-hba1c_zitamet_zita_rx,#execution-hba1c_zita_pio_met_rx,#execution-hba1c_zita_d_rx,#execution-hba1c_telma_ln_range_rx,#execution-hba1c_zita_dm_rx')
|
|
.change(function() {
|
|
$('#execution-hba1c_total_rx').val(parseInt($('#execution-hba1c_zitamet_zita_rx').val()) +
|
|
parseInt($('#execution-hba1c_zita_pio_met_rx').val()) +
|
|
parseInt($('#execution-hba1c_zita_d_rx').val()) +
|
|
parseInt($('#execution-hba1c_telma_ln_range_rx').val()) +
|
|
parseInt($('#execution-hba1c_zita_dm_rx').val())
|
|
)
|
|
|
|
})
|
|
|
|
document.getElementById("field-camp_date").value = "{{ date('Y-m-d') }}";
|
|
// document.getElementById("field-camp_date").min = "{{ date('Y-m-d') }}";
|
|
// document.getElementById("field-camp_date").max = "{{ date('Y-m-d', strtotime('now +7 days')) }}";
|
|
|
|
|
|
// $('#field-camp_date').change(function(event){
|
|
// let seldate = new Date($('#field-camp_date').val())
|
|
// let mindate = new Date();
|
|
// mindate.setDate(mindate.getDate() + 7);
|
|
// if(seldate < mindate) {
|
|
// alert( "Please select Camp date greater than " + mindate.toDateString() )
|
|
// $('#field-camp_date').val( mindate.toISOString().split('T')[0] )
|
|
// }
|
|
// })
|
|
|
|
// $('.datepicker').flatpickr({
|
|
// dateFormat: "m-d-Y"
|
|
// });
|
|
|
|
|
|
$('#report-form').on('submit', function(event) {
|
|
|
|
event.preventDefault();
|
|
$("#pageloader").fadeIn();
|
|
$.ajax({
|
|
type: "POST",
|
|
url: '/form/ajaxsubmit',
|
|
data: new FormData($('#report-form')[0]),
|
|
processData: false,
|
|
contentType: false,
|
|
success: function(data) {
|
|
$("#pageloader").fadeOut();
|
|
if (data.status == 'success') {
|
|
Swal.fire({
|
|
title: 'Great!',
|
|
text: 'Your data is successfully submitted!',
|
|
icon: 'success'
|
|
})
|
|
window.location.reload();
|
|
//$('#report-form').trigger("reset");
|
|
} else {
|
|
Swal.fire({
|
|
icon: 'error',
|
|
title: 'Data not submitted',
|
|
text: 'Something went wrong, please try again after some time!'
|
|
})
|
|
}
|
|
},
|
|
});
|
|
});
|
|
|
|
|
|
$('#execution-form').on('submit', function(event) {
|
|
event.preventDefault();
|
|
$("#pageloader").fadeIn();
|
|
$.ajax({
|
|
type: "POST",
|
|
url: '/form/ajaxsubmit',
|
|
data: new FormData($('#execution-form')[0]),
|
|
processData: false,
|
|
contentType: false,
|
|
success: function(data) {
|
|
$("#pageloader").fadeOut();
|
|
if (data.status == 'success') {
|
|
Swal.fire({
|
|
title: 'Great!',
|
|
text: 'Your data is successfully submitted!',
|
|
icon: 'success'
|
|
})
|
|
window.location.reload();
|
|
//$('#report-form').trigger("reset");
|
|
} else {
|
|
Swal.fire({
|
|
icon: 'error',
|
|
title: 'Data not submitted',
|
|
text: 'Something went wrong, please try again after some time!'
|
|
})
|
|
}
|
|
},
|
|
});
|
|
});
|
|
|
|
var today = new Date();
|
|
var dd = String(today.getDate()).padStart(2, '0');
|
|
var mm = String(today.getMonth() + 1).padStart(2, '0');
|
|
var yyyy = today.getFullYear();
|
|
today = yyyy + '-' + mm + '-' + dd;
|
|
|
|
var recordDateField = document.getElementById('field-camp_date');
|
|
//recordDateField.setAttribute('min', today);
|
|
|
|
var executionDateField = document.getElementById('execution-camp_date');
|
|
//executionDateField.setAttribute('min', today);
|
|
|
|
$('.edit-btn').click(function() {
|
|
var executionexeField = document.getElementById('execution-record_date');
|
|
executionexeField.setAttribute('min', executionDateField.value);
|
|
});
|
|
|
|
executionDateField.addEventListener('change', function() {
|
|
console.log('gg');
|
|
var executionexeField = document.getElementById('execution-record_date');
|
|
executionexeField.setAttribute('min', executionDateField.value);
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
|
|
</html> |