Rapport-Laravel/resources/views/form/rapport-pulmocare/1742297848-159745be-ac42-41...

1515 lines
93 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="http://cdnjs.cloudflare.com/ajax/libs/semantic-ui/0.16.1/images/loader-large.gif" alt="processing..." />
</div>
<body class="loading">
<div class="account-pages">
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8 col-lg-6 col-xl-5 p-0">
<div class="card bg-patter" style="background:linear-gradient(125deg,rgba(111, 198, 235, 0.38) 0%, rgba(66, 70, 157, 0.25) 100%);">
<div class="card-body p-3 row">
@if(Session::has('error'))<div class="alert alert-danger">{{Session::get('error')}}</div>
<br>@endif
@if(session('success'))<div class=" alert alert-success">{{ session('success') }}
</div>
<br>@endif
<div class="col-8">
<!-- <h4 class="page-title">{{$form->title}}</h4> -->
</div>
@if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != 'yes' ) )
<div class="col-4">
@if($form->link_type == 'form')
<!-- <a href="/form/history" class="float-end pt-1">View History</a> -->
<button type="button" class="btn btn-primary btn-xs mb-2" id="add-actionplan-btn">Add Action Plan</button>
@else
<a href="{{url()->previous()}}" class="float-end pt-1">Back</a>
@endif
</div>
@endif
@if(isset($form->user_info))
<div class="col-12">
<h6>Submitted By: {{$form->user_info->name}}</h6>
</div>
@endif
@php
$history = Formhelper::getMultiformData( $form->partition, $form_id.'_coaching', $form->user_id);
$histories = [];
$date = '';
foreach($history->data->submissions as $sub) {
$sub->formdata->id = $sub->id;
$sub->formdata->user_info = $sub->user_info;
$histories[] = $sub->formdata;
}
@endphp
<div class="col-md-12" id="table-wrapper">
<div class="card">
<div class="card-body p-0">
<div class="table-responsive">
<table class="table table-striped table-hover table-nowrap table-centered m-0">
<thead class="table-light">
<tr>
<th>Action</th>
<th>User</th>
<th>Month</th>
<th>Adherance</th>
</tr>
</thead>
<tbody>
@foreach($histories as $his)
<tr>
<td>
<button class="btn btn-primary btn-xs edit-button" type="button" data="{{json_encode($his)}}">Follow Up</button>
</td>
<td>{{$his->user_info->name}}</td>
<td>{{$his->select_month}}</td>
<td>{{$his->adherance_to_action_plan}}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
<div id="form-wrapper">
<form method="POST" action="/form/submit" id="report-form" enctype="multipart/form-data">
<input type="hidden" name="form_id" value="{{$form_id}}">
<input type="hidden" name="coach_id" value="{{$form->user_id}}">
<input type="hidden" name="form_type" value="coaching">
@csrf
@if($id)
<input type="hidden" name="id" value="{{$id}}">
@endif
@foreach($questions as $question)
@if(in_array($question->code, ['goal_1_tour_plan_adherence_self_and_team','goal_2_spread_of_performance','goal_3_joint_field_work','goal_4_kol_engagement_and_roi','select_role','select_month','key_goals_set_by_coach_and_coachee','action_plan','timeline_agreed_for_selected_action_plans_completion','adherance_to_action_plan','record_date','date_of_feedback_discussion','follow_up_conversation_date_1','follow_up_conversation_date_2']))
@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)
<option value="{{$option->value}}" {{isset($question->value) && $question->value == $option->value ? 'selected':''}}>{{$option->display}}</option>
@endforeach
</select>
@break
@case('radio')
@foreach($question->options as $option)
<div class="form-check mb-2 form-check-success">
<input class="form-check-input" type="radio" name="{{$question->code}}" id="field-{{$question->code}}_{{$option->value}}" value="{{$option->value}}">
<label class="form-check-label" for="field-{{$question->code}}_{{$option->value}}">{{$option->display}}</label>
</div>
@endforeach
@break
@case('checkbox')
@foreach($question->options as $option)
<div class="form-check mb-2 form-check-primary ms-2">
<input class="form-check-input" type="checkbox" id="field-{{$question->code}}-{{$option->value}}" name="{{$question->code}}[]" value="{{$option->value}}" {{isset($question->value) && $question->value != '' && in_array($option->value, $question->value) ? 'checked':''}}>
<label class="form-check-label" for="field-{{$question->code}}-{{$option->value}}">{{$option->display}}</label>
</div>
@endforeach
@break
@case('file')
@if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != 'yes' ) )
<input type="file" id="field-{{$question->code}}" name="{{$question->code}}" class="form-control" value="" {{$question->required == 'yes'?'required':'' }}>
@elseif(isset($question->value))
<img src="{{$question->value}}" class="img-fluid">
@endif
@break
@case('multitextbox')
<div class="row">
@foreach($question->options as $option)
<div class="col-6">{{$option->display}}</div>
<div class="col-6 mb-1">
<input type="number" id="field-{{$option->value}}" name="{{$option->value}}" class="form-control" required value="{{isset($option->val)?$option->val:0}}">
</div>
@endforeach
</div>
@break
@endswitch
</div>
@endforeach
{{-- First Accordian starts --}}
<div id="accordion1" class="mb-3 mt-3 custom-accordion-outer">
@if(isset($form->manager_can_submit) && $form->manager_can_submit == true)
<div class="card mb-1">
<div class="card-header" id="heading-">
<h5 class="m-0">
<a class="text-dar" data-bs-toggle="collapse" href="#field-user_id-wrapper" aria-expanded="true">
<div class="me-3">
<i class="mdi mdi-apple-keyboard-command text-primary me-1"></i>
Select User / Territory <span class="text-danger">*</span>
</div>
<span id="result-user_id" class="custom-badge"></span>
</a>
</h5>
</div>
<div id="field-user_id-wrapper" class="collapse" aria-labelledby="heading-" data-bs-parent="#accordion" required="required" max="2025-06-27">
<div class="card-body pt-1">
<div class="form-group mb-2">
<select class="form-control" id="field-user_id" name="user_id" required>
<option value=""> -- Select -- </option>
@foreach($form->users as $option)
<option value="{{$option->value}}" hierarchy="{{$option->hierarchy_id}}" {{isset($question->value) && $question->value == $option->value ? 'selected':''}}>{{$option->display}}</option>
@endforeach
</select>
<input type="hidden" id="field-hierarchy_id" name="hierarchy_id" value="">
</div>
</div>
</div>
</div>
@endif
@foreach($questions as $question)
@if(in_array($question->code, ['select_role','select_month']))
<div class="card mb-1">
<div class="card-header" id="heading-">
<h5 class="m-0">
<a class="text-dar" data-bs-toggle="collapse" href="#field-{{$question->code}}-wrapper" aria-expanded="true">
<div class="me-3">
<i class="mdi mdi-apple-keyboard-command text-primary me-1"></i>
{{$question->question}} {!!$question->required == 'yes' ? '<span class="text-danger">*</span>':''!!}
</div>
<span id="result-{{$question->code}}" class="custom-badge"></span>
</a>
</h5>
</div>
<div id="field-{{$question->code}}-wrapper" class="collapse" aria-labelledby="heading-" data-bs-parent="#accordion">
<div class="card-body pt-1">
@php
$required_flag = false;
@endphp
@foreach($question->options as $option)
<div class="form-check mb-2 form-check-success">
<input class="form-check-input" type="radio" name="{{$question->code}}" id="field-{{$question->code}}_{{$option->value}}" value="{{$option->value}}" {{!$required_flag ? 'required':''}}>
<label class="form-check-label" for="field-{{$question->code}}_{{$option->value}}">{{$option->display}}</label>
</div>
@php
$required_flag = true;
@endphp
@endforeach
<!-- <p id="value-{{$question->code}}"></p> -->
{{-- <div class="col-md-12 mb-2">
<label for="proficiency-{{$question->code}}" class="form-label">Option selected for {{$question->question}} <span class="text-danger">*</span> </label>
<input type="text" id="proficiency-{{$question->code}}" name="proficiency-{{$question->code}}" class="form-control bg-light" required="" value="" readonly="">
</div> --}}
</div>
</div>
</div>
@endif
@if(in_array($question->code, ['record_date']))
<div class="card mb-1">
<div class="card-header" id="heading-">
<h5 class="m-0">
<a class="text-dar" data-bs-toggle="collapse" href="#field-{{$question->code}}-wrapper" aria-expanded="true">
<div class="me-3">
<i class="mdi mdi-apple-keyboard-command text-primary me-1"></i>
{{$question->question}} {!!$question->required == 'yes' ? '<span class="text-danger">*</span>':''!!}
</div>
<span id="result-{{$question->code}}" class="custom-badge"></span>
</a>
</h5>
</div>
<div id="field-{{$question->code}}-wrapper" class="collapse" aria-labelledby="heading-" data-bs-parent="#accordion">
<div class="card-body pt-1">
@php
$required_flag = false;
@endphp
{{-- @foreach($question->options as $option)
--}}
<div class="form-group mb-2">
<input type="date" name="record_date" id="field-record_date" class="form-control" {{$question->required == 'yes'?'required':'' }} value="{{isset($question->value)?$question->value:''}}">
</div>
@php
$required_flag = true;
@endphp
{{-- @endforeach --}}
<!-- <p id="value-{{$question->code}}"></p> -->
{{-- <div class="col-md-12 mb-2">
<label for="proficiency-{{$question->code}}" class="form-label">Option selected for {{$question->question}} <span class="text-danger">*</span> </label>
<input type="text" id="proficiency-{{$question->code}}" name="proficiency-{{$question->code}}" class="form-control bg-light" required="" value="" readonly="">
</div> --}}
</div>
</div>
</div>
@endif
@endforeach
</div>
{{-- First Accordian Ends --}}
{{-- Goal Accordion Starts --}}
<div id="accordion2" class="mb-3 mt-3 custom-accordion-outer">
@foreach($questions as $question)
@if(in_array($question->code, ['goal_1_tour_plan_adherence_self_and_team','goal_2_spread_of_performance','goal_3_joint_field_work','goal_4_kol_engagement_and_roi']))
<div class="card mb-1">
<div class="card-header" id="heading-">
<h5 class="m-0">
<a class="text-dar" data-bs-toggle="collapse" href="#field-{{$question->code}}" aria-expanded="true">
<div class="me-3">
<i class="mdi mdi-apple-keyboard-command text-primar me-1"></i>
{{$question->question}} {!!$question->required == 'yes' ? '<span class="text-danger">*</span>':''!!}
</div>
<span id="result-{{$question->code}}" class="custom-badge"></span>
</a>
</h5>
</div>
<div id="field-{{$question->code}}" class="collapse" aria-labelledby="heading-" data-bs-parent="#accordion">
<div class="card-body pt-1">
@php
$required_flag = false;
@endphp
@foreach($question->options as $option)
<div class="form-check mb-2 form-check-success">
<input class="form-check-input" type="radio" name="{{$question->code}}" id="field-{{$question->code}}_{{$option->value}}" value="{{$option->value}}" {{!$required_flag ? 'required':''}}>
<label class="form-check-label" for="field-{{$question->code}}_{{$option->value}}">{{$option->display}}</label>
</div>
@php
$required_flag = true;
@endphp
@endforeach
<!-- <p id="value-{{$question->code}}"></p> -->
<div class="col-md-12 mb-2">
<label for="proficiency-{{$question->code}}" class="form-label">Proficiency Level for {{$question->question}} <span class="text-danger">*</span> </label>
<input type="text" id="proficiency-{{$question->code}}" name="proficiency-{{$question->code}}" class="form-control bg-light" required="" value="" readonly="">
</div>
</div>
</div>
</div>
@endif
@endforeach
</div>
<div id="accordion" class="mb-3 mt-3 custom-accordion-outer">
@foreach($questions as $question)
@if(in_array($question->code, ['key_goals_set_by_coach_and_coachee']))
<div class="card mb-1">
<div class="card-header" id="heading-">
<h5 class="m-0">
<a class="text-dar" data-bs-toggle="collapse" href="#field-{{$question->code}}" aria-expanded="true">
<div class="me-3">
<i class="mdi mdi-apple-keyboard-command text-primary me-1"></i>
{{$question->question}} {!!$question->required == 'yes' ? '<span class="text-danger">*</span>':''!!}
</div>
<span id="result-{{$question->code}}" class="custom-badge"></span>
</a>
</h5>
</div>
<div id="field-{{$question->code}}" class="collapse" aria-labelledby="heading-" data-bs-parent="#accordion3">
<span class="m-3 text-danger">You can select upto two goals</span>
<div class="card-body pt-1">
@php
$required_flag = false;
@endphp
@foreach($question->options as $option)
<div class="form-check mb-2 form-check-success">
<input class="form-check-input" type="checkbox" name="{{$question->code}}[]" id="field-{{$question->code}}_{{$option->value}}" 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>
@php
$required_flag = true;
@endphp
@endforeach
<!-- <p id="value-{{$question->code}}"></p> -->
{{-- <div class="col-md-12 mb-2">
<label for="proficiency-{{$question->code}}" class="form-label">Option selected for {{$question->question}} <span class="text-danger">*</span> </label>
<input type="text" id="proficiency-{{$question->code}}" name="proficiency-{{$question->code}}" class="form-control bg-light" required="" value="" readonly="">
</div> --}}
</div>
</div>
</div>
@endif
@endforeach
</div>
{{-- Goal Accordion Ends --}}
{{-- Third Accordian Starts --}}
<div id="accordion3" class="mb-3 mt-3 custom-accordion-outer">
@foreach($questions as $question)
@if(in_array($question->code, ['action_plan']))
<div class="card mb-1">
<div class="card-header" id="heading-">
<h5 class="m-0">
<a class="text-dar" data-bs-toggle="collapse" href="#field-{{$question->code}}" aria-expanded="true">
<div class="me-3">
<i class="mdi mdi-apple-keyboard-command text-primary me-1"></i>
{{$question->question}} {!!$question->required == 'yes' ? '<span class="text-danger">*</span>':''!!}
</div>
{{-- <span id="result-{{$question->code}}" class="custom-badge"></span> --}}
</a>
</h5>
</div>
<div id="field-{{$question->code}}" class="collapse" aria-labelledby="heading-" data-bs-parent="#accordion3">
<span class="m-3 text-danger">You can select upto three Action Plans</span>
<div class="card-body pt-1">
@php
$required_flag = false;
@endphp
@foreach($question->options as $option)
<div class="form-check mb-2 form-check-success">
<input class="form-check-input" type="checkbox" name="{{$question->code}}[]" id="field-{{$question->code}}_{{$option->value}}" 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>
@php
$required_flag = true;
@endphp
@endforeach
<!-- <p id="value-{{$question->code}}"></p> -->
{{-- <div class="col-md-12 mb-2">
<label for="proficiency-{{$question->code}}" class="form-label">Option selected for {{$question->question}} <span class="text-danger">*</span> </label>
<input type="text" id="proficiency-{{$question->code}}" name="proficiency-{{$question->code}}" class="form-control bg-light" required="" value="" readonly="">
</div> --}}
<div>
<label for="other_action_plan" >Other Action Plan</label>
<input class="form-control" type="text" name="other_action_plan" id="field-other_action_plan" placeholder="Enter Other Action Plan" required>
</div>
</div>
</div>
</div>
@endif
@if(in_array($question->code, ['timeline_agreed_for_selected_action_plans_completion']))
<div class="card mb-1">
<div class="card-header" id="heading-">
<h5 class="m-0">
<a class="text-dar" data-bs-toggle="collapse" href="#field-{{$question->code}}" aria-expanded="true">
<div class="me-3">
<i class="mdi mdi-apple-keyboard-command text-primary me-1"></i>
{{$question->question}} {!!$question->required == 'yes' ? '<span class="text-danger">*</span>':''!!}
</div>
<span id="result-{{$question->code}}" class="custom-badge"></span>
</a>
</h5>
</div>
<div id="field-{{$question->code}}" class="collapse" aria-labelledby="heading-" data-bs-parent="#accordion">
<div class="card-body pt-1">
@php
$required_flag = false;
@endphp
@foreach($question->options as $option)
<div class="form-check mb-2 form-check-success">
<input class="form-check-input" type="radio" name="{{$question->code}}" id="field-{{$question->code}}_{{$option->value}}" value="{{$option->value}}" {{!$required_flag ? 'required':''}}>
<label class="form-check-label" for="field-{{$question->code}}_{{$option->value}}">{{$option->display}}</label>
</div>
@php
$required_flag = true;
@endphp
@endforeach
<!-- <p id="value-{{$question->code}}"></p> -->
{{-- <div class="col-md-12 mb-2">
<label for="proficiency-{{$question->code}}" class="form-label">Option selected for {{$question->question}} <span class="text-danger">*</span> </label>
<input type="text" id="proficiency-{{$question->code}}" name="proficiency-{{$question->code}}" class="form-control bg-light" required="" value="" readonly="">
</div> --}}
</div>
</div>
</div>
@endif
@if(in_array($question->code, ['date_of_feedback_discussion']))
<div class="card mb-1">
<div class="card-header" id="heading-">
<h5 class="m-0">
<a class="text-dar" data-bs-toggle="collapse" href="#field-{{$question->code}}" aria-expanded="true">
<div class="me-3">
<i class="mdi mdi-apple-keyboard-command text-primary me-1"></i>
{{$question->question}} {!!$question->required == 'yes' ? '<span class="text-danger">*</span>':''!!}
</div>
<span id="result-{{$question->code}}" class="custom-badge"></span>
</a>
</h5>
</div>
<div id="field-{{$question->code}}" class="collapse" aria-labelledby="heading-" data-bs-parent="#accordion">
<div class="card-body pt-1">
@php
$required_flag = false;
@endphp
{{-- @foreach($question->options as $option)
--}}
<div class="form-group mb-2">
<input type="date" name="date_of_feedback_discussion" id="field-date_of_feedback_discussion" class="form-control" {{$question->required == 'yes'?'required':'' }} value="{{isset($question->value)?$question->value:''}}">
</div>
@php
$required_flag = true;
@endphp
{{-- @endforeach --}}
<!-- <p id="value-{{$question->code}}"></p> -->
{{-- <div class="col-md-12 mb-2">
<label for="proficiency-{{$question->code}}" class="form-label">Option selected for {{$question->question}} <span class="text-danger">*</span> </label>
<input type="text" id="proficiency-{{$question->code}}" name="proficiency-{{$question->code}}" class="form-control bg-light" required="" value="" readonly="">
</div> --}}
</div>
</div>
</div>
@endif
@endforeach
</div>
{{-- Third Accordian Ends --}}
{{-- Fourth Accordian Starts --}}
<div id="accordion4" class="mb-3 mt-3 custom-accordion-outer">
@foreach($questions as $question)
@if(in_array($question->code, ['adherance_to_action_plan']))
<div class="card mb-1">
<div class="card-header" id="heading-">
<h5 class="m-0">
<a class="text-dar" data-bs-toggle="collapse" href="#field-{{$question->code}}" aria-expanded="true">
<div class="me-3">
<i class="mdi mdi-apple-keyboard-command text-primary me-1"></i>
{{$question->question}} {!!$question->required == 'yes' ? '<span class="text-danger">*</span>':''!!}
</div>
<span id="result-{{$question->code}}" class="custom-badge"></span>
</a>
</h5>
</div>
<div id="field-{{$question->code}}" class="collapse" aria-labelledby="heading-" data-bs-parent="#accordion">
<div class="card-body pt-1">
@php
$required_flag = false;
@endphp
@foreach($question->options as $option)
<div class="form-check mb-2 form-check-success">
<input class="form-check-input" type="radio" name="{{$question->code}}" id="field-{{$question->code}}_{{$option->value}}" value="{{$option->value}}" {{!$required_flag ? 'required':''}}>
<label class="form-check-label" for="field-{{$question->code}}_{{$option->value}}">{{$option->display}}</label>
</div>
@php
$required_flag = true;
@endphp
@endforeach
<!-- <p id="value-{{$question->code}}"></p> -->
{{-- <div class="col-md-12 mb-2">
<label for="proficiency-{{$question->code}}" class="form-label">Option selected for {{$question->question}} <span class="text-danger">*</span> </label>
<input type="text" id="proficiency-{{$question->code}}" name="proficiency-{{$question->code}}" class="form-control bg-light" required="" value="" readonly="">
</div> --}}
</div>
</div>
</div>
@endif
@if(in_array($question->code, ['follow_up_conversation_date_1']))
<div class="card mb-1">
<div class="card-header" id="heading-">
<h5 class="m-0">
<a class="text-dar" data-bs-toggle="collapse" href="#field-{{$question->code}}" aria-expanded="true">
<div class="me-3">
<i class="mdi mdi-apple-keyboard-command text-primary me-1"></i>
{{$question->question}} {!!$question->required == 'yes' ? '<span class="text-danger">*</span>':''!!}
</div>
<span id="result-{{$question->code}}" class="custom-badge"></span>
</a>
</h5>
</div>
<div id="field-{{$question->code}}" class="collapse" aria-labelledby="heading-" data-bs-parent="#accordion">
<div class="card-body pt-1">
@php
$required_flag = false;
@endphp
{{-- @foreach($question->options as $option)
--}}
<div class="form-group mb-2">
<input type="date" name="follow_up_conversation_date_1" id="field-follow_up_conversation_date_1" class="form-control" {{$question->required == 'yes'?'required':'' }} value="{{isset($question->value)?$question->value:''}}">
</div>
@php
$required_flag = true;
@endphp
{{-- @endforeach --}}
<!-- <p id="value-{{$question->code}}"></p> -->
{{-- <div class="col-md-12 mb-2">
<label for="proficiency-{{$question->code}}" class="form-label">Option selected for {{$question->question}} <span class="text-danger">*</span> </label>
<input type="text" id="proficiency-{{$question->code}}" name="proficiency-{{$question->code}}" class="form-control bg-light" required="" value="" readonly="">
</div> --}}
</div>
</div>
</div>
@endif
@if(in_array($question->code, ['follow_up_conversation_date_2']))
<div class="card mb-1">
<div class="card-header" id="heading-">
<h5 class="m-0">
<a class="text-dar" data-bs-toggle="collapse" href="#field-{{$question->code}}" aria-expanded="true">
<div class="me-3">
<i class="mdi mdi-apple-keyboard-command text-primary me-1"></i>
{{$question->question}} {!!$question->required == 'yes' ? '<span class="text-danger">*</span>':''!!}
</div>
<span id="result-{{$question->code}}" class="custom-badge"></span>
</a>
</h5>
</div>
<div id="field-{{$question->code}}" class="collapse" aria-labelledby="heading-" data-bs-parent="#accordion">
<div class="card-body pt-1">
@php
$required_flag = false;
@endphp
{{-- @foreach($question->options as $option)
--}}
<div class="form-group mb-2">
<input type="date" name="follow_up_conversation_date_2" id="field-follow_up_conversation_date_2" class="form-control" {{$question->required == 'yes'?'required':'' }} value="{{isset($question->value)?$question->value:''}}">
</div>
@php
$required_flag = true;
@endphp
{{-- @endforeach --}}
<!-- <p id="value-{{$question->code}}"></p> -->
{{-- <div class="col-md-12 mb-2">
<label for="proficiency-{{$question->code}}" class="form-label">Option selected for {{$question->question}} <span class="text-danger">*</span> </label>
<input type="text" id="proficiency-{{$question->code}}" name="proficiency-{{$question->code}}" class="form-control bg-light" required="" value="" readonly="">
</div> --}}
</div>
</div>
</div>
@endif
@endforeach
</div>
{{-- Fourth Accordian Ends --}}
@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 btn-purplegray" 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-label {
font-weight:bold;
font-size:16px;
}
.quick-action-form-card .form-control {
font-size: 16px;
}
.custom-accordion-outer > .card {
border: 1px solid #d9d9d9;
}
.custom-accordion-outer .card-header {
/* padding: 1rem 1.5rem; */
margin-bottom: 0;
/* background-color: #edeff1; */
/* border-bottom: 0 solid #f7f7f7; */
padding: 0;
}
.custom-accordion-outer > .card > .card-header {
/* background-color: transparent;*/
background-color: rgba(66, 70, 157, 0.11);
}
/* .custom-accordion-outer > .card > .collapse > .card-body {
padding-top: 0.5rem;
} */
.custom-accordion-outer>.card .card-body {
background-color: rgba(66, 70, 157, 0.05);
}
.card-header:first-child {
border-radius: 0.25rem 0.25rem 0 0;
}
.custom-accordion-outer .card-header a {
padding: 1rem 1rem;
/* color: var(--bs-primary);*/
color: #626993;
background-color: transparent;
display: flex;
justify-content: space-between;
}
.custom-accordion.custom-accordion-inner .accordion-arrow {
font-size: 1.2rem;
position: absolute;
right: 0.5rem;
line-height: 1;
}
.custom-accordion.custom-accordion-inner .card {
box-shadow: 0 0.75rem 6rem rgba(56, 65, 74, 0.05);
background-color: #f0f6fb;
}
.custom-accordion.custom-accordion-inner .card-header a {
background-color: #e5eef7;
color: var(--bs-secondary);
border-radius: 0.25rem;
font-size: 0.9rem;
}
.custom-badge { display: inline-block;
padding: 0.25rem 0.35rem;
color: #333;
font-size: 13px;
border-radius: 4px;
}
.badge-visible {
background-color: #b0ffcd;
}
.btn-primary.btn-purplegray {
color: #fff;
background-color: #848bb6;
border-color: #7c82a8;
}
/* .custom-accordion.custom-accordion-inner .collapse .card-body {
} */
.field-group-title{
color:#c37736;
font-size:15px;
background: #fff3e8;
padding: 10px 10px 10px;
border-radius: 4px;
margin-bottom:20px;
}
.field-group-title i{
color:#c37736;
}
</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()
$('#add-actionplan-btn').click(function(){
$('#report-form').trigger("reset");
$('#form-wrapper').show()
$('#table-wrapper').hide()
})
$('.edit-button').click(function(){
$('#form-wrapper').show()
let data = JSON.parse( $(this).attr('data') )
$('#field-user_id-wrapper').collapse('show'); // Bootstrap collapse
setTimeout(function() {
$('#field-user_id').val(data['user_id']).trigger('change');
}, 300);
// $("#field-user_id option").filter(function() {
// return $(this).attr('value').includes(data['user_id']);
// }).prop("selected", true).parent().trigger("change");
$('#field-record_date-wrapper').collapse('show'); // Bootstrap collapse
setTimeout(function() {
$('#field-record_date').val(data['record_date']).trigger('change');
$('#field-record_date-wrapper').collapse('hide');
}, 300);
$('#field-select_month-wrapper').collapse('show');
setTimeout(() => {
$("input[name='select_month'][value='" + data['select_month'] + "']").prop("checked", true).trigger('change');
}, 300);
$('#report-form').append('<input type="hidden" name="base_record" value="'+data.id+'">')
console.log(data)
// console.log('data[user_id]: ', data['user_id'])
// for(let k of Object.keys(data)) {
// $('#field-' + k).val( data[k] )
// }
//$('#field-user_id').val(data['user_id']).trigger('change');
//$('#field-user_id').val(data['user_id']);
$('#field-goal_1_tour_plan_adherence_self_and_team_'+ data['goal_1_tour_plan_adherence_self_and_team']).trigger('click')
$('#field-goal_2_spread_of_performance_'+ data['goal_2_spread_of_performance']).trigger('click')
$('#field-goal_3_joint_field_work_'+ data['goal_3_joint_field_work']).trigger('click')
$('#field-goal_4_kol_engagement_and_roi_'+ data['goal_4_kol_engagement_and_roi']).trigger('click')
$('#field-timeline_agreed_for_selected_action_plans_completion_'+ data['timeline_agreed_for_selected_action_plans_completion']).trigger('click')
$('#field-select_month_'+ data['select_month']).trigger('click')
$('#field-date_of_feedback_discussion').val(data['date_of_feedback_discussion'])
for(let key_goal of data['key_goals_set_by_coach_and_coachee']) {
$('#field-key_goals_set_by_coach_and_coachee_'+ key_goal).trigger('click')
}
for(let action_plan of data['action_plan']) {
$('#field-action_plan_'+ action_plan).trigger('click')
}
//field-action_plan_tour_plan_adherence_of_team
$('#table-wrapper').hide()
})
$('#field-user_id').change(function(){
let hierarchy = $('option:selected', this).attr('hierarchy');
$('#field-hierarchy_id').val(hierarchy)
event.preventDefault();
$.ajax({
type: "GET",
url: '/form/getdoctorlist?partition={{$form->partition}}&hierarchy='+hierarchy,
processData: false,
contentType: false,
success: function( data ) {
$("#pageloader").fadeOut();
$('#field-contact_id').html('')
$('#field-contact_id').append($("<option></option>").attr("value",'').text('-- Select --'));
for(let itm of data) {
$('#field-contact_id').append($("<option></option>").attr("value",itm.value).text(itm.display));
}
},
});
console.log(hierarchy)
})
$('label[for="other_action_plan"]').hide();
$('#field-other_action_plan').hide();
$('#field-other_action_plan').prop("required",false);
$('#field-goal_1_tour_plan_adherance,#field-goal_2_basic_working,#field-goal_3_activations,#field-goal_4_in_clinic_effectiveness,#field-goal_5_spread_of_performance,#field-record_date,field-select_role,#field-select_month,#field-key_goals_set_by_coach_and_coachee,#field-action_plan,#field-timeline_agreed_for_selected_action_plans_completion,#field-date_of_feedback_discussion,#field-adherance_to_action_plan,#field-follow_up_conversation_date_1,#field-follow_up_conversation_date_2').attr("required","true");
$('#field-goal_1_tour_plan_adherence_self_and_team').on('click',function(e){
$('#report-form').append('<input type="hidden" name="'+e.target.value +'" value="1">')
})
$('#field-goal_2_spread_of_performance').on('click',function(e){
$('#report-form').append('<input type="hidden" name="'+e.target.value+'" value="1">')
})
$('#field-goal_3_joint_field_work').on('click',function(e){
$('#report-form').append('<input type="hidden" name="'+ e.target.value +'" value="1">')
})
$('#field-goal_4_kol_engagement_and_roi').on('click',function(e){
$('#report-form').append('<input type="hidden" name="'+e.target.value+'" value="1">')
})
$('#field-key_goals_set_by_coach_and_coachee').on('click',function(e){
$('#report-form').append('<input type="hidden" name="'+e.target.value+'" value="1">')
})
$('#field-timeline_agreed_for_selected_action_plans_completion').on('click', function(e) {
$('#report-form').append('<input type="hidden" name="' + e.target.value + '" value="1">')
})
$('#field-adherance_to_action_plan').on('click', function(e) {
$('#report-form').append('<input type="hidden" name="' + e.target.value + '" value="1">')
})
$('#field-action_plan').on('click', function(e) {
console.log("This is checked")
$('#report-form').append('<input type="hidden" name="' + e.target.value + '" value="1">')
})
$('#field-key_goals_set_by_coach_and_coachee').on('click', function(e) {
console.log("This is checked")
$('#report-form').append('<input type="hidden" name="' + e.target.value + '" value="1">')
})
$("<h3 class='field-group-title' >Goals</h3>").insertBefore('#accordion2');
$("<h3 class='field-group-title' >Goal linked Action Plan</h3>").insertBefore('#accordion3');
$("<h3 class='field-group-title' >Progress Observed</h3>").insertBefore('#accordion4');
/* Goal 1 Radio Button */
let radios = document.querySelectorAll("input[name=goal_1_tour_plan_adherence_self_and_team]");
console.log("radios - ",radios)
radios.forEach(radio => {
$(radio).on('click', function(e) {
console.log(e.target.value);
let selectedVal = '';
switch(e.target.value) {
case 'self_no_tp_deviation_team_75_of_all_team_members_adhered_to_tp': selectedVal = 'A - Proficient';
console.log("In Case (self_no_tp_deviation_team_75_of_all_team_members_adhered_to_tp) : ",e.target.value);
break;
case 'self_1_time_tp_deviation_team_50_75_of_team_members_adhered_to_tp': selectedVal = 'B - Competent';
console.log("In Case (self_1_time_tp_deviation_team_50_75_of_team_members_adhered_to_tp) : ",e.target.value);
break;
case 'self_1_time_tp_deviation_team_less_than_50_of_team_members_adhered_to_tp': selectedVal = 'C - Intermediate';
console.log("In Case (self_1_time_tp_deviation_team_50_of_team_members_has_10_tp_adherence) : ",e.target.value);
break;
case 'self_1_time_tp_deviation_team_50_of_team_members_has_10_tp_adherence': selectedVal = 'D - Beginner';
console.log("In Case (self_1_time_tp_deviation_team_50_of_team_members_has_10_tp_adherence) : ",e.target.value);
break;
default: selectedVal = '';
console.log("In Case (default) : ",e.target.value);
}
console.log("selected Value : ",selectedVal);
// $('#value-goal_1_tour_plan_adherance, #result-goal_1_tour_plan_adherance').html(
// selectedVal
// );
$('#result-goal_1_tour_plan_adherence_self_and_team').html(
selectedVal
).addClass('badge-visible');
$('#proficiency-goal_1_tour_plan_adherence_self_and_team').val(
selectedVal
);
})
});
/* End of Goal 1 Radio Button */
/* Goal 2 Radio Button */
let radios2 = document.querySelectorAll("input[name=goal_2_spread_of_performance]");
console.log("radios - ",radios2)
radios2.forEach(radio2 => {
$(radio2).on('click', function(e) {
console.log(e.target.value);
let selectedVal = '';
switch(e.target.value) {
case 'target_100_teamhqs_achieved_their_targets_mandate_brands_44_score_card_at_75_of_hqs_nis_dsm_and_100_team_achieved_ni_target': selectedVal = 'A - Proficient';
console.log("In Case (target_100_teamhqs_achieved_their_targets_mandate_brands_44_score_card_at_75_of_hqs_nis_dsm_and_100_team_achieved_ni_target) : ",e.target.value);
break;
case 'target_80_teamhqs_achieved_their_targets_mandate_brands_44_score_card_nis_dsm_target_achieved_but_only_50_team_achieved_ni_target': selectedVal = 'B - Competent';
console.log("In Case (target_80_teamhqs_achieved_their_targets_mandate_brands_44_score_card_nis_dsm_target_achieved_but_only_50_team_achieved_ni_target) : ",e.target.value);
break;
case 'target_only_50_teamhqs_achieved_their_targets_mandate_brands_34_score_card_nis_dsm_target_achieved_but_50_team_not_achieved_ni_target': selectedVal = 'C - Intermediate';
console.log("In Case (target_only_50_teamhqs_achieved_their_targets_mandate_brands_34_score_card_nis_dsm_target_achieved_but_50_team_not_achieved_ni_target) : ",e.target.value);
break;
case 'target_50_teamhqs_achieved_their_targets_mandate_brands_24_score_card_nis_dsm_target_is_not_achieved': selectedVal = 'D - Beginner';
console.log("In Case (target_50_teamhqs_achieved_their_targets_mandate_brands_24_score_card_nis_dsm_target_is_not_achieved) : ",e.target.value);
break;
default: selectedVal = '';
console.log("In Case (default) : ",e.target.value);
}
console.log("selected Value : ",selectedVal);
// $('#value-goal_2_basic_working, #result-goal_2_basic_working').html(
// selectedVal
// );
$('#result-goal_2_spread_of_performance').html(
selectedVal
).addClass('badge-visible');
$('#proficiency-goal_2_spread_of_performance').val(
selectedVal
);
})
});
/* End of Goal 2 Radio Button */
/* Goal 3 Radio Button */
let radios3 = document.querySelectorAll("input[name=goal_3_joint_field_work]");
console.log("radios - ",radios3)
radios3.forEach(radio3 => {
$(radio3).on('click', function(e) {
console.log(e.target.value);
let selectedVal = '';
switch(e.target.value) {
case '3_days_stretch_working_twice_a_month_critical_geography_recovered_with_right_time_allocation': selectedVal = 'A - Proficient';
console.log("In Case (3_days_stretch_working_twice_a_month_critical_geography_recovered_with_right_time_allocation) : ",e.target.value);
break;
case '3_days_stretch_working_once_in_a_month_good_time_allocation_at_critical_geography_without_any_great_progress_at_business_and_process': selectedVal = 'B - Competent';
console.log("In Case (3_days_stretch_working_once_in_a_month_good_time_allocation_at_critical_geography_without_any_great_progress_at_business_and_process) : ",e.target.value);
break;
case '1_2_days_stretch_working_with_few_changes_in_work_plan_avg_time_allocation_at_critical_geography_without_any_great_progress_at_business_and_process': selectedVal = 'C - Intermediate';
console.log("In Case (1_2_days_stretch_working_with_few_changes_in_work_plan_avg_time_allocation_at_critical_geography_without_any_great_progress_at_business_and_process) : ",e.target.value);
break;
case 'no_stretch_working_and_frequent_changes_in_work_plan_poor_time_allocation_and_poor_progress_at_critical_geography': selectedVal = 'D - Beginner';
console.log("In Case (no_stretch_working_and_frequent_changes_in_work_plan_poor_time_allocation_and_poor_progress_at_critical_geography) : ",e.target.value);
break;
default: selectedVal = '';
console.log("In Case (default) : ",e.target.value);
}
console.log("selected Value : ",selectedVal);
// $('#value-goal_3_activations, #result-goal_3_activations').html(
// selectedVal
// );
$('#result-goal_3_joint_field_work').html(
selectedVal
).addClass('badge-visible');
$('#proficiency-goal_3_joint_field_work').val(
selectedVal
);
})
});
/* End of Goal 3 Radio Button */
/* Goal 4 Radio Button */
let radios4 = document.querySelectorAll("input[name=goal_4_kol_engagement_and_roi]");
console.log("radios - ",radios4)
radios4.forEach(radio4 => {
$(radio4).on('click', function(e) {
console.log(e.target.value);
let selectedVal = '';
switch(e.target.value) {
case '100_coverage_of_sponsored_doctors_in_last_month_with_80_of_the_doctors_giving_more_than_5_times_business': selectedVal = 'A - Proficient';
console.log("In Case (100_coverage_of_sponsored_doctors_in_last_month_with_80_of_the_doctors_giving_more_than_5_times_business) : ",e.target.value);
break;
case '100_coverage_of_sponsored_doctors_with_only_50_of_the_doctors_giving_more_than_5_times_business': selectedVal = 'B - Competent';
console.log("In Case (100_coverage_of_sponsored_doctors_with_only_50_of_the_doctors_giving_more_than_5_times_business) : ",e.target.value);
break;
case '80_coverage_of_sponsored_doctors_in_last_month_but_only_30_of_them_are_giving_5_times_business': selectedVal = 'C - Intermediate';
console.log("In Case (80_coverage_of_sponsored_doctors_in_last_month_but_only_30_of_them_are_giving_5_times_business) : ",e.target.value);
break;
case 'only_50_coverage_of_sponsored_doctors_in_last_1_month_poor_supportbusiness_from_sponsored_doctors': selectedVal = 'D - Beginner';
console.log("In Case (only_50_coverage_of_sponsored_doctors_in_last_1_month_poor_supportbusiness_from_sponsored_doctors) : ",e.target.value);
break;
default: selectedVal = '';
console.log("In Case (default) : ",e.target.value);
}
console.log("selected Value : ",selectedVal);
// $('#value-goal_4_in_clinic_effectiveness, #result-goal_4_in_clinic_effectiveness').html(
// selectedVal
// );
$('#result-goal_4_kol_engagement_and_roi').html(
selectedVal
).addClass('badge-visible');
$('#proficiency-goal_4_kol_engagement_and_roi').val(
selectedVal
);
})
});
/* End of Goal 4 Radio Button */
/* Goal 7 Radio Button */
let radios7 = document.querySelectorAll("input[name=select_month]");
console.log("radios - ", radios7)
radios7.forEach(radio7 => {
$(radio7).on('click', function(e) {
console.log(e.target.value);
let selectedVal = '';
switch (e.target.value) {
case "Apr'25":
selectedVal = "Apr'25";
console.log("In Case (Apr'25) : ", e.target.value);
break;
case "May'25":
selectedVal = "May'25";
console.log("In Case (May'25) : ", e.target.value);
break;
case "Jun'25":
selectedVal = "Jun'25";
console.log("In Case (Jun'25) : ", e.target.value);
break;
case "Jul'25":
selectedVal = "Jul'25";
console.log("In Case (Jul'25) : ", e.target.value);
break;
case "Aug'25":
selectedVal = "Aug'25";
console.log("In Case (Aug'25) : ", e.target.value);
break;
case "Sep'25":
selectedVal = "Sep'25";
console.log("In Case (Sep'25) : ", e.target.value);
break;
case "Oct'25":
selectedVal = "Oct'25";
console.log("In Case (Oct'25) : ", e.target.value);
break;
case "Nov'25":
selectedVal = "Nov'25";
console.log("In Case (Nov'25) : ", e.target.value);
break;
case "Dec'25":
selectedVal = "Dec'25";
console.log("In Case (Dec'25) : ", e.target.value);
break;
default:
selectedVal = '';
console.log("In Case (default) : ", e.target.value);
}
console.log("selected Value : ", selectedVal);
$('#result-select_month').html(
selectedVal
).addClass('badge-visible');
$('#proficiency-select_month').val(
selectedVal
);
})
});
/* End of Goal 7 Radio Button */
/* Goal 8 Radio Button */
// let radios8 = document.querySelectorAll("input[name=key_goals_set_by_coach_and_coachee]");
// console.log("radios - ", radios8)
// radios8.forEach(radio8 => {
// $(radio8).on('click', function(e) {
// console.log(e.target.value);
// let selectedVal = '';
// switch (e.target.value) {
// case "tour_plan_adherence_of_self_and_team":
// selectedVal = "Tour plan Adherence of Self & Team";
// console.log("In Case (Tour plan Adherence of Self & Team) : ", e.target.value);
// break;
// case "business_performance":
// selectedVal = "Business Performance";
// console.log("In Case (Business Performance) : ", e.target.value);
// break;
// case "mandate_brand_performance":
// selectedVal = "Mandate Brand performance";
// console.log("In Case (Mandate Brand performance) : ", e.target.value);
// break;
// case "ni_brand_performance":
// selectedVal = "NI brand Performance";
// console.log("In Case (NI brand Performance) : ", e.target.value);
// break;
// case "stretch_working":
// selectedVal = "Stretch working";
// console.log("In Case (Stretch working) : ", e.target.value);
// break;
// case "critical_geography_working":
// selectedVal = "Critical Geography working";
// console.log("In Case (Critical Geography working) : ", e.target.value);
// break;
// case "sponsored_doctor_coverage":
// selectedVal = "Sponsored doctor Coverage";
// console.log("In Case (Sponsored doctor Coverage) : ", e.target.value);
// break;
// case "sponsored_doctor_business":
// selectedVal = "Sponsored doctor Business";
// console.log("In Case (Sponsored doctor Business) : ", e.target.value);
// break;
// default:
// selectedVal = '';
// console.log("In Case (default) : ", e.target.value);
// }
// console.log("selected Value : ", selectedVal);
// $('#result-key_goals_set_by_coach_and_coachee').html(
// selectedVal
// ).addClass('badge-visible');
// $('#proficiency-key_goals_set_by_coach_and_coachee').val(
// selectedVal
// );
// })
// });
/* End of Goal 8 Radio Button */
/* Goal 9 Radio Button */
let radios9 = document.querySelectorAll("input[name=action_plan]");
console.log("radios - ", radios9)
radios9.forEach(radio9 => {
$(radio9).on('click', function(e) {
console.log(e.target.value);
let selectedVal = '';
switch (e.target.value) {
case "tour_plan_adherence_of_team":
selectedVal = "Tour Plan adherence of Team";
console.log("In Case (Tour Plan adherence of Team) : ", e.target.value);
break;
case "100_spread_of_performance":
selectedVal = "100% Spread of performance";
console.log("In Case (100% Spread of performance) : ", e.target.value);
break;
case "100_rm_region_target_achievement":
selectedVal = "100% RM Region Target achievement";
console.log("In Case (100% RM Region Target achievement) : ", e.target.value);
break;
case "sop_at_mandate_brand_performance":
selectedVal = "SOP at Mandate Brand performance";
console.log("In Case (SOP at Mandate Brand performance) : ", e.target.value);
break;
case "rm_mandate_target_achievement":
selectedVal = "RM Mandate Target Achievement";
console.log("In Case (RM Mandate Target Achievement) : ", e.target.value);
break;
case "sop_at_ni_brand_performance":
selectedVal = "SOP at NI Brand performance";
console.log("In Case (SOP at NI Brand performance) : ", e.target.value);
break;
case "rm_ni_target_achievement":
selectedVal = "RM NI Target Achievement";
console.log("In Case (RM NI Target Achievement) : ", e.target.value);
break;
case "stretch_working_with_sbms":
selectedVal = "Stretch working with SBMs";
console.log("In Case (Stretch working with SBMs) : ", e.target.value);
break;
case "critical_geography_time_allocation":
selectedVal = "Critical Geography time allocation";
console.log("In Case (Critical Geography time allocation) : ", e.target.value);
break;
case "critical_geography_revival":
selectedVal = "Critical geography Revival";
console.log("In Case (Critical geography Revival) : ", e.target.value);
break;
case "covering_all_sponsored_doctors":
selectedVal = "Covering all Sponsored doctors";
console.log("In Case (Covering all Sponsored doctors) : ", e.target.value);
break;
case "ensuring_equal_spread_at_all_doctors":
selectedVal = "Ensuring equal spread at all doctors";
console.log("In Case (Ensuring equal spread at all doctors) : ", e.target.value);
break;
case "ensuring_15_times_roi_from_sponsored_doctors":
selectedVal = "Ensuring 1:5 times ROI from Sponsored doctors";
console.log("In Case (Ensuring 1:5 times ROI from Sponsored doctors) : ", e.target.value);
break;
case "others":
selectedVal = "Others";
console.log("In Case (Others) : ", e.target.value);
break;
default:
selectedVal = '';
console.log("In Case (default) : ", e.target.value);
}
console.log("selected Value : ", selectedVal);
$('#result-action_plan').html(
selectedVal
).addClass('badge-visible');
$('#proficiency-action_plan').val(
selectedVal
);
})
});
/* End of Goal 9 Radio Button */
/* Goal 10 Radio Button */
let radios10 = document.querySelectorAll("input[name=timeline_agreed_for_selected_action_plans_completion]");
console.log("radios - ", radios10)
radios10.forEach(radio10 => {
$(radio10).on('click', function(e) {
console.log(e.target.value);
let selectedVal = '';
switch (e.target.value) {
case "less_than_1_month":
selectedVal = "Less than 1 Month";
console.log("In Case (less_than_1_month) : ", e.target.value);
break;
case "1_month":
selectedVal = "1 Month";
console.log("In Case (1_month) : ", e.target.value);
break;
case "3_month":
selectedVal = "3 Months";
console.log("In Case (3_month) : ", e.target.value);
break;
case "6_month":
selectedVal = "6 Months";
console.log("In Case (6_month) : ", e.target.value);
break;
default:
selectedVal = '';
console.log("In Case (default) : ", e.target.value);
}
console.log("selected Value : ", selectedVal);
$('#result-timeline_agreed_for_selected_action_plans_completion').html(
selectedVal
).addClass('badge-visible');
$('#proficiency-timeline_agreed_for_selected_action_plans_completion').val(
selectedVal
);
})
});
/* End of Goal 10 Radio Button */
/* Goal 11 Radio Button */
let radios11 = document.querySelectorAll("input[name=adherance_to_action_plan]");
console.log("radios - ", radios11)
radios11.forEach(radio11 => {
$(radio11).on('click', function(e) {
console.log(e.target.value);
let selectedVal = '';
switch (e.target.value) {
case "on_track":
selectedVal = "On Track";
console.log("In Case (On Track) : ", e.target.value);
break;
case "needs_correction":
selectedVal = "Needs Correction";
console.log("In Case (Needs Correction) : ", e.target.value);
break;
case "staus_quo":
selectedVal = "Staus-Quo";
console.log("In Case (staus_quo) : ", e.target.value);
break;
default:
selectedVal = '';
console.log("In Case (default) : ", e.target.value);
}
console.log("selected Value : ", selectedVal);
$('#result-adherance_to_action_plan').html(
selectedVal
).addClass('badge-visible');
$('#proficiency-adherance_to_action_plan').val(
selectedVal
);
})
});
/* End of Goal 10 Radio Button */
$('#field-goal_1_tour_plan_adherence_self_and_team').on('click',function(e){
$('#report-form').append('<input type="hidden" name="goal_1_value" value="'+$('input[name="goal_1_tour_plan_adherence_self_and_team"]:checked').parent().text().trim()+'">')
})
$('#field-goal_2_spread_of_performance').on('click',function(e){
$('#report-form').append('<input type="hidden" name="goal_2_value" value="'+$('input[name="goal_2_spread_of_performance"]:checked').parent().text().trim()+'">')
})
$('#field-goal_3_joint_field_work').on('click',function(e){
$('#report-form').append('<input type="hidden" name="goal_3_value" value="'+$('input[name="goal_3_joint_field_work"]:checked').parent().text().trim()+'">')
})
$('#field-goal_4_kol_engagement_and_roi').on('click',function(e){
$('#report-form').append('<input type="hidden" name="goal_4_value" value="'+$('input[name="goal_4_kol_engagement_and_roi"]:checked').parent().text().trim()+'">')
})
// $('input[type=checkbox]').on('change', function() {
// let checkBoxes=$('input[type=checkbox]:checked');
// console.log(checkBoxes);
// if (checkBoxes.length > 3) {
// //Uncheck the most recently checked checkbox (this one)
// $(this).prop('checked', false);
// alert("Only 3 selections allowed");
// }
// });
$('input[name="key_goals_set_by_coach_and_coachee[]"]').on('change', function() {
let checkedBoxes = $('input[name="key_goals_set_by_coach_and_coachee[]"]:checked');
if (checkedBoxes.length > 2) {
// Uncheck the one just clicked
$(this).prop('checked', false);
alert("Only 2 selections allowed");
}
});
$('input[name="action_plan[]"]').on('change', function() {
let checkedBoxes = $('input[name="action_plan[]"]:checked');
if (checkedBoxes.length > 3) {
// Uncheck the one just clicked
$(this).prop('checked', false);
alert("Only 3 selections allowed");
}
});
$('input[name="action_plan[]"]').on('change', function() {
if($(this).is(":checked") && $(this).val()==='others' ){
$('label[for="other_action_plan"]').show();
$('#field-other_action_plan').show();
$('#field-other_action_plan').prop("required",true);
}
else{
$('label[for="other_action_plan"]').hide();
$('#field-other_action_plan').hide();
$('#field-other_action_plan').prop("required",false);
}
});
$('#report-form').on('submit', function(event){
event.preventDefault();
$("#pageloader").fadeIn();
$.ajax({
type: "POST",
url: '/form/ajaxsubmit',
data: new FormData($('#report-form')[0]),
processData: false,
contentType: false,
success: function( data ) {
$("#pageloader").fadeOut();
if(data.status == 'success') {
Swal.fire({
title: 'Great!',
text: 'Your data is successfully submitted!',
icon: 'success'
})
$('#report-form').trigger("reset");
} else {
Swal.fire({
icon: 'error',
title: data.hasOwnProperty('message') ? 'You are not mapped to any position code' : 'Data not submitted',
text: data.hasOwnProperty('message') ? 'for resolution please email Position code, L1 Manager and L2 Manager details to support1@stratawiz.com':'Something went wrong, please try again after some time!'
})
}
},
});
});
var today = new Date();
var dd = String(today.getDate()).padStart(2, '0');
var mm = String(today.getMonth() + 1).padStart(2, '0');
var yyyy = today.getFullYear();
today = yyyy + '-' + mm + '-' + dd;
var plandateField = document.getElementById('field-record_date');
plandateField.setAttribute('max', today);
});
</script>
</body>
</html>