Viewing file: meal_plan.blade.php (8.99 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
@extends('layouts.customer')
@section('title') Meal Plan @endsection
@section('extra-css') <link rel="stylesheet" href="{{asset('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css')}}"> <link rel="stylesheet" href="{{asset('plugins/datatables-responsive/css/responsive.bootstrap4.min.css')}}">
<style> .w-100{ width: 100%; } .task-header,.task-result{ padding: 4px; } .t-head-sec{ border-bottom: 2px solid #5b73e8; } .task-result{ font-size: 11px !important; } input[type=checkbox] { display: block !important; } </style>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css"> @endsection
@section('content') <!-- Main content --> <section class="content"> <div class="row"> @if(!isset($upgrade_plan) && isset($customer_meal_plan) && $customer_meal_plan)
<div class="col-md-10 mx-auto"> <div class="card"> <div class="card-body"> <p>Meal Plan Information</p> <div class="mt-3"> <h5>{{$customer_meal_plan->meal_plan->title}}</h5> </div> @if($customer_meal_plan->plan_details) @foreach($customer_meal_plan->plan_details as $detail) <div class="card"> <div class="card-header text-center"> <h4>{{isset($detail->day)?$detail->day:''}}</h4> </div> <div class="card-body text-center"> <div class="row justify-content-between t-head-sec"> <div class="task-header col-2 col-sm-2"><strong> Breakfast</strong></div> <div class="task-header col-2 col-sm-2"><strong> Launch</strong></div> <div class="task-header col-2 col-sm-2"><strong> Snack</strong></div> <div class="task-header col-2 col-sm-2"><strong> Dinner</strong></div> <div class="task-header col-2 col-sm-2"><strong>Dinner Snack </strong></div> <div class="task-header col-2 col-sm-2"><strong>Status</strong></div> </div> <div class="row justify-content-between mt-2"> <div class="task-result col-2 col-sm-2"> @foreach($detail->plan_tasks()->where('type', 'breakfast')->get() as $plan_task) {{isset($plan_task->task)?$plan_task->task:''}} <hr class="task-list"> @endforeach </div> <div class="task-result col-2 col-sm-2"> @foreach($detail->plan_tasks()->where('type', 'launch')->get() as $plan_task) {{isset($plan_task->task)?$plan_task->task:''}} <hr class="task-list"> @endforeach </div> <div class="task-result col-2 col-sm-2"> @foreach($detail->plan_tasks()->where('type', 'snack')->get() as $plan_task) {{isset($plan_task->task)?$plan_task->task:''}} <hr class="task-list"> @endforeach </div> <div class="task-result col-2 col-sm-2"> @foreach($detail->plan_tasks()->where('type', 'dinner')->get() as $plan_task) {{isset($plan_task->task)?$plan_task->task:''}} <hr class="task-list"> @endforeach </div> <div class="task-result col-2 col-sm-2"> @foreach($detail->plan_tasks()->where('type', 'dinner_snack')->get() as $plan_task) {{isset($plan_task->task)?$plan_task->task:''}} <hr class="task-list"> @endforeach </div> <div class="task-result col-2 text-center col-sm-2"> <input type="checkbox" {{$detail->status=='complete'?'checked':''}} class="check_meal_task mt-1 mx-auto" data-id="{{$detail->id}}"> </div>
</div> </div> </div> @endforeach @endif </div> </div> </div> @else <div class="col-md-12 mx-auto"> <div class="card"> <div class="card-header"> <h2 class="card-title">@lang('Meal Plan Details')</h2> </div>
<div class="card-body"> <div class="row"> <div class="col-md-4 mx-auto"> <div class="card"> <div class="card-body text-center"> <h5>{{trans('No Meal Plan Assigned')}}</h5> <strong>{{trans('Contact With Admin')}}</strong> </div> </div> </div> </div> </div> </div> </div> @endif </div>
<!-- /.row --> </section> <!-- /.content -->
@endsection
@section('extra-scripts') <script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js"></script>
<script> "use strict";
$(document).on("click", ".check_meal_task", function () { const data_id = $(this).attr('data-id'); let status = 'incomplete'; if ($(this).is(':checked')) { status = 'complete';
} else { status = 'incomplete'; }
$.ajax({ type: 'POST', url: '{{route('customer.meal.plan.status')}}', data: { status: status, id: data_id, '_token': '{{csrf_token()}}', },
success: function (res) { if(res.status=='success'){ toastr.success(res.message); } } }) });
</script>
<script> "use strict"; let workout_task_status = 'incomplete'; $(document).on("click", ".check_workout_task", function (e) { const data_id = $(this).attr('data-id'); if ($(this).is(':checked')) { workout_task_status = 'complete'; } else { workout_task_status = 'incomplete'; }
$.ajax({ url: '{{route('customer.work.out.plan.status')}}', method: 'POST', data: { '_token': '{{csrf_token()}}', workout_task_status: workout_task_status, id: data_id }, success: function (res) { if(res.status=='success'){ toastr.success(res.message); } } });
}); </script>
@endsection
|