Pulmocare (Pulmothron POB)
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m42s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m42s
Details
This commit is contained in:
parent
ab4d1403e7
commit
4755c66fa2
|
|
@ -1,13 +1,76 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
@include('layouts.shared/title-meta', ['title' => "Form"])
|
@include('layouts.shared/title-meta', ['title' => "Form"])
|
||||||
@include('layouts.shared/head-css', ["mode" => $mode ?? '', "demo" => $demo ?? ''])
|
@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/sweetalert2/sweetalert2.min.css')}}" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="{{ asset('assets/libs/select2/select2.min.css') }}" rel="stylesheet" type="text/css" />
|
||||||
</head>
|
</head>
|
||||||
<div id="pageloader">
|
<div id="pageloader">
|
||||||
<img src="http://cdnjs.cloudflare.com/ajax/libs/semantic-ui/0.16.1/images/loader-large.gif" alt="processing..." />
|
<img src="http://cdnjs.cloudflare.com/ajax/libs/semantic-ui/0.16.1/images/loader-large.gif" alt="processing..." />
|
||||||
</div>
|
</div>
|
||||||
|
@php
|
||||||
|
$brandData = [
|
||||||
|
|
||||||
|
['brand'=>"BUDASURE PULMULES (2ML)", 'slug'=>'budasure_pulmules_2ml_units','pseudoId'=>'budasure_pulmules_2ml_value'],
|
||||||
|
['brand'=>"CLEARNEB PULMULES 3% W/V", 'slug'=>'clearneb_pulmules_3_w_v_units','pseudoId'=>'clearneb_pulmules_3_w_v_value'],
|
||||||
|
['brand'=>"FIBNIB CAPSULES 100 (10'S)", 'slug'=>'fibnib_capsules_100_10s_units','pseudoId'=>'fibnib_capsules_100_10s_value'],
|
||||||
|
['brand'=>"FIBNIB CAPSULES 150 (10'S)", 'slug'=>'fibnib_capsules_150_10s_units','pseudoId'=>'fibnib_capsules_150_10s_value'],
|
||||||
|
['brand'=>"GLYCOQUIC PULMULES 25MCG (2ML)", 'slug'=>'glycoquic_pulmules_25mcg_2ml_units','pseudoId'=>'glycoquic_pulmules_25mcg_2ml_value'],
|
||||||
|
|
||||||
|
['brand'=>"INNOHALER DPI DEVICE", 'slug'=>'innohaler_dpi_device_units','pseudoId'=>'innohaler_dpi_device_value'],
|
||||||
|
['brand'=>"INNOSPACER", 'slug'=>'innospacer_units','pseudoId'=>'innospacer_value'],
|
||||||
|
['brand'=>"IPRASURE LS PULMULES (2.5 ML)", 'slug'=>'iprasure_ls_pulmules_2_5_ml_units','pseudoId'=>'iprasure_ls_pulmules_2_5_ml_value'],
|
||||||
|
['brand'=>"IPRASURE PULMULES (2.5 ML)", 'slug'=>'iprasure_pulmules_2_5_ml_units','pseudoId'=>'iprasure_pulmules_2_5_ml_value'],
|
||||||
|
['brand'=>"PULMOSMART 1MG PULMULES (2 ML)", 'slug'=>'pulmosmart_1mg_pulmules_2_ml_units','pseudoId'=>'pulmosmart_1mg_pulmules_2_ml_value'],
|
||||||
|
|
||||||
|
['brand'=>"PULMOSMART 200 PULMICAPS (30'S)", 'slug'=>'pulmosmart_200_pulmicaps_30s_units','pseudoId'=>'pulmosmart_200_pulmicaps_30s_value'],
|
||||||
|
['brand'=>"PULMOSMART 400 PULMICAPS (30'S)", 'slug'=>'pulmosmart_400_pulmicaps_30s_units','pseudoId'=>'pulmosmart_400_pulmicaps_30s_value'],
|
||||||
|
['brand'=>"PULMOSMART DOSE COUNTER MDI 200 INHALER", 'slug'=>'pulmosmart_dose_counter_mdi_200_inhaler_units','pseudoId'=>'pulmosmart_dose_counter_mdi_200_inhaler_value'],
|
||||||
|
['brand'=>"PULMOSMART DOSE COUNTER MDI 400 INHALER", 'slug'=>'pulmosmart_dose_counter_mdi_400_inhaler_units','pseudoId'=>'pulmosmart_dose_counter_mdi_400_inhaler_value'],
|
||||||
|
['brand'=>"PULMOSMART G PULMICAPS (30'S)", 'slug'=>'pulmosmart_g_pulmicaps_30s_units','pseudoId'=>'pulmosmart_g_pulmicaps_30s_value'],
|
||||||
|
|
||||||
|
['brand'=>"PULMOSMART PULMULES (2 ML)", 'slug'=>'pulmosmart_pulmules_2_ml_units','pseudoId'=>'pulmosmart_pulmules_2_ml_value'],
|
||||||
|
['brand'=>"QUICNAC AB TABLETS (100/600 MG)(10'S)", 'slug'=>'quicnac_ab_tablets_100_600_mg_10s_units','pseudoId'=>'quicnac_ab_tablets_100600_mg10s_value'],
|
||||||
|
['brand'=>"QUICNAC TABLETS 600MG (10'S)", 'slug'=>'quicnac_tablets_600mg_10s_units','pseudoId'=>'quicnac_tablets_600mg_10s_value'],
|
||||||
|
['brand'=>"RAPILEVO PULMULES (2.5 ML)", 'slug'=>'rapilevo_pulmules_25_ml_units','pseudoId'=>'rapilevo_pulmules_25_ml_value'],
|
||||||
|
['brand'=>"VILORESP U PULMICAPS (30'S)", 'slug'=>'viloresp_u_pulmicaps_30s_units','pseudoId'=>'viloresp_u_pulmicaps_30s_value'],
|
||||||
|
['brand'=>"ZADONASE TABLETS (10'S)", 'slug'=>'zadonase_tablets_10s_units','pseudoId'=>'zadonase_tablets_10s_value'],
|
||||||
|
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
@php
|
||||||
|
$submissions = Formhelper::getMultiformData($form->partition, $form_id, $form->user_id);
|
||||||
|
/* $submission = null;
|
||||||
|
if(isset($submissions->data->submissions) && count($submissions->data->submissions) > 0) {
|
||||||
|
$submission = $submissions->data->submissions[1];
|
||||||
|
$formdata = $submission->formdata ?? (object)[];
|
||||||
|
} else {
|
||||||
|
$formdata = [];
|
||||||
|
} */
|
||||||
|
|
||||||
|
|
||||||
|
$formdata = null;
|
||||||
|
|
||||||
|
if (!empty($submissions->data->submissions)) {
|
||||||
|
foreach ($submissions->data->submissions as $submission) {
|
||||||
|
if ($submission->id == $id) {
|
||||||
|
$formdata = $submission->formdata ?? null;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
|
||||||
<body class="loading">
|
<body class="loading">
|
||||||
<div class="account-pages">
|
<div class="account-pages">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
@ -21,14 +84,11 @@
|
||||||
@if(session('success'))<div class=" alert alert-success">{{ session('success') }}
|
@if(session('success'))<div class=" alert alert-success">{{ session('success') }}
|
||||||
</div>
|
</div>
|
||||||
<br>@endif
|
<br>@endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<h4 class="page-title">{{$form->title}}</h4>
|
<h4 class="page-title">{{$form->title}}</h4>
|
||||||
</div>
|
</div>
|
||||||
@if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != 'yes' ) )
|
@if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != 'yes'
|
||||||
|
) )
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
@if($form->link_type == 'form')
|
@if($form->link_type == 'form')
|
||||||
<a href="/form/history" class="float-end pt-1">View History</a>
|
<a href="/form/history" class="float-end pt-1">View History</a>
|
||||||
|
|
@ -42,27 +102,24 @@
|
||||||
<h6>Submitted By: {{$form->user_info->name}}</h6>
|
<h6>Submitted By: {{$form->user_info->name}}</h6>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@php
|
|
||||||
$submissions = Formhelper::getMultiformData( $form->partition, $form_id, $form->user_id);
|
|
||||||
$submissions = $submissions->data->submissions;
|
|
||||||
|
|
||||||
|
|
||||||
@endphp
|
|
||||||
@if(count($submissions) <= 29 )
|
|
||||||
<form method="POST" action="/form/submit" id="report-form" enctype="multipart/form-data">
|
<form method="POST" action="/form/submit" id="report-form" enctype="multipart/form-data">
|
||||||
<input type="hidden" name="form_id" value="{{$form_id}}">
|
<input type="hidden" name="form_id" value="{{$form_id}}">
|
||||||
|
<input type="hidden" name="record_date" value="" id="field-record_date">
|
||||||
@csrf
|
@csrf
|
||||||
@if($id)
|
@if($id)
|
||||||
<input type="hidden" name="id" value="{{$id}}">
|
<input type="hidden" name="id" value="{{$id}}">
|
||||||
@endif
|
@endif
|
||||||
@if(isset($form->manager_can_submit) && $form->manager_can_submit == true)
|
@if(isset($form->manager_can_submit) && $form->manager_can_submit == true)
|
||||||
<div class="col-md-12 mb-2">
|
<div class="col-md-12 mb-2">
|
||||||
<label for="field-user_id" class="form-label"> Select User / Territory <span class="text-danger">*</span> </label>
|
<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>
|
<select class="form-control" id="field-user_id" name="user_id" required>
|
||||||
<option value=""> -- Select -- </option>
|
<option value=""> -- Select -- </option>
|
||||||
@foreach($form->users as $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>
|
<option value="{{$option->value}}" hierarchy="{{$option->hierarchy_id}}"
|
||||||
|
{{isset($question->value) && $question->value == $option->value ? 'selected':''}}>
|
||||||
|
{{$option->display}}
|
||||||
|
</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
</select>
|
</select>
|
||||||
<input type="hidden" id="field-hierarchy_id" name="hierarchy_id" value="">
|
<input type="hidden" id="field-hierarchy_id" name="hierarchy_id" value="">
|
||||||
|
|
@ -70,46 +127,71 @@
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@foreach($questions as $question)
|
@foreach($questions as $question)
|
||||||
@if($question->code == 'doctor_name' || $question->code == 'msl_code')
|
|
||||||
@continue;
|
|
||||||
@endif
|
|
||||||
<div class="col-md-12 mb-2">
|
<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>
|
|
||||||
|
|
||||||
|
<label for="field-{{$question->code}}" class="form-label">{{$question->question}}
|
||||||
|
{!!$question->required == 'yes' ? '<span class="text-danger">*</span>':''!!}
|
||||||
|
</label>
|
||||||
@switch($question->type)
|
@switch($question->type)
|
||||||
@case('hidden')
|
@case('hidden')
|
||||||
<input type="{{$question->type}}" id="field-{{$question->code}}" name="{{$question->code}}" value="{{isset($question->value)?$question->value:''}}">
|
<input type="{{$question->type}}" id="field-{{$question->code}}"
|
||||||
|
name="{{$question->code}}"
|
||||||
|
value="{{isset($question->value)?$question->value:''}}">
|
||||||
@break
|
@break
|
||||||
@case('text')
|
@case('text')
|
||||||
@case('email')
|
@case('email')
|
||||||
@case('tel')
|
@case('tel')
|
||||||
@case('date')
|
@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:''}}">
|
<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
|
@break
|
||||||
@case('number')
|
@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}}">
|
<input type="{{$question->type}}" min="0" max="9999999999" step="0.01"
|
||||||
|
id="field-{{$question->code}}" name="{{$question->code}}" class="form-control"
|
||||||
|
{{$question->required == 'yes'?'required':'' }}
|
||||||
|
value="{{isset($question->value)?$question->value:0}}">
|
||||||
@break
|
@break
|
||||||
@case('textarea')
|
@case('textarea')
|
||||||
<textarea id="field-{{$question->code}}" name="{{$question->code}}" class="form-control" {{$question->required == 'yes'?'required':'' }}>{{isset($question->value)?$question->value:''}}</textarea>
|
<textarea id="field-{{$question->code}}" name="{{$question->code}}"
|
||||||
|
class="form-control"
|
||||||
|
{{$question->required == 'yes'?'required':'' }}>{{isset($question->value)?$question->value:''}}</textarea>
|
||||||
@break
|
@break
|
||||||
@case('dropdown')
|
@case('dropdown')
|
||||||
<select class="form-control" id="field-{{ $question->code }}" name="{{ $question->code }}" {{ $question->required == 'yes' ? 'required' : '' }}>
|
<select class="form-control" id="field-{{ $question->code }}" name="{{ $question->code }}" {{ $question->required == 'yes' ? 'required' : '' }}>
|
||||||
<option value=""> -- Select -- </option>
|
<option value=""> -- Select -- </option>
|
||||||
@foreach ($question->options as $option)
|
@foreach ($question->options as $option)
|
||||||
<option value="{{$option->value}}" {{isset($question->value) && $question->value == $option->value ? 'selected':''}}>{{$option->display}}</option>
|
@php $spec = $option->contact->speciality ?? ''; @endphp
|
||||||
|
<option value="{{ $option->value }}"
|
||||||
|
{{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }}
|
||||||
|
msl_code="{{ $option->contact->msl_code ?? '' }}"
|
||||||
|
speciality="{{ $spec }}">
|
||||||
|
{{ $option->display }}
|
||||||
|
</option>
|
||||||
|
|
||||||
|
|
||||||
@endforeach
|
@endforeach
|
||||||
</select>
|
</select>
|
||||||
@break
|
@break
|
||||||
@case('checkbox')
|
@case('checkbox')
|
||||||
@foreach($question->options as $option)
|
@foreach($question->options as $option)
|
||||||
<div class="form-check mb-2 form-check-primary">
|
<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':''}}>
|
<input class="form-check-input" type="checkbox"
|
||||||
<label class="form-check-label" for="field-{{$question->code}}-{{$option->value}}">{{$option->display}}</label>
|
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>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
@break
|
@break
|
||||||
@case('file')
|
@case('file')
|
||||||
@if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != 'yes' ) )
|
@if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval
|
||||||
<input type="file" id="field-{{$question->code}}" name="{{$question->code}}" class="form-control" value="" {{$question->required == 'yes'?'required':'' }}>
|
!= 'yes' ) )
|
||||||
|
<input type="file" id="field-{{$question->code}}" name="{{$question->code}}"
|
||||||
|
class="form-control" value="" {{$question->required == 'yes'?'required':'' }}>
|
||||||
@elseif(isset($question->value))
|
@elseif(isset($question->value))
|
||||||
<img src="{{$question->value}}" class="img-fluid">
|
<img src="{{$question->value}}" class="img-fluid">
|
||||||
@endif
|
@endif
|
||||||
|
|
@ -117,30 +199,56 @@
|
||||||
@break
|
@break
|
||||||
@case('multitextbox')
|
@case('multitextbox')
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@foreach($question->options as $option)
|
<div style="width: auto; overflow-y: auto; overflow-x: auto;">
|
||||||
|
<table class="table tableclass">
|
||||||
|
<thead id="heading">
|
||||||
|
<tr>
|
||||||
|
<th>Brand</th>
|
||||||
|
<th>Units</th>
|
||||||
|
<th>Value</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach($brandData as $brand)
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<td>{{ $brand['brand'] }}</td>
|
||||||
|
<td>
|
||||||
|
<input type="number" id="field-{{ $brand['slug'] }}"
|
||||||
|
name="{{ $brand['slug'] }}"
|
||||||
|
class="form-control form-control-large" value="{{ $id && isset($formdata) && isset($formdata->{$brand['slug']}) ? $formdata->{$brand['slug']} : 0 }}" >
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="number" id="field-{{ $brand['pseudoId'] }}"
|
||||||
|
name="{{ $brand['pseudoId'] }}"
|
||||||
|
class="form-control form-control-large" readonly="true" value="{{ $id && isset($formdata) && isset($formdata->{$brand['pseudoId']}) ? $formdata->{$brand['pseudoId']} : 0 }}">
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- @foreach($question->options as $option)
|
||||||
<div class="col-6">{{$option->display}}</div>
|
<div class="col-6">{{$option->display}}</div>
|
||||||
<div class="col-6 mb-1">
|
<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}}">
|
<input type="number" id="field-{{$option->value}}" name="{{$option->value}}" class="form-control" required value="{{isset($option->val)?$option->val:0}}">
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach -->
|
||||||
</div>
|
</div>
|
||||||
@break
|
@break
|
||||||
@endswitch
|
@endswitch
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
<div class=" mb-2" id="doctor_msl_wrapper">
|
@if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval !=
|
||||||
|
'yes' ) )
|
||||||
</div>
|
|
||||||
@if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != 'yes' ) )
|
|
||||||
<div class="text-center d-grid mt-3">
|
<div class="text-center d-grid mt-3">
|
||||||
<button class="btn btn-primary" type="submit" id="submit-btn"> Submit </button>
|
<button class="btn btn-primary" type="submit" id="submit-btn"> Submit </button>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
</form>
|
</form>
|
||||||
@else
|
|
||||||
<h4 class="text-center" >You have already submitted 30 Dotcors</h4>
|
|
||||||
|
|
||||||
@endif
|
|
||||||
|
|
||||||
</div> <!-- end card-body -->
|
</div> <!-- end card-body -->
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -175,106 +283,323 @@
|
||||||
</style>
|
</style>
|
||||||
@include('layouts.shared/footer-script')
|
@include('layouts.shared/footer-script')
|
||||||
<script src="{{asset('assets/libs/sweetalert2/sweetalert2.min.js')}}"></script>
|
<script src="{{asset('assets/libs/sweetalert2/sweetalert2.min.js')}}"></script>
|
||||||
|
<script src="{{ asset('assets/libs/select2/select2.min.js') }}"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery(document).ready(function($) {
|
jQuery(document).ready(function($) {
|
||||||
|
$('[data-toggle="select2"]').select2();
|
||||||
|
let selected_user_id = ''
|
||||||
$('#field-user_id').change(function() {
|
$('#field-user_id').change(function() {
|
||||||
let hierarchy = $('option:selected', this).attr('hierarchy');
|
$("#pageloader").fadeIn();
|
||||||
|
selected_user_id = $(this).val()
|
||||||
|
hierarchy = $('option:selected', this).attr('hierarchy');
|
||||||
$('#field-hierarchy_id').val(hierarchy)
|
$('#field-hierarchy_id').val(hierarchy)
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: '/form/getdoctorlist?partition={{$form->partition}}&hierarchy='+hierarchy,
|
url: '/form/getdoctorlist?partition={{$form->partition}}&hierarchy=' +
|
||||||
|
hierarchy,
|
||||||
processData: false,
|
processData: false,
|
||||||
contentType: false,
|
contentType: false,
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
$("#pageloader").fadeOut();
|
$("#pageloader").fadeOut();
|
||||||
$('#field-contact_id').html('')
|
$('#field-contact_id').html('')
|
||||||
$('#field-contact_id').append($("<option></option>").attr("value",'').text('-- Select --'));
|
$('#field-contact_id').append($("<option></option>").attr("value", '')
|
||||||
|
.text('-- Select --'));
|
||||||
for (let itm of data) {
|
for (let itm of data) {
|
||||||
$('#field-contact_id').append($("<option></option>").attr("value",itm.value).text(itm.display));
|
if(itm.contact.c2c == 'Yes') {
|
||||||
|
$('#field-contact_id').append($("<option></option>").attr("value",
|
||||||
|
itm.value).text(itm.display).attr("speciality", itm
|
||||||
|
.contact.speciality));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#field-contact_id').change(function() {
|
||||||
|
$('#field-speciality').val($('option:selected', this).attr(
|
||||||
|
'speciality'))
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(hierarchy)
|
console.log(hierarchy)
|
||||||
})
|
})
|
||||||
|
|
||||||
// let doctor_html = `<div class="col-md-12 mb-2">
|
$('#field-contact_id').change(function() {
|
||||||
// <label for="field-doctor_name_${i}" class="form-label">Doctor Name <span class="text-danger">*</span> </label>
|
$('#field-speciality').val($('option:selected', this).attr('speciality'))
|
||||||
// <input type="text" id="field-doctor_name_${i}" name="doctor_name[]" class="form-control" value="" required>
|
});
|
||||||
// </div>
|
|
||||||
// <div class="col-md-12 mb-2">
|
|
||||||
// <label for="field-msl_code_${i}" class="form-label">MSL Code <span class="text-danger">*</span> </label>
|
|
||||||
// <input type="text" id="field-msl_code_${i}" name="msl_code[]" class="form-control" value="" required>
|
|
||||||
// </div>`;
|
|
||||||
|
|
||||||
let docNameFields = document.querySelectorAll('#field-doctor_name');
|
$('#field-contact_id').change(function() {
|
||||||
let mslCodeFields = document.querySelectorAll('#field-msl_code');
|
$('#field-msl_code').val($('option:selected', this).attr('msl_code'))
|
||||||
|
});
|
||||||
|
|
||||||
//Hide all doctor fields
|
|
||||||
hideDoctorFields();
|
|
||||||
// docNameFields.forEach((docField, index) => {
|
|
||||||
// if(index !== 0)
|
|
||||||
// $(docField).parent().hide();
|
|
||||||
// })
|
|
||||||
//Hide all msl code fields
|
|
||||||
hideMSLCodeFields()
|
|
||||||
// mslCodeFields.forEach((mslField, index) => {
|
|
||||||
// if(index !== 0)
|
|
||||||
// $(mslField).parent().hide();
|
|
||||||
// })
|
|
||||||
|
|
||||||
$('#field-quantity').on('change',function(){
|
$('#field-chemist_name,#field-contact_id,#field-msl_code,#field-speciality').parent().hide();
|
||||||
let qtyValue=parseInt($(this).val());
|
$('#field-chemist_name,#field-contact_id,#field-msl_code,#field-speciality').attr('required',false);
|
||||||
$('#doctor_msl_wrapper').html('')
|
|
||||||
for(let i = 1; i <= qtyValue; i++) {
|
$('#field-speciality,#field-msl_code').attr('readonly',true);
|
||||||
$('#doctor_msl_wrapper').append(`<div class="col-md-12 mb-2">
|
|
||||||
<label for="field-doctor_name_${i}" class="form-label">Doctor Name ${i}<span class="text-danger">*</span> </label>
|
$('#field-pob_type').on('change',function(){
|
||||||
<input type="text" id="field-doctor_name_${i}" name="doctor_name[]" class="form-control" value="" required>
|
let value=$(this).val();
|
||||||
</div>
|
console.log("Value is : ",value);
|
||||||
<div class="col-md-12 mb-2">
|
if(value==='Doctor'){
|
||||||
<label for="field-msl_code_${i}" class="form-label">MSL Code ${i}<span class="text-danger">*</span> </label>
|
$('#field-chemist_name').parent().hide();
|
||||||
<input type="text" id="field-msl_code_${i}" name="msl_code[]" class="form-control" value="" required>
|
$('#field-chemist_name').attr('required',false);
|
||||||
</div>`)
|
$('#field-contact_id,#field-msl_code,#field-speciality').parent().show();
|
||||||
|
$('#field-contact_id,#field-msl_code,#field-speciality').attr('required',true);
|
||||||
|
|
||||||
|
}
|
||||||
|
else if(value==='Chemist'){
|
||||||
|
$('#field-contact_id,#field-msl_code,#field-speciality').parent().hide();
|
||||||
|
$('#field-contact_id,#field-msl_code,#field-speciality').attr('required',false);
|
||||||
|
$('#field-chemist_name').parent().show();
|
||||||
|
$('#field-chemist_name').attr('required',true);
|
||||||
|
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$('#field-chemist_name,#field-contact_id,#field-msl_code,#field-speciality').parent().hide();
|
||||||
|
$('#field-chemist_name,#field-contact_id,#field-msl_code,#field-speciality').attr('required',false);
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
//hide doctor fields
|
|
||||||
function hideDoctorFields (){
|
|
||||||
docNameFields.forEach((docField, index) => {
|
|
||||||
if(index !== 0)
|
|
||||||
$(docField).parent().hide();
|
|
||||||
$(docField).prop({"required":false});
|
|
||||||
})
|
|
||||||
}
|
|
||||||
//hide msl code fields
|
|
||||||
function hideMSLCodeFields (){
|
|
||||||
mslCodeFields.forEach((mslField, index) => {
|
|
||||||
if(index !== 0)
|
|
||||||
$(mslField).parent().hide();
|
|
||||||
$(mslField).prop({"required":false});
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
|
const products = {
|
||||||
|
budasure_pulmules_2ml: 19.34,
|
||||||
|
clearneb_pulmules_3_wv: 14.63,
|
||||||
|
fibnib_capsules_100_10s: 710.7,
|
||||||
|
fibnib_capsules_150_10s: 842.86,
|
||||||
|
glycoquic_pulmules_25mcg_2ml: 42.13,
|
||||||
|
innohaler_dpi_device: 250.63,
|
||||||
|
|
||||||
|
innospacer: 408.57,
|
||||||
|
iprasure_ls_pulmules_25_ml: 16.34,
|
||||||
|
iprasure_pulmules_25_ml: 14.48,
|
||||||
|
pulmosmart_1mg_pulmules_2_ml: 59.24,
|
||||||
|
pulmosmart_200_pulmicaps_30s: 138.59,
|
||||||
|
pulmosmart_400_pulmicaps_30s: 164.02,
|
||||||
|
pulmosmart_dose_counter_mdi_200_inhaler: 288.96,
|
||||||
|
pulmosmart_dose_counter_mdi_400_inhaler: 329.28,
|
||||||
|
pulmosmart_g_pulmicaps_30s: 421.41,
|
||||||
|
pulmosmart_pulmules_2_ml: 62.44,
|
||||||
|
quicnac_ab_tablets_100600_mg10s: 139.81,
|
||||||
|
|
||||||
|
quicnac_tablets_600mg_10s: 229.41,
|
||||||
|
rapilevo_pulmules_25_ml: 11.43,
|
||||||
|
viloresp_u_pulmicaps_30s: 570.63,
|
||||||
|
zadonase_tablets_10s: 198.74,
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
$(document).on('input change', '[id^="field-"][id$="_units"]', function () {
|
||||||
|
|
||||||
|
let totalValue = 0;
|
||||||
|
let totalUnits = 0;
|
||||||
|
|
||||||
|
$.each(products, function (key, rate) {
|
||||||
|
|
||||||
|
let unitsField = $(`#field-${key}_units`);
|
||||||
|
let valueField = $(`#field-${key}_value`);
|
||||||
|
|
||||||
|
if (unitsField.length) {
|
||||||
|
|
||||||
|
let units = parseFloat(unitsField.val()) || 0;
|
||||||
|
|
||||||
|
let value = units * rate;
|
||||||
|
|
||||||
|
totalUnits += units;
|
||||||
|
totalValue += value;
|
||||||
|
|
||||||
|
valueField.val(value.toFixed(1));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//show doctor fields
|
});
|
||||||
function showDoctorFields (numOfFields){
|
|
||||||
docNameFields.forEach((docField, index) => {
|
$('#field-total_pob_value').val(totalValue.toFixed(1));
|
||||||
if(index < numOfFields)
|
$('#field-total_pob_units').val(totalUnits);
|
||||||
$(docField).parent().show();
|
|
||||||
})
|
$.each(productGroups, function(groupName, keys) {
|
||||||
|
calculateGroupTotals(groupName, keys);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('#field-total_pob_value,#field-total_pob_units').attr('readonly',true);
|
||||||
|
|
||||||
|
$('#field-pob_type').trigger('change');
|
||||||
|
|
||||||
|
$(document).on('input', '[id$="_units"]', function () {
|
||||||
|
// Remove anything that is not a digit
|
||||||
|
this.value = this.value.replace(/[^0-9]/g, '');
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#field-upload_supporting_document').on('change', function () {
|
||||||
|
let file = this.files[0];
|
||||||
|
if (file) {
|
||||||
|
let allowedTypes = ['image/png', 'image/jpg', 'image/jpeg'];
|
||||||
|
|
||||||
|
if (!allowedTypes.includes(file.type)) {
|
||||||
|
alert('Only PNG, JPG, and JPEG files are allowed.');
|
||||||
|
$(this).val(''); // reset input
|
||||||
}
|
}
|
||||||
//show msl code fields
|
}
|
||||||
function showMSLCodeFields (numOfFields){
|
});
|
||||||
mslCodeFields.forEach((mslField, index) => {
|
|
||||||
if(index < numOfFields)
|
|
||||||
$(mslField).parent().show();
|
const productGroups = {
|
||||||
})
|
acivir: ["acivir_200_dt","acivir_400_dt","acivir_400_dt_10s","acivir_800_dt","acivir_800_dt_tablets_1x10s","acivir_cream_10_gm","acivir_suspension"],
|
||||||
|
advent: [
|
||||||
|
"advent_1000_mg",
|
||||||
|
"advent_457_dt_6s",
|
||||||
|
"advent_457_dt_tablets",
|
||||||
|
"advent_625_tablets_10s",
|
||||||
|
"advent_drops_10ml",
|
||||||
|
"advent_es",
|
||||||
|
"advent_forte_457_syp_60_ml",
|
||||||
|
"advent_forte_syp_30m",
|
||||||
|
"advent_kid_2285_tab",
|
||||||
|
"advent_syp_2285mg",
|
||||||
|
"advent_syrup"
|
||||||
|
],
|
||||||
|
azee_solids: ["azee_500_tabs","azee_1000","azee_250_tablets10s","azee_250_tabs","azee_500_tablets_1_x_5s","azee_500_tablets_5s"],
|
||||||
|
azee_ped: ["azee_100_ds_15ml","azee_100_dt","azee_100_ip_100mg5ml_15ml","azee_100_xl_dry_syru","azee_100_xl_liquids_30_ml_100mg5ml","azee_200_ds_15ml","azee_200_ip_200mg5ml_15ml","azee_200_xl_dry_syru","azee_200_xl_liquids_30_ml_200mg5ml"],
|
||||||
|
bilafav: ["bilafav_m","bilafav_m_odt_adult_tablets_1x10s_2010","bilafav_m_odt_pedia_tablets_1x10s_104","bilafav_m_oral_suspension"],
|
||||||
|
civono:["civono_10_mg_tablets_10s","civono_20_mg_tablets_10s"],
|
||||||
|
corex:["corex_dx_cough_syrup_100ml_ip","corex_dx_cough_syrup_50ml_ip"],
|
||||||
|
cpink:["cpink_200ml","cpink_drops_15ml","cpink_suspension_150ml"],
|
||||||
|
farobact:["farobact_200","farobact_200_tabs_1_x_10_s","farobact_300_er_tablets","farobact_300_er_tabs_10_s"],
|
||||||
|
flomist:["flomist_aq_100md"],
|
||||||
|
flomist_f:["flomist_f_240_md","flomist_f_275_mcg_120_md"],
|
||||||
|
|
||||||
|
|
||||||
|
ibugesic:["ibugesic_plus_tablets_20s","ibugesic_plus_tablets_20s_ip"],
|
||||||
|
omnix:["omnix_100_ds","omnix_100_dry_syrup","omnix_100_dt_tab","omnix_200_dt_tab","omnix_50_dry_syrup","omnix_50_dt","omnix_cv_200_tab","omnix_o"],
|
||||||
|
junior_lanzol:["junior_lanzol_15","junior_lanzol_30"],
|
||||||
|
levoflox:["levoflox_250_10s_ip","levoflox_250_tab_10","levoflox_500_10s_ip","levoflox_500_10s","levoflox_750_5s_ip","levoflox_750_tab_5s","levoflox_infusion"],
|
||||||
|
metaspray:["metaspray_100aq"],
|
||||||
|
/* montair:["montair_fx_15s","montair_ab_tablet"], */
|
||||||
|
curkey:["curkey_kof_syrup_p_100ml","curkey_pastiles_10_x_10s","curkey_pastiles_100_mg_5_x_10s","curkey_pastilles_100mg_1_x_10s","curkey_syrup_60ml"],
|
||||||
|
nutramide:["nutramide_200_ml_syrup","nutramide_drops_15_ml"],
|
||||||
|
emeset:["emeset_4_odtindia1_x_10s","emeset_4mg_10s","emeset_8mg_10s","emeset_syrup","emeset_syrup_strawberry_30_ml"],
|
||||||
|
|
||||||
|
oflox:["oflox_100mg_rediuse_60ml","oflox_200_tab_10s","oflox_400_10s","oflox_50mg_rediuse_60ml","oflox_eye_drops","oflox_rediuse","oflox_200_mg_10s_tablets_ip","oflox_400_mg_10s_tablets_ip","oflox_m_suspension"],
|
||||||
|
oflox_oz:["oflox_oz_tablets_ip"],
|
||||||
|
emeset_r:["emset_r_10_x_10_tablets"],
|
||||||
|
montair:["montair_ab_tablet"],
|
||||||
|
pansec:["pansec_80_mg_tablets","pansec_d_sr_capsules_15s","pansec_tablets_15s","pansec_l_capsules"],
|
||||||
|
antiflu:["antiflu_syrup_75_ml"]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
function calculateGroupTotals(groupName, keys) {
|
||||||
|
let totalUnits = 0;
|
||||||
|
let totalValue = 0;
|
||||||
|
|
||||||
|
keys.forEach(key => {
|
||||||
|
totalUnits += parseInt($(`#field-${key}_units`).val()) || 0;
|
||||||
|
totalValue += parseFloat($(`#field-${key}_value`).val()) || 0;
|
||||||
|
});
|
||||||
|
|
||||||
|
$(`#field-${groupName}_units`).val(totalUnits);
|
||||||
|
$(`#field-${groupName}_value`).val(totalValue.toFixed(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#field-quantity').on('change',function(){
|
|
||||||
$('#report-form').append("<input type='hidden' name='actual_count' value=1 >");
|
|
||||||
})
|
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-acivir_units" name="acivir_units" />');
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-acivir_value" name="acivir_value" />');
|
||||||
|
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-advent_units" name="advent_units" />');
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-advent_value" name="advent_value" />');
|
||||||
|
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-azee_solids_units" name="azee_solids_units" />');
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-azee_solids_value" name="azee_solids_value" />');
|
||||||
|
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-azee_ped_units" name="azee_ped_units" />');
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-azee_ped_value" name="azee_ped_value" />');
|
||||||
|
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-bilafav_units" name="bilafav_units" />');
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-bilafav_value" name="bilafav_value" />');
|
||||||
|
|
||||||
|
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-civono_units" name="civono_units" />');
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-civono_value" name="civono_value" />');
|
||||||
|
|
||||||
|
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-corex_units" name="corex_units" />');
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-corex_value" name="corex_value" />');
|
||||||
|
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-cpink_units" name="cpink_units" />');
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-cpink_value" name="cpink_value" />');
|
||||||
|
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-farobact_units" name="farobact_units" />');
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-farobact_value" name="farobact_value" />');
|
||||||
|
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-flomist_units" name="flomist_units" />');
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-flomist_value" name="flomist_value" />');
|
||||||
|
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-flomist_f_units" name="flomist_f_units" />');
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-flomist_f_value" name="flomist_f_value" />');
|
||||||
|
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-ibugesic_units" name="ibugesic_units" />');
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-ibugesic_value" name="ibugesic_value" />');
|
||||||
|
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-omnix_units" name="omnix_units" />');
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-omnix_value" name="omnix_value" />');
|
||||||
|
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-junior_lanzol_units" name="junior_lanzol_units" />');
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-junior_lanzol_value" name="junior_lanzol_value" />');
|
||||||
|
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-levoflox_units" name="levoflox_units" />');
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-levoflox_value" name="levoflox_value" />');
|
||||||
|
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-metaspray_units" name="metaspray_units" />');
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-metaspray_value" name="metaspray_value" />');
|
||||||
|
|
||||||
|
/* $('#report-form').append('<input type="hidden" id="field-montair_units" name="montair_units" />');
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-montair_value" name="montair_value" />'); */
|
||||||
|
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-curkey_units" name="curkey_units" />');
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-curkey_value" name="curkey_value" />');
|
||||||
|
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-nutramide_units" name="nutramide_units" />');
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-nutramide_value" name="nutramide_value" />');
|
||||||
|
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-emeset_units" name="emeset_units" />');
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-emeset_value" name="emeset_value" />');
|
||||||
|
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-oflox_units" name="oflox_units" />');
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-oflox_value" name="oflox_value" />');
|
||||||
|
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-oflox_oz_units" name="oflox_oz_units" />');
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-oflox_oz_value" name="oflox_oz_value" />');
|
||||||
|
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-emeset_r_units" name="emeset_r_units" />');
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-emeset_r_value" name="emeset_r_value" />');
|
||||||
|
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-montair_units" name="montair_units" />');
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-montair_value" name="montair_value" />');
|
||||||
|
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-pansec_units" name="pansec_units" />');
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-pansec_value" name="pansec_value" />');
|
||||||
|
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-antiflu_units" name="antiflu_units" />');
|
||||||
|
$('#report-form').append('<input type="hidden" id="field-antiflu_value" name="antiflu_value" />');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#report-form').on('submit', function(event) {
|
$('#report-form').on('submit', function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
@ -282,7 +607,7 @@
|
||||||
$("#pageloader").fadeIn();
|
$("#pageloader").fadeIn();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: '/form/ajaxsubmitmultiple',
|
url: '/form/ajaxsubmit',
|
||||||
data: new FormData($('#report-form')[0]),
|
data: new FormData($('#report-form')[0]),
|
||||||
processData: false,
|
processData: false,
|
||||||
contentType: false,
|
contentType: false,
|
||||||
|
|
@ -295,6 +620,8 @@
|
||||||
icon: 'success'
|
icon: 'success'
|
||||||
})
|
})
|
||||||
$('#report-form').trigger("reset");
|
$('#report-form').trigger("reset");
|
||||||
|
$('#field-user_id').val(selected_user_id)
|
||||||
|
$('#field-user_id').trigger("change");
|
||||||
} else {
|
} else {
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
icon: 'error',
|
icon: 'error',
|
||||||
|
|
@ -316,6 +643,11 @@
|
||||||
|
|
||||||
plandateField.setAttribute('max', today);
|
plandateField.setAttribute('max', today);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue