1306 lines
82 KiB
PHP
1306 lines
82 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
|
|
$brandData = [
|
|
|
|
['brand'=>'Kidney Transplant', 'slug'=>'kidney_transplant_dennovo','pseudoId'=>'kidney_transplant_gennova','pseudoId2'=>'kidney_transplant_graftsol','pseudoId3'=>'kidney_transplant_total'],
|
|
['brand'=>'Liver Transplant', 'slug'=>'liver_transplant_dennovo','pseudoId'=>'liver_transplant_gennova','pseudoId2'=>'liver_transplant_graftsol','pseudoId3'=>'liver_transplant_total'],
|
|
['brand'=>'Heart/Others', 'slug'=>'heart_transplant_dennovo','pseudoId'=>'heart_transplant_gennova','pseudoId2'=>'heart_transplant_graftsol','pseudoId3'=>'heart_transplant_total'],
|
|
['brand'=>'Cardioplegia', 'slug'=>'cardio_transplant_dennovo','pseudoId'=>'cardio_transplant_gennova','pseudoId2'=>'cardio_transplant_graftsol','pseudoId3'=>'cardio_transplant_total'],
|
|
['brand'=>'Total Transplants ', 'slug'=>'total_transplant_dennovo','pseudoId'=>'total_transplant_gennova','pseudoId2'=>'total_transplant_graftsol','pseudoId3'=>'total_transplant_total'],
|
|
|
|
];
|
|
|
|
$brandData2 = [
|
|
|
|
['brand'=>'Kidney Transplant', 'slug'=>'kidney_transplant','pseudoId'=>'kidney_transplant_gennova_week1','pseudoId2'=>'kidney_transplant_gennova_week2','pseudoId3'=>'kidney_transplant_gennova_week3','pseudoId4'=>'kidney_transplant_gennova_week4','pseudoId5'=>'kidney_transplant_switch_week1','pseudoId6'=>'kidney_transplant_switch_week2','pseudoId7'=>'kidney_transplant_switch_week3','pseudoId8'=>'kidney_transplant_switch_week4','pseudoId9'=>'kidney_transplant_graftsol_week1','pseudoId10'=>'kidney_transplant_graftsol_week2','pseudoId11'=>'kidney_transplant_graftsol_week3','pseudoId12'=>'kidney_transplant_graftsol_week4'],
|
|
['brand'=>'liver Transplant', 'slug'=>'liver_transplant','pseudoId'=>'liver_transplant_gennova_week1','pseudoId2'=>'liver_transplant_gennova_week2','pseudoId3'=>'liver_transplant_gennova_week3','pseudoId4'=>'liver_transplant_gennova_week4','pseudoId5'=>'liver_transplant_switch_week1','pseudoId6'=>'liver_transplant_switch_week2','pseudoId7'=>'liver_transplant_switch_week3','pseudoId8'=>'liver_transplant_switch_week4','pseudoId9'=>'liver_transplant_graftsol_week1','pseudoId10'=>'liver_transplant_graftsol_week2','pseudoId11'=>'liver_transplant_graftsol_week3','pseudoId12'=>'liver_transplant_graftsol_week4'],
|
|
['brand'=>'Heart/Others', 'slug'=>'heart_transplant','pseudoId'=>'heart_transplant_gennova_week1','pseudoId2'=>'heart_transplant_gennova_week2','pseudoId3'=>'heart_transplant_gennova_week3','pseudoId4'=>'heart_transplant_gennova_week4','pseudoId5'=>'heart_transplant_switch_week1','pseudoId6'=>'heart_transplant_switch_week2','pseudoId7'=>'heart_transplant_switch_week3','pseudoId8'=>'heart_transplant_switch_week4','pseudoId9'=>'heart_transplant_graftsol_week1','pseudoId10'=>'heart_transplant_graftsol_week2','pseudoId11'=>'heart_transplant_graftsol_week3','pseudoId12'=>'heart_transplant_graftsol_week4'],
|
|
['brand'=>'Cardioplegia', 'slug'=>'cardio_transplant','pseudoId'=>'cardio_transplant_gennova_week1','pseudoId2'=>'cardio_transplant_gennova_week2','pseudoId3'=>'cardio_transplant_gennova_week3','pseudoId4'=>'cardio_transplant_gennova_week4','pseudoId5'=>'cardio_transplant_switch_week1','pseudoId6'=>'cardio_transplant_switch_week2','pseudoId7'=>'cardio_transplant_switch_week3','pseudoId8'=>'cardio_transplant_switch_week4','pseudoId9'=>'cardio_transplant_graftsol_week1','pseudoId10'=>'cardio_transplant_graftsol_week2','pseudoId11'=>'cardio_transplant_graftsol_week3','pseudoId12'=>'cardio_transplant_graftsol_week4'],
|
|
['brand'=>'Total Transplant', 'slug'=>'total_transplant','pseudoId'=>'total_transplant_gennova_week1','pseudoId2'=>'total_transplant_gennova_week2','pseudoId3'=>'total_transplant_gennova_week3','pseudoId4'=>'total_transplant_gennova_week4','pseudoId5'=>'total_transplant_switch_week1','pseudoId6'=>'total_transplant_switch_week2','pseudoId7'=>'total_transplant_switch_week3','pseudoId8'=>'total_transplant_switch_week4','pseudoId9'=>'total_transplant_graftsol_week1','pseudoId10'=>'total_transplant_graftsol_week2','pseudoId11'=>'total_transplant_graftsol_week3','pseudoId12'=>'total_transplant_graftsol_week4']
|
|
|
|
|
|
];
|
|
|
|
|
|
@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>Plan Date</th>
|
|
<th>Execution Done</th>
|
|
|
|
<th>Doctor Name</th>
|
|
<th>Centre Name</th>
|
|
<th>Execution Date</th>
|
|
|
|
<th>Plan Month</th>
|
|
<th>Speciality</th>
|
|
<th>UID Number</th>
|
|
|
|
|
|
<th>Kidney Transplant-Dennovo Plan </th>
|
|
<th>Liver Transplant-Dennovo Plan</th>
|
|
<th>Heart/Others Transplant-Dennovo Plan</th>
|
|
<th>Cardioplegia-Dennovo Plan</th>
|
|
<th>Total Transplants-Dennovo Plan</th>
|
|
|
|
<th>Kidney Transplant-Switch Plan </th>
|
|
<th>Liver Transplant-Switch Plan</th>
|
|
<th>Heart/Others Transplant-Switch Plan</th>
|
|
<th>Cardioplegia-Switch Plan</th>
|
|
<th>Total Transplants-Switch Plan</th>
|
|
|
|
<th>Kidney Transplant-Graftsol Tx Plan </th>
|
|
<th>Liver Transplant-Graftsol Tx Plan</th>
|
|
<th>Heart/Others Transplant-Graftsol Tx Plan</th>
|
|
<th>Cardioplegia-Graftsol Tx Plan</th>
|
|
<th>Total Transplants-Graftsol Tx Plan</th>
|
|
|
|
<th>Kidney Transplant-Monthly Expected No. of Transplant Plan</th>
|
|
<th>Liver Transplant-Monthly Expected No. of Transplant Plan</th>
|
|
<th>Heart/Others Transplant-Monthly Expected No. of Transplant Plan</th>
|
|
<th>Cardioplegia-Monthly Expected No. of Transplant Plan</th>
|
|
<th>Total Transplants-Monthly Expected No. of Transplant Plan</th>
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($history->data->submissions as $sub)
|
|
@php
|
|
$sub->formdata->id = $sub->id;
|
|
@endphp
|
|
<tr>
|
|
<td>
|
|
<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>
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
</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 }}
|
|
@endif
|
|
</td>
|
|
<td>
|
|
@if (isset($sub->formdata->center_name) && $sub->formdata->center_name !== '')
|
|
{{ $sub->formdata->center_name }}
|
|
@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->speciality) ? $sub->formdata->speciality: ''}}</td>
|
|
<td>{{isset($sub->formdata->msl_code) ? $sub->formdata->msl_code: ''}}</td>
|
|
|
|
|
|
|
|
<td>{{isset($sub->formdata->kidney_transplant_dennovo) ? $sub->formdata->kidney_transplant_dennovo: ''}}</td>
|
|
<td>{{isset($sub->formdata->liver_transplant_dennovo) ? $sub->formdata->liver_transplant_dennovo: ''}}</td>
|
|
<td>{{isset($sub->formdata->heart_transplant_dennovo) ? $sub->formdata->heart_transplant_dennovo: ''}}</td>
|
|
<td>{{isset($sub->formdata->cardio_transplant_dennovo) ? $sub->formdata->cardio_transplant_dennovo: ''}}</td>
|
|
<td>{{isset($sub->formdata->total_transplant_dennovo) ? $sub->formdata->total_transplant_dennovo: ''}}</td>
|
|
|
|
<td>{{isset($sub->formdata->kidney_transplant_gennova) ? $sub->formdata->kidney_transplant_gennova: ''}}</td>
|
|
<td>{{isset($sub->formdata->liver_transplant_gennova) ? $sub->formdata->liver_transplant_gennova: ''}}</td>
|
|
<td>{{isset($sub->formdata->heart_transplant_gennova) ? $sub->formdata->heart_transplant_gennova: ''}}</td>
|
|
<td>{{isset($sub->formdata->cardio_transplant_gennova) ? $sub->formdata->cardio_transplant_gennova: ''}}</td>
|
|
<td>{{isset($sub->formdata->total_transplant_gennova) ? $sub->formdata->total_transplant_gennova: ''}}</td>
|
|
|
|
|
|
<td>{{isset($sub->formdata->kidney_transplant_graftsol) ? $sub->formdata->kidney_transplant_graftsol: ''}}</td>
|
|
<td>{{isset($sub->formdata->liver_transplant_graftsol) ? $sub->formdata->liver_transplant_graftsol: ''}}</td>
|
|
<td>{{isset($sub->formdata->heart_transplant_graftsol) ? $sub->formdata->heart_transplant_graftsol: ''}}</td>
|
|
<td>{{isset($sub->formdata->cardio_transplant_graftsol) ? $sub->formdata->cardio_transplant_graftsol: ''}}</td>
|
|
<td>{{isset($sub->formdata->total_transplant_graftsol) ? $sub->formdata->total_transplant_graftsol: ''}}</td>
|
|
|
|
|
|
<td>{{isset($sub->formdata->kidney_transplant_total) ? $sub->formdata->kidney_transplant_total: ''}}</td>
|
|
<td>{{isset($sub->formdata->liver_transplant_total) ? $sub->formdata->liver_transplant_total: ''}}</td>
|
|
<td>{{isset($sub->formdata->heart_transplant_total) ? $sub->formdata->heart_transplant_total: ''}}</td>
|
|
<td>{{isset($sub->formdata->cardio_transplant_total) ? $sub->formdata->cardio_transplant_total: ''}}</td>
|
|
<td>{{isset($sub->formdata->total_transplant_total) ? $sub->formdata->total_transplant_total: ''}}</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 }}">
|
|
<input type="hidden" name="dummyformid" value="" id="field-dummyformid">
|
|
@endif
|
|
@foreach ($questions as $question)
|
|
@if (in_array($question->code, ['execution_date','transplant_execution','execution_week']))
|
|
@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)
|
|
{{-- Doctor dropdown --}}
|
|
@if($question->code == 'contact_id'
|
|
&& isset($option->contact->type)
|
|
&& $option->contact->type == 'doctor')
|
|
|
|
<option value="{{ $option->value }}"
|
|
{{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }}
|
|
msl_code="{{ $option->contact->uid_number ?? '' }}"
|
|
speciality="{{ $option->contact->speciality ?? '' }}">
|
|
{{ $option->display }}
|
|
</option>
|
|
|
|
{{-- Center dropdown --}}
|
|
@elseif($question->code == 'center_name'
|
|
&& isset($option->contact->type)
|
|
&& $option->contact->type == 'center')
|
|
|
|
<option value="{{ $option->value }}"
|
|
{{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }}>
|
|
{{ $option->display }}
|
|
</option>
|
|
|
|
{{-- Other dropdowns --}}
|
|
@elseif($question->code != 'contact_id' && $question->code != 'center_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>Transplant</th>
|
|
<th>Monthly Expected No. of Transplant</th>
|
|
<th>Gennova Share Dennovo Plan</th>
|
|
<th>Gennova Share Switch Plan</th>
|
|
<th>Gennova Share Graftsol Tx Plan</th>
|
|
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($brandData as $brand)
|
|
<tr>
|
|
|
|
<td>{{ $brand['brand'] }}</td>
|
|
<td>
|
|
<input type="number" step="1" min="0" id="field-{{ $brand['pseudoId3'] }}"
|
|
name="{{ $brand['pseudoId3'] }}" readonly="true"
|
|
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['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>
|
|
|
|
</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)
|
|
{{-- Doctor dropdown --}}
|
|
@if($question->code == 'contact_id'
|
|
&& isset($option->contact->type)
|
|
&& $option->contact->type == 'doctor')
|
|
|
|
<option value="{{ $option->value }}"
|
|
{{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }}
|
|
msl_code="{{ $option->contact->uid_number ?? '' }}"
|
|
speciality="{{ $option->contact->speciality ?? '' }}">
|
|
{{ $option->display }}
|
|
</option>
|
|
|
|
{{-- Center dropdown --}}
|
|
@elseif($question->code == 'center_name'
|
|
&& isset($option->contact->type)
|
|
&& $option->contact->type == 'center')
|
|
|
|
<option value="{{ $option->value }}"
|
|
{{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }}>
|
|
{{ $option->display }}
|
|
</option>
|
|
|
|
{{-- Other dropdowns --}}
|
|
@elseif($question->code != 'contact_id' && $question->code != 'center_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=='transplant')
|
|
<div class="row">
|
|
<div style="width: auto; overflow-y: auto; overflow-x: auto;">
|
|
<table class="table tableclass">
|
|
<thead id="heading">
|
|
<tr>
|
|
<th>Transplant</th>
|
|
<th>Monthly Expected No. of Transplant</th>
|
|
<th>Gennova Share Dennovo Plan</th>
|
|
<th>Gennova Share Switch Plan</th>
|
|
<th>Gennova Share Graftsol Tx Plan</th>
|
|
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($brandData as $brand)
|
|
<tr>
|
|
|
|
<td>{{ $brand['brand'] }}</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['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>
|
|
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
@if($question->code=='transplant_execution')
|
|
<div class="ro" id="execution-table">
|
|
|
|
<div style="width: auto; overflow-y: auto; overflow-x: auto;">
|
|
<table class="table table-bordered tableclass ">
|
|
<thead id="heading">
|
|
<tr>
|
|
<th colspan="2"></th> <!-- for first 2 empty columns -->
|
|
|
|
<th colspan="4" style="text-align:center; color: red">
|
|
Gennova Share Dennovo Actual
|
|
</th>
|
|
|
|
<th colspan="4" style="text-align:center; color:blueviolet">
|
|
Gennova Share Switch Actual
|
|
</th>
|
|
|
|
<th colspan="4" style="text-align:center; color: green">
|
|
Gennova Share Graftsol Tx Actual
|
|
</th>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>Transplant</th>
|
|
<th>Total Actual Transplants</th>
|
|
<th>Week 1</th>
|
|
<th>Week 2</th>
|
|
<th>Week 3</th>
|
|
<th>Week 4</th>
|
|
|
|
<th>Week 1</th>
|
|
<th>Week 2</th>
|
|
<th>Week 3</th>
|
|
<th>Week 4</th>
|
|
|
|
<th>Week 1</th>
|
|
<th>Week 2</th>
|
|
<th>Week 3</th>
|
|
<th>Week 4</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" 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['pseudoId']}) ? $formdata->{$brand['pseudoId']} : 0 }}">
|
|
</td>
|
|
|
|
<td>
|
|
<input type="number" step="1" min="0" id="execution-{{ $brand['pseudoId5'] }}"
|
|
name="{{ $brand['pseudoId5'] }}"
|
|
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['pseudoId6'] }}"
|
|
name="{{ $brand['pseudoId6'] }}"
|
|
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['pseudoId7'] }}"
|
|
name="{{ $brand['pseudoId7'] }}"
|
|
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['pseudoId8'] }}"
|
|
name="{{ $brand['pseudoId8'] }}"
|
|
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['pseudoId9'] }}"
|
|
name="{{ $brand['pseudoId9'] }}"
|
|
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['pseudoId10'] }}"
|
|
name="{{ $brand['pseudoId10'] }}"
|
|
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['pseudoId11'] }}"
|
|
name="{{ $brand['pseudoId11'] }}"
|
|
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['pseudoId12'] }}"
|
|
name="{{ $brand['pseudoId12'] }}"
|
|
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>
|
|
@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($) {
|
|
$('#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-total_transplant_dennovo,#field-total_transplant_gennova,#field-total_transplant_graftsol').attr({"readonly":true});
|
|
|
|
|
|
|
|
|
|
|
|
// $('#field-kidney_transplant_dennovo,#field-liver_transplant_dennovo,#field-heart_transplant_dennovo,#field-cardio_transplant_dennovo,#field-kidney_transplant_gennova,#field-liver_transplant_gennova,#field-heart_transplant_gennova,#field-cardio_transplant_gennova,#field-kidney_transplant_graftsol,#field-liver_transplant_graftsol,#field-heart_transplant_graftsol,#field-cardio_transplant_graftsol').on('input',function(){
|
|
// let dennovaTotal=(
|
|
// parseInt($('#field-kidney_transplant_dennovo').val()||0)+
|
|
// parseInt($('#field-liver_transplant_dennovo').val()||0)+
|
|
// parseInt($('#field-heart_transplant_dennovo').val()||0)
|
|
// );
|
|
|
|
// let switchTotal=(
|
|
// parseInt($('#field-kidney_transplant_gennova').val()||0)+
|
|
// parseInt($('#field-liver_transplant_gennova').val()||0)+
|
|
// parseInt($('#field-heart_transplant_gennova').val()||0)
|
|
// );
|
|
|
|
// let graftsolTotal=(
|
|
// parseInt($('#field-kidney_transplant_graftsol').val()||0)+
|
|
// parseInt($('#field-liver_transplant_graftsol').val()||0)+
|
|
// parseInt($('#field-heart_transplant_graftsol').val()||0)
|
|
// );
|
|
|
|
// let liverTotal=(
|
|
// parseInt($('#field-liver_transplant_dennovo').val()||0)+
|
|
// parseInt($('#field-liver_transplant_gennova').val()||0)+
|
|
// parseInt($('#field-liver_transplant_graftsol').val()||0)
|
|
// );
|
|
|
|
// let kidneyTotal=(
|
|
// parseInt($('#field-kidney_transplant_dennovo').val()||0)+
|
|
// parseInt($('#field-kidney_transplant_gennova').val()||0)+
|
|
// parseInt($('#field-kidney_transplant_graftsol').val()||0)
|
|
// );
|
|
|
|
// let heartTotal=(
|
|
// parseInt($('#field-heart_transplant_dennovo').val()||0)+
|
|
// parseInt($('#field-heart_transplant_gennova').val()||0)+
|
|
// parseInt($('#field-heart_transplant_graftsol').val()||0)
|
|
// );
|
|
|
|
// let cardioTotal=(
|
|
// parseInt($('#field-cardio_transplant_dennovo').val()||0)+
|
|
// parseInt($('#field-cardio_transplant_gennova').val()||0)+
|
|
// parseInt($('#field-cardio_transplant_graftsol').val()||0)
|
|
// );
|
|
|
|
// let expectedTotal=(
|
|
// parseInt($('#field-kidney_transplant_dennovo').val()||0)+
|
|
// parseInt($('#field-liver_transplant_dennovo').val()||0)+
|
|
// parseInt($('#field-heart_transplant_dennovo').val()||0)+
|
|
// parseInt($('#field-kidney_transplant_gennova').val()||0)+
|
|
// parseInt($('#field-liver_transplant_gennova').val()||0)+
|
|
// parseInt($('#field-heart_transplant_gennova').val()||0)+
|
|
// parseInt($('#field-kidney_transplant_graftsol').val()||0)+
|
|
// parseInt($('#field-liver_transplant_graftsol').val()||0)+
|
|
// parseInt($('#field-heart_transplant_graftsol').val()||0)
|
|
|
|
|
|
// );
|
|
|
|
|
|
// $('#field-total_transplant_dennovo').val(dennovaTotal);
|
|
// $('#field-total_transplant_gennova').val(switchTotal);
|
|
// $('#field-total_transplant_graftsol').val(graftsolTotal);
|
|
// $('#field-kidney_transplant_total').val(kidneyTotal);
|
|
// $('#field-liver_transplant_total').val(liverTotal);
|
|
// $('#field-heart_transplant_total').val(heartTotal);
|
|
// $('#field-cardio_transplant_total').val(cardioTotal);
|
|
// $('#field-total_transplant_total').val(expectedTotal);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// })
|
|
$('#field-kidney_transplant_total,#field-liver_transplant_total,#field-heart_transplant_total,#field-cardio_transplant_total').removeAttr('readonly');
|
|
$('#field-total_transplant_dennovo,#field-total_transplant_gennova,#field-total_transplant_graftsol').attr('readonly',true);
|
|
|
|
const getSum = (fields) =>
|
|
fields.reduce((sum, id) => sum + (parseInt($(id).val()) || 0), 0);
|
|
|
|
$('#field-kidney_transplant_dennovo,#field-liver_transplant_dennovo,#field-heart_transplant_dennovo,#field-cardio_transplant_dennovo,#field-kidney_transplant_gennova,#field-liver_transplant_gennova,#field-heart_transplant_gennova,#field-cardio_transplant_gennova,#field-kidney_transplant_graftsol,#field-liver_transplant_graftsol,#field-heart_transplant_graftsol,#field-cardio_transplant_graftsol,#field-kidney_transplant_total,#field-liver_transplant_total,#field-heart_transplant_total,#field-cardio_transplant_total')
|
|
.on('input', function () {
|
|
|
|
const dennovo = ['#field-kidney_transplant_dennovo','#field-liver_transplant_dennovo','#field-heart_transplant_dennovo'];
|
|
const gennova = ['#field-kidney_transplant_gennova','#field-liver_transplant_gennova','#field-heart_transplant_gennova'];
|
|
const graftsol = ['#field-kidney_transplant_graftsol','#field-liver_transplant_graftsol','#field-heart_transplant_graftsol'];
|
|
|
|
const kidney = ['#field-kidney_transplant_dennovo','#field-kidney_transplant_gennova','#field-kidney_transplant_graftsol'];
|
|
const liver = ['#field-liver_transplant_dennovo','#field-liver_transplant_gennova','#field-liver_transplant_graftsol'];
|
|
const heart = ['#field-heart_transplant_dennovo','#field-heart_transplant_gennova','#field-heart_transplant_graftsol'];
|
|
const cardio = ['#field-cardio_transplant_dennovo','#field-cardio_transplant_gennova','#field-cardio_transplant_graftsol'];
|
|
|
|
$('#field-total_transplant_dennovo').val(getSum(dennovo));
|
|
$('#field-total_transplant_gennova').val(getSum(gennova));
|
|
$('#field-total_transplant_graftsol').val(getSum(graftsol));
|
|
|
|
$('#field-total_transplant_total').val(getSum(['#field-kidney_transplant_total','#field-liver_transplant_total','#field-heart_transplant_total']));
|
|
// $('#field-kidney_transplant_total').val(getSum(kidney));
|
|
// $('#field-liver_transplant_total').val(getSum(liver));
|
|
// $('#field-heart_transplant_total').val(getSum(heart));
|
|
// $('#field-cardio_transplant_total').val(getSum(cardio));
|
|
|
|
// $('#field-total_transplant_total').val(
|
|
// getSum([...dennovo, ...gennova, ...graftsol])
|
|
// );
|
|
|
|
});
|
|
|
|
|
|
|
|
$('.edit-btn').click(function() {
|
|
$('#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 centers=document.getElementById('execution-center_name');
|
|
centers.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-msl_code').prop('readonly',true);
|
|
|
|
//$('#execution-time').prop('disabled', true)
|
|
|
|
|
|
|
|
|
|
let selected = JSON.parse($(this).attr('plan_details'))
|
|
$('#execution-dummyformid').val(selected['proxy_formid'])
|
|
|
|
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
|
|
$('#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'])
|
|
|
|
|
|
let centerid = $('#execution-center_name option').map(function() {
|
|
if ($(this).text().trim() == selected['center_name']) return this;
|
|
}).attr('value')
|
|
console.log("docid : ",centerid);
|
|
$('#execution-center_name').val(centerid)
|
|
|
|
/* $('#execution-execution_week').on('change',function(){
|
|
let week=$(this).val();
|
|
if(week==='1'){
|
|
$('#execution-kidney_transplant_gennova_week2,#execution-kidney_transplant_gennova_week3,#execution-kidney_transplant_gennova_week4,#execution-kidney_transplant_switch_week2,#execution-kidney_transplant_switch_week3,#execution-kidney_transplant_switch_week4,#execution-kidney_transplant_graftsol_week2,#execution-kidney_transplant_graftsol_week3,#execution-kidney_transplant_graftsol_week4').attr('readonly',true);
|
|
$('#execution-liver_transplant_gennova_week2,#execution-liver_transplant_gennova_week3,#execution-liver_transplant_gennova_week4,#execution-liver_transplant_switch_week2,#execution-liver_transplant_switch_week3,#execution-liver_transplant_switch_week4,#execution-liver_transplant_graftsol_week2,#execution-liver_transplant_graftsol_week3,#execution-liver_transplant_graftsol_week4').attr('readonly',true);
|
|
$('#execution-heart_transplant_gennova_week2,#execution-heart_transplant_gennova_week3,#execution-heart_transplant_gennova_week4,#execution-heart_transplant_switch_week2,#execution-heart_transplant_switch_week3,#execution-heart_transplant_switch_week4,#execution-heart_transplant_graftsol_week2,#execution-heart_transplant_graftsol_week3,#execution-heart_transplant_graftsol_week4').attr('readonly',true);
|
|
$('#execution-cardio_transplant_gennova_week2,#execution-cardio_transplant_gennova_week3,#execution-cardio_transplant_gennova_week4,#execution-cardio_transplant_switch_week2,#execution-cardio_transplant_switch_week3,#execution-cardio_transplant_switch_week4,#execution-cardio_transplant_graftsol_week2,#execution-cardio_transplant_graftsol_week3,#execution-cardio_transplant_graftsol_week4').attr('readonly',true);
|
|
|
|
|
|
}
|
|
}) */
|
|
|
|
$('[id*="_transplant_"][id*="week"]').prop('readonly', true);
|
|
|
|
|
|
|
|
$('#execution-execution_week').on('change', function () {
|
|
|
|
let selectedWeek = $(this).val();
|
|
const organs = ['kidney', 'liver', 'heart', 'cardio'];
|
|
const types = ['gennova', 'switch', 'graftsol'];
|
|
|
|
// First enable all fields
|
|
$('[id*="_transplant_"][id*="week"]').prop('readonly', false);
|
|
|
|
// Disable all weeks except selected
|
|
for (let week = 1; week <= 4; week++) {
|
|
|
|
if (week == selectedWeek) continue;
|
|
|
|
organs.forEach(organ => {
|
|
types.forEach(type => {
|
|
let id = `#execution-${organ}_transplant_${type}_week${week}`;
|
|
$(id).prop('readonly', true);
|
|
});
|
|
});
|
|
}
|
|
|
|
$('#execution-total_transplant').prop('readonly', true);
|
|
|
|
$('[id^="execution-total_transplant_"]').prop('readonly', true);
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/* $(document).on('input', '[id*="_transplant_"][id*="week"]', function () {
|
|
|
|
const organs = ['kidney', 'liver', 'heart', 'cardio'];
|
|
const organsWeek = ['kidney', 'liver', 'heart']; // exclude cardio
|
|
const types = ['gennova', 'switch', 'graftsol'];
|
|
|
|
let totalTransplant = 0; // 🔥 grand total (excluding cardio)
|
|
|
|
// -------------------------
|
|
// 1. ORGAN TOTALS (all weeks)
|
|
// -------------------------
|
|
organs.forEach(organ => {
|
|
let total = 0;
|
|
|
|
for (let week = 1; week <= 4; week++) {
|
|
types.forEach(type => {
|
|
let id = `#execution-${organ}_transplant_${type}_week${week}`;
|
|
total += parseInt($(id).val()) || 0;
|
|
});
|
|
}
|
|
|
|
$(`#execution-${organ}_transplant`).val(total);
|
|
|
|
// add only kidney, liver, heart to grand total
|
|
if (organsWeek.includes(organ)) {
|
|
totalTransplant += total;
|
|
}
|
|
});
|
|
|
|
// -------------------------
|
|
// 2. WEEK-WISE TYPE TOTALS
|
|
// -------------------------
|
|
for (let week = 1; week <= 4; week++) {
|
|
|
|
types.forEach(type => {
|
|
let total = 0;
|
|
|
|
organsWeek.forEach(organ => { // exclude cardio
|
|
let id = `#execution-${organ}_transplant_${type}_week${week}`;
|
|
total += parseInt($(id).val()) || 0;
|
|
});
|
|
|
|
$(`#execution-total_transplant_${type}_week${week}`).val(total);
|
|
});
|
|
|
|
}
|
|
|
|
// -------------------------
|
|
// 3. GRAND TOTAL (no cardio)
|
|
// -------------------------
|
|
$('#execution-total_transplant').val(totalTransplant);
|
|
|
|
}); */
|
|
|
|
|
|
$(document).on('input','[id*="_transplant_"]',function () {
|
|
|
|
const organs = ['kidney', 'liver', 'heart'];
|
|
const organsWeek = ['kidney', 'liver', 'heart'];
|
|
const types = ['gennova', 'switch', 'graftsol'];
|
|
|
|
// -------------------------
|
|
// 1. WEEK-WISE TOTALS
|
|
// -------------------------
|
|
for (let week = 1; week <= 4; week++) {
|
|
|
|
types.forEach(type => {
|
|
|
|
let total = 0;
|
|
|
|
organsWeek.forEach(organ => {
|
|
|
|
let id = `#execution-${organ}_transplant_${type}_week${week}`;
|
|
|
|
total += parseInt($(id).val()) || 0;
|
|
|
|
});
|
|
|
|
$(`#execution-total_transplant_${type}_week${week}`).val(total);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
// -------------------------
|
|
// 2. FIRST COLUMN GRAND TOTAL
|
|
// -------------------------
|
|
let firstColumnTotal = 0;
|
|
|
|
organs.forEach(organ => {
|
|
|
|
firstColumnTotal += parseInt(
|
|
$(`#execution-${organ}_transplant`).val()
|
|
) || 0;
|
|
|
|
});
|
|
|
|
$('#execution-total_transplant').val(firstColumnTotal);
|
|
|
|
});
|
|
|
|
$(document).on('input','#execution-kidney_transplant, #execution-liver_transplant, #execution-heart_transplant',function () {
|
|
|
|
let total =
|
|
(parseInt($('#execution-kidney_transplant').val()) || 0) +
|
|
(parseInt($('#execution-liver_transplant').val()) || 0) +
|
|
(parseInt($('#execution-heart_transplant').val()) || 0);
|
|
|
|
$('#execution-total_transplant').val(total);
|
|
|
|
}
|
|
);
|
|
|
|
|
|
})
|
|
|
|
|
|
$('.edit-plan-btn').click(function() {
|
|
$('#execution-form-wrapper').show(100, () => {
|
|
$('#add-camp-btn').hide(0);
|
|
})
|
|
$('#table-wrapper').hide()
|
|
|
|
$('#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']);
|
|
$('#execution-dummyformid').val(selected['proxy_formid'])
|
|
|
|
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
|
|
$('#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'])
|
|
|
|
|
|
let centerid = $('#execution-center_name option').map(function() {
|
|
if ($(this).text().trim() == selected['center_name']) return this;
|
|
}).attr('value')
|
|
console.log("docid : ",centerid);
|
|
$('#execution-center_name').val(centerid)
|
|
|
|
|
|
$('#execution-contact_id').change(function() {
|
|
$('#execution-speciality').val($('option:selected', this).attr(
|
|
'speciality'))
|
|
})
|
|
|
|
$('#execution-contact_id').change(function() {
|
|
$('#execution-msl_code').val($('option:selected', this).attr('msl_code'))
|
|
})
|
|
|
|
|
|
$('#execution-execution_date,#execution-execution_week,#execution-table').parent().hide();
|
|
$('#execution-execution_date,#execution-execution_week,#execution-table').attr('required',false);
|
|
|
|
const getSum = (fields) =>
|
|
fields.reduce((sum, id) => sum + (parseInt($(id).val()) || 0), 0);
|
|
|
|
$('#execution-kidney_transplant_dennovo,#execution-liver_transplant_dennovo,#execution-heart_transplant_dennovo,#execution-cardio_transplant_dennovo,#execution-kidney_transplant_gennova,#execution-liver_transplant_gennova,#execution-heart_transplant_gennova,#execution-cardio_transplant_gennova,#execution-kidney_transplant_graftsol,#execution-liver_transplant_graftsol,#execution-heart_transplant_graftsol,#execution-cardio_transplant_graftsol').attr('readonly',false);
|
|
|
|
|
|
$('#execution-kidney_transplant_dennovo,#execution-liver_transplant_dennovo,#execution-heart_transplant_dennovo,#execution-cardio_transplant_dennovo,#execution-kidney_transplant_gennova,#execution-liver_transplant_gennova,#execution-heart_transplant_gennova,#execution-cardio_transplant_gennova,#execution-kidney_transplant_graftsol,#execution-liver_transplant_graftsol,#execution-heart_transplant_graftsol,#execution-cardio_transplant_graftsol').on('input', function () {
|
|
|
|
const dennovo = ['#execution-kidney_transplant_dennovo','#execution-liver_transplant_dennovo','#execution-heart_transplant_dennovo'];
|
|
const gennova = ['#execution-kidney_transplant_gennova','#execution-liver_transplant_gennova','#execution-heart_transplant_gennova'];
|
|
const graftsol = ['#execution-kidney_transplant_graftsol','#execution-liver_transplant_graftsol','#execution-heart_transplant_graftsol'];
|
|
|
|
const kidney = ['#execution-kidney_transplant_dennovo','#execution-kidney_transplant_gennova','#execution-kidney_transplant_graftsol'];
|
|
const liver = ['#execution-liver_transplant_dennovo','#execution-liver_transplant_gennova','#execution-liver_transplant_graftsol'];
|
|
const heart = ['#execution-heart_transplant_dennovo','#execution-heart_transplant_gennova','#execution-heart_transplant_graftsol'];
|
|
const cardio = ['#execution-cardio_transplant_dennovo','#execution-cardio_transplant_gennova','#execution-cardio_transplant_graftsol'];
|
|
|
|
$('#execution-total_transplant_dennovo').val(getSum(dennovo));
|
|
$('#execution-total_transplant_gennova').val(getSum(gennova));
|
|
$('#execution-total_transplant_graftsol').val(getSum(graftsol));
|
|
|
|
$('#execution-kidney_transplant_total').val(getSum(kidney));
|
|
$('#execution-liver_transplant_total').val(getSum(liver));
|
|
$('#execution-heart_transplant_total').val(getSum(heart));
|
|
$('#execution-cardio_transplant_total').val(getSum(cardio));
|
|
|
|
$('#execution-total_transplant_total').val(
|
|
getSum([...dennovo, ...gennova, ...graftsol])
|
|
);
|
|
});
|
|
|
|
|
|
|
|
})
|
|
|
|
$('#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!'
|
|
})
|
|
}
|
|
},
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
$('#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').prop('readonly',true);
|
|
$('#field-speciality').prop('readonly',true);
|
|
|
|
|
|
$('#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() {
|
|
let today = new Date().toISOString().split('T')[0];
|
|
var executionexeField = document.getElementById('execution-execution_date');
|
|
console.log("Edit execution date");
|
|
//executionexeField.setAttribute('min', executionDateField.value);
|
|
executionexeField.setAttribute('max',today);
|
|
|
|
});
|
|
|
|
|
|
|
|
executionDateField.addEventListener('change', function() {
|
|
console.log('gg');
|
|
var executionexeField = document.getElementById('execution-record_date');
|
|
executionexeField.setAttribute('min', executionDateField.value);
|
|
});
|
|
|
|
});
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html> |