799 lines
43 KiB
PHP
799 lines
43 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/select2/select2.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>
|
|
@php
|
|
$brandData = [
|
|
|
|
['brand'=>'ACIVIR 200 DT', 'slug'=>'acivir_200_dt_units','pseudoId'=>'acivir_200_dt_value'],
|
|
['brand'=>'ACIVIR 400 DT', 'slug'=>'acivir_400_dt_units','pseudoId'=>'acivir_400_dt_value'],
|
|
['brand'=>'Acivir 400 DT 10s', 'slug'=>'acivir_400_dt_10s_units','pseudoId'=>'acivir_400_dt_10s_value'],
|
|
['brand'=>'ACIVIR 800 DT', 'slug'=>'acivir_800_dt_units','pseudoId'=>'acivir_800_dt_value'],
|
|
['brand'=>'Acivir 800 DT Tablets 1X10s', 'slug'=>'acivir_800_dt_tablets_1x10s_units','pseudoId'=>'acivir_800_dt_tablets_1x10s_value'],
|
|
['brand'=>'ACIVIR CREAM 10 GM', 'slug'=>'acivir_cream_10_gm_units','pseudoId'=>'acivir_cream_10_gm_value'],
|
|
['brand'=>'Advent 1000 MG', 'slug'=>'advent_1000_mg_units','pseudoId'=>'advent_1000_mg_value'],
|
|
['brand'=>"ADVENT 457 DT 6'S", 'slug'=>'advent_457_dt_6s_units','pseudoId'=>'advent_457_dt_6s_value'],
|
|
['brand'=>'Advent 457 DT Tablets', 'slug'=>'advent_457_dt_tablets_units','pseudoId'=>'advent_457_dt_tablets_value'],
|
|
['brand'=>'ADVENT 625 TABLETS 10S', 'slug'=>'advent_625_tablets_10s_units','pseudoId'=>'advent_625_tablets_10s_value'],
|
|
['brand'=>'ADVENT DROPS 10ML', 'slug'=>'advent_drops_10ml_units','pseudoId'=>'advent_drops_10ml_value'],
|
|
['brand'=>'ADVENT ES', 'slug'=>'advent_es_units','pseudoId'=>'advent_es_value'],
|
|
['brand'=>'ADVENT FORTE 457 SYP 60 ML', 'slug'=>'advent_forte_457_syp_60_ml_units','pseudoId'=>'advent_forte_457_syp_60_ml_value'],
|
|
['brand'=>'ADVENT FORTE SYP 30M', 'slug'=>'advent_forte_syp_30m_units','pseudoId'=>'advent_forte_syp_30m_value'],
|
|
['brand'=>'ADVENT KID 228.5 TAB', 'slug'=>'advent_kid_2285_tab_units','pseudoId'=>'advent_kid_2285_tab_value'],
|
|
['brand'=>'ADVENT SYP 228.5MG', 'slug'=>'advent_syp_2285mg_units','pseudoId'=>'advent_syp_2285mg_value'],
|
|
['brand'=>'ADVENT SYRUP', 'slug'=>'advent_syrup_units','pseudoId'=>'advent_syrup_value'],
|
|
['brand'=>'AZEE - 500 TABS', 'slug'=>'azee_500_tabs_units','pseudoId'=>'azee_500_tabs_value'],
|
|
['brand'=>'AZEE 100 D/S 15ML', 'slug'=>'azee_100_ds_15ml_units','pseudoId'=>'azee_100_ds_15ml_value'],
|
|
['brand'=>'AZEE 100 DT', 'slug'=>'azee_100_dt_units','pseudoId'=>'azee_100_dt_value'],
|
|
|
|
['brand'=>'AZEE 100 IP 100MG/5ML (15ML)', 'slug'=>'azee_100_ip_100mg5ml_15ml_units','pseudoId'=>'azee_100_ip_100mg5ml_15ml_value'],
|
|
['brand'=>'AZEE 100 XL DRY SYRU', 'slug'=>'azee_100_xl_dry_syru_units','pseudoId'=>'azee_100_xl_dry_syru_value'],
|
|
['brand'=>'AZEE 100 XL Liquids 30 ml (100mg/5ml)', 'slug'=>'azee_100_xl_liquids_30_ml_100mg5ml_units','pseudoId'=>'azee_100_xl_liquids_30_ml_100mg5ml_value'],
|
|
['brand'=>'AZEE 1000', 'slug'=>'azee_1000_units','pseudoId'=>'azee_1000_value'],
|
|
['brand'=>'AZEE 200 D/S 15ML', 'slug'=>'azee_200_ds_15ml_units','pseudoId'=>'azee_200_ds_15ml_value'],
|
|
['brand'=>'AZEE 200 IP 200MG/5ML (15ML)', 'slug'=>'azee_200_ip_200mg5ml_15ml_units','pseudoId'=>'azee_200_ip_200mg5ml_15ml_value'],
|
|
['brand'=>'AZEE 200 XL DRY SYRU', 'slug'=>'azee_200_xl_dry_syru_units','pseudoId'=>'azee_200_xl_dry_syru_value'],
|
|
['brand'=>"AZEE 200 XL Liquids 30 ml (200mg/5ml)", 'slug'=>'azee_200_xl_liquids_30_ml_200mg5ml_units','pseudoId'=>'azee_200_xl_liquids_30_ml_200mg5ml_value'],
|
|
['brand'=>"AZEE 250 TABLETS(10'S)", 'slug'=>'azee_250_tablets10s_units','pseudoId'=>'azee_250_tablets10s_value'],
|
|
['brand'=>'AZEE 250 TABS', 'slug'=>'azee_250_tabs_units','pseudoId'=>'azee_250_tabs_value'],
|
|
|
|
['brand'=>"AZEE 500 Tablets 1 x 5'S", 'slug'=>'azee_500_tablets_1_x_5s_units','pseudoId'=>'azee_500_tablets_1_x_5s_value'],
|
|
['brand'=>"AZEE 500 TABLETS 5'S", 'slug'=>'azee_500_tablets_5s_units','pseudoId'=>'azee_500_tablets_5s_value'],
|
|
/* ['brand'=>'AZEE PULSE 3 TABLETS', 'slug'=>'azee_pulse_3_tablets_units','pseudoId'=>'azee_pulse_3_tablets_value'] ,*/
|
|
|
|
['brand'=>"Bilafav M", 'slug'=>'bilafav_m_units','pseudoId'=>'bilafav_m_value'],
|
|
['brand'=>"Bilafav M ODT Adult Tablets 1x10s - 20/10", 'slug'=>'bilafav_m_odt_adult_tablets_1x10s_2010_units','pseudoId'=>'bilafav_m_odt_adult_tablets_1x10s_2010_value'],
|
|
['brand'=>"Bilafav M ODT Pedia Tablets 1X10s 10/4", 'slug'=>'bilafav_m_odt_pedia_tablets_1x10s_104_units','pseudoId'=>'bilafav_m_odt_pedia_tablets_1x10s_104_value'],
|
|
|
|
['brand'=>"Bilafav M Oral suspension", 'slug'=>'bilafav_m_oral_suspension_units','pseudoId'=>'bilafav_m_oral_suspension_value'],
|
|
|
|
|
|
['brand'=>"CIVONO 10 MG TABLETS 10'S", 'slug'=>'civono_10_mg_tablets_10s_units','pseudoId'=>'civono_10_mg_tablets_10s_value'],
|
|
['brand'=>"CIVONO 20 MG TABLETS 10'S", 'slug'=>'civono_20_mg_tablets_10s_units','pseudoId'=>'civono_20_mg_tablets_10s_value'],
|
|
['brand'=>'COREX-DX COUGH SYRUP 100ML (IP)', 'slug'=>'corex_dx_cough_syrup_100ml_ip_units','pseudoId'=>'corex_dx_cough_syrup_100ml_ip_value'],
|
|
['brand'=>'COREX-DX COUGH SYRUP 50ML (IP)', 'slug'=>'corex_dx_cough_syrup_50ml_ip_units','pseudoId'=>'corex_dx_cough_syrup_50ml_ip_value'],
|
|
['brand'=>"Cpink 200ml", 'slug'=>'cpink_200ml_units','pseudoId'=>'cpink_200ml_value'],
|
|
['brand'=>"CPINK DROPS - 15ML", 'slug'=>'cpink_drops_15ml_units','pseudoId'=>'cpink_drops_15ml_value'],
|
|
['brand'=>'CPINK SUSPENSION - 150ML', 'slug'=>'cpink_suspension_150ml_units','pseudoId'=>'cpink_suspension_150ml_value'],
|
|
|
|
|
|
['brand'=>"FAROBACT 200", 'slug'=>'farobact_200_units','pseudoId'=>'farobact_200_value'],
|
|
['brand'=>"FAROBACT 200 TABS 1 x 10 S", 'slug'=>'farobact_200_tabs_1_x_10_s_units','pseudoId'=>'farobact_200_tabs_1_x_10_s_value'],
|
|
['brand'=>'Farobact 300 ER TABLETS', 'slug'=>'farobact_300_er_tablets_units','pseudoId'=>'farobact_300_er_tablets_value'],
|
|
['brand'=>"FAROBACT 300 ER TABS 10 S", 'slug'=>'farobact_300_er_tabs_10_s_units','pseudoId'=>'farobact_300_er_tabs_10_s_value'],
|
|
/* ['brand'=>"Farobact Dry Syrup", 'slug'=>'farobact_dry_syrup_units','pseudoId'=>'farobact_dry_syrup_value'] ,*/
|
|
['brand'=>'FLOMIST AQ. 100MD', 'slug'=>'flomist_aq_100md_units','pseudoId'=>'flomist_aq_100md_value'],
|
|
['brand'=>'Flomist F 240 MD', 'slug'=>'flomist_f_240_md_units','pseudoId'=>'flomist_f_240_md_value'],
|
|
['brand'=>"Flomist F 27.5 MCG 120 MD", 'slug'=>'flomist_f_275_mcg_120_md_units','pseudoId'=>'flomist_f_275_mcg_120_md_value'],
|
|
['brand'=>"IBUGESIC PLUS TABLETS 20'S", 'slug'=>'ibugesic_plus_tablets_20s_units','pseudoId'=>'ibugesic_plus_tablets_20s_value'],
|
|
['brand'=>"IBUGESIC PLUS TABLETS 20'S IP", 'slug'=>'ibugesic_plus_tablets_20s_ip_units','pseudoId'=>'ibugesic_plus_tablets_20s_ip_value'],
|
|
|
|
['brand'=>"OMNIX 100 D/S", 'slug'=>'omnix_100_ds_units','pseudoId'=>'omnix_100_ds_value'],
|
|
['brand'=>"OMNIX 100 DRY SYRUP", 'slug'=>'omnix_100_dry_syrup_units','pseudoId'=>'omnix_100_dry_syrup_value'],
|
|
['brand'=>'OMNIX 100 DT TAB', 'slug'=>'omnix_100_dt_tab_units','pseudoId'=>'omnix_100_dt_tab_value'],
|
|
['brand'=>"OMNIX 200 DT TAB", 'slug'=>'omnix_200_dt_tab_units','pseudoId'=>'omnix_200_dt_tab_value'],
|
|
['brand'=>"OMNIX 50 DRY SYRUP", 'slug'=>'omnix_50_dry_syrup_units','pseudoId'=>'omnix_50_dry_syrup_value'],
|
|
['brand'=>'OMNIX 50 DT', 'slug'=>'omnix_50_dt_units','pseudoId'=>'omnix_50_dt_value'],
|
|
['brand'=>'OMNIX CV 200 TAB', 'slug'=>'omnix_cv_200_tab_units','pseudoId'=>'omnix_cv_200_tab_value'],
|
|
['brand'=>"OMNIX O", 'slug'=>'omnix_o_units','pseudoId'=>'omnix_o_value'],
|
|
['brand'=>"Emeset 4 ODT/India/1 X 10'S", 'slug'=>'emeset_4_odtindia1_x_10s_units','pseudoId'=>'emeset_4_odtindia1_x_10s_value'],
|
|
['brand'=>"EMESET 4MG (10'S)", 'slug'=>'emeset_4mg_10s_units','pseudoId'=>'emeset_4mg_10s_value'],
|
|
|
|
['brand'=>"EMESET 8MG (10'S)", 'slug'=>'emeset_8mg_10s_units','pseudoId'=>'emeset_8mg_10s_value'],
|
|
['brand'=>"EMESET SYRUP", 'slug'=>'emeset_syrup_units','pseudoId'=>'emeset_syrup_value'],
|
|
['brand'=>'EMESET SYRUP STRAWBERRY 30 ML', 'slug'=>'emeset_syrup_strawberry_30_ml_units','pseudoId'=>'emeset_syrup_strawberry_30_ml_value'],
|
|
['brand'=>"OFLOX 100mg REDIUSE 60ML", 'slug'=>'oflox_100mg_rediuse_60ml_units','pseudoId'=>'oflox_100mg_rediuse_60ml_value'],
|
|
['brand'=>"OFLOX 200 TAB (10'S)", 'slug'=>'oflox_200_tab_10s_units','pseudoId'=>'oflox_200_tab_10s_value'],
|
|
['brand'=>"OFLOX 400 10'S", 'slug'=>'oflox_400_10s_units','pseudoId'=>'oflox_400_10s_value'],
|
|
['brand'=>'OFLOX 50MG REDIUSE 60ML', 'slug'=>'oflox_50mg_rediuse_60ml_units','pseudoId'=>'oflox_50mg_rediuse_60ml_value'],
|
|
/* ['brand'=>"OFLOX EYE DROPS", 'slug'=>'oflox_eye_drops_units','pseudoId'=>'oflox_eye_drops_value'] ,*/
|
|
['brand'=>"OFLOX OZ TABLETS IP", 'slug'=>'oflox_oz_tablets_ip_units','pseudoId'=>'oflox_oz_tablets_ip_value'],
|
|
['brand'=>"OFLOX REDIUSE", 'slug'=>'oflox_rediuse_units','pseudoId'=>'oflox_rediuse_value'],
|
|
|
|
|
|
['brand'=>"OFLOX-200 MG 10's TABLETS (IP)", 'slug'=>'oflox_200_mg_10s_tablets_ip_units','pseudoId'=>'oflox_200_mg_10s_tablets_ip_value'],
|
|
['brand'=>"OFLOX-400 MG 10's TABLETS (IP)", 'slug'=>'oflox_400_mg_10s_tablets_ip_units','pseudoId'=>'oflox_400_mg_10s_tablets_ip_value'],
|
|
['brand'=>"OFLOX M SUSPENSION", 'slug'=>'oflox_m_suspension_units','pseudoId'=>'oflox_m_suspension_value'],
|
|
|
|
['brand'=>'EMSET R 10 x 10 TABLETS', 'slug'=>'emset_r_10_x_10_tablets_units','pseudoId'=>'emset_r_10_x_10_tablets_value'],
|
|
['brand'=>"Montair AB Tablet", 'slug'=>'montair_ab_tablet_units','pseudoId'=>'montair_ab_tablet_value'],
|
|
['brand'=>"Pansec 80 MG Tablets", 'slug'=>'pansec_80_mg_tablets_units','pseudoId'=>'pansec_80_mg_tablets_value'],
|
|
['brand'=>"PANSEC D SR CAPSULES 15'S", 'slug'=>'pansec_d_sr_capsules_15s_units','pseudoId'=>'pansec_d_sr_capsules_15s_value'],
|
|
['brand'=>"PANSEC TABLETS 15'S", 'slug'=>'pansec_tablets_15s_units','pseudoId'=>'pansec_tablets_15s_value'],
|
|
['brand'=>"PANSEC-L CAPSULES", 'slug'=>'pansec_l_capsules_units','pseudoId'=>'pansec_l_capsules_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">
|
|
<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}}">
|
|
<input type="hidden" name="record_date" value="" id="field-record_date">
|
|
@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">
|
|
|
|
|
|
<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')
|
|
@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="0.01"
|
|
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)
|
|
@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
|
|
</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')
|
|
@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">
|
|
<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 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%;
|
|
}
|
|
</style>
|
|
@include('layouts.shared/footer-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">
|
|
jQuery(document).ready(function($) {
|
|
$('[data-toggle="select2"]').select2();
|
|
let selected_user_id = ''
|
|
$('#field-user_id').change(function() {
|
|
$("#pageloader").fadeIn();
|
|
selected_user_id = $(this).val()
|
|
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) {
|
|
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)
|
|
})
|
|
|
|
$('#field-contact_id').change(function() {
|
|
$('#field-speciality').val($('option:selected', this).attr('speciality'))
|
|
});
|
|
|
|
$('#field-contact_id').change(function() {
|
|
$('#field-msl_code').val($('option:selected', this).attr('msl_code'))
|
|
});
|
|
|
|
|
|
$('#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);
|
|
|
|
$('#field-speciality,#field-msl_code').attr('readonly',true);
|
|
|
|
$('#field-pob_type').on('change',function(){
|
|
let value=$(this).val();
|
|
console.log("Value is : ",value);
|
|
if(value==='Doctor'){
|
|
$('#field-chemist_name').parent().hide();
|
|
$('#field-chemist_name').attr('required',false);
|
|
$('#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);
|
|
|
|
}
|
|
})
|
|
|
|
|
|
|
|
|
|
const products = {
|
|
acivir_200_dt: 61.91,
|
|
acivir_400_dt: 55.60,
|
|
acivir_400_dt_10s: 111.20,
|
|
acivir_800_dt: 153.27,
|
|
acivir_800_dt_tablets_1x10s: 306.54,
|
|
acivir_cream_10_gm: 139.18,
|
|
|
|
advent_1000_mg: 421.74,
|
|
advent_457_dt_6s: 140.34,
|
|
advent_457_dt_tablets: 257.26,
|
|
advent_625_tablets_10s: 148.95,
|
|
advent_drops_10ml: 100.57,
|
|
advent_es: 163.03,
|
|
advent_forte_457_syp_60_ml: 227.76,
|
|
advent_forte_syp_30m: 184.18,
|
|
advent_kid_2285_tab: 174.67,
|
|
advent_syp_2285mg: 98.87,
|
|
advent_syrup: 49.43,
|
|
|
|
azee_500_tabs: 57.55,
|
|
azee_100_ds_15ml: 39.64,
|
|
azee_100_dt: 29.05,
|
|
azee_100_ip_100mg5ml_15ml: 39.64,
|
|
azee_100_xl_dry_syru: 80.00,
|
|
azee_100_xl_liquids_30_ml_100mg5ml: 80.00,
|
|
azee_1000: 47.02,
|
|
azee_200_ds_15ml: 41.62,
|
|
azee_200_ip_200mg5ml_15ml: 41.62,
|
|
azee_200_xl_dry_syru: 83.28,
|
|
azee_200_xl_liquids_30_ml_200mg5ml: 83.28,
|
|
azee_250_tablets10s: 94.96,
|
|
azee_250_tabs: 56.97,
|
|
azee_500_tablets_1_x_5s: 95.91,
|
|
azee_500_tablets_5s: 95.91,
|
|
azee_pulse_3_tablets: 57.55,
|
|
|
|
civono_10_mg_tablets_10s: 78.57,
|
|
civono_20_mg_tablets_10s: 121.42,
|
|
|
|
corex_dx_cough_syrup_100ml_ip: 121.78,
|
|
corex_dx_cough_syrup_50ml_ip: 80.37,
|
|
|
|
cpink_200ml: 246.62,
|
|
cpink_drops_15ml: 94.42,
|
|
cpink_suspension_150ml: 138.97,
|
|
|
|
farobact_200: 495.21,
|
|
farobact_200_tabs_1_x_10_s: 998.67,
|
|
farobact_300_er_tablets: 543.80,
|
|
farobact_300_er_tabs_10_s: 1096.66,
|
|
farobact_dry_syrup: 423.50,
|
|
|
|
flomist_aq_100md: 367.44,
|
|
flomist_f_240_md: 616.78,
|
|
flomist_f_275_mcg_120_md: 444.50,
|
|
|
|
ibugesic_plus_tablets_20s: 31.61,
|
|
ibugesic_plus_tablets_20s_ip: 31.61,
|
|
|
|
omnix_100_ds: 58.31,
|
|
omnix_100_dry_syrup: 116.64,
|
|
omnix_100_dt_tab: 87.48,
|
|
omnix_200_dt_tab: 79.59,
|
|
omnix_50_dry_syrup: 39.83,
|
|
omnix_50_dt: 55.54,
|
|
omnix_cv_200_tab: 291.61,
|
|
omnix_o: 183.71,
|
|
|
|
emeset_4_odtindia1_x_10s: 41.83,
|
|
emeset_4mg_10s: 41.83,
|
|
emeset_8mg_10s: 73.75,
|
|
emeset_syrup: 30.71,
|
|
emeset_syrup_strawberry_30_ml: 30.71,
|
|
|
|
oflox_100mg_rediuse_60ml: 141.25,
|
|
oflox_200_tab_10s: 84.19,
|
|
oflox_400_10s: 305.58,
|
|
oflox_50mg_rediuse_60ml: 66.78,
|
|
oflox_eye_drops: 38.58,
|
|
oflox_oz_tablets_ip: 157.25,
|
|
oflox_rediuse: 66.78,
|
|
oflox_200_mg_10s_tablets_ip: 84.19,
|
|
oflox_400_mg_10s_tablets_ip: 305.58,
|
|
oflox_m_suspension: 68.57,
|
|
|
|
|
|
emset_r_10_x_10_tablets: 60.09,
|
|
|
|
montair_ab_tablet: 238.11,
|
|
|
|
pansec_80_mg_tablets: 226.21,
|
|
pansec_d_sr_capsules_15s: 235.22,
|
|
pansec_tablets_15s: 197.71,
|
|
pansec_l_capsules: 132.21,
|
|
|
|
bilafav_m: 167.31,
|
|
bilafav_m_odt_pedia_tablets_1x10s_104: 55.31,
|
|
bilafav_m_odt_adult_tablets_1x10s_2010: 100.62,
|
|
|
|
|
|
bilafav_m_oral_suspension: 140.69
|
|
};
|
|
|
|
$(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));
|
|
|
|
}
|
|
|
|
});
|
|
|
|
$('#field-total_pob_value').val(totalValue.toFixed(1));
|
|
$('#field-total_pob_units').val(totalUnits);
|
|
|
|
$.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
|
|
}
|
|
}
|
|
});
|
|
|
|
|
|
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"],
|
|
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"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
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));
|
|
}
|
|
|
|
|
|
|
|
|
|
$('#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').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");
|
|
$('#field-user_id').val(selected_user_id)
|
|
$('#field-user_id').trigger("change");
|
|
} 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> |