1905 lines
122 KiB
PHP
1905 lines
122 KiB
PHP
<!DOCTYPE html>
|
||
<html lang="en">
|
||
|
||
<head>
|
||
@include('layouts.shared/title-meta', ['title' => 'Form'])
|
||
@include('layouts.shared/head-css', ['mode' => $mode ?? '', 'demo' => $demo ?? ''])
|
||
<link href="{{ asset('assets/libs/sweetalert2/sweetalert2.min.css') }}" rel="stylesheet" type="text/css" />
|
||
</head>
|
||
<div id="pageloader">
|
||
<img src="/images/loader-large.gif" alt="processing..." />
|
||
</div>
|
||
|
||
@php
|
||
// echo "<pre>";
|
||
// print_r($questions);
|
||
|
||
@endphp
|
||
|
||
@php
|
||
$brandData = [
|
||
|
||
['brand'=>'Vintor 4K', 'slug'=>'vintor_4k_units','pseudoId'=>'vintor_4k_week1','pseudoId2'=>'vintor_4k_week2','pseudoId3'=>'vintor_4k_week3','pseudoId4'=>'vintor_4k_week4'],
|
||
['brand'=>'Vintor 10K', 'slug'=>'vintor_10k_units','pseudoId'=>'vintor_10k_week1','pseudoId2'=>'vintor_10k_week2','pseudoId3'=>'vintor_10k_week3','pseudoId4'=>'vintor_10k_week4'],
|
||
['brand'=>'Encicarb 500', 'slug'=>'encicarb_500_units','pseudoId'=>'encicarb_500_week1','pseudoId2'=>'encicarb_500_week2','pseudoId3'=>'encicarb_500_week3','pseudoId4'=>'encicarb_500_week4'],
|
||
['brand'=>'Encicarb 100', 'slug'=>'encicarb_100_units','pseudoId'=>'encicarb_100_week1','pseudoId2'=>'encicarb_100_week2','pseudoId3'=>'encicarb_100_week3','pseudoId4'=>'encicarb_100_week4'],
|
||
// ['brand'=>'Epofer 4K', 'slug'=>'epofer_4k_units','pseudoId'=>'epofer_4k_week1','pseudoId2'=>'epofer_4k_week2','pseudoId3'=>'epofer_4k_week3','pseudoId4'=>'epofer_4k_week4'],
|
||
// ['brand'=>'Epofer 10K', 'slug'=>'epofer_10k_units','pseudoId'=>'epofer_10k_week1','pseudoId2'=>'epofer_10k_week2','pseudoId3'=>'epofer_10k_week3','pseudoId4'=>'epofer_10k_week4'],
|
||
['brand'=>'Dynulta', 'slug'=>'dynulta_units','pseudoId'=>'dynulta_week1','pseudoId2'=>'dynulta_week2','pseudoId3'=>'dynulta_week3','pseudoId4'=>'dynulta_week4'],
|
||
];
|
||
|
||
$brandData2 = [
|
||
|
||
['brand'=>'Vintor 4K', 'slug'=>'vintor_4k_units_execution','pseudoId'=>'vintor_4k_week1_exe','pseudoId2'=>'vintor_4k_week2_exe','pseudoId3'=>'vintor_4k_week3_exe','pseudoId4'=>'vintor_4k_week4_exe','pseudoId5'=>'vintor_4k_percent'],
|
||
['brand'=>'Vintor 10K', 'slug'=>'vintor_10k_units_execution','pseudoId'=>'vintor_10k_week1_exe','pseudoId2'=>'vintor_10k_week2_exe','pseudoId3'=>'vintor_10k_week3_exe','pseudoId4'=>'vintor_10k_week4_exe','pseudoId5'=>'vintor_10k_percent'],
|
||
['brand'=>'Encicarb 500', 'slug'=>'encicarb_500_units_execution','pseudoId'=>'encicarb_500_week1_exe','pseudoId2'=>'encicarb_500_week2_exe','pseudoId3'=>'encicarb_500_week3_exe','pseudoId4'=>'encicarb_500_week4_exe','pseudoId5'=>'encicarb_500_percent'],
|
||
['brand'=>'Encicarb 100', 'slug'=>'encicarb_100_units_execution','pseudoId'=>'encicarb_100_week1_exe','pseudoId2'=>'encicarb_100_week2_exe','pseudoId3'=>'encicarb_100_week3_exe','pseudoId4'=>'encicarb_100_week4_exe','pseudoId5'=>'encicarb_100_percent'],
|
||
// ['brand'=>'Epofer 4K', 'slug'=>'epofer_4k_units_execution','pseudoId'=>'epofer_4k_week1_exe','pseudoId2'=>'epofer_4k_week2_exe','pseudoId3'=>'epofer_4k_week3_exe','pseudoId4'=>'epofer_4k_week4_exe','pseudoId5'=>'epofer_4k_percent'],
|
||
// ['brand'=>'Epofer 10K', 'slug'=>'epofer_10k_units_execution','pseudoId'=>'epofer_10k_week1_exe','pseudoId2'=>'epofer_10k_week2_exe','pseudoId3'=>'epofer_10k_week3_exe','pseudoId4'=>'epofer_10k_week4_exe','pseudoId5'=>'epofer_10k_percent'],
|
||
['brand'=>'Dynulta', 'slug'=>'dynulta_units_execution','pseudoId'=>'dynulta_week1_exe','pseudoId2'=>'dynulta_week2_exe','pseudoId3'=>'dynulta_week3_exe','pseudoId4'=>'dynulta_week4_exe','pseudoId5'=>'dynulta_percent'],
|
||
|
||
];
|
||
|
||
|
||
@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">
|
||
<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">Plan Vs Execution Tracker</h4>
|
||
</div> --}}
|
||
@if (!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval !=
|
||
'yes'))
|
||
<div class="col-4">
|
||
@if ($form->link_type == 'form')
|
||
<!-- <a href="/form/history" class="float-end pt-1">View History</a> -->
|
||
<button type="button" class="btn btn-primary btn-xs" id="add-camp-btn">Add
|
||
Plan</button>
|
||
@else
|
||
<a href="{{ url()->previous() }}" class="float-end pt-1">Back</a>
|
||
@endif
|
||
</div>
|
||
@endif
|
||
|
||
@php
|
||
$history = Formhelper::getMultiformData($form->partition, $form->form_id, $form->user_id);
|
||
/* echo "<pre>";
|
||
print_r($history); */
|
||
@endphp
|
||
|
||
|
||
<div class="col-12" id="table-wrapper">
|
||
|
||
|
||
<div class="table-responsive">
|
||
<table class="table table-borderless table-nowrap table-hover table-centered m-0">
|
||
|
||
<thead class="table-light">
|
||
<tr>
|
||
<th>Action.</th>
|
||
<th>Camp Plan Date</th>
|
||
<th>Execution Done</th>
|
||
|
||
<th>Centre Name</th>
|
||
<th>Execution Date</th>
|
||
|
||
<th>Plan Month</th>
|
||
<th>Plan Week</th>
|
||
<th>Vintor 4K Month Plan Units</th>
|
||
<th>Vintor 10K Month Plan Units</th>
|
||
<th>Encicarb 500 Month Plan Units</th>
|
||
<th>Encicarb 100 Month Plan Units</th>
|
||
<th>Dynulta Month Plan Units</th>
|
||
|
||
|
||
<th>Vintor 4K Week 1 planned units</th>
|
||
<th>Vintor 10K Week 1 planned units</th>
|
||
<th>Encicarb 500 Week 1 planned units</th>
|
||
<th>Encicarb 100 Week 1 planned units</th>
|
||
<th>Dynulta Week 1 planned units</th>
|
||
|
||
<th>Vintor 4K Week 2 planned units</th>
|
||
<th>Vintor 10K Week 2 planned units</th>
|
||
<th>Encicarb 500 Week 2 planned units</th>
|
||
<th>Encicarb 100 Week 2 planned units</th>
|
||
<th>Dynulta Week 2 planned units</th>
|
||
|
||
<th>Vintor 4K Week 3 planned units</th>
|
||
<th>Vintor 10K Week 3 planned units</th>
|
||
<th>Encicarb 500 Week 3 planned units</th>
|
||
<th>Encicarb 100 Week 3 planned units</th>
|
||
<th>Dynulta Week 3 planned units</th>
|
||
|
||
<th>Vintor 4K Week 4 planned units</th>
|
||
<th>Vintor 10K Week 4 planned units</th>
|
||
<th>Encicarb 500 Week 4 planned units</th>
|
||
<th>Encicarb 100 Week 4 planned units</th>
|
||
<th>Dynulta Week 4 planned units</th>
|
||
|
||
<th>Vintor 4K Total Executed units</th>
|
||
<th>Vintor 10K Total Executed units</th>
|
||
<th>Encicarb 500 Total Executed units</th>
|
||
<th>Encicarb 100 Total Executed units</th>
|
||
<th>Dynulta Total Executed units</th>
|
||
|
||
|
||
<th>Vintor 4K Percentage Achievement</th>
|
||
<th>Vintor 10K Percentage Achievement</th>
|
||
<th>Encicarb 500 Percentage Achievement</th>
|
||
<th>Encicarb 100 Percentage Achievement</th>
|
||
<th>Dynulta Percentage Achievement</th>
|
||
|
||
<th>Vintor 4K Week 1 Execution units</th>
|
||
<th>Vintor 10K Week 1 Execution units</th>
|
||
<th>Encicarb 500 Week 1 Execution units</th>
|
||
<th>Encicarb 100 Week 1 Execution units</th>
|
||
<th>Dynulta Week 1 Execution units</th>
|
||
|
||
<th>Vintor 4K Week 2 Execution units</th>
|
||
<th>Vintor 10K Week 2 Execution units</th>
|
||
<th>Encicarb 500 Week 2 Execution units</th>
|
||
<th>Encicarb 100 Week 2 Execution units</th>
|
||
<th>Dynulta Week 2 Execution units</th>
|
||
|
||
<th>Vintor 4K Week 3 Execution units</th>
|
||
<th>Vintor 10K Week 3 Execution units</th>
|
||
<th>Encicarb 500 Week 3 Execution units</th>
|
||
<th>Encicarb 100 Week 3 Execution units</th>
|
||
<th>Dynulta Week 3 Execution units</th>
|
||
|
||
<th>Vintor 4K Week 4 Execution units</th>
|
||
<th>Vintor 10K Week 4 Execution units</th>
|
||
<th>Encicarb 500 Week 4 Execution units</th>
|
||
<th>Encicarb 100 Week 4 Execution units</th>
|
||
<th>Dynulta Week 4 Execution units</th>
|
||
{{-- <th>Activity done in this Month</th> --}}
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
@foreach ($history->data->submissions as $sub)
|
||
@php
|
||
$sub->formdata->id = $sub->id;
|
||
@endphp
|
||
<tr>
|
||
<td>
|
||
@if($sub->workflow_status=='approved' || isset($sub->formdata->execution_done) && $sub->formdata->execution_done == 'Yes' )
|
||
<button type="button" class="btn btn-xs btn-info edit-btn"
|
||
plan_details="{{ json_encode($sub->formdata) }}"><i
|
||
class="mdi mdi-pencil"></i> Execute</button>
|
||
|
||
|
||
|
||
@elseif($sub->workflow_status=='rejected')
|
||
<button type="button" class="btn btn-xs btn-info edit-plan-btn"
|
||
plan_details="{{ json_encode($sub->formdata) }}"><i
|
||
class="mdi mdi-pencil"></i> Edit Plan</button>
|
||
|
||
@endif
|
||
</td>
|
||
<td>{{ $sub->formdata->plan_date }}</td>
|
||
<td>{{ isset($sub->formdata->execution_done) && $sub->formdata->execution_done == 'Yes' ? 'Yes' : 'No' }}
|
||
</td>
|
||
|
||
<td>
|
||
@if (isset($sub->formdata->contact_id) && $sub->formdata->contact_id
|
||
!== '')
|
||
{{ $sub->formdata->contact_id }}
|
||
@elseif (isset($sub->formdata->doctor_name))
|
||
{{ $sub->formdata->doctor_name }}
|
||
@else
|
||
{{-- Default value or empty string, adjust as needed --}}
|
||
{{ '' }}
|
||
@endif
|
||
</td>
|
||
<td>{{$sub->formdata->execution_date}}</td>
|
||
{{-- <td>{{isset($sub->formdata->no_of_dialysis_machines ) ? $sub->formdata->no_of_dialysis_machines : ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->center_type) ? $sub->formdata->center_type : '' }}
|
||
</td> --}}
|
||
<td>{{isset($sub->formdata->select_plan_month) ? $sub->formdata->select_plan_month: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->select_plan_week) ? $sub->formdata->select_plan_week: ''}}
|
||
</td>
|
||
|
||
<td>{{isset($sub->formdata->vintor_4k_units) ? $sub->formdata->vintor_4k_units: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->vintor_10k_units) ? $sub->formdata->vintor_10k_units: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->encicarb_500_units) ? $sub->formdata->encicarb_500_units: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->encicarb_100_units) ? $sub->formdata->encicarb_100_units: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->dynulta_units) ? $sub->formdata->dynulta_units: ''}}
|
||
</td>
|
||
|
||
|
||
<td>{{isset($sub->formdata->vintor_4k_week1) ? (int)$sub->formdata->vintor_4k_week1: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->vintor_10k_week1) ? (int)$sub->formdata->vintor_10k_week1: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->encicarb_500_week1) ? (int)$sub->formdata->encicarb_500_week1: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->encicarb_100_week1) ? (int)$sub->formdata->encicarb_100_week1: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->dynulta_week1) ? (int)$sub->formdata->dynulta_week1: ''}}
|
||
</td>
|
||
|
||
|
||
<td>{{isset($sub->formdata->vintor_4k_week2) ? (int)$sub->formdata->vintor_4k_week2: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->vintor_10k_week2) ? (int)$sub->formdata->vintor_10k_week2: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->encicarb_500_week2) ? (int)$sub->formdata->encicarb_500_week2: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->encicarb_100_week2) ? (int)$sub->formdata->encicarb_100_week1: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->dynulta_week2) ? (int)$sub->formdata->dynulta_week2: ''}}
|
||
</td>
|
||
|
||
|
||
|
||
<td>{{isset($sub->formdata->vintor_4k_week3) ? (int)$sub->formdata->vintor_4k_week3: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->vintor_10k_week3) ? (int)$sub->formdata->vintor_10k_week3: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->encicarb_500_week3) ? (int)$sub->formdata->encicarb_500_week3: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->encicarb_100_week3) ? (int)$sub->formdata->encicarb_100_week3: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->dynulta_week3) ? (int)$sub->formdata->dynulta_week3: ''}}
|
||
</td>
|
||
|
||
|
||
<td>{{isset($sub->formdata->vintor_4k_week4) ? (int)$sub->formdata->vintor_4k_week4: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->vintor_10k_week4) ? (int)$sub->formdata->vintor_10k_week4: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->encicarb_500_week4) ? (int)$sub->formdata->encicarb_500_week4: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->encicarb_100_week4) ? (int)$sub->formdata->encicarb_100_week4: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->dynulta_week4) ? (int)$sub->formdata->dynulta_week4: ''}}
|
||
</td>
|
||
|
||
|
||
|
||
<td>{{isset($sub->formdata->vintor_4k_units_execution) ? $sub->formdata->vintor_4k_units_execution: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->vintor_10k_units_execution) ? $sub->formdata->vintor_10k_units_execution: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->encicarb_500_units_execution) ? $sub->formdata->encicarb_500_units_execution: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->encicarb_100_units_execution) ? $sub->formdata->encicarb_100_units_execution: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->dynulta_units_execution) ? $sub->formdata->dynulta_units_execution: ''}}
|
||
</td>
|
||
|
||
|
||
<td>{{isset($sub->formdata->vintor_4k_percent) ? $sub->formdata->vintor_4k_percent: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->vintor_10k_percent) ? $sub->formdata->vintor_10k_percent: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->encicarb_500_percent) ? $sub->formdata->encicarb_500_percent: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->encicarb_100_percent) ? $sub->formdata->encicarb_100_percent: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->dynulta_percent) ? $sub->formdata->dynulta_percent: ''}}
|
||
</td>
|
||
|
||
|
||
|
||
<td>{{isset($sub->formdata->vintor_4k_week1_exe) ? $sub->formdata->vintor_4k_week1_exe: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->vintor_10k_week1_exe) ? $sub->formdata->vintor_10k_week1_exe: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->encicarb_500_week1_exe) ? $sub->formdata->encicarb_500_week1_exe: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->encicarb_100_week1_exe) ? $sub->formdata->encicarb_100_week1_exe: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->dynulta_week1_exe) ? $sub->formdata->dynulta_week1_exe: ''}}
|
||
</td>
|
||
|
||
|
||
<td>{{isset($sub->formdata->vintor_4k_week2_exe) ? $sub->formdata->vintor_4k_week2_exe: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->vintor_10k_week2_exe) ? $sub->formdata->vintor_10k_week2_exe: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->encicarb_500_week2_exe) ? $sub->formdata->encicarb_500_week2_exe: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->encicarb_100_week2_exe) ? $sub->formdata->encicarb_100_week2_exe: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->dynulta_week2_exe) ? $sub->formdata->dynulta_week2_exe: ''}}
|
||
</td>
|
||
|
||
|
||
<td>{{isset($sub->formdata->vintor_4k_week3_exe) ? $sub->formdata->vintor_4k_week3_exe: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->vintor_10k_week3_exe) ? $sub->formdata->vintor_10k_week3_exe: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->encicarb_500_week3_exe) ? $sub->formdata->encicarb_500_week3_exe: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->encicarb_100_week3_exe) ? $sub->formdata->encicarb_100_week3_exe: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->dynulta_week3_exe) ? $sub->formdata->dynulta_week3_exe: ''}}
|
||
</td>
|
||
|
||
|
||
<td>{{isset($sub->formdata->vintor_4k_week4_exe) ? $sub->formdata->vintor_4k_week4_exe: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->vintor_10k_week4_exe) ? $sub->formdata->vintor_10k_week4_exe: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->encicarb_500_week4_exe) ? $sub->formdata->encicarb_500_week4_exe: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->encicarb_100_week4_exe) ? $sub->formdata->encicarb_100_week4_exe: ''}}
|
||
</td>
|
||
<td>{{isset($sub->formdata->dynulta_week4_exe) ? $sub->formdata->dynulta_week4_exe: ''}}
|
||
</td>
|
||
|
||
{{-- <td>{{isset($sub->formdata->activity_done_this_month) ? $sub->formdata->activity_done_this_month: ''}}
|
||
</td> --}}
|
||
|
||
</tr>
|
||
@endforeach
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div id="form-wrapper">
|
||
<div class="col-8">
|
||
<h5 class="page-title">Plan</h5>
|
||
</div>
|
||
<form method="POST" action="/form/submit" id="report-form"
|
||
enctype="multipart/form-data">
|
||
<input type="hidden" name="form_id" value="{{ $form_id }}">
|
||
@csrf
|
||
@if ($id)
|
||
<input type="hidden" name="id" value="{{ $id }}">
|
||
@endif
|
||
@foreach ($questions as $question)
|
||
@if (in_array($question->code, ['execution_date','executed_as_per_plan','execution_month' ,'execution_week','vintor_4k_week1_monthly_actual_units','vintor_10k_week1_monthly_actual_units','encicarb_500_week1_monthly_actual_units','encicarb_100_week1_monthly_actual_units','epofer_4k_week1_monthly_actual_units','epofer_10k_week1_monthly_actual_units','vintor_4k_week2_monthly_actual_units','vintor_10k_week2_monthly_actual_units','encicarb_500_week2_monthly_actual_units','encicarb_100_week2_monthly_actual_units','epofer_4k_week2_monthly_actual_units','epofer_10k_week2_monthly_actual_units','vintor_4k_week3_monthly_actual_units','vintor_10k_week3_monthly_actual_units','encicarb_500_week3_monthly_actual_units','encicarb_100_week3_monthly_actual_units','epofer_4k_week3_monthly_actual_units','epofer_10k_week3_monthly_actual_units','vintor_4k_week4_monthly_actual_units','vintor_10k_week4_monthly_actual_units','encicarb_500_week4_monthly_actual_units','encicarb_100_week4_monthly_actual_units','epofer_4k_week4_monthly_actual_units','epofer_10k_week4_monthly_actual_units','execution_product','activity_done_this_month']))
|
||
@continue
|
||
@endif
|
||
<div class="col-md-12 mb-2">
|
||
<label for="field-{{ $question->code }}"
|
||
class="form-label">{{ $question->question }} {!! $question->required ==
|
||
'yes' ? '<span class="text-danger">*</span>' : '' !!}
|
||
</label>
|
||
@switch($question->type)
|
||
@case('hidden')
|
||
<input type="{{ $question->type }}" id="field-{{ $question->code }}"
|
||
name="{{ $question->code }}"
|
||
value="{{ isset($question->value) ? $question->value : '' }}">
|
||
@break
|
||
|
||
@case('text')
|
||
@case('email')
|
||
|
||
@case('tel')
|
||
@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)
|
||
|
||
{{-- Centers --}}
|
||
@if($question->code == 'contact_id' && isset($option->contact->type) && $option->contact->type == 'center')
|
||
<option value="{{ $option->value }}"
|
||
{{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }}
|
||
pcode="{{ $option->contact->pcode ?? '' }}"
|
||
speciality="{{ $option->contact->speciality ?? '' }}">
|
||
{{ $option->display }}
|
||
</option>
|
||
|
||
{{-- Doctors --}}
|
||
@elseif($question->code == 'doctor_name' && isset($option->contact->type) && $option->contact->type == 'doctor')
|
||
<option value="{{ $option->value }}"
|
||
{{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }}
|
||
uid="{{ $option->contact->uid_number ?? '' }}"
|
||
speciality="{{ $option->contact->speciality ?? '' }}">
|
||
{{ $option->display }}
|
||
</option>
|
||
|
||
{{-- Other dropdowns --}}
|
||
@elseif($question->code != 'contact_id' && $question->code != 'doctor_name')
|
||
<option value="{{ $option->value }}"
|
||
{{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }}>
|
||
{{ $option->display }}
|
||
</option>
|
||
|
||
@endif
|
||
|
||
@endforeach
|
||
|
||
</select>
|
||
|
||
@break
|
||
|
||
@case('checkbox')
|
||
@foreach ($question->options as $option)
|
||
<div class="form-check mb-2 form-check-primary">
|
||
<input class="form-check-input" type="checkbox"
|
||
id="field-{{ $question->code }}-{{ $option->value }}"
|
||
name="{{ $question->code }}[]" value="{{ $option->value }}"
|
||
{{ isset($question->value) && $question->value != '' && in_array($option->value, $question->value) ? 'checked' : '' }}>
|
||
<label class="form-check-label"
|
||
for="field-{{ $question->code }}-{{ $option->value }}">{{ $option->display }}</label>
|
||
</div>
|
||
@endforeach
|
||
@break
|
||
|
||
@case('file')
|
||
<input type="file" id="field-{{ $question->code }}" name="{{ $question->code }}"
|
||
class="form-control" value="" accept="image/jpg, image/jpeg, image/png"
|
||
required>
|
||
@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>Product</th>
|
||
<th>Enter Month Plan Units</th>
|
||
<th>Week 1 planned units</th>
|
||
<th>Week 2 planned units</th>
|
||
<th>Week 3 planned units</th>
|
||
<th>Week 4 planned units</th>
|
||
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
@foreach($brandData as $brand)
|
||
<tr>
|
||
|
||
<td>{{ $brand['brand'] }}</td>
|
||
<td>
|
||
<input type="number" step="1" min="0" 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" step="1" min="0" id="field-{{ $brand['pseudoId'] }}"
|
||
name="{{ $brand['pseudoId'] }}"
|
||
class="form-control form-control-large" value="{{ $id && isset($formdata) && isset($formdata->{$brand['pseudoId']}) ? $formdata->{$brand['pseudoId']} : 0 }}">
|
||
</td>
|
||
<td>
|
||
<input type="number" step="1" min="0" id="field-{{ $brand['pseudoId2'] }}"
|
||
name="{{ $brand['pseudoId2'] }}"
|
||
class="form-control form-control-large" value="{{ $id && isset($formdata) && isset($formdata->{$brand['pseudoId']}) ? $formdata->{$brand['pseudoId']} : 0 }}">
|
||
</td>
|
||
<td>
|
||
<input type="number" step="1" min="0" id="field-{{ $brand['pseudoId3'] }}"
|
||
name="{{ $brand['pseudoId3'] }}"
|
||
class="form-control form-control-large" value="{{ $id && isset($formdata) && isset($formdata->{$brand['pseudoId']}) ? $formdata->{$brand['pseudoId']} : 0 }}">
|
||
</td>
|
||
<td>
|
||
<input type="number" step="1" min="0" id="field-{{ $brand['pseudoId4'] }}"
|
||
name="{{ $brand['pseudoId4'] }}"
|
||
class="form-control form-control-large" value="{{ $id && isset($formdata) && isset($formdata->{$brand['pseudoId']}) ? $formdata->{$brand['pseudoId']} : 0 }}">
|
||
</td>
|
||
|
||
</tr>
|
||
@endforeach
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
|
||
</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>
|
||
|
||
<div id="execution-form-wrapper">
|
||
<div class="col-8">
|
||
<h5 class="page-title">Execution</h5>
|
||
</div>
|
||
<form method="POST" action="/form/submit" id="execution-form"
|
||
enctype="multipart/form-data">
|
||
<input type="hidden" name="form_id" value="{{ $form_id }}">
|
||
@csrf
|
||
<input type="hidden" name="id" value="" id="execution-id">
|
||
<input type="hidden" name="dummyformid" value="" id="execution-dummyformid">
|
||
{{-- <input type="hidden" name="execution_done" value="yes"> --}}
|
||
@foreach ($questions as $question)
|
||
<div class="col-md-12 mb-2">
|
||
<label for="execution-{{ $question->code }}"
|
||
class="form-label">{{ $question->question }} {!! $question->required ==
|
||
'yes' ? '<span class="text-danger">*</span>' : '' !!}
|
||
</label>
|
||
@switch($question->type)
|
||
@case('hidden')
|
||
<input type="{{ $question->type }}" id="execution-{{ $question->code }}"
|
||
name="{{ $question->code }}"
|
||
value="{{ isset($question->value) ? $question->value : '' }}">
|
||
@break
|
||
|
||
@case('text')
|
||
@case('email')
|
||
|
||
@case('tel')
|
||
@case('date')
|
||
<input type="{{ $question->type }}" id="execution-{{ $question->code }}"
|
||
name="{{ $question->code }}" class="form-control"
|
||
{{ $question->required == 'yes' ? 'required' : '' }}
|
||
value="{{ isset($question->value) ? $question->value : '' }}">
|
||
@break
|
||
|
||
@case('number')
|
||
<input type="{{ $question->type }}" min="0" max="9999999999" step="1"
|
||
id="execution-{{ $question->code }}" name="{{ $question->code }}"
|
||
class="form-control" {{ $question->required == 'yes' ? 'required' : '' }}
|
||
value="{{ isset($question->value) ? $question->value : 0 }}">
|
||
@break
|
||
|
||
@case('textarea')
|
||
<textarea id="execution-{{ $question->code }}" name="{{ $question->code }}"
|
||
class="form-control"
|
||
{{ $question->required == 'yes' ? 'required' : '' }}>{{ isset($question->value) ? $question->value : '' }}</textarea>
|
||
@break
|
||
|
||
@case('dropdown')
|
||
<select class="form-control" id="execution-{{ $question->code }}" name="{{ $question->code }}" {{ $question->required == 'yes' ? 'required' : '' }}>
|
||
<option value=""> -- Select -- </option>
|
||
@foreach ($question->options as $option)
|
||
|
||
{{-- Centers --}}
|
||
@if($question->code == 'contact_id' && isset($option->contact->type) && $option->contact->type == 'center')
|
||
<option value="{{ $option->value }}"
|
||
{{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }}
|
||
pcode="{{ $option->contact->pcode ?? '' }}"
|
||
speciality="{{ $option->contact->speciality ?? '' }}">
|
||
{{ $option->display }}
|
||
</option>
|
||
|
||
{{-- Doctors --}}
|
||
@elseif($question->code == 'doctor_name' && isset($option->contact->type) && $option->contact->type == 'doctor')
|
||
<option value="{{ $option->value }}"
|
||
{{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }}
|
||
uid="{{ $option->contact->uid_number ?? '' }}"
|
||
speciality="{{ $option->contact->speciality ?? '' }}">
|
||
{{ $option->display }}
|
||
</option>
|
||
|
||
{{-- Other dropdowns --}}
|
||
@elseif($question->code != 'contact_id' && $question->code != 'doctor_name')
|
||
<option value="{{ $option->value }}"
|
||
{{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }}>
|
||
{{ $option->display }}
|
||
</option>
|
||
|
||
@endif
|
||
|
||
@endforeach
|
||
</select>
|
||
@break
|
||
|
||
@case('checkbox')
|
||
@foreach ($question->options as $option)
|
||
<div class="form-check mb-2 form-check-primary">
|
||
<input class="form-check-input" type="checkbox"
|
||
id="execution-{{ $question->code }}-{{ $option->value }}"
|
||
name="{{ $question->code }}[]" value="{{ $option->value }}"
|
||
{{ isset($question->value) && $question->value != '' && in_array($option->value, $question->value) ? 'checked' : '' }}>
|
||
<label class="form-check-label"
|
||
for="execution-{{ $question->code }}-{{ $option->value }}">{{ $option->display }}</label>
|
||
</div>
|
||
@endforeach
|
||
@break
|
||
|
||
@case('file')
|
||
<input type="file" id="execution-{{ $question->code }}"
|
||
name="{{ $question->code }}" class="form-control" value=""
|
||
accept="image/jpg, image/jpeg, image/png">
|
||
@break
|
||
@case('multitextbox')
|
||
|
||
@if($question->code=='product')
|
||
<div class="row">
|
||
<div style="width: auto; overflow-y: auto; overflow-x: auto;">
|
||
<table class="table tableclass">
|
||
<thead id="heading">
|
||
<tr>
|
||
<th>Product</th>
|
||
<th>Enter Month Plan Units</th>
|
||
<th>Week 1 planned units</th>
|
||
<th>Week 2 planned units</th>
|
||
<th>Week 3 planned units</th>
|
||
<th>Week 4 planned units</th>
|
||
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
@foreach($brandData as $brand)
|
||
<tr>
|
||
|
||
<td>{{ $brand['brand'] }}</td>
|
||
<td>
|
||
<input type="number" id="execution-{{ $brand['slug'] }}"
|
||
name="{{ $brand['slug'] }}"
|
||
class="form-control form-control-large" readonly="true" value="{{ isset($formdata->{$brand['slug']}) ? $formdata->{$brand['slug']} : 0 }}" >
|
||
</td>
|
||
<td>
|
||
<input type="number" id="execution-{{ $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>
|
||
<td>
|
||
<input type="number" id="execution-{{ $brand['pseudoId2'] }}"
|
||
name="{{ $brand['pseudoId2'] }}"
|
||
class="form-control form-control-large" readonly="true" value="{{ $id && isset($formdata) && isset($formdata->{$brand['pseudoId2']}) ? $formdata->{$brand['pseudoId2']} : 0 }}">
|
||
</td>
|
||
<td>
|
||
<input type="number" id="execution-{{ $brand['pseudoId3'] }}"
|
||
name="{{ $brand['pseudoId3'] }}"
|
||
class="form-control form-control-large" readonly="true" value="{{ $id && isset($formdata) && isset($formdata->{$brand['pseudoId3']}) ? $formdata->{$brand['pseudoId3']} : 0 }}">
|
||
</td>
|
||
<td>
|
||
<input type="number" id="execution-{{ $brand['pseudoId4'] }}"
|
||
name="{{ $brand['pseudoId4'] }}"
|
||
class="form-control form-control-large" readonly="true" value="{{ $id && isset($formdata) && isset($formdata->{$brand['pseudoId4']}) ? $formdata->{$brand['pseudoId4']} : 0 }}">
|
||
</td>
|
||
|
||
</tr>
|
||
@endforeach
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
@endif
|
||
@if($question->code=='execution_product')
|
||
<div class="row" id="execution_table">
|
||
|
||
<div style="width: auto; overflow-y: auto; overflow-x: auto;">
|
||
<table class="table tableclass">
|
||
<thead id="heading">
|
||
<tr>
|
||
<th>Product</th>
|
||
<th>Total Executed Units </th>
|
||
<th>Percentage Achievement</th>
|
||
<th>Week 1 Execution units</th>
|
||
<th>Week 2 Execution units</th>
|
||
<th>Week 3 Execution units</th>
|
||
<th>Week 4 Execution units</th>
|
||
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
@foreach($brandData2 as $brand)
|
||
<tr>
|
||
|
||
<td>{{ $brand['brand'] }}</td>
|
||
<td>
|
||
<input type="number" step="1" min="0" id="execution-{{ $brand['slug'] }}"
|
||
name="{{ $brand['slug'] }}"
|
||
class="form-control form-control-large" readonly="true" value="{{ isset($formdata->{$brand['slug']}) ? $formdata->{$brand['slug']} : 0 }}" >
|
||
</td>
|
||
<td>
|
||
<input type="number" step="1" min="0" id="execution-{{ $brand['pseudoId5'] }}"
|
||
name="{{ $brand['pseudoId5'] }}"
|
||
class="form-control form-control-large" readonly="true" value="{{ isset($formdata->{$brand['slug']}) ? $formdata->{$brand['slug']} : 0 }}" >
|
||
</td>
|
||
<td>
|
||
<input type="number" step="1" min="0" id="execution-{{ $brand['pseudoId'] }}"
|
||
name="{{ $brand['pseudoId'] }}"
|
||
class="form-control form-control-large" value="{{ $id && isset($formdata) && isset($formdata->{$brand['pseudoId']}) ? $formdata->{$brand['pseudoId']} : 0 }}">
|
||
</td>
|
||
<td>
|
||
<input type="number" step="1" min="0" id="execution-{{ $brand['pseudoId2'] }}"
|
||
name="{{ $brand['pseudoId2'] }}"
|
||
class="form-control form-control-large" value="{{ $id && isset($formdata) && isset($formdata->{$brand['pseudoId2']}) ? $formdata->{$brand['pseudoId2']} : 0 }}">
|
||
</td>
|
||
<td>
|
||
<input type="number" step="1" min="0" id="execution-{{ $brand['pseudoId3'] }}"
|
||
name="{{ $brand['pseudoId3'] }}"
|
||
class="form-control form-control-large" value="{{ $id && isset($formdata) && isset($formdata->{$brand['pseudoId3']}) ? $formdata->{$brand['pseudoId3']} : 0 }}">
|
||
</td>
|
||
<td>
|
||
<input type="number" step="1" min="0" id="execution-{{ $brand['pseudoId4'] }}"
|
||
name="{{ $brand['pseudoId4'] }}"
|
||
class="form-control form-control-large" value="{{ $id && isset($formdata) && isset($formdata->{$brand['pseudoId4']}) ? $formdata->{$brand['pseudoId4']} : 0 }}">
|
||
</td>
|
||
|
||
</tr>
|
||
@endforeach
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
@endif
|
||
|
||
@break
|
||
|
||
|
||
@endswitch
|
||
</div>
|
||
@endforeach
|
||
@if (!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval
|
||
!= 'yes'))
|
||
<div class="text-center d-grid mt-3">
|
||
<button class="btn btn-primary" type="submit" id="submit-btn"> Submit
|
||
</button>
|
||
</div>
|
||
@endif
|
||
</form>
|
||
</div>
|
||
|
||
</div> <!-- end card-body -->
|
||
</div>
|
||
<!-- end card -->
|
||
|
||
<!-- end row -->
|
||
|
||
</div> <!-- end col -->
|
||
</div>
|
||
<!-- end row -->
|
||
</div>
|
||
<!-- end container -->
|
||
</div>
|
||
<!-- end page -->
|
||
<style type="text/css">
|
||
#pageloader {
|
||
background: rgba(255, 255, 255, 0.8);
|
||
display: none;
|
||
height: 100%;
|
||
position: fixed;
|
||
width: 100%;
|
||
z-index: 9999;
|
||
}
|
||
|
||
#pageloader img {
|
||
left: 50%;
|
||
margin-left: -32px;
|
||
margin-top: -32px;
|
||
position: absolute;
|
||
top: 50%;
|
||
}
|
||
.form-control-large{
|
||
width: 75px;
|
||
}
|
||
</style>
|
||
@include('layouts.shared/footer-script')
|
||
<script src="{{ asset('assets/libs/sweetalert2/sweetalert2.min.js') }}"></script>
|
||
<script type="text/javascript">
|
||
jQuery(document).ready(function($) {
|
||
|
||
|
||
|
||
|
||
// Allow only positive integers
|
||
$('input[type="number"]').on('input', function () {
|
||
|
||
// remove anything except digits
|
||
this.value = this.value.replace(/[^0-9]/g, '');
|
||
|
||
// prevent negative
|
||
if (parseInt(this.value) < 0 || this.value.includes('-')) {
|
||
this.value = '';
|
||
}
|
||
|
||
});
|
||
|
||
|
||
|
||
$('#form-wrapper').hide()
|
||
$('#execution-form-wrapper').hide()
|
||
|
||
// $('#add-camp-btn').click(function() {
|
||
// $('#form-wrapper').show()
|
||
// $('#table-wrapper').hide()
|
||
// })
|
||
|
||
$('#add-camp-btn').click(function() {
|
||
$('#table-wrapper').hide(0)
|
||
$('#form-wrapper').show(100, () => {
|
||
$('#add-camp-btn').hide(0);
|
||
})
|
||
|
||
|
||
})
|
||
|
||
$('#field-select_plan_week').on('change',function(){
|
||
let week=$('#field-select_plan_week').val();
|
||
console.log("week :",week);
|
||
|
||
})
|
||
|
||
// $('#field-contact_id').on('change',function(){
|
||
// let selectedOption = $(this).find(':selected')[0];
|
||
// let name = selectedOption.label || selectedOption.innerText || selectedOption.textContent;
|
||
// //$('#report-form').append('<input type="hidden" name="'+name+'" value="1">')
|
||
// })
|
||
|
||
$('#execution-vintor_4k_week1_monthly_actual_units,#execution-vintor_10k_week1_monthly_actual_units,#execution-encicarb_500_week1_monthly_actual_units,#execution-encicarb_100_week1_monthly_actual_units,#execution-epofer_4k_week1_monthly_actual_units,#execution-epofer_10k_week1_monthly_actual_units,#execution-vintor_4k_week2_monthly_actual_units,#execution-vintor_10k_week2_monthly_actual_units,#execution-encicarb_500_week2_monthly_actual_units,#execution-encicarb_100_week2_monthly_actual_units,#execution-epofer_4k_week2_monthly_actual_units,#execution-epofer_10k_week2_monthly_actual_units,#execution-vintor_4k_week3_monthly_actual_units,#execution-vintor_10k_week3_monthly_actual_units,#execution-encicarb_500_week3_monthly_actual_units,#execution-encicarb_100_week3_monthly_actual_units,#execution-epofer_4k_week3_monthly_actual_units,#execution-epofer_10k_week3_monthly_actual_units,#execution-vintor_4k_week4_monthly_actual_units,#execution-vintor_10k_week4_monthly_actual_units,#execution-encicarb_500_week4_monthly_actual_units,#execution-encicarb_100_week4_monthly_actual_units,#execution-epofer_4k_week4_monthly_actual_units,#execution-epofer_10k_week4_monthly_actual_units').prop({"required":false});
|
||
$('#execution-vintor_4k_week1_monthly_actual_units,#execution-vintor_10k_week1_monthly_actual_units,#execution-encicarb_500_week1_monthly_actual_units,#execution-encicarb_100_week1_monthly_actual_units,#execution-epofer_4k_week1_monthly_actual_units,#execution-epofer_10k_week1_monthly_actual_units,#execution-vintor_4k_week2_monthly_actual_units,#execution-vintor_10k_week2_monthly_actual_units,#execution-encicarb_500_week2_monthly_actual_units,#execution-encicarb_100_week2_monthly_actual_units,#execution-epofer_4k_week2_monthly_actual_units,#execution-epofer_10k_week2_monthly_actual_units,#execution-vintor_4k_week3_monthly_actual_units,#execution-vintor_10k_week3_monthly_actual_units,#execution-encicarb_500_week3_monthly_actual_units,#execution-encicarb_100_week3_monthly_actual_units,#execution-epofer_4k_week3_monthly_actual_units,#execution-epofer_10k_week3_monthly_actual_units,#execution-vintor_4k_week4_monthly_actual_units,#execution-vintor_10k_week4_monthly_actual_units,#execution-encicarb_500_week4_monthly_actual_units,#execution-encicarb_100_week4_monthly_actual_units,#execution-epofer_4k_week4_monthly_actual_units,#execution-epofer_10k_week4_monthly_actual_units').parent().hide();
|
||
|
||
|
||
|
||
|
||
|
||
|
||
// $('#field-vintor_4k_units,#field-vintor_10k_units,#field-encicarb_500_units,#field-encicarb_100_units,#field-encicarb_100_units,#field-epofer_4k_units,#field-epofer_10k_units,#field-dynulta_units').on('keyup',function(){
|
||
// let week=$('#field-select_plan_week').val();
|
||
// console.log("week :",week);
|
||
// let month_plan_units_Victor_4k=(parseInt($('#field-vintor_4k_units').val()))||0;
|
||
// let month_plan_units_Victor_10k=parseInt($('#field-vintor_10k_units').val())||0;
|
||
// let month_plan_units_Encicarb_500=parseInt($('#field-encicarb_500_units').val())||0;
|
||
// let month_plan_units_Encicarb_100=parseInt($('#field-encicarb_100_units').val())||0;
|
||
// // let month_plan_units_Epofer_4K=parseInt($('#field-epofer_4k_units').val())||0;
|
||
// // let month_plan_units_Epofer_10K=parseInt($('#field-epofer_10k_units').val())||0;
|
||
// let month_plan_units_Dynulta=parseInt($('#field-dynulta_units').val())||0;
|
||
|
||
|
||
|
||
// $('#field-vintor_4k_week1').val(Math.round(month_plan_units_Victor_4k*0.2));
|
||
// $('#field-vintor_10k_week1').val(Math.round(month_plan_units_Victor_10k*0.2));
|
||
// $('#field-encicarb_500_week1').val(Math.round(month_plan_units_Encicarb_500*0.2));
|
||
// $('#field-encicarb_100_week1').val(Math.round(month_plan_units_Encicarb_100*0.2));
|
||
// // $('#field-epofer_4k_week1').val(Math.round(month_plan_units_Epofer_4K*0.2));
|
||
// // $('#field-epofer_10k_week1').val(Math.round(month_plan_units_Epofer_10K*0.2));
|
||
// $('#field-dynulta_week1').val(Math.round(month_plan_units_Dynulta*0.2));
|
||
|
||
|
||
// $('#field-vintor_4k_week2').val(Math.round(month_plan_units_Victor_4k*0.4));
|
||
// $('#field-vintor_10k_week2').val(Math.round(month_plan_units_Victor_10k*0.4));
|
||
// $('#field-encicarb_500_week2').val(Math.round(month_plan_units_Encicarb_500*0.4));
|
||
// $('#field-encicarb_100_week2').val(Math.round(month_plan_units_Encicarb_100*0.4));
|
||
// // $('#field-epofer_4k_week2').val(Math.round(month_plan_units_Epofer_4K*0.4));
|
||
// // $('#field-epofer_10k_week2').val(Math.round(month_plan_units_Epofer_10K*0.4));
|
||
// $('#field-dynulta_week2').val(Math.round(month_plan_units_Dynulta*0.4));
|
||
|
||
|
||
|
||
// $('#field-vintor_4k_week3').val(Math.round(month_plan_units_Victor_4k*0.7));
|
||
// $('#field-vintor_10k_week3').val(Math.round(month_plan_units_Victor_10k*0.7));
|
||
// $('#field-encicarb_500_week3').val(Math.round(month_plan_units_Encicarb_500*0.7));
|
||
// $('#field-encicarb_100_week3').val(Math.round(month_plan_units_Encicarb_100*0.7));
|
||
// // $('#field-epofer_4k_week3').val(Math.round(month_plan_units_Epofer_4K*0.7));
|
||
// // $('#field-epofer_10k_week3').val(Math.round(month_plan_units_Epofer_10K*0.7));
|
||
// $('#field-dynulta_week3').val(Math.round(month_plan_units_Dynulta*0.7));
|
||
|
||
|
||
|
||
// $('#field-vintor_4k_week4').val(Math.round(month_plan_units_Victor_4k*1));
|
||
// $('#field-vintor_10k_week4').val(Math.round(month_plan_units_Victor_10k*1));
|
||
// $('#field-encicarb_500_week4').val(Math.round(month_plan_units_Encicarb_500*1));
|
||
// $('#field-encicarb_100_week4').val(Math.round(month_plan_units_Encicarb_100*1));
|
||
// // $('#field-epofer_4k_week4').val(Math.round(month_plan_units_Epofer_4K*1));
|
||
// // $('#field-epofer_10k_week4').val(Math.round(month_plan_units_Epofer_10K*1));
|
||
// $('#field-dynulta_week4').val(Math.round(month_plan_units_Dynulta*1));
|
||
|
||
|
||
// })
|
||
|
||
|
||
|
||
$('.edit-btn').click(function() {
|
||
// First make all readonly
|
||
// $('#execution-form input').prop('readonly', true);
|
||
|
||
// Keep only PLAN fields editable
|
||
$('#execution-vintor_4k_units').prop('readonly', false);
|
||
$('#execution-vintor_10k_units').prop('readonly', false);
|
||
$('#execution-encicarb_500_units').prop('readonly', false);
|
||
$('#execution-encicarb_100_units').prop('readonly', false);
|
||
$('#execution-dynulta_units').prop('readonly', false);
|
||
|
||
$('#execution-vintor_4k_week1').prop('readonly', false);
|
||
$('#execution-vintor_4k_week2').prop('readonly', false);
|
||
$('#execution-vintor_4k_week3').prop('readonly', false);
|
||
$('#execution-vintor_4k_week4').prop('readonly', false);
|
||
|
||
$('#execution-vintor_10k_week1').prop('readonly', false);
|
||
$('#execution-vintor_10k_week2').prop('readonly', false);
|
||
$('#execution-vintor_10k_week3').prop('readonly', false);
|
||
$('#execution-vintor_10k_week4').prop('readonly', false);
|
||
|
||
$('#execution-encicarb_500_week1').prop('readonly', false);
|
||
$('#execution-encicarb_500_week2').prop('readonly', false);
|
||
$('#execution-encicarb_500_week3').prop('readonly', false);
|
||
$('#execution-encicarb_500_week4').prop('readonly', false);
|
||
|
||
$('#execution-encicarb_100_week1').prop('readonly', false);
|
||
$('#execution-encicarb_100_week2').prop('readonly', false);
|
||
$('#execution-encicarb_100_week3').prop('readonly', false);
|
||
$('#execution-encicarb_100_week4').prop('readonly', false);
|
||
|
||
$('#execution-dynulta_week1').prop('readonly', false);
|
||
$('#execution-dynulta_week2').prop('readonly', false);
|
||
$('#execution-dynulta_week3').prop('readonly', false);
|
||
$('#execution-dynulta_week4').prop('readonly', false);
|
||
|
||
// execution fields still editable
|
||
// $('[id*="_exe"]').prop('readonly', false);
|
||
|
||
// percentage + total execution readonly
|
||
$('[id*="_percent"]').prop('readonly', true);
|
||
$('[id*="_units_execution"]').prop('readonly', true);
|
||
|
||
|
||
$('#execution-form-wrapper').show(100, () => {
|
||
$('#add-camp-btn').hide(0);
|
||
})
|
||
$('#table-wrapper').hide()
|
||
$('#execution-form').append('<input type="hidden" name="execution_done" value="Yes"/>')
|
||
|
||
let contacts=document.getElementById('execution-contact_id');
|
||
contacts.addEventListener('mousedown',function(e){
|
||
e.preventDefault();
|
||
})
|
||
|
||
let docname=document.getElementById('execution-doctor_name');
|
||
docname.addEventListener('mousedown',function(e){
|
||
e.preventDefault();
|
||
})
|
||
|
||
let months=document.getElementById('execution-select_plan_month');
|
||
months.addEventListener('mousedown',function(e){
|
||
e.preventDefault();
|
||
})
|
||
|
||
|
||
$('#execution-speciality').prop('readonly', true)
|
||
$('#execution-plan_date').prop('readonly', true)
|
||
$('#execution-uid_number').prop('readonly',true);
|
||
//$('#execution-time').prop('disabled', true)
|
||
|
||
|
||
|
||
let selected = JSON.parse($(this).attr('plan_details'))
|
||
console.log("Plan_Details : ",selected);
|
||
console.log("Hospital Name is : ",selected['contact_id']);
|
||
for (let k of Object.keys(selected)) {
|
||
|
||
if (selected[k] != '') {
|
||
if (k == 'contact_id') {
|
||
//$("#execution-contact_id option:contains(" + selected[k] + ")").prop('selected', true)
|
||
// console.log($("#execution-contact_id option:contains(" + selected[k] + ")").attr('value'))
|
||
$('#execution-contact_id').val($("#execution-contact_id option:contains(" +
|
||
selected[k] + ")").attr('value'));
|
||
}
|
||
else if (k == 'doctor_name') {
|
||
//$("#execution-contact_id option:contains(" + selected[k] + ")").prop('selected', true)
|
||
// console.log($("#execution-contact_id option:contains(" + selected[k] + ")").attr('value'))
|
||
$('#execution-doctor_name').val($("#execution-doctor_name option:contains(" +
|
||
selected[k] + ")").attr('value'));
|
||
}
|
||
|
||
else
|
||
{
|
||
$('#execution-' + k).val(selected[k]);
|
||
}
|
||
}
|
||
// if(selected[k] != '')
|
||
// $('#execution-'+k).val(selected[k]);
|
||
}
|
||
|
||
|
||
let docid = $('#execution-contact_id option').map(function() {
|
||
if ($(this).text().trim() == selected['contact_id']) return this;
|
||
}).attr('value')
|
||
console.log("docid : ",docid);
|
||
$('#execution-contact_id').val(docid)
|
||
$('#execution-id').val(selected['id'])
|
||
$('#execution-dummyformid').val(selected['proxy_formid'])
|
||
|
||
|
||
$('#execution-execution_month').parent().hide();
|
||
|
||
$('#execution-execution_month').attr({"required":false});
|
||
//$('#execution-execution_week').parent().hide();
|
||
//$('#execution-execution_week').attr({"required":false});
|
||
|
||
$('#execution-executed_as_per_plan').on('change',function(){
|
||
let value=$('#execution-executed_as_per_plan').val();
|
||
if(value==='No'){
|
||
$('#execution-execution_month').parent().show();
|
||
$('#execution-execution_week').parent().show();
|
||
$('#execution-execution_month').attr({"required":true});
|
||
$('#execution-execution_week').attr({"required":true});
|
||
}
|
||
else{
|
||
$('#execution-execution_month').parent().hide();
|
||
$('#execution-execution_week').parent().hide();
|
||
$('#execution-execution_month').attr({"required":false});
|
||
$('#execution-execution_week').attr({"required":false});
|
||
}
|
||
})
|
||
|
||
|
||
$(document).ready(function () {
|
||
|
||
// 👉 Initially: make all week fields readonly
|
||
$('[id*="_week"][id*="_exe"]').prop('readonly', true);
|
||
|
||
// 👉 On dropdown change
|
||
$('#execution-execution_week').on('change', function () {
|
||
|
||
let selectedWeek = $(this).val();
|
||
|
||
// 👉 First lock everything
|
||
$('[id*="_week"][id*="_exe"]').prop('readonly', true);
|
||
|
||
// 👉 Then enable only selected week
|
||
if (selectedWeek) {
|
||
$(`[id*="_week${selectedWeek}_exe"]`).prop('readonly', false);
|
||
}
|
||
|
||
});
|
||
|
||
});
|
||
|
||
// $('#execution-vintor_4k_units,#execution-vintor_10k_units,#execution-encicarb_500_units,#execution-encicarb_100_units,#execution-encicarb_100_units,#execution-epofer_4k_units,#execution-epofer_10k_units,#execution-dynulta_units').on('keyup',function(){
|
||
// let week=$('#execution-select_plan_week').val();
|
||
// console.log("week :",week);
|
||
// let month_plan_units_Victor_4k=(parseInt($('#execution-vintor_4k_units').val()))||0;
|
||
// let month_plan_units_Victor_10k=parseInt($('#execution-vintor_10k_units').val())||0;
|
||
// let month_plan_units_Encicarb_500=parseInt($('#execution-encicarb_500_units').val())||0;
|
||
// let month_plan_units_Encicarb_100=parseInt($('#execution-encicarb_100_units').val())||0;
|
||
// // let month_plan_units_Epofer_4K=parseInt($('#execution-epofer_4k_units').val())||0;
|
||
// // let month_plan_units_Epofer_10K=parseInt($('#execution-epofer_10k_units').val())||0;
|
||
// let month_plan_units_dynulta=parseInt($('#execution-dynulta_units').val())||0;
|
||
|
||
|
||
// $('#execution-vintor_4k_week1').val(Math.round(month_plan_units_Victor_4k*0.2));
|
||
// $('#execution-vintor_10k_week1').val(Math.round(month_plan_units_Victor_10k*0.2));
|
||
// $('#execution-encicarb_500_week1').val(Math.round(month_plan_units_Encicarb_500*0.2));
|
||
// $('#execution-encicarb_100_week1').val(Math.round(month_plan_units_Encicarb_100*0.2));
|
||
// // $('#execution-epofer_4k_week1').val(Math.round(month_plan_units_Epofer_4K*0.2));
|
||
// // $('#execution-epofer_10k_week1').val(Math.round(month_plan_units_Epofer_10K*0.2));
|
||
// $('#execution-dynulta_week1').val(Math.round(month_plan_units_dynulta*0.2));
|
||
|
||
|
||
// $('#execution-vintor_4k_week2').val(Math.round(month_plan_units_Victor_4k*0.4));
|
||
// $('#execution-vintor_10k_week2').val(Math.round(month_plan_units_Victor_10k*0.4));
|
||
// $('#execution-encicarb_500_week2').val(Math.round(month_plan_units_Encicarb_500*0.4));
|
||
// $('#execution-encicarb_100_week2').val(Math.round(month_plan_units_Encicarb_100*0.4));
|
||
// // $('#execution-epofer_4k_week2').val(Math.round(month_plan_units_Epofer_4K*0.4));
|
||
// // $('#execution-epofer_10k_week2').val(Math.round(month_plan_units_Epofer_10K*0.4));
|
||
// $('#execution-dynulta_week2').val(Math.round(month_plan_units_dynulta*0.4));
|
||
|
||
|
||
|
||
|
||
// $('#execution-vintor_4k_week3').val(Math.round(month_plan_units_Victor_4k*0.7));
|
||
// $('#execution-vintor_10k_week3').val(Math.round(month_plan_units_Victor_10k*0.7));
|
||
// $('#execution-encicarb_500_week3').val(Math.round(month_plan_units_Encicarb_500*0.7));
|
||
// $('#execution-encicarb_100_week3').val(Math.round(month_plan_units_Encicarb_100*0.7));
|
||
// // $('#execution-epofer_4k_week3').val(Math.round(month_plan_units_Epofer_4K*0.7));
|
||
// // $('#execution-epofer_10k_week3').val(Math.round(month_plan_units_Epofer_10K*0.7));
|
||
// $('#execution-dynulta_week3').val(Math.round(month_plan_units_dynulta*0.7));
|
||
|
||
|
||
|
||
// $('#execution-vintor_4k_week4').val(Math.round(month_plan_units_Victor_4k*1));
|
||
// $('#execution-vintor_10k_week4').val(Math.round(month_plan_units_Victor_10k*1));
|
||
// $('#execution-encicarb_500_week4').val(Math.round(month_plan_units_Encicarb_500*1));
|
||
// $('#execution-encicarb_100_week4').val(Math.round(month_plan_units_Encicarb_100*1));
|
||
// // $('#execution-epofer_4k_week4').val(Math.round(month_plan_units_Epofer_4K*1));
|
||
// // $('#execution-epofer_10k_week4').val(Math.round(month_plan_units_Epofer_10K*1));
|
||
// $('#execution-dynulta_week4').val(Math.round(month_plan_units_dynulta*1));
|
||
|
||
|
||
// })
|
||
|
||
|
||
$('label[for="execution-execution_week"]').html('<p class="form-label">Select Execution Week <span class="text-danger">*</span></p><p class="text-danger">*below total exe units & achv % will be calculated basis the week selected here</p>');
|
||
$('label[for="execution-execution_product"]').html('<p class="form-label">Execution Product <span class="text-danger">*</span></p><p class="text-danger">*Pl enter exec/achv units for the week selected above;<br/> eg if week 3 is selected, enter achv/exec units for week 3 only; accordingly total units and percentage will get calculated</p>');
|
||
|
||
function calculateExecution() {
|
||
|
||
let numOfWeek = $('#execution-execution_week').val();
|
||
|
||
if(!numOfWeek) return;
|
||
|
||
// Vintor 4K
|
||
let v4k = parseInt($('#execution-vintor_4k_week'+numOfWeek+'_exe').val()) || 0;
|
||
let v4kPlan = parseInt($('#execution-vintor_4k_units').val()) || 0;
|
||
|
||
$('#execution-vintor_4k_units_execution').val(v4k);
|
||
$('#execution-vintor_4k_percent').val(
|
||
v4kPlan ? ((v4k / v4kPlan) * 100).toFixed(2) : 0
|
||
);
|
||
|
||
// Vintor 10K
|
||
let v10k = parseInt($('#execution-vintor_10k_week'+numOfWeek+'_exe').val()) || 0;
|
||
let v10kPlan = parseInt($('#execution-vintor_10k_units').val()) || 0;
|
||
|
||
$('#execution-vintor_10k_units_execution').val(v10k);
|
||
$('#execution-vintor_10k_percent').val(
|
||
v10kPlan ? ((v10k / v10kPlan) * 100).toFixed(2) : 0
|
||
);
|
||
|
||
// Encicarb 500
|
||
let e500 = parseInt($('#execution-encicarb_500_week'+numOfWeek+'_exe').val()) || 0;
|
||
let e500Plan = parseInt($('#execution-encicarb_500_units').val()) || 0;
|
||
|
||
$('#execution-encicarb_500_units_execution').val(e500);
|
||
$('#execution-encicarb_500_percent').val(
|
||
e500Plan ? ((e500 / e500Plan) * 100).toFixed(2) : 0
|
||
);
|
||
|
||
// Encicarb 100
|
||
let e100 = parseInt($('#execution-encicarb_100_week'+numOfWeek+'_exe').val()) || 0;
|
||
let e100Plan = parseInt($('#execution-encicarb_100_units').val()) || 0;
|
||
|
||
$('#execution-encicarb_100_units_execution').val(e100);
|
||
$('#execution-encicarb_100_percent').val(
|
||
e100Plan ? ((e100 / e100Plan) * 100).toFixed(2) : 0
|
||
);
|
||
|
||
// Dynulta
|
||
let dyn = parseInt($('#execution-dynulta_week'+numOfWeek+'_exe').val()) || 0;
|
||
let dynPlan = parseInt($('#execution-dynulta_units').val()) || 0;
|
||
|
||
$('#execution-dynulta_units_execution').val(dyn);
|
||
$('#execution-dynulta_percent').val(
|
||
dynPlan ? ((dyn / dynPlan) * 100).toFixed(2) : 0
|
||
);
|
||
}
|
||
|
||
|
||
// Auto calculate while typing
|
||
$('[id*="_exe"]').on('keyup change', function () {
|
||
calculateExecution();
|
||
});
|
||
|
||
|
||
// Week change readonly logic
|
||
$('#execution-execution_week').on('change', function () {
|
||
|
||
let selectedWeek = $(this).val();
|
||
|
||
$('[id*="_week"][id*="_exe"]').prop('readonly', true);
|
||
|
||
if (selectedWeek) {
|
||
$(`[id*="_week${selectedWeek}_exe"]`).prop('readonly', false);
|
||
}
|
||
|
||
calculateExecution();
|
||
});
|
||
// $('#execution-execution_week').on('change',function(){
|
||
// let numOfWeek=$('#execution-execution_week').val();
|
||
// console.log("Number of Week : ",numOfWeek);
|
||
|
||
|
||
// /* New Code Calculation */
|
||
|
||
// // $('#execution-vintor_4k_units_execution').val(parseInt($('#execution-vintor_4k_week'+numOfWeek+'_exe').val())||0);
|
||
// $('#execution-vintor_4k_percent').val((( parseInt($('#execution-vintor_4k_units_execution').val()) / parseInt($('#execution-vintor_4k_units').val()) )*100).toFixed(2));
|
||
|
||
// $('#execution-vintor_10k_units_execution').val(parseInt($('#execution-vintor_10k_week'+numOfWeek+'_exe').val())||0);
|
||
// $('#execution-vintor_10k_percent').val((( parseInt($('#execution-vintor_10k_units_execution').val()) / parseInt($('#execution-vintor_10k_units').val()) )*100).toFixed(2));
|
||
|
||
// $('#execution-encicarb_500_units_execution').val(parseInt($('#execution-encicarb_500_week'+numOfWeek+'_exe').val())||0);
|
||
// $('#execution-encicarb_500_percent').val((( parseInt($('#execution-encicarb_500_units_execution').val()) / parseInt($('#execution-encicarb_500_units').val()) )*100).toFixed(2));
|
||
|
||
// $('#execution-encicarb_100_units_execution').val(parseInt($('#execution-encicarb_100_week'+numOfWeek+'_exe').val())||0);
|
||
// $('#execution-encicarb_100_percent').val((( parseInt($('#execution-encicarb_100_units_execution').val()) / parseInt($('#execution-encicarb_100_units').val()) )*100).toFixed(2));
|
||
|
||
// $('#execution-epofer_4k_units_execution').val(parseInt($('#execution-epofer_4k_week'+numOfWeek+'_exe').val())||0);
|
||
// $('#execution-epofer_4k_percent').val((( parseInt($('#execution-epofer_4k_units_execution').val()) / parseInt($('#execution-epofer_4k_units').val()) )*100).toFixed(2));
|
||
|
||
// $('#execution-epofer_10k_units_execution').val(parseInt($('#execution-epofer_10k_week'+numOfWeek+'_exe').val())||0);
|
||
// $('#execution-epofer_10k_percent').val((( parseInt($('#execution-epofer_10k_units_execution').val()) / parseInt($('#execution-epofer_10k_units').val()) )*100).toFixed(2));
|
||
|
||
// /* End of New Code Calculation */
|
||
|
||
|
||
// // if(numOfWeek==='4'){
|
||
// // $('#execution-vintor_4k_week1_exe,#execution-vintor_4k_week2_exe,#execution-vintor_4k_week3_exe,#execution-vintor_4k_week4_exe').on('keyup',function(){
|
||
|
||
// // let d=parseInt($('#execution-vintor_4k_week4_exe').val())||0;
|
||
|
||
// // let total=(d);
|
||
// // $('#execution-vintor_4k_units_execution').val(total);
|
||
// // let oldPlanValue=$('#execution-vintor_4k_units').val();
|
||
// // let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
// // $('#execution-vintor_4k_percent').val(percentage);
|
||
// // })
|
||
|
||
|
||
// // $('#execution-vintor_10k_week1_exe,#execution-vintor_10k_week2_exe,#execution-vintor_10k_week3_exe,#execution-vintor_10k_week4_exe').on('keyup',function(){
|
||
|
||
// // let d=parseInt($('#execution-vintor_10k_week4_exe').val())||0;
|
||
|
||
// // let total=(d);
|
||
// // $('#execution-vintor_10k_units_execution').val(total);
|
||
// // let oldPlanValue=$('#execution-vintor_10k_units').val();
|
||
// // let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
// // $('#execution-vintor_10k_percent').val(percentage);
|
||
// // })
|
||
|
||
// // $('#execution-encicarb_500_week1_exe,#execution-encicarb_500_week2_exe,#execution-encicarb_500_week3_exe,#execution-encicarb_500_week4_exe').on('keyup',function(){
|
||
|
||
// // let d=parseInt($('#execution-encicarb_500_week4_exe').val())||0;
|
||
|
||
// // let total=(d);
|
||
// // $('#execution-encicarb_500_units_execution').val(total);
|
||
// // let oldPlanValue=$('#execution-encicarb_500_units').val();
|
||
// // let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
// // $('#execution-encicarb_500_percent').val(percentage);
|
||
// // })
|
||
|
||
// // $('#execution-encicarb_100_week1_exe,#execution-encicarb_100_week2_exe,#execution-encicarb_100_week3_exe,#execution-encicarb_100_week4_exe').on('keyup',function(){
|
||
// // let d=parseInt($('#execution-encicarb_100_week4_exe').val())||0;
|
||
|
||
// // let total=(d);
|
||
// // $('#execution-encicarb_100_units_execution').val(total);
|
||
// // let oldPlanValue=$('#execution-encicarb_100_units').val();
|
||
// // let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
// // $('#execution-encicarb_100_percent').val(percentage);
|
||
// // })
|
||
|
||
// // $('#execution-epofer_4k_week1_exe,#execution-epofer_4k_week2_exe,#execution-epofer_4k_week3_exe,#execution-epofer_4k_week4_exe').on('keyup',function(){
|
||
// // let d=parseInt($('#execution-epofer_4k_week4_exe').val())||0;
|
||
|
||
// // let total=(d);
|
||
// // $('#execution-epofer_4k_units_execution').val(total);
|
||
// // let oldPlanValue=$('#execution-epofer_4k_units').val();
|
||
// // let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
// // $('#execution-epofer_4k_percent').val(percentage);
|
||
// // })
|
||
|
||
// // $('#execution-epofer_10k_week1_exe,#execution-epofer_10k_week2_exe,#execution-epofer_10k_week3_exe,#execution-epofer_10k_week4_exe').on('keyup',function(){
|
||
// // let d=parseInt($('#execution-epofer_10k_week4_exe').val())||0;
|
||
|
||
// // let total=(d);
|
||
// // $('#execution-epofer_10k_units_execution').val(total);
|
||
// // let oldPlanValue=$('#execution-epofer_10k_units').val();
|
||
// // let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
// // $('#execution-epofer_10k_percent').val(percentage);
|
||
// // })
|
||
|
||
// // $('#execution-dynulta_week1_exe,#execution-dynulta_week2_exe,#execution-dynulta_week3_exe,#execution-dynulta_week4_exe').on('keyup',function(){
|
||
|
||
// // let d = parseInt($('#execution-dynulta_week4_exe').val()) || 0;
|
||
|
||
// // let total = (d);
|
||
// // $('#execution-dynulta_units_execution').val(total);
|
||
// // let oldPlanValue = $('#execution-dynulta_units').val();
|
||
// // let percentage = ((total / oldPlanValue) * 100).toFixed(2);
|
||
// // $('#execution-dynulta_percent').val(percentage);
|
||
// // });
|
||
// // }
|
||
// else if(numOfWeek==='1'){
|
||
// $('#execution-vintor_4k_week1_exe,#execution-vintor_4k_week2_exe,#execution-vintor_4k_week3_exe,#execution-vintor_4k_week4_exe').on('keyup',function(){
|
||
|
||
// let d=parseInt($('#execution-vintor_4k_week1_exe').val())||0;
|
||
|
||
// let total=(d);
|
||
// $('#execution-vintor_4k_units_execution').val(total);
|
||
// let oldPlanValue=$('#execution-vintor_4k_units').val();
|
||
// let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
// $('#execution-vintor_4k_percent').val(percentage);
|
||
// })
|
||
|
||
|
||
// $('#execution-vintor_10k_week1_exe,#execution-vintor_10k_week2_exe,#execution-vintor_10k_week3_exe,#execution-vintor_10k_week4_exe').on('keyup',function(){
|
||
|
||
// let d=parseInt($('#execution-vintor_10k_week1_exe').val())||0;
|
||
|
||
// let total=(d);
|
||
// $('#execution-vintor_10k_units_execution').val(total);
|
||
// let oldPlanValue=$('#execution-vintor_10k_units').val();
|
||
// let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
// $('#execution-vintor_10k_percent').val(percentage);
|
||
// })
|
||
|
||
// $('#execution-encicarb_500_week1_exe,#execution-encicarb_500_week2_exe,#execution-encicarb_500_week3_exe,#execution-encicarb_500_week4_exe').on('keyup',function(){
|
||
|
||
// let d=parseInt($('#execution-encicarb_500_week1_exe').val())||0;
|
||
|
||
// let total=(d);
|
||
// $('#execution-encicarb_500_units_execution').val(total);
|
||
// let oldPlanValue=$('#execution-encicarb_500_units').val();
|
||
// let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
// $('#execution-encicarb_500_percent').val(percentage);
|
||
// })
|
||
|
||
// $('#execution-encicarb_100_week1_exe,#execution-encicarb_100_week2_exe,#execution-encicarb_100_week3_exe,#execution-encicarb_100_week4_exe').on('keyup',function(){
|
||
// let d=parseInt($('#execution-encicarb_100_week1_exe').val())||0;
|
||
|
||
// let total=(d);
|
||
// $('#execution-encicarb_100_units_execution').val(total);
|
||
// let oldPlanValue=$('#execution-encicarb_100_units').val();
|
||
// let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
// $('#execution-encicarb_100_percent').val(percentage);
|
||
// })
|
||
|
||
// $('#execution-epofer_4k_week1_exe,#execution-epofer_4k_week2_exe,#execution-epofer_4k_week3_exe,#execution-epofer_4k_week4_exe').on('keyup',function(){
|
||
// let d=parseInt($('#execution-epofer_4k_week1_exe').val())||0;
|
||
|
||
// let total=(d);
|
||
// $('#execution-epofer_4k_units_execution').val(total);
|
||
// let oldPlanValue=$('#execution-epofer_4k_units').val();
|
||
// let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
// $('#execution-epofer_4k_percent').val(percentage);
|
||
// })
|
||
|
||
// $('#execution-epofer_10k_week1_exe,#execution-epofer_10k_week2_exe,#execution-epofer_10k_week3_exe,#execution-epofer_10k_week4_exe').on('keyup',function(){
|
||
// let d=parseInt($('#execution-epofer_10k_week1_exe').val())||0;
|
||
|
||
// let total=(d);
|
||
// $('#execution-epofer_10k_units_execution').val(total);
|
||
// let oldPlanValue=$('#execution-epofer_10k_units').val();
|
||
// let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
// $('#execution-epofer_10k_percent').val(percentage);
|
||
// })
|
||
|
||
// $('#execution-dynulta_week1_exe,#execution-dynulta_week2_exe,#execution-dynulta_week3_exe,#execution-dynulta_week4_exe').on('keyup',function(){
|
||
|
||
// let d = parseInt($('#execution-dynulta_week1_exe').val()) || 0;
|
||
|
||
// let total = (d);
|
||
// $('#execution-dynulta_units_execution').val(total);
|
||
// let oldPlanValue = $('#execution-dynulta_units').val();
|
||
// let percentage = ((total / oldPlanValue) * 100).toFixed(2);
|
||
// $('#execution-dynulta_percent').val(percentage);
|
||
// });
|
||
// }
|
||
|
||
// else if(numOfWeek==='2'){
|
||
// $('#execution-vintor_4k_week1_exe,#execution-vintor_4k_week2_exe,#execution-vintor_4k_week3_exe,#execution-vintor_4k_week4_exe').on('keyup',function(){
|
||
|
||
// let d=parseInt($('#execution-vintor_4k_week2_exe').val())||0;
|
||
|
||
// let total=(d);
|
||
// $('#execution-vintor_4k_units_execution').val(total);
|
||
// let oldPlanValue=$('#execution-vintor_4k_units').val();
|
||
// let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
// $('#execution-vintor_4k_percent').val(percentage);
|
||
// })
|
||
|
||
|
||
// $('#execution-vintor_10k_week1_exe,#execution-vintor_10k_week2_exe,#execution-vintor_10k_week3_exe,#execution-vintor_10k_week4_exe').on('keyup',function(){
|
||
|
||
// let d=parseInt($('#execution-vintor_10k_week2_exe').val())||0;
|
||
|
||
// let total=(d);
|
||
// $('#execution-vintor_10k_units_execution').val(total);
|
||
// let oldPlanValue=$('#execution-vintor_10k_units').val();
|
||
// let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
// $('#execution-vintor_10k_percent').val(percentage);
|
||
// })
|
||
|
||
// $('#execution-encicarb_500_week1_exe,#execution-encicarb_500_week2_exe,#execution-encicarb_500_week3_exe,#execution-encicarb_500_week4_exe').on('keyup',function(){
|
||
|
||
// let d=parseInt($('#execution-encicarb_500_week2_exe').val())||0;
|
||
|
||
// let total=(d);
|
||
// $('#execution-encicarb_500_units_execution').val(total);
|
||
// let oldPlanValue=$('#execution-encicarb_500_units').val();
|
||
// let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
// $('#execution-encicarb_500_percent').val(percentage);
|
||
// })
|
||
|
||
// $('#execution-encicarb_100_week1_exe,#execution-encicarb_100_week2_exe,#execution-encicarb_100_week3_exe,#execution-encicarb_100_week4_exe').on('keyup',function(){
|
||
// let d=parseInt($('#execution-encicarb_100_week2_exe').val())||0;
|
||
|
||
// let total=(d);
|
||
// $('#execution-encicarb_100_units_execution').val(total);
|
||
// let oldPlanValue=$('#execution-encicarb_100_units').val();
|
||
// let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
// $('#execution-encicarb_100_percent').val(percentage);
|
||
// })
|
||
|
||
// $('#execution-epofer_4k_week1_exe,#execution-epofer_4k_week2_exe,#execution-epofer_4k_week3_exe,#execution-epofer_4k_week4_exe').on('keyup',function(){
|
||
// let d=parseInt($('#execution-epofer_4k_week2_exe').val())||0;
|
||
|
||
// let total=(d);
|
||
// $('#execution-epofer_4k_units_execution').val(total);
|
||
// let oldPlanValue=$('#execution-epofer_4k_units').val();
|
||
// let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
// $('#execution-epofer_4k_percent').val(percentage);
|
||
// })
|
||
|
||
// $('#execution-epofer_10k_week1_exe,#execution-epofer_10k_week2_exe,#execution-epofer_10k_week3_exe,#execution-epofer_10k_week4_exe').on('keyup',function(){
|
||
// let d=parseInt($('#execution-epofer_10k_week2_exe').val())||0;
|
||
|
||
// let total=(d);
|
||
// $('#execution-epofer_10k_units_execution').val(total);
|
||
// let oldPlanValue=$('#execution-epofer_10k_units').val();
|
||
// let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
// $('#execution-epofer_10k_percent').val(percentage);
|
||
// })
|
||
|
||
// $('#execution-dynulta_week1_exe,#execution-dynulta_week2_exe,#execution-dynulta_week3_exe,#execution-dynulta_week4_exe').on('keyup',function(){
|
||
|
||
// let d = parseInt($('#execution-dynulta_week2_exe').val()) || 0;
|
||
|
||
// let total = (d);
|
||
// $('#execution-dynulta_units_execution').val(total);
|
||
// let oldPlanValue = $('#execution-dynulta_units').val();
|
||
// let percentage = ((total / oldPlanValue) * 100).toFixed(2);
|
||
// $('#execution-dynulta_percent').val(percentage);
|
||
// });
|
||
// }
|
||
|
||
// else if(numOfWeek==='3'){
|
||
// $('#execution-vintor_4k_week1_exe,#execution-vintor_4k_week2_exe,#execution-vintor_4k_week3_exe,#execution-vintor_4k_week4_exe').on('keyup',function(){
|
||
|
||
// let d=parseInt($('#execution-vintor_4k_week3_exe').val())||0;
|
||
|
||
// let total=(d);
|
||
// $('#execution-vintor_4k_units_execution').val(total);
|
||
// let oldPlanValue=$('#execution-vintor_4k_units').val();
|
||
// let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
// $('#execution-vintor_4k_percent').val(percentage);
|
||
// })
|
||
|
||
|
||
// $('#execution-vintor_10k_week1_exe,#execution-vintor_10k_week2_exe,#execution-vintor_10k_week3_exe,#execution-vintor_10k_week4_exe').on('keyup',function(){
|
||
|
||
// let d=parseInt($('#execution-vintor_10k_week3_exe').val())||0;
|
||
|
||
// let total=(d);
|
||
// $('#execution-vintor_10k_units_execution').val(total);
|
||
// let oldPlanValue=$('#execution-vintor_10k_units').val();
|
||
// let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
// $('#execution-vintor_10k_percent').val(percentage);
|
||
// })
|
||
|
||
// $('#execution-encicarb_500_week1_exe,#execution-encicarb_500_week2_exe,#execution-encicarb_500_week3_exe,#execution-encicarb_500_week4_exe').on('keyup',function(){
|
||
|
||
// let d=parseInt($('#execution-encicarb_500_week3_exe').val())||0;
|
||
|
||
// let total=(d);
|
||
// $('#execution-encicarb_500_units_execution').val(total);
|
||
// let oldPlanValue=$('#execution-encicarb_500_units').val();
|
||
// let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
// $('#execution-encicarb_500_percent').val(percentage);
|
||
// })
|
||
|
||
// $('#execution-encicarb_100_week1_exe,#execution-encicarb_100_week2_exe,#execution-encicarb_100_week3_exe,#execution-encicarb_100_week4_exe').on('keyup',function(){
|
||
// let d=parseInt($('#execution-encicarb_100_week3_exe').val())||0;
|
||
|
||
// let total=(d);
|
||
// $('#execution-encicarb_100_units_execution').val(total);
|
||
// let oldPlanValue=$('#execution-encicarb_100_units').val();
|
||
// let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
// $('#execution-encicarb_100_percent').val(percentage);
|
||
// })
|
||
|
||
// $('#execution-epofer_4k_week1_exe,#execution-epofer_4k_week2_exe,#execution-epofer_4k_week3_exe,#execution-epofer_4k_week4_exe').on('keyup',function(){
|
||
// let d=parseInt($('#execution-epofer_4k_week3_exe').val())||0;
|
||
|
||
// let total=(d);
|
||
// $('#execution-epofer_4k_units_execution').val(total);
|
||
// let oldPlanValue=$('#execution-epofer_4k_units').val();
|
||
// let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
// $('#execution-epofer_4k_percent').val(percentage);
|
||
// })
|
||
|
||
// $('#execution-epofer_10k_week1_exe,#execution-epofer_10k_week2_exe,#execution-epofer_10k_week3_exe,#execution-epofer_10k_week4_exe').on('keyup',function(){
|
||
// let d=parseInt($('#execution-epofer_10k_week3_exe').val())||0;
|
||
|
||
// let total=(d);
|
||
// $('#execution-epofer_10k_units_execution').val(total);
|
||
// let oldPlanValue=$('#execution-epofer_10k_units').val();
|
||
// let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
// $('#execution-epofer_10k_percent').val(percentage);
|
||
// })
|
||
|
||
// $('#execution-dynulta_week1_exe,#execution-dynulta_week2_exe,#execution-dynulta_week3_exe,#execution-dynulta_week4_exe').on('keyup',function(){
|
||
|
||
// let d = parseInt($('#execution-dynulta_week3_exe').val()) || 0;
|
||
|
||
// let total = (d);
|
||
// $('#execution-dynulta_units_execution').val(total);
|
||
// let oldPlanValue = $('#execution-dynulta_units').val();
|
||
// let percentage = ((total / oldPlanValue) * 100).toFixed(2);
|
||
// $('#execution-dynulta_percent').val(percentage);
|
||
// });
|
||
// }
|
||
|
||
|
||
// })
|
||
|
||
|
||
$('#execution-vintor_4k_week1_exe,#execution-vintor_4k_week2_exe,#execution-vintor_4k_week3_exe,#execution-vintor_4k_week4_exe').on('keyup',function(){
|
||
|
||
let d=parseInt($('#execution-vintor_4k_week4_exe').val())||0;
|
||
|
||
let total=(d);
|
||
$('#execution-vintor_4k_units_execution').val(total);
|
||
let oldPlanValue=$('#execution-vintor_4k_units').val();
|
||
let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
$('#execution-vintor_4k_percent').val(percentage);
|
||
})
|
||
|
||
|
||
$('#execution-vintor_10k_week1_exe,#execution-vintor_10k_week2_exe,#execution-vintor_10k_week3_exe,#execution-vintor_10k_week4_exe').on('keyup',function(){
|
||
|
||
let d=parseInt($('#execution-vintor_10k_week4_exe').val())||0;
|
||
|
||
let total=(d);
|
||
$('#execution-vintor_10k_units_execution').val(total);
|
||
let oldPlanValue=$('#execution-vintor_10k_units').val();
|
||
let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
$('#execution-vintor_10k_percent').val(percentage);
|
||
})
|
||
|
||
$('#execution-encicarb_500_week1_exe,#execution-encicarb_500_week2_exe,#execution-encicarb_500_week3_exe,#execution-encicarb_500_week4_exe').on('keyup',function(){
|
||
|
||
let d=parseInt($('#execution-encicarb_500_week4_exe').val())||0;
|
||
|
||
let total=(d);
|
||
$('#execution-encicarb_500_units_execution').val(total);
|
||
let oldPlanValue=$('#execution-encicarb_500_units').val();
|
||
let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
$('#execution-encicarb_500_percent').val(percentage);
|
||
})
|
||
|
||
$('#execution-encicarb_100_week1_exe,#execution-encicarb_100_week2_exe,#execution-encicarb_100_week3_exe,#execution-encicarb_100_week4_exe').on('keyup',function(){
|
||
let d=parseInt($('#execution-encicarb_100_week4_exe').val())||0;
|
||
|
||
let total=(d);
|
||
$('#execution-encicarb_100_units_execution').val(total);
|
||
let oldPlanValue=$('#execution-encicarb_100_units').val();
|
||
let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
$('#execution-encicarb_100_percent').val(percentage);
|
||
})
|
||
|
||
$('#execution-epofer_4k_week1_exe,#execution-epofer_4k_week2_exe,#execution-epofer_4k_week3_exe,#execution-epofer_4k_week4_exe').on('keyup',function(){
|
||
let d=parseInt($('#execution-epofer_4k_week4_exe').val())||0;
|
||
|
||
let total=(d);
|
||
$('#execution-epofer_4k_units_execution').val(total);
|
||
let oldPlanValue=$('#execution-epofer_4k_units').val();
|
||
let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
$('#execution-epofer_4k_percent').val(percentage);
|
||
})
|
||
|
||
$('#execution-epofer_10k_week1_exe,#execution-epofer_10k_week2_exe,#execution-epofer_10k_week3_exe,#execution-epofer_10k_week4_exe').on('keyup',function(){
|
||
let d=parseInt($('#execution-epofer_10k_week4_exe').val())||0;
|
||
|
||
let total=(d);
|
||
$('#execution-epofer_10k_units_execution').val(total);
|
||
let oldPlanValue=$('#execution-epofer_10k_units').val();
|
||
let percentage=((total/oldPlanValue)*100).toFixed(2);
|
||
$('#execution-epofer_10k_percent').val(percentage);
|
||
})
|
||
|
||
|
||
|
||
|
||
|
||
})
|
||
|
||
|
||
$('.edit-plan-btn').click(function() {
|
||
$('#execution-form-wrapper').show(100, () => {
|
||
$('#add-camp-btn').hide(0);
|
||
})
|
||
$('#table-wrapper').hide()
|
||
|
||
|
||
$('#execution-execution_date,#execution-execution_week,#execution_table').parent().hide();
|
||
$('#execution-execution_date,#execution-execution_week,#execution_table').attr('required',false);
|
||
|
||
$('#execution-doctor_name').change(function() {
|
||
$('#execution-speciality').val($('option:selected', this).attr('speciality'))
|
||
})
|
||
|
||
$('#execution-doctor_name').change(function() {
|
||
$('#execution-uid_number').val($('option:selected', this).attr('uid'))
|
||
})
|
||
|
||
$('#execution-speciality').prop('readonly', true)
|
||
|
||
$('#execution-msl_code').prop('readonly',true);
|
||
|
||
let selected = JSON.parse($(this).attr('plan_details'))
|
||
console.log("Plan_Details : ",selected);
|
||
console.log("Hospital Name is : ",selected['contact_id']);
|
||
for (let k of Object.keys(selected)) {
|
||
|
||
if (selected[k] != '') {
|
||
if (k == 'contact_id') {
|
||
//$("#execution-contact_id option:contains(" + selected[k] + ")").prop('selected', true)
|
||
// console.log($("#execution-contact_id option:contains(" + selected[k] + ")").attr('value'))
|
||
$('#execution-contact_id').val($("#execution-contact_id option:contains(" +
|
||
selected[k] + ")").attr('value'));
|
||
}
|
||
else if (k == 'doctor_name') {
|
||
//$("#execution-contact_id option:contains(" + selected[k] + ")").prop('selected', true)
|
||
// console.log($("#execution-contact_id option:contains(" + selected[k] + ")").attr('value'))
|
||
$('#execution-doctor_name').val($("#execution-doctor_name option:contains(" +
|
||
selected[k] + ")").attr('value'));
|
||
}
|
||
|
||
else
|
||
{
|
||
$('#execution-' + k).val(selected[k]);
|
||
}
|
||
}
|
||
// if(selected[k] != '')
|
||
// $('#execution-'+k).val(selected[k]);
|
||
}
|
||
let docid = $('#execution-contact_id option').map(function() {
|
||
if ($(this).text().trim() == selected['contact_id']) return this;
|
||
}).attr('value')
|
||
console.log("docid : ",docid);
|
||
$('#execution-contact_id').val(docid)
|
||
$('#execution-id').val(selected['id'])
|
||
$('#execution-dummyformid').val(selected['proxy_formid'])
|
||
|
||
|
||
$('#execution-execution_month').parent().hide();
|
||
|
||
$('#execution-execution_month').attr({"required":false});
|
||
|
||
$('#execution-vintor_4k_units,#execution-vintor_10k_units,#execution-encicarb_500_units,#execution-encicarb_100_units,#execution-encicarb_100_units,#execution-epofer_4k_units,#execution-epofer_10k_units,#execution-dynulta_units').prop('readonly',false);
|
||
|
||
// $('#execution-vintor_4k_units,#execution-vintor_10k_units,#execution-encicarb_500_units,#execution-encicarb_100_units,#execution-encicarb_100_units,#execution-epofer_4k_units,#execution-epofer_10k_units,#execution-dynulta_units').on('keyup',function(){
|
||
// let week=$('#execution-select_plan_week').val();
|
||
// console.log("week :",week);
|
||
// let month_plan_units_Victor_4k=(parseInt($('#execution-vintor_4k_units').val()))||0;
|
||
// let month_plan_units_Victor_10k=parseInt($('#execution-vintor_10k_units').val())||0;
|
||
// let month_plan_units_Encicarb_500=parseInt($('#execution-encicarb_500_units').val())||0;
|
||
// let month_plan_units_Encicarb_100=parseInt($('#execution-encicarb_100_units').val())||0;
|
||
// // let month_plan_units_Epofer_4K=parseInt($('#execution-epofer_4k_units').val())||0;
|
||
// // let month_plan_units_Epofer_10K=parseInt($('#execution-epofer_10k_units').val())||0;
|
||
// let month_plan_units_Dynulta=parseInt($('#execution-dynulta_units').val())||0;
|
||
|
||
|
||
|
||
// $('#execution-vintor_4k_week1').val(Math.round(month_plan_units_Victor_4k*0.2));
|
||
// $('#execution-vintor_10k_week1').val(Math.round(month_plan_units_Victor_10k*0.2));
|
||
// $('#execution-encicarb_500_week1').val(Math.round(month_plan_units_Encicarb_500*0.2));
|
||
// $('#execution-encicarb_100_week1').val(Math.round(month_plan_units_Encicarb_100*0.2));
|
||
// // $('#execution-epofer_4k_week1').val(Math.round(month_plan_units_Epofer_4K*0.2));
|
||
// // $('#execution-epofer_10k_week1').val(Math.round(month_plan_units_Epofer_10K*0.2));
|
||
// $('#execution-dynulta_week1').val(Math.round(month_plan_units_Dynulta*0.2));
|
||
|
||
|
||
// $('#execution-vintor_4k_week2').val(Math.round(month_plan_units_Victor_4k*0.4));
|
||
// $('#execution-vintor_10k_week2').val(Math.round(month_plan_units_Victor_10k*0.4));
|
||
// $('#execution-encicarb_500_week2').val(Math.round(month_plan_units_Encicarb_500*0.4));
|
||
// $('#execution-encicarb_100_week2').val(Math.round(month_plan_units_Encicarb_100*0.4));
|
||
// // $('#execution-epofer_4k_week2').val(Math.round(month_plan_units_Epofer_4K*0.4));
|
||
// // $('#execution-epofer_10k_week2').val(Math.round(month_plan_units_Epofer_10K*0.4));
|
||
// $('#execution-dynulta_week2').val(Math.round(month_plan_units_Dynulta*0.4));
|
||
|
||
|
||
|
||
// $('#execution-vintor_4k_week3').val(Math.round(month_plan_units_Victor_4k*0.7));
|
||
// $('#execution-vintor_10k_week3').val(Math.round(month_plan_units_Victor_10k*0.7));
|
||
// $('#execution-encicarb_500_week3').val(Math.round(month_plan_units_Encicarb_500*0.7));
|
||
// $('#execution-encicarb_100_week3').val(Math.round(month_plan_units_Encicarb_100*0.7));
|
||
// // $('#execution-epofer_4k_week3').val(Math.round(month_plan_units_Epofer_4K*0.7));
|
||
// // $('#execution-epofer_10k_week3').val(Math.round(month_plan_units_Epofer_10K*0.7));
|
||
// $('#execution-dynulta_week3').val(Math.round(month_plan_units_Dynulta*0.7));
|
||
|
||
|
||
|
||
// $('#execution-vintor_4k_week4').val(Math.round(month_plan_units_Victor_4k*1));
|
||
// $('#execution-vintor_10k_week4').val(Math.round(month_plan_units_Victor_10k*1));
|
||
// $('#execution-encicarb_500_week4').val(Math.round(month_plan_units_Encicarb_500*1));
|
||
// $('#execution-encicarb_100_week4').val(Math.round(month_plan_units_Encicarb_100*1));
|
||
// // $('#execution-epofer_4k_week4').val(Math.round(month_plan_units_Epofer_4K*1));
|
||
// // $('#execution-epofer_10k_week4').val(Math.round(month_plan_units_Epofer_10K*1));
|
||
// $('#execution-dynulta_week4').val(Math.round(month_plan_units_Dynulta*1));
|
||
|
||
|
||
// })
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
})
|
||
|
||
|
||
$('#report-form').on('submit', function(event) {
|
||
event.preventDefault();
|
||
$("#pageloader").fadeIn();
|
||
$.ajax({
|
||
type: "POST",
|
||
url: '/form/ajaxsubmit',
|
||
data: new FormData($('#report-form')[0]),
|
||
processData: false,
|
||
contentType: false,
|
||
success: function(data) {
|
||
$("#pageloader").fadeOut();
|
||
if (data.status == 'success') {
|
||
Swal.fire({
|
||
title: 'Great!',
|
||
text: 'Your data is successfully submitted!',
|
||
icon: 'success'
|
||
})
|
||
window.location.reload();
|
||
//$('#report-form').trigger("reset");
|
||
} else {
|
||
Swal.fire({
|
||
icon: 'error',
|
||
title: 'Data not submitted',
|
||
text: 'Something went wrong, please try again after some time!'
|
||
})
|
||
}
|
||
},
|
||
});
|
||
});
|
||
|
||
// $('#execution-sitazit_d_rx').attr({
|
||
// "min":0,
|
||
// "max":50
|
||
// });
|
||
// $('#execution-sitazit_dm_rx').attr({
|
||
// "min":0,
|
||
// "max":50
|
||
// });
|
||
// $('#execution-ziten_m_rx').attr({
|
||
// "min":0,
|
||
// "max":50
|
||
// });
|
||
|
||
|
||
|
||
$('#field-doctor_name').change(function() {
|
||
$('#field-speciality').val($('option:selected', this).attr('speciality'))
|
||
})
|
||
|
||
$('#field-doctor_name').change(function() {
|
||
$('#field-uid_number').val($('option:selected', this).attr('uid'))
|
||
})
|
||
|
||
|
||
$('#field-uid_number').prop('readonly',true);
|
||
$('#field-speciality').prop('readonly',true);
|
||
|
||
$('#field-speciality').prop('required',false);
|
||
$('#field-uid_number').prop('required',false);
|
||
|
||
$('#execution-total_camp_rx').prop('readonly',true);
|
||
$('#execution-expected_patients_to_be_screened').prop('readonly',true);
|
||
$('#execution-sitazit_d_rx,#execution-sitazit_dm_rx,#execution-ziten_m_rx').on('input',function(){
|
||
var a=parseInt($('#execution-sitazit_d_rx').val())||0;
|
||
var b=parseInt($('#execution-sitazit_dm_rx').val())||0;
|
||
var c=parseInt($('#execution-ziten_m_rx').val())||0;
|
||
var total=a+b+c;
|
||
$('#execution-total_camp_rx').val(total)
|
||
})
|
||
|
||
$('#execution-form').on('submit', function(event) {
|
||
event.preventDefault();
|
||
$("#pageloader").fadeIn();
|
||
$.ajax({
|
||
type: "POST",
|
||
url: '/form/ajaxsubmit',
|
||
data: new FormData($('#execution-form')[0]),
|
||
processData: false,
|
||
contentType: false,
|
||
success: function(data) {
|
||
$("#pageloader").fadeOut();
|
||
if (data.status == 'success') {
|
||
Swal.fire({
|
||
title: 'Great!',
|
||
text: 'Your data is successfully submitted!',
|
||
icon: 'success'
|
||
})
|
||
window.location.reload();
|
||
//$('#report-form').trigger("reset");
|
||
} else {
|
||
Swal.fire({
|
||
icon: 'error',
|
||
title: 'Data not submitted',
|
||
text: 'Something went wrong, please try again after some time!'
|
||
})
|
||
}
|
||
},
|
||
});
|
||
});
|
||
|
||
var today = new Date();
|
||
var dd = String(today.getDate()).padStart(2, '0');
|
||
var mm = String(today.getMonth() + 1).padStart(2, '0');
|
||
var yyyy = today.getFullYear();
|
||
today = yyyy + '-' + mm + '-' + dd;
|
||
|
||
var recordDateField = document.getElementById('field-plan_date');
|
||
//recordDateField.setAttribute('min', today);
|
||
|
||
var executionDateField = document.getElementById('execution-plan_date');
|
||
//executionDateField.setAttribute('min', today);
|
||
|
||
// $('.edit-btn').click(function() {
|
||
// var executionexeField = document.getElementById('execution-record_date');
|
||
// executionexeField.setAttribute('min', executionDateField.value);
|
||
// });
|
||
|
||
|
||
|
||
// $('.edit-btn').click(function() {
|
||
// var executionexeField = document.getElementById('execution-execution_date');
|
||
// executionexeField.setAttribute('min', executionDateField.value);
|
||
// });
|
||
$('.edit-btn').click(function() {
|
||
|
||
var executionexeField =
|
||
document.getElementById('execution-execution_date');
|
||
|
||
let today = new Date();
|
||
|
||
let localToday =
|
||
today.getFullYear() + '-' +
|
||
String(today.getMonth() + 1).padStart(2, '0') + '-' +
|
||
String(today.getDate()).padStart(2, '0');
|
||
|
||
executionexeField.setAttribute('max', localToday);
|
||
|
||
});
|
||
|
||
|
||
|
||
executionDateField.addEventListener('change', function() {
|
||
console.log('gg');
|
||
var executionexeField = document.getElementById('execution-record_date');
|
||
executionexeField.setAttribute('min', executionDateField.value);
|
||
});
|
||
|
||
|
||
});
|
||
</script>
|
||
|
||
</body>
|
||
|
||
</html> |