Rapport-Laravel/resources/views/form/rapport-bfconnect/1716957858-4f1912db-4996-42...

549 lines
35 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" />
</head>
<div id="pageloader">
<img src="http://cdnjs.cloudflare.com/ajax/libs/semantic-ui/0.16.1/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 bg-pattern">
<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">{{$form->title}}</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>
@else
<a href="{{url()->previous()}}" class="float-end pt-1">Back</a>
@endif
</div>
@endif
@if(isset($form->user_info))
<div class="col-12">
<h6>Submitted By: {{$form->user_info->name}}</h6>
</div>
@endif
<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
@if(isset($form->manager_can_submit) && $form->manager_can_submit == true)
<div class="col-md-12 mb-2">
<label for="field-user_id" class="form-label"> Select User / Territory <span class="text-danger">*</span> </label>
<select class="form-control" id="field-user_id" name="user_id" required>
<option value=""> -- Select -- </option>
@foreach($form->users as $option)
<option value="{{$option->value}}" hierarchy="{{$option->hierarchy_id}}" {{isset($question->value) && $question->value == $option->value ? 'selected':''}}>{{$option->display}}</option>
@endforeach
</select>
<input type="hidden" id="field-hierarchy_id" name="hierarchy_id" value="">
</div>
@endif
@foreach($questions as $question)
<div class="col-md-12 mb-2">
@if($question->type == 'radio')
<label for="field-{{$question->code}}" class="position-relative form-label d-flex align-items-center label-with-info" data-bs-toggle="collapse" data-bs-target="#{{$question->code}}-collapse" aria-expanded="false" aria-controls="{{$question->code}}-collapse">
<div>{{$question->question}} {!!$question->required == 'yes' ? '<span class="text-danger">*</span>':''!!} </div>
<div class="btn btn-sm btn-secondary rounded-pills">
<i class="fas fa-angle-down"></i>
</div>
</label>
<div class="collapse" id="{{$question->code}}-collapse">
<div class="card">
<div class="card-body p-0">
<div class="table-responsive">
<table class="table table-sm table-bordered info-table mb-0">
<thead>
<tr>
<th>Task</th>
<th>Level-1</th>
<th>Level-2</th>
<th>Level-3</th>
<th>Level-4</th>
</tr>
</thead>
<tbody>
@if($question->code == "planning_pre_clinic_communication")
<tr>
<td>Planning: Pre Clinic Communication</td>
<td>Greeting and only Informing the doctor</td>
<td>
<ul>
<li>Greeting the Dr</li>
<li>Giving brief to the doctor about Counselling. Device technique and PFT</li>
</ul>
</td>
<td>
<ul>
<li>Informing chemist and paramedical staffs</li>
<li>Greetng the Dr</li>
<li>Giving brief to the doctor about Counselling. Device technique and PFT</li>
<li>Asking the doctor to refer all the respiratory patients for counselling</li>
</ul>
</td>
<td>
<ul>
<li>Reminding Patients one day before</li>
<li>Informing chemist and paramedical staffs</li>
<li>Greeting the Dr</li>
<li>Giving brief to the doctor about Counselling. Device technique and PFT</li>
<li>Askin the doctor to rever all the respiratoly patients for counsel.</li>
</ul>
</td>
</tr>
@elseif($question->code == "educator_hygiene_fb_fit")
<tr>
<td>Educator Hygiene / BF Fit</td>
<td>
<ul>
<li>Doing clinic without maintaining BF Fit and proper hygiene</li>
</ul>
</td>
<td>
<ul>
<li>All the materials and tools are at display</li>
</ul>
</td>
<td>
<ul>
<li>Groomed Well</li>
<li>All the materials and tools are at display (Spirometer BOM, BOT, Device kit, PEM and counseling Aid, mouthpieces)</li>
</ul>
</td>
<td>
<ul>
<li>Groomed Well</li>
<li>All the materials and tools are at display (Spirometer BOM, BOT, Device kit, PEM and counseling Aid, mouthpieces)</li>
<li>Clinic Date visibility</li>
</ul>
</td>
</tr>
@elseif($question->code == "patient_communication_counselling")
<tr>
<td>Overall Patient Communication & Counseling (PEM)</td>
<td>
<ul>
<li>Only giving brief about the drug, disease and devices</li>
</ul>
</td>
<td>
<ul>
<li>Opening the call by building Trust and Rapport</li>
<li>Problem identification by asking question</li>
<li>Listening to the patient</li>
</ul>
</td>
<td>
<ul>
<li>Opening the call by building Trust and Raport</li>
<li>Problem identification by asking question</li>
<li>Listening to the patient</li>
<li>Sharing complete information by using Folder / PEM for counseling?</li>
</ul>
</td>
<td>
<ul>
<li>Opening the call by building Trust and Raport</li>
<li>Problem identification by asking question</li>
<li>Listening to the patient</li>
<li>Handling objection with empathy</li>
<li>Sharing complete information by using Folder / PEM for counseling?</li>
<li>Closing the call by taking the agreement from the patient</li>
</ul>
</td>
</tr>
@elseif($question->code == "ability_to_demonstrate")
<tr>
<td>Ability to demonstrate right device technique</td>
<td>
<ul>
<li>Only Giving instruction to patient</li>
</ul>
</td>
<td>
<ul>
<li>Giving demo but not right technique</li>
</ul>
</td>
<td>
<ul>
<li>Demonstrating all devices with right technique confidently</li>
</ul>
</td>
<td>
<ul>
<li>Demonstrating all devices with right technique confidently and asking for teachback</li>
</ul>
</td>
</tr>
@elseif($question->code == "ability_to_conduct")
<tr>
<td>Ability to conduct effective Diagnostic tests</td>
<td>
<ul>
<li>Only doing PFT and asking the patient to show it to the doctor</li>
</ul>
</td>
<td>
<ul>
<li>Asking the patient questions about history.</li>
<li>Briefing the patient about the test</li>
</ul>
</td>
<td>
<ul>
<li>Asking the patient questions about history.</li>
<li>Briefing the patient doout the test.</li>
<li>Giving trial runs using mouthpiece.</li>
<li>Following the guidelines (Measuring height, asking for age, following 4 steps of doing PFT correctly, 15 minutes wait before post-test)</li>
</ul>
</td>
<td>
<ul>
<li>Asking the patient questions about history.</li>
<li>Briefing the patient doout the test.</li>
<li>Giving trial runs using mouthpiece.</li>
<li>Following the guidelines (Measuring height, asking for age, following 4 steps of doing PFT correctly, 15 minutes wait before post-test)</li>
<li>Able to generate acceptable and repeatable (A/B grade) reports in all patients.</li>
</ul>
</td>
</tr>
@elseif($question->code == "post_clinic_communication")
<tr>
<td>Post Clinic Communication</td>
<td>
Greeting and only Informing the doctor about departue
</td>
<td>
<ul>
<li>Clinic Update (As per script)</li>
<li>Next Clinic Date reminder</li>
</ul>
</td>
<td>
<ul>
<li>Clinic Update (As per script)</li>
<li>Next Clinic Date reminder</li>
<li>Changing Breathefree clinic visibility date</li>
</ul>
</td>
<td>
<ul>
<li>Clinic Update (As per script)</li>
<li>Next Clinic Date reminder</li>
<li>Changing Breathefree clinic visibility date</li>
<li>Informing paramedic staffs and chemists</li>
</ul>
</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
</div>
</div>
@else
<label for="field-{{$question->code}}" class="form-label">{{$question->question}} {!!$question->required == 'yes' ? '<span class="text-danger">*</span>':''!!} </label>
@endif
@php
$ques_img = '';
if($question->code == "task_identified_for_coaching") {
$ques_img = 'q9.png';
} else if($question->code == "task_performance_potential") {
$ques_img = 'q10.png';
} else if($question->code == "review_agree_on_next_steps") {
$ques_img = 'q15.png';
} else {
$ques_img = '';
}
@endphp
@if($ques_img != "")
<div class="img-container mb-2">
<img src="{{asset('assets/images/bfconnect-coaching-action-2024/'.$ques_img)}}" class="img-fluid" alt="{{$question->code}} image" />
</div>
@endif
@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')
@case('date')
<input type="{{$question->type}}" id="field-{{$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}}" 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':''}}>{{$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('radio')
<div class="d-flex align-items-center flex-wrap border">
<div class="row row-cols-5 gx-0 w-100">
<div class="col h-100">
<div class="option-card d-flex flex-column align-items-center">
<div class="bg-white">&nbsp;</div>
<label class="form-check-label bg-light">Task</label>
</div>
</div>
@foreach($question->options as $option)
<div class="col">
<div class="option-card d-flex flex-column align-items-center form-check form-check-primary">
<label class="form-check-label bg-white" for="field-{{$question->code}}-{{$option->value}}">{{$option->display}}</label>
<div class="bg-light"><input class="form-check-input" type="radio" id="field-{{$question->code}}-{{$option->value}}" name="{{$question->code}}" value="{{$option->value}}" {{isset($question->value) && $question->value != '' && in_array($option->value, $question->value) ? 'checked':''}}></div>
</div>
</div>
@endforeach
</div>
</div>
@break
@case('file')
@if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != 'yes' ) )
<input type="file" id="field-{{$question->code}}" name="{{$question->code}}" class="form-control" value="" {{$question->required == 'yes'?'required':'' }}>
@elseif(isset($question->value))
<img src="{{$question->value}}" class="img-fluid">
@endif
@break
@case('multitextbox')
<div class="row">
@foreach($question->options as $option)
<div class="col-6">{{$option->display}}</div>
<div class="col-6 mb-1">
<input type="number" id="field-{{$option->value}}" name="{{$option->value}}" class="form-control" required value="{{isset($option->val)?$option->val:0}}">
</div>
@endforeach
</div>
@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> <!-- 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%;
}
.info-table.table > :not(caption) > * > * {
font-size: 13px;
}
.info-table.table tr td,
.info-table.table tr th {
min-width: 120px;
}
.info-table.table tr td {
font-size: 13px;
color: #333;
}
.info-table.table thead th {
background-color: #23408c;
color: #fff;
}
.info-table.table tr td:nth-child(2) {
background-color: #f4d0c0;
min-width: 120px;
}
.info-table.table tr td:nth-child(3) {
background-color: #c7eafd;
min-width: 150px;
}
.info-table.table tr td:nth-child(4) {
background-color: #d8ead2;
min-width: 200px;
}
.info-table.table tr td:nth-child(5) {
background-color: #d3d4e8;
min-width: 250px;
}
.info-table.table td ul {
padding-left: 0.8rem;
margin-bottom: 0;
}
label.label-with-info {
padding-right: 40px;
cursor: pointer;
}
label.label-with-info .btn {
position: absolute;
right: 0;
padding: 0 0.6rem;
border-radius: 15px;
background-color: #e9f0f4;
border-color: #d9d9d9;
color: #888;
}
label.label-with-info .btn i {
font-size: 16px;
line-height: 1.5;
transition: 0.2s ease;
}
label.label-with-info[aria-expanded="true"] .btn i {
transform: rotate(-180deg);
}
.option-card {
padding-left: 0rem;
padding-right: 0rem;
}
.option-card.form-check .form-check-input {
float: none;
margin-left: auto;
}
.option-card > label,
.option-card > div {
padding: 0.5rem;
flex-grow: 1;
text-align: center;
width: 100%;
}
.option-card .bg-light {
background-color: #e9f0f4 !important;
}
</style>
@include('layouts.shared/footer-script')
<script src="{{asset('assets/libs/sweetalert2/sweetalert2.min.js')}}"></script>
<script type="text/javascript">
jQuery(document).ready(function($){
$('#field-user_id').change(function(){
let hierarchy = $('option:selected', this).attr('hierarchy');
$('#field-hierarchy_id').val(hierarchy)
event.preventDefault();
$.ajax({
type: "GET",
url: '/form/getdoctorlist?partition={{$form->partition}}&hierarchy='+hierarchy,
processData: false,
contentType: false,
success: function( data ) {
$("#pageloader").fadeOut();
$('#field-contact_id').html('')
$('#field-contact_id').append($("<option></option>").attr("value",'').text('-- Select --'));
for(let itm of data) {
$('#field-contact_id').append($("<option></option>").attr("value",itm.value).text(itm.display));
}
},
});
console.log(hierarchy)
})
$('#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'
})
$('#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 plandateField = document.getElementById('field-record_date');
plandateField.setAttribute('max', today);
});
</script>
</body>
</html>