Merge branch 'main' of http://192.168.1.200:3000/Stratawiz/Rapport-Laravel
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m9s Details

This commit is contained in:
Tanuja Pansare 2026-06-22 15:18:04 +05:30
commit 71906fb85d
13 changed files with 2032 additions and 36 deletions

View File

@ -5,6 +5,7 @@
@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="/images/loader-large.gif" alt="processing..." />
@ -94,9 +95,13 @@
@endphp
<tr>
<td>
@if(isset($sub->formdata->execution_done) && $sub->formdata->execution_done == 'yes')
Executed
@else
<button type="button" class="btn btn-xs btn-info edit-btn"
plan_details="{{ json_encode($sub->formdata) }}"><i
class="mdi mdi-pencil"></i>Report</button>
@endif
</td>
<td>{{ $sub->formdata->plan_date }}</td>
<td>{{ isset($sub->formdata->execution_done) && $sub->formdata->execution_done == 'yes' ? 'Yes' : 'No' }}
@ -207,7 +212,8 @@
@break
@case('dropdown')
<select class="form-control" id="field-{{ $question->code }}" name="{{ $question->code }}" {{ $question->required == 'yes' ? 'required' : '' }}>
<select class="form-control"{!!($question->code
== 'contact_id')?'data-toggle="select2"':'' !!} id="field-{{ $question->code }}" name="{{ $question->code }}" {{ $question->required == 'yes' ? 'required' : '' }}>
<option value=""> -- Select -- </option>
@foreach ($question->options as $option)
@if($question->code == 'contact_id' && isset($option->contact->type) && $option->contact->type != 'Chemist' )
@ -394,8 +400,10 @@
</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();
$('#form-wrapper').hide()
$('#execution-form-wrapper').hide()
@ -428,7 +436,9 @@
e.preventDefault();
})
$('#execution-msl_code,#execution-speciality,execution-plan_date').prop('readonly',true);
$('#execution-msl_code,#execution-speciality,#execution-plan_date').prop('readonly',true);
$('#execution-plan_date').css('pointer-events', 'none');
$('#execution-plan_date').css('background', '#f2f2f2');
let selected = JSON.parse($(this).attr('plan_details'));
console.log("Plan Detail : ", selected);

View File

@ -65,7 +65,7 @@
<th>Execution Done</th>
<th>Execution Date</th>
<th>Camp Execution Date</th>
{{-- <th>Camp Execution Date</th> --}}
<th>Type of meet</th>
<th>Other type of meet</th>
<th>Location</th>
@ -84,9 +84,13 @@
@endphp
<tr>
<td>
@if(isset($sub->formdata->execution_done) && $sub->formdata->execution_done == 'yes')
Executed
@else
<button type="button" class="btn btn-xs btn-info edit-btn"
plan_details="{{ json_encode($sub->formdata) }}"><i
class="mdi mdi-pencil"></i>Report</button>
@endif
</td>
<td>{{ $sub->formdata->plan_date }}</td>
<td>{{ isset($sub->formdata->execution_done) && $sub->formdata->execution_done == 'yes' ? 'Yes' : 'No' }}
@ -96,8 +100,9 @@
<td>{{ $sub->formdata->execution_date }}</td>
<td>{{ isset($sub->formdata->type_of_meet) ? $sub->formdata->type_of_meet : '' }}</td>
<td>{{ isset($sub->formdata->location) ? $sub->formdata->location : '' }}</td>
<td>{{ isset($sub->formdata->other_type_of_meet) ? $sub->formdata->other_type_of_meet : '' }}</td>
<td>{{ isset($sub->formdata->location) ? $sub->formdata->location : '' }}</td>
{{-- <td>{{ isset($sub->formdata->module_type) ? $sub->formdata->module_type : '' }}</td> --}}
<td>{{ isset($sub->formdata->meeting_done) ? $sub->formdata->meeting_done : '' }}</td>
@ -422,6 +427,11 @@
$('#execution-location').prop('readonly', true)
$('#execution-plan_date').prop('readonly', true)
$('#execution-plan_date').css('pointer-events', 'none');
$('#execution-plan_date').css('background', '#f2f2f2');
$('#execution-uid').prop('readonly', true);
//$('#execution-time').prop('disabled', true)

View File

@ -5,6 +5,7 @@
@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="/images/loader-large.gif" alt="processing..." />
@ -30,12 +31,20 @@
<div class="col-8">
<h4 class="page-title">(RA-1) Catch Up Camp</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>
<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
@ -49,7 +58,7 @@
$form->user_id,
);
@endphp
<div class="col-12" id="table-wrapper">
@ -89,9 +98,13 @@
@endphp
<tr class="text-center">
<td>
@if(isset($sub->formdata->execution_done) && $sub->formdata->execution_done == 'yes')
Executed
@else
<button type="button" class="btn btn-xs btn-info edit-btn"
plan_details="{{ json_encode($sub->formdata) }}"><i
class="mdi mdi-pencil"></i>Report</button>
@endif
</td>
<td>{{ $sub->formdata->plan_date }}</td>
<td>{{ isset($sub->formdata->execution_done) && $sub->formdata->execution_done == 'yes' ? 'Yes' : 'No' }}
@ -195,7 +208,8 @@
@break
@case('dropdown')
<select class="form-control" id="field-{{ $question->code }}" name="{{ $question->code }}" {{ $question->required == 'yes' ? 'required' : '' }}>
<select class="form-control" {!!($question->code
== 'contact_id')?'data-toggle="select2"':'' !!} id="field-{{ $question->code }}" name="{{ $question->code }}" {{ $question->required == 'yes' ? 'required' : '' }}>
<option value=""> -- Select -- </option>
@foreach ($question->options as $option)
@if($question->code == 'contact_id' && isset($option->contact->type) && $option->contact->type != 'Chemist' )
@ -382,8 +396,10 @@
</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();
$('#form-wrapper').hide()
$('#execution-form-wrapper').hide()
@ -405,7 +421,8 @@
$('#execution-form-wrapper').show(100, () => {
$('#add-camp-btn').hide(0);
})
$('#table-wrapper').hide()
$('#table-wrapper').hide();
let contacts = document.getElementById('execution-contact_id');
contacts.addEventListener('mousedown', function(e) {
e.preventDefault();
@ -416,7 +433,9 @@
e.preventDefault();
})
$('#execution-msl_code,#execution-speciality,execution-plan_date').prop('readonly',true);
$('#execution-msl_code,#execution-speciality,#execution-plan_date').prop('readonly',true);
$('#execution-plan_date').css('pointer-events', 'none');
$('#execution-plan_date').css('background', '#f2f2f2');
let selected = JSON.parse($(this).attr('plan_details'));
console.log("Plan Detail : ", selected);

View File

@ -65,7 +65,7 @@
<th>Execution Done</th>
<th>Execution Date</th>
<th>Camp Execution Date</th>
<th>Type of meet</th>
<th>Other type of meet</th>
<th>Location</th>
@ -84,9 +84,13 @@
@endphp
<tr>
<td>
@if(isset($sub->formdata->execution_done) && $sub->formdata->execution_done == 'yes')
Executed
@else
<button type="button" class="btn btn-xs btn-info edit-btn"
plan_details="{{ json_encode($sub->formdata) }}"><i
class="mdi mdi-pencil"></i>Report</button>
@endif
</td>
<td>{{ $sub->formdata->plan_date }}</td>
<td>{{ isset($sub->formdata->execution_done) && $sub->formdata->execution_done == 'yes' ? 'Yes' : 'No' }}
@ -425,6 +429,10 @@
$('#execution-uid').prop('readonly', true);
//$('#execution-time').prop('disabled', true)
$('#execution-plan_date').css('pointer-events', 'none');
$('#execution-plan_date').css('background', '#f2f2f2');
let selected = JSON.parse($(this).attr('plan_details'));
console.log("Plan Detail : ", selected);

View File

@ -101,6 +101,8 @@ $brandData = [
['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'],
@ -519,6 +521,8 @@ if (!empty($submissions->data->submissions)) {
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,
@ -630,7 +634,7 @@ if (!empty($submissions->data->submissions)) {
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:["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"],

View File

@ -28,6 +28,8 @@ $brandData = [
['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'=>"CEFOPROX 100 30ML(60", 'slug'=>'cefoprox_100_30ml60_units','pseudoId'=>'cefoprox_100_30ml60_value'],
['brand'=>'CEFOPROX 100DT', 'slug'=>'cefoprox_100dt_units','pseudoId'=>'cefoprox_100dt_value'],
['brand'=>"CEFOPROX 200 10'S", 'slug'=>'cefoprox_200_10s_units','pseudoId'=>'cefoprox_200_10s_value'],
@ -448,6 +450,7 @@ if (!empty($submissions->data->submissions)) {
"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,
"cefoprox_100_30ml60": 195.91,
"cefoprox_100dt": 153.44,
"cefoprox_200_10s": 199.70,
@ -599,7 +602,8 @@ if (!empty($submissions->data->submissions)) {
"oflox_oz_tablets_ip",
"oflox_rediuse",
"oflox_200_mg_10s_tablets_ip",
"oflox_400_mg_10s_tablets_ip"
"oflox_400_mg_10s_tablets_ip",
"oflox_m_suspension"
],
cefoprox: ["cefoprox_100_30ml60","cefoprox_100dt","cefoprox_200_10s","cefoprox_50_30ml","cefoprox_cv_325_tab"],
cheston: ["cheston_duo_100ml_syrup","cheston_ls_junior_100_ml","cheston_d_cough_syrup_100_ml","cheston_d_plus_1_x_10s","cheston_ls_cough_syrup_100_ml","cheston_ls_junior_60_ml"],

View File

@ -47,7 +47,7 @@ $brandData = [
['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'=>'AZEE PULSE 3 TABLETS', 'slug'=>'azee_pulse_3_tablets_units','pseudoId'=>'azee_pulse_3_tablets_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'],
@ -61,7 +61,7 @@ $brandData = [
['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'=>"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'],
@ -86,13 +86,15 @@ $brandData = [
['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 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'],

View File

@ -22,7 +22,8 @@ $brandData = [
['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 EYE DROPS', 'slug'=>'oflox_eye_drops_units','pseudoId'=>'oflox_eye_drops_value'], */
['brand'=>"OFLOX M SUSPENSION", 'slug'=>'oflox_m_suspension_units','pseudoId'=>'oflox_m_suspension_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'],
@ -58,7 +59,7 @@ $brandData = [
['brand'=>'Mucinac AB Tablet', 'slug'=>'mucinac_ab_tablet_units','pseudoId'=>'mucinac_ab_tablet_value'],
['brand'=>"MUCINAC C Tablets 1 x 15'S", 'slug'=>'mucinac_c_tablets_1_x_15s_units','pseudoId'=>'mucinac_c_tablets_1_x_15s_value'],
/* ['brand'=>"MUCINAC C Tablets 1 x 15'S", 'slug'=>'mucinac_c_tablets_1_x_15s_units','pseudoId'=>'mucinac_c_tablets_1_x_15s_value'], */
['brand'=>"Mucinac Oral Solution 100ml", 'slug'=>'mucinac_oral_solution_100ml_units','pseudoId'=>'mucinac_oral_solution_100ml_value'],
['brand'=>'NOVAMOX 500', 'slug'=>'novamox_500_units','pseudoId'=>'novamox_500_value'],
['brand'=>"NOVAMOX 125 REDIUSE 30 ML", 'slug'=>'novamox_125_rediuse_30_ml_units','pseudoId'=>'novamox_125_rediuse_30_ml_value'],
@ -92,10 +93,10 @@ $brandData = [
['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'=>"NEKSIUM 20mg TAB (IP)", 'slug'=>'neksium_20mg_tab_ip_units','pseudoId'=>'neksium_20mg_tab_ip_value'],
/* ['brand'=>"NEKSIUM 20mg TAB (IP)", 'slug'=>'neksium_20mg_tab_ip_units','pseudoId'=>'neksium_20mg_tab_ip_value'],
['brand'=>"NEKSIUM 40mg TAB", 'slug'=>'neksium_40mg_tab_units','pseudoId'=>'neksium_40mg_tab_value'],
['brand'=>"NEKSIUM-D 20/30mg CAPS 15s (IP)", 'slug'=>'neksium_d_2030mg_caps_15s_ip_units','pseudoId'=>'neksium_d_2030mg_caps_15s_ip_value'],
['brand'=>"NEKSIUM-D 40/30mg CAPS 15s (IP)", 'slug'=>'neksium_d_4030mg_caps_15s_ip_units','pseudoId'=>'neksium_d_4030mg_caps_15s_ip_value'],
['brand'=>"NEKSIUM-D 40/30mg CAPS 15s (IP)", 'slug'=>'neksium_d_4030mg_caps_15s_ip_units','pseudoId'=>'neksium_d_4030mg_caps_15s_ip_value'],*/
['brand'=>"TASIRON 15 CHEW TABS 3X10'S (B12)", 'slug'=>'tasiron_15_chew_tabs_3x10s_b12_units','pseudoId'=>'tasiron_15_chew_tabs_3x10s_b12_value'],
['brand'=>"TASIRON 30 CHEW TABS", 'slug'=>'tasiron_30_chew_tabs_units','pseudoId'=>'tasiron_30_chew_tabs_value'],
['brand'=>"TASIRON DROPS 30ML WITH EXTERNAL DROPPER", 'slug'=>'tasiron_drops_30ml_with_external_dropper_units','pseudoId'=>'tasiron_drops_30ml_with_external_dropper_value'],

View File

@ -105,6 +105,13 @@
$otherMolecule = trim((string) $otherMolecule);
}
$otherMoleculeRxSupport = $formdata->other_molecule_rx_support ?? '';
if (is_array($otherMoleculeRxSupport) || $otherMoleculeRxSupport instanceof \Traversable) {
$otherMoleculeRxSupport = trim((string)(array_values((array)$otherMoleculeRxSupport)[0] ?? ''));
} else {
$otherMoleculeRxSupport = trim((string)$otherMoleculeRxSupport);
}
$recordDate = $formdata->record_date ?? '';
if (is_array($recordDate) || $recordDate instanceof \Traversable) {
$recordDate = trim((string) (array_values((array) $recordDate)[0] ?? ''));
@ -123,6 +130,7 @@
'doctor_name' => $doctorNameById[$doctorId] ?? $rawDoctorId,
'rx_support' => $rxSupport,
'other_molecule_use' => $otherMolecule,
'other_molecule_rx_support' => $otherMoleculeRxSupport ?? '',
'record_date' => $recordDate,
];
@ -193,6 +201,7 @@
'rx_support',
'other_molecule_use',
'molecule_use',
'other_molecule_rx_support',
];
@endphp
@ -339,17 +348,25 @@
<div class="col-md-12 mt-3">
<div class="card">
<div class="card-header">
<h5 class="mb-0">{{ ucwords($categoryLabel) }}</h5>
{{-- <h5 class="mb-0">{{ ucwords($categoryLabel) }}</h5> --}}
<h5 class="mb-0">
{{ $categoryLabel == 'nac + acebrophylline'
? 'NAC + Acebrophylline'
: ucwords($categoryLabel) }}
</h5>
</div>
<div class="card-body p-0">
<div class="table-responsive">
<table class="table table-bordered mb-0">
<thead>
<tr>
<th>Doctor Name</th>
<th>Rxn/Week Support</th>
<th>Other Molecule Use</th>
</tr>
<th>Doctor Name</th>
<th>Rxn/Week Support</th>
<th>Other Molecule Use</th>
<th class="other-rx-header" style="display:none;">
Other Molecule Rxn/Week Support
</th>
</tr>
</thead>
<tbody
class="doctor-table-body"
@ -370,6 +387,7 @@
</select>
</td>
<td>
<select class="form-control rx-support-select" required>
<option value="">-- Select --</option>
<option value="1-3 Rxn/Week">1-3 Rxn/Week</option>
@ -378,6 +396,7 @@
<option value=">11 Rxn/Week">&gt;11 Rxn/Week</option>
</select>
</td>
<td>
<select class="form-control other-molecule-select" required>
<option value="">-- Select --</option>
@ -387,6 +406,15 @@
<option value="No">No</option>
</select>
</td>
<td class="other-molecule-rx-cell" style="display:none;">
<select class="form-control other-molecule-rx-support">
<option value="">-- Select --</option>
<option value="1-3 Rxn/Week">1-3 Rxn/Week</option>
<option value="4-7 Rxn/Week">4-7 Rxn/Week</option>
<option value="8-11 Rxn/Week">8-11 Rxn/Week</option>
<option value=">11 Rxn/Week">&gt;11 Rxn/Week</option>
</select>
</td>
</tr>
@php $globalRowIndex++; @endphp
@endfor
@ -464,6 +492,17 @@ select option:disabled {
var categoryDoctorSubmissions = {!! json_encode($categoryDoctorSubmissions) !!};
jQuery(document).ready(function($){
$(document).on(
'change',
'.other-molecule-select',
function(){
toggleOtherMoleculeRxSupport(
$(this).closest('tr')
);
}
);
function getDoctorRows() {
let rows = [];
@ -529,6 +568,9 @@ select option:disabled {
.val(submission.rx_support || '');
$row.find('.other-molecule-select')
.val(submission.other_molecule_use || '');
$row.find('.other-molecule-rx-support')
.val(submission.other_molecule_rx_support || '');
toggleOtherMoleculeRxSupport($row);
setSubmissionId($row, submission.submission_id);
});
}
@ -538,8 +580,44 @@ select option:disabled {
prefillDoctorTableSection($(this), $(this).data('category'));
});
}
function checkOtherRxHeader(){
function updateDoctorDropdowns($tbody) {
let visible = false;
$('.other-molecule-rx-cell').each(function(){
if($(this).is(':visible')){
visible = true;
}
});
if(visible){
$('.other-rx-header').show();
}else{
$('.other-rx-header').hide();
}
}
function toggleOtherMoleculeRxSupport($row){
let value = $row.find('.other-molecule-select').val();
if(
value &&
value !== 'No'
){
$row.find('.other-molecule-rx-cell').show();
$('.other-rx-header').show();
}else{
$row.find('.other-molecule-rx-cell').hide();
$row.find('.other-molecule-rx-support').val('');
}
checkOtherRxHeader();
}
/* function updateDoctorDropdowns($tbody) {
let selectedDoctors = [];
$tbody.find('.doctor-select').each(function() {
@ -574,7 +652,47 @@ select option:disabled {
});
});
}
*/
function updateDoctorDropdowns() {
let selectedDoctors = [];
$('.doctor-select').each(function() {
let value = $(this).val();
if (value) {
selectedDoctors.push(value);
}
});
$('.doctor-select').each(function() {
let currentDropdown = $(this);
let currentValue = currentDropdown.val();
currentDropdown.find('option').each(function() {
let option = $(this);
let originalText = option.data('original-text') || option.text();
option.data('original-text', originalText);
option.text(originalText);
option.prop('disabled', false);
let optionValue = option.val();
if (
optionValue &&
optionValue !== currentValue &&
selectedDoctors.includes(optionValue)
) {
option.prop('disabled', true);
option.text(originalText + ' (Already Added)');
}
});
});
}
function updateOtherMoleculeDropdowns($tbody) {
let sectionMolecule = $tbody.data('molecule-use');
@ -600,7 +718,7 @@ select option:disabled {
function buildSubmitFormData() {
let fd = new FormData();
let form = $('#report-form')[0];
let rowFieldClasses = ['doctor-select', 'rx-support-select', 'other-molecule-select'];
let rowFieldClasses = ['doctor-select', 'rx-support-select', 'other-molecule-select', 'other-molecule-rx-support'];
Array.from(form.elements).forEach(function(el) {
if (!el.name || el.disabled) {
@ -652,6 +770,7 @@ select option:disabled {
fd.append('contact_id[]', $row.find('.doctor-select').val());
fd.append('rx_support[]', $row.find('.rx-support-select').val());
fd.append('other_molecule_use[]', $row.find('.other-molecule-select').val());
fd.append('other_molecule_rx_support[]', $row.find('.other-molecule-rx-support').val());
fd.append('molecule_use[]', item.moleculeUse);
let submissionId = $row.attr('data-submission-id');
@ -663,8 +782,11 @@ select option:disabled {
return fd;
}
$(document).on('change', '.doctor-select', function() {
/*$(document).on('change', '.doctor-select', function() {
updateDoctorDropdowns($(this).closest('.doctor-table-body'));
});*/
$(document).on('change', '.doctor-select', function() {
updateDoctorDropdowns();
});
$('.doctor-select').select2({
@ -675,12 +797,18 @@ select option:disabled {
prefillAllDoctorTables();
$('.doctor-table-body').each(function() {
/* $('.doctor-table-body').each(function() {
let $tbody = $(this);
updateOtherMoleculeDropdowns($tbody);
updateDoctorDropdowns($tbody);
}); */
$('.doctor-table-body').each(function() {
let $tbody = $(this);
updateOtherMoleculeDropdowns($tbody);
});
updateDoctorDropdowns();
$('#report-form').on('submit', function(event) {
event.preventDefault();
@ -692,6 +820,7 @@ select option:disabled {
processData: false,
contentType: false,
success: function(data) {
$("#pageloader").fadeOut();
if (data.status == 'success') {
Swal.fire({

View File

@ -90,7 +90,24 @@
</option>
@endif
@endforeach
<option value="others">Others</option>
<option value="others"
{{ isset($question->value) && $question->value == 'others' ? 'selected' : '' }}>
Others
</option>
@elseif ($question->code == 'name_of_other_hcp')
@foreach ($question->options as $option)
@if(!isset($option->contact->ciphaler_rxber) || trim($option->contact->ciphaler_rxber) == '')
<option value="{{ $option->value }}"
pcode="{{ isset($option->contact->pcode) ? $option->contact->pcode : '' }}"
msl_code="{{ isset($option->contact->msl_code) ? $option->contact->msl_code : '' }}"
{{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }}>
{{ $option->display }}
</option>
@endif
@endforeach
@else
@foreach ($question->options as $option)
<option value="{{ $option->value }}" pcode="{{isset($option->contact->pcode)?$option->contact->pcode:''}}" msl_code="{{isset($option->contact->msl_code)?$option->contact->msl_code:''}}" {{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }}>
@ -181,6 +198,12 @@
<script src="{{asset('assets/libs/sweetalert2/sweetalert2.min.js')}}"></script>
<script type="text/javascript">
jQuery(document).ready(function($){
if($('#field-contact_id').val() === 'others'){
$('#field-name_of_other_hcp,#field-p_code_of_other_hcp')
.parent().show();
$('#field-msl_code').parent().hide();
}
var today = new Date().toISOString().split('T')[0];
$('#field-record_date').attr('max', today);
@ -243,7 +266,7 @@
$('#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'))
})

View File

@ -28,7 +28,7 @@
<br>
@endif
<div class="col-8">
<h4 class="page-title">Report Novel Meet</h4>
<h4 class="page-title">Novel Meet</h4>
</div>
@if (!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval !=
'yes'))
@ -170,7 +170,7 @@
</option>
@endforeach
<option value="Other">Other</option>
</select>
@break
@ -288,7 +288,7 @@
<div class="doctor-group-wrapper">
<div class="row">
<div class="col-6"><h4>Add Doctors</h4></div>
<div class="col-6"><h4>Add Attendee/Speaker</h4></div>
{{-- <div class="col-6"><button class="btn btn-info btn-xs float-end" type="button" id="add-doctor">Add</button></div>
</div> --}}
<div class="doctor-group row">
@ -475,7 +475,7 @@
$('.doctor-group-wrapper').show();
// आधीचे सर्व जनरेट झालेले ग्रुप्स साफ करा
$('.execution-doctor-group-wrapper').empty();
if (attendees <= 0) {
@ -498,10 +498,29 @@
doctor_html = doctor_html.replaceAll('pcode_of_wrapper_doctor', 'pcode_of_wrapper_doctor_' + count);
doctor_html = doctor_html.replaceAll('speaker_name', 'speaker_name_' + count);
// Label text change
doctor_html = doctor_html.replace(
/>\s*HCP Name 1\s*</g,
'>HCP Name ' + count + '<'
);
doctor_html = doctor_html.replace(
/>\s*P\s*Code 1\s*</g,
'>P Code ' + count + '<'
);
doctor_html = doctor_html.replace(
/>\s*Speaker\/\s*Attendee 1\s*</g,
'>Speaker/Attendee ' + count + '<'
);
$('.execution-doctor-group-wrapper').append(
'<div class="doctor-group row">' + doctor_html + '</div>'
);
updateDoctorOptions();
(function(c) {
$('#field-hcp_name_' + c).change(function() {
@ -510,7 +529,7 @@
$('#field-pcode_of_wrapper_doctor_' + c).val(selectedOption.attr('msl_code'));
// २. सर्वात महत्त्वाचे: या ड्रॉपडाउनची 'value' बदलून थेट डॉक्टरांचे 'नाव' सेट करा
let doctorName = selectedOption.text().trim();
if(doctorName !== "" && doctorName !== "-- Select --") {
selectedOption.val(doctorName);
@ -521,6 +540,60 @@
});
function updateDoctorOptions() {
let selectedDoctors = [];
$('[id^="field-hcp_name"]').each(function () {
let val = $(this).val();
if (val) {
selectedDoctors.push(val);
}
});
$('[id^="field-hcp_name"]').each(function () {
let currentValue = $(this).val();
$(this).find('option').each(function () {
let optionValue = $(this).val();
if (
optionValue &&
optionValue !== currentValue &&
selectedDoctors.includes(optionValue)
) {
$(this).prop('disabled', true);
} else {
$(this).prop('disabled', false);
}
});
});
}
$(document).on('change', '[id^="field-hcp_name"]', function () {
let currentVal = $(this).val();
let duplicate = false;
$('[id^="field-hcp_name"]').not(this).each(function () {
if ($(this).val() === currentVal && currentVal !== '') {
duplicate = true;
}
});
if (duplicate) {
alert('This doctor is already selected.');
$(this).val('');
}
updateDoctorOptions();
});
$('#field-hcp_name').change(function() {
$('#field-pcode_of_wrapper_doctor').val($('option:selected', this).attr('msl_code'))
})
@ -562,6 +635,7 @@
$('#execution-plan_date').prop('readonly', true);
$('#execution-msl_code').prop('readonly',true);
$('#execution-expected_no_of_attendees').prop('readonly',true);
$('#execution-name_of_additional_speaker').prop('readonly',true);
let contacts = document.getElementById('execution-contact_id');
@ -615,6 +689,10 @@
$('#execution-hcp_name,#execution-pcode_of_wrapper_doctor,#execution-speaker_name').parent().hide();
$('#execution-hcp_name,#execution-pcode_of_wrapper_doctor,#execution-speaker_name').attr('required',false);
document.querySelectorAll('[id^="field-pcode_of_wrapper_doctor"]')
.forEach(function(el) {
el.readOnly = true;
});
})

View File

@ -0,0 +1,493 @@
<!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}}">
<input type="hidden" name="user_id" value="{{$form->user_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">
<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="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)
@if($question->code == 'contact_id' && isset($option->contact->type) && $option->contact->type == 'doctor' )
<option value="{{ $option->value }}"
@if(isset($question->value) && $question->value == $option->value) selected @endif
@if($question->code == 'contact_id')
msl_code="{{ (isset($option->contact->msl_code) ? $option->contact->msl_code : '') }}"
speciality="{{ (isset($option->contact->speciality) ? $option->contact->speciality : '') }}"
@endif
>
{{ $option->display }}
</option>
@elseif($question->code != 'contact_id')
<option value="{{ $option->value }}" {{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }} {{ $question->code == 'contact_id' ? 'pcode= ' . (isset($option->contact->pcode)?$option->contact->pcode:'') . ' ' : '' }} {{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }} {{ $question->code == 'contact_id' ? 'speciality= ' . (isset($option->contact->speciality) ? $option->contact->speciality :'') . ' ' : '' }} >
{{ $option->display }}
</option>
@endif
@endforeach
{{-- @if($question->code=='contact_id')
<option value="others" {{ isset($question->value) && $question->value == 'others' ? 'selected' : '' }}>Others</option>
@endif --}}
</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">
@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
@case('time')
<input type="time"
id="field-{{$question->code}}"
name="{{$question->code}}"
class="form-control"
{{$question->required == 'yes' ? 'required' : ''}}
value="{{isset($question->value) ? $question->value : ''}}">
@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 type="text/javascript">
jQuery(document).ready(function($){
$('#field-total_value_rx_bf_clinic')
.prop('readonly', true)
.closest('.col-md-12')
.hide();
function calculateTotalRxValue() {
let total = 0;
total += (parseInt($('#field-glycohale_f_capsules').val()) || 0) * 326;
total += (parseInt($('#field-glycohale_fb').val()) || 0) * 431;
total += (parseInt($('#field-foracort_g_400_rotacaps').val()) || 0) * 431;
total += (parseInt($('#field-glycohale_fb_inhaler').val()) || 0) * 665;
total += (parseInt($('#field-foracort_g_inhaler').val()) || 0) * 665;
total += (parseInt($('#field-glycohale_fb_synchrobreathe').val()) || 0) * 668;
total += (parseInt($('#field-foracort_g_synchrobreathe').val()) || 0) * 668;
total += (parseInt($('#field-glycohale_f_inhaler').val()) || 0) * 315;
total += (parseInt($('#field-glycohale_f_synchrobreathe').val()) || 0) * 353;
total += (parseInt($('#field-foracort_g_400_ciphaler').val()) || 0) * 784;
total += (parseInt($('#field-glycohale_fb_ciphaler').val()) || 0) * 784;
$('#field-total_value_rx_bf_clinic').val(total);
}
$(document).on('input',
'#field-glycohale_f_capsules,\
#field-glycohale_fb,\
#field-foracort_g_400_rotacaps,\
#field-glycohale_fb_inhaler,\
#field-foracort_g_inhaler,\
#field-glycohale_fb_synchrobreathe,\
#field-foracort_g_synchrobreathe,\
#field-glycohale_f_inhaler,\
#field-glycohale_f_synchrobreathe,\
#field-foracort_g_400_ciphaler,\
#field-glycohale_fb_ciphaler',
calculateTotalRxValue
);
$('#field-total_value_rx_bf_clinic').prop('readonly', true);
// selfie_upload_along_educator
$('#field-selfie_upload_along_educator').on('change', function () {
const file = this.files[0];
if (!file) return;
const allowedTypes = [
'image/jpeg',
'image/jpg',
'image/png'
];
if (!allowedTypes.includes(file.type)) {
Swal.fire({
icon: 'error',
title: 'Invalid File',
text: 'Only JPG, JPEG and PNG files are allowed.'
});
$(this).val('');
}
});
$('#field-selfie_upload_along_educator')
.attr('accept', '.jpg,.jpeg,.png,.pdf');
const maxSize = 10 * 1024 * 1024; // 10 MB
$('#field-upload_invoice_photo_max_10_mb, #field-selfie_upload_along_educator')
.on('change', function () {
const file = this.files[0];
if (!file) return;
if (file.size > maxSize) {
Swal.fire({
icon: 'error',
title: 'File Too Large',
text: 'Maximum file size allowed is 10 MB.'
});
$(this).val('');
}
});
$('#field-selfie_upload_along_educator')
.attr('accept', 'image/*')
.attr('capture', 'environment');
$('input[type="number"]').on('input', function () {
let value = $(this).val();
// Remove decimal point and minus sign
value = value.replace(/[^0-9]/g, '');
$(this).val(value);
});
$('#field-user_id').change(function(){
let hierarchy = $('option:selected', this).attr('hierarchy');
$('#field-hierarchy_id').val(hierarchy)
event.preventDefault();
$("#pageloader").fadeIn();
$.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).attr("msl_code", itm.contact.msl_code).attr('speciality',itm.contact.speciality));
}
$('#field-contact_id').change(function() {
$('#field-msl_code').val($('option:selected', this).attr('msl_code'))
})
$('#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-msl_code,#field-speciality').attr('readonly',true);
/* $('#field-other_doctor_name,#field-other_speciality,#field-other_msl_code').prop({"required":false});
$('#field-other_doctor_name,#field-other_speciality,#field-other_msl_code').parent().hide();
$('#field-contact_id').on('change',function(){
let dropDown=$('#field-contact_id').val();
if(dropDown==='others'){
$('#field-other_doctor_name,#field-other_speciality,#field-other_msl_code').parent().show();
$('#field-other_doctor_name,#field-other_speciality,#field-other_msl_code').prop({"required":true});
$('#field-speciality,#field-msl_code').parent().hide();
$('#field-speciality,#field-msl_code').prop({"required":false});
}
else{
$('#field-other_doctor_name,#field-other_speciality,#field-other_msl_code').parent().hide();
$('#field-other_doctor_name,#field-other_speciality,#field-other_msl_code').prop({"required":false});
$('#field-speciality,#field-msl_code').parent().show();
$('#field-speciality,#field-msl_code').prop({"required":true});
}
})*/
// $('#field-contact_id').append('<option value="others">Others</option>');
/*
$('#field-sitazit_d_rx,#field-sitazit_dm_rx,#field-ziten_m_rx').on('input', function() {
var total=(
(parseInt($('#execution-sitazit_d_rx').val())*15 ||0)+
(parseInt($('#execution-sitazit_dm_rx').val())*25 ||0)+
(parseInt($('#execution-ziten_m_rx').val())*35 ||0)
);
$('#execution-total_camp_rx').val(total)
}) */
$('#field-file_upload').on('change', function () {
let file = this.files[0];
if (file) {
let allowedTypes = ['image/png', 'image/jpg', 'image/jpeg'];
let maxSize = 10 * 1024 * 1024; // 10 MB
// Type validation
if (!allowedTypes.includes(file.type)) {
alert('Only PNG, JPG, and JPEG files are allowed.');
$(this).val('');
return;
}
// Size validation
if (file.size > maxSize) {
alert('File size should not exceed 10 MB.');
$(this).val('');
return;
}
}
});
$(document).ready(function () {
$('#field-contact_id').trigger('change');
});
$('#field-city,#field-state,#field-departmental_head_name').on('input', function () {
this.value = this.value.replace(/[^a-zA-Z\s]/g, '');
});
$('#report-form').on('submit', function(event){
event.preventDefault();
// At least one brand should have value > 0
let brandFields = [
'#field-glycohale_f_capsules',
'#field-glycohale_fb',
'#field-foracort_g_400_rotacaps',
'#field-glycohale_fb_inhaler',
'#field-foracort_g_inhaler',
'#field-glycohale_fb_synchrobreathe',
'#field-foracort_g_synchrobreathe',
'#field-glycohale_f_inhaler',
'#field-glycohale_f_synchrobreathe',
'#field-foracort_g_400_ciphaler',
'#field-glycohale_fb_ciphaler'
];
let hasValue = false;
brandFields.forEach(function(field) {
if ((parseInt($(field).val()) || 0) > 0) {
hasValue = true;
}
});
if (!hasValue) {
Swal.fire({
icon: 'error',
title: 'Validation Error',
text: 'From all 11 brands, at least one field should be greater than 0.'
});
return false;
}
const formData = new FormData($('#report-form')[0]);
// Log form data to console
for (let [key, value] of formData.entries()) {
console.log(key, value);
}
$("#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'
}).then(() => {
location.reload(); // 🔥 page refresh here
});
$('#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>