<?php $__env->startSection('content'); ?>
 <header class="header inner-pages-header min bg-img valign" style="background:url(<?php echo e(asset($header->image)); ?>)">
        <div class="container">
            <div class="row">
                <div class="col-lg-12">
                    <div class="caption text-center wow fadeIn" data-wow-delay=".5s">
                        <h2 class="pg_title"><?php echo e(__('web.profile')); ?></h2>
                        <div class="bread">
                            <a href="<?php echo e(url(getCurrentLocale().'/')); ?>"><?php echo e(__('web.home')); ?></a>
                            <span><i class="fas fa-arrows-alt-h"></i></span>
                            <span class="current_pg"><?php echo e(__('web.profile')); ?></span>
                        </div>
                    </div>
                </div>
            </div>
        </div>


        <img src="<?php echo e(url('')); ?>/assets/web/images/header_b.svg" alt="" class="header_lines"/>
    </header>
    <main>
        <!-- Start profile -->
        <section class="profile bg-img section-padding">
            <div class="container">
                <div class="row">
                     <?php if(Session::has('error')): ?>
   <div class="col-12">
    <div  class="alert alert-danger">
<p style="color: black;"><?php echo e(Session::get('error')); ?></p>
</div>
</div>
<?php endif; ?>
 <?php if(Session::has('success')): ?>
   <div class="col-12">
    <div  class="alert alert-success">
<p style="color: black;"><?php echo e(Session::get('success')); ?></p>
</div>
</div>
<?php endif; ?>
                    <div class="col-md-3">
                        <div class="fixed-r-nav">
                            <form action="<?php echo e(url(getCurrentLocale().'/profileimage')); ?>" onsubmit="saveimage(this)" id="saveimage" method="post">
                                <?php echo csrf_field(); ?>
                            <div class="img">
                                <img id="img-profile" class="img-fluid image-profile" src="<?php echo e(asset($user->photo)); ?>" alt="your image">
                                <a class="butn" href="#"><i class="far fa-edit"></i></a>
                                <input type="file" name="photo" class="custom-file-input" id="input-profile" onchange="readURL(this);" required />
                            </div>
                            
                            <div class="text-center mt-3">
                                <button type="submit" class="butn" id="saveImage" > <span>حفظ</span></button>
                            </div>
                            </form>
                            <div class="nav flex-column nav-pills mt-5" id="v-pills-tab" role="tablist" aria-orientation="vertical">
                                <a class="nav-link active" id="v-pills-tab1-tab" data-toggle="pill" href="#v-pills-tab1" role="tab" aria-controls="v-pills-tab1" aria-selected="true"><?php echo e(__('web.personal')); ?></a>
                                <a class="nav-link" id="v-pills-tab2-tab" data-toggle="pill" href="#v-pills-tab2" role="tab" aria-controls="v-pills-tab2" aria-selected="false"><?php echo e(__('web.editporfile')); ?></a>
                                <!-- <a class="nav-link" id="v-pills-tab5-tab" data-toggle="pill" href="#v-pills-tab5" role="tab" aria-controls="v-pills-tab5" aria-selected="false">الاشعارات</a> -->
                                <a class="nav-link" id="v-pills-tab3-tab" data-toggle="pill" href="#v-pills-tab3" role="tab" aria-controls="v-pills-tab3" aria-selected="false"><?php echo e(__('web.subscribtion')); ?></a>
                                <a class="nav-link" id="v-pills-tab4-tab" data-toggle="pill" href="#v-pills-tab4" role="tab" aria-controls="v-pills-tab4" aria-selected="false"><?php echo e(__('web.updatesub')); ?></a>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-9">
                        <div class="tab-content" id="v-pills-tabContent">
                            <div class="tab-pane fade show active" id="v-pills-tab1" role="tabpanel" aria-labelledby="v-pills-tab1-tab">
                                <div class="tab-wrapper tab1">
                                    <div class="content">
                                        <div class="row">
                                            <div class="items col-md-6">
                                                <h5><?php echo e(__('web.name')); ?> : <span><?php echo e($user->name); ?></span></h5>
                                            </div>
                                            <div class="items col-md-6">
                                                <h5><?php echo e(__('web.email')); ?> : <span> <?php echo e($user->email); ?></span></h5>
                                            </div>
                                            <div class="items col-md-6">
                                                <h5><?php echo e(__('web.gender')); ?> : <span><?php if($user->gender == 'male'): ?> <?php echo e(__('web.male')); ?> <?php else: ?> <?php echo e(__('web.female')); ?> <?php endif; ?></span></h5>
                                            </div>
                                            <div class="items col-md-6">
                                                <h5><?php echo e(__('web.phone')); ?> : <span><?php echo e($user->phone); ?></span></h5>
                                            </div>
                                            <div class="items col-md-6">
                                                <h5><?php echo e(__('web.address')); ?> : <span><?php echo e($user->address); ?></span></h5>
                                            </div>
                                            <div class="items col-md-6">
                                                <h5><?php echo e(__('web.city')); ?> : <span><?php echo e(countryname($user->country_id)); ?></span></h5>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="tab-pane fade" id="v-pills-tab2" role="tabpanel" aria-labelledby="v-pills-tab2-tab">
                                <div class="tab-wrapper form-wrapper">
                                    <form action="<?php echo e(url(getCurrentLocale().'/profile')); ?>" onsubmit="updateprorfile(this)" id="updateprorfile" method="post">
                                        <?php echo csrf_field(); ?>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form">
                                                    <div class="form-group">
                                                        <label for=""><?php echo e(__('web.name')); ?></label>
                                                        <input class="form-control" id="name" name="name" value="<?php echo e($user->name); ?>" type="text" >
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form">
                                                    <div class="form-group">
                                                        <label for=""><?php echo e(__('web.email')); ?></label>
                                                        <input class="form-control" id="email" name="email" value="<?php echo e($user->email); ?>" type="text">
                                                    </div>
                                                </div>
                                            </div>
                                             <div class="col-md-6">
                                                <div class="form">
                                                    <div class="form-group">
                                                        <label for=""><?php echo e(__('web.password')); ?></label>
                                                        <input class="form-control"  name="password"  type="password">
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form">
                                                    <div class="form-group">
                                                        <label for=""><?php echo e(__('web.phone')); ?> </label>
                                                        <input class="form-control"id="phone" name="phone" value="<?php echo e($user->phone); ?>" type="text" >
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form">
                                                    <div class="form-group">
                                                        <label for=""><?php echo e(__('web.address')); ?> </label>
                                                        <input class="form-control" id="address" name="address"  value="<?php echo e($user->address); ?>" type="text" >
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form">
                                                    <div class="form-group">
                                                        <label for=""><?php echo e(__('web.gender')); ?> </label>
                                                        <select name="gender" id="gender" class="form-control">
                                                            <option <?php if($user->gender == 'male'): ?> selected <?php endif; ?> value="male"><?php echo e(__('web.male')); ?></option>
                                                            <option <?php if($user->gender == 'female'): ?> selected <?php endif; ?> value="female"><?php echo e(__('web.female')); ?></option>
                                                        </select>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form">
                                                    <div class="form-group">
                                                        <label for=""><?php echo e(__('web.city')); ?> </label>
                                                        <select name="city_id" id="city_id" class="form-control">
                                                            <?php $__currentLoopData = $countries; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                            <option <?php if($user->country_id == $row->id): ?> selected <?php endif; ?> value="<?php echo e($row->id); ?>"><?php echo e(countryname($row->id)); ?></option>
                                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                        </select>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form">
                                                    <div class="form-group">
                                                        <label for=""><?php echo e(__('web.area')); ?> </label>
                                                        <select name="country_id" id="country_id" class="form-control">
                                                            <?php $__currentLoopData = $cities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                            <option <?php if($user->city_id == $row->id): ?> selected <?php endif; ?> value="<?php echo e($row->id); ?>"><?php echo e(cityname($row->id)); ?></option>
                                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                        </select>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="mt-4 d-block w-100">
                                                <button type="submit" class="butn butn-bg m-auto" ><span><?php echo e(__('web.save')); ?></span></button>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                            <!-- <div class="tab-pane fade" id="v-pills-tab5" role="tabpanel" aria-labelledby="v-pills-tab5-tab">
                                <div class="tab-wrapper notifications-tab">
                                    <div class="notifi-item ">
                                        <p class="dec">
                                            <img src="<?php echo e(url('')); ?>/assets/web/images/icons/notification-1.svg" alt="" class="icon"> 
                                            تم تسجيل الدخول بنجاح
                                        </p>
                                        <span class="time">9:35 pm</span>
                                    </div>
                                    <div class="notifi-item ">
                                        <p class="dec">
                                            <img src="<?php echo e(url('')); ?>/assets/web/images/icons/notification-2.svg" alt="" class="icon"> حدث خطأ يرحى المحاوله مرة اخرى 
                                        </p>
                                        <span class="time">9:35 pm</span>
                                    </div>
                                    <div class="notifi-item ">
                                        <p class="dec">
                                            <img src="<?php echo e(url('')); ?>/assets/web/images/icons/notification-3.svg" alt="" class="icon"> انت الآن عضو مميز.
                                        </p>
                                        <span class="time">9:35 pm</span>
                                    </div>
                                </div>
                            </div> -->
                            <div class="tab-pane fade" id="v-pills-tab3" role="tabpanel" aria-labelledby="v-pills-tab3-tab">
                                <div class="tab-wrapper subscription_tab">
                                    <div class="content">
                                        <div class="row">
                                            <?php if($subscribe): ?>
                                            
                                            
                                            <div class="col-md-6">
                                                <div class="items ">
                                                    <h5><?php echo e(__('web.subscribe_id')); ?> : <span> <?php echo e($subscribe->id); ?></span></h5>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="items ">
                                                    <h5><?php echo e(__('web.subscribe_type')); ?> : <span><?php if($subscribe->end_date < date('Y-m-d')): ?> <?php echo e(__('web.invalid')); ?> <?php else: ?> <?php echo e(__('web.valid')); ?> <?php endif; ?></span></h5>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="items">
                                                    <h5><?php echo e(__('web.subscribe_delivery')); ?> : <span><?php if($subscribe->delivery == 'home'): ?> <?php echo e(__('web.fromhome')); ?> <?php else: ?> <?php echo e(__('web.delivery')); ?> <?php endif; ?></span></h5>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="items">
                                                    <h5><?php echo e(__('web.start_date')); ?> : <span><?php echo e(difftime($start_day)); ?></span></h5>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="items">
                                                    <h5><?php echo e(__('web.end_date')); ?> : <span><?php echo e(difftime($end_day)); ?></span></h5>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="items ">
                                                    <h5><?php echo e(__('web.remain')); ?> : <span><?php echo e($count_days); ?> <?php echo e(__('web.day')); ?></span></h5>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="items">
                                                    <h5><?php echo e(__('web.still')); ?>  : <span><?php echo e(10-$subscribe->stop_days); ?> <?php echo e(__('web.day')); ?></span></h5>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="items">
                                                    <h5><?php echo e(__('web.report')); ?> : 
                                                        <span><a class="butn link-butn" <?php if(!$report): ?> href="#0"  data-toggle="modal" data-target="#reportModal" <?php endif; ?>> <?php if(!$report): ?> <?php echo e(__('web.reporting')); ?> <?php else: ?> <?php echo e(__('web.reported')); ?> <?php endif; ?></a> </span>
                                                    </h5>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="items">
                                                    <h5><?php echo e(__('web.stopbutton')); ?> : 
                                                        <span><button class="unsubscribe-butn" data-toggle="modal" data-target="#unsubscribeModal"><?php echo e(__('web.stop')); ?></button></span>
                                                    </h5>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="items">
                                                    <h5><?php echo e(__('web.billsub')); ?> : 
                                                        <span><a href="#0" class="butn link-butn"><?php echo e(__('web.bill')); ?> PDF</a> </span>
                                                    </h5>
                                                </div>
                                            </div>
                                        
                                        
                                        
                                        <?php else: ?>
                                        <?php echo e(__('web.not_sub')); ?>

                                        <?php endif; ?>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            
                            <div class="tab-pane fade" id="v-pills-tab4" role="tabpanel" aria-labelledby="v-pills-tab4-tab">
                                <form method="post" action="<?php echo e(url(getCurrentLocale().'/editsub')); ?>">
                                    <?php echo csrf_field(); ?>
                                <div class="tab-wrapper menu_order_tab">
                                    <?php if($subscribe): ?>
                                    <?php if($product): ?>
                                    <input type="hidden" id="lengthsnacks" value="<?php echo e($product->count); ?>">
                                    <?php endif; ?>
                                    <h5 class="mb-4"> <?php echo e(__('web.selectday')); ?> : </h5>
                                    <div class="week-meal">
                                        <div class="week-tabs">
                                            <div class="radios-wrapper table-responsive">
                                                <?php $__currentLoopData = $days; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <div class="custom-control custom-radio">
                                                    <input type="radio" <?php if($days[0]['day'] <= date('Y-m-d') && end($days)['day'] >= date('Y-m-d') ): ?> <?php if($row->day == date('Y-m-d')): ?> checked <?php endif; ?> <?php else: ?> <?php if($key == '0'): ?> checked <?php endif; ?> <?php endif; ?> id="selectDay<?php echo e($key); ?>" name="selectDay" key-id="<?php echo e($key); ?>" onclick="daySelect(this)" class="custom-control-input">
                                                    <label class="custom-control-label" for="selectDay<?php echo e($key); ?>">
                                                        <span><?php echo e(date('D',strtotime($row->day))); ?></span> 
                                                        <span class="radio_date"><?php echo e(date('Y/m/d',strtotime($row->day))); ?></span>
                                                    </label>
                                                </div>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </div>
                                        </div>
                                        <div class="content">
                                            
                                                <input type="hidden" id="length" value="<?php echo e($subscribe->mealCount); ?>">
                                            <?php $__currentLoopData = $days; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <?php $keys = 0; ?>
                                            <div class="row mealsdata" id="daysmeal<?php echo e($key); ?>" <?php if($key != '0'): ?> style="display:none" <?php endif; ?>>
                                                <input type="hidden"  id="countmealsday<?php echo e($key); ?>" value="<?php echo e(countmealsday($row->id)); ?>">
                                                <input type="hidden"  id="countmealscounter<?php echo e($key); ?>" value="<?php echo e(countmealsday($row->id)); ?>">
                                                <input type="hidden"  id="countsnacks<?php echo e($key); ?>" value="<?php echo e(count(dayssnack($row->id))); ?>">
                                                
                                                <div class="col-lg-12">
                                                    <div class="box">
                                                        <div class="box-titel">
                                                            <h5>
                                                                <?php echo e(__('web.main_meals')); ?>

                                                                <img src="<?php echo e(url('')); ?>/assets/web/images/title_heading.svg" alt="" class="title_bg"/>
                                                            </h5>
                                                        </div>
                                                        <ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
                                                            <li class="nav-item" role="presentation">
                                                                <a class="nav-link active" id="pills-mainMeal1-tab" data-toggle="pill" href="#pills-mainMeal<?php echo e($key); ?>chicken" role="tab" aria-controls="pills-mainMeal1" aria-selected="true"><?php echo e(__('web.chicken')); ?></a>
                                                            </li>
                                                            <li class="nav-item" role="presentation">
                                                                <a class="nav-link" id="pills-mainMeal2-tab" data-toggle="pill" href="#pills-mainMeal<?php echo e($key); ?>meat" role="tab" aria-controls="pills-mainMeal2" aria-selected="false"><?php echo e(__('web.meat')); ?></a>
                                                            </li>
                                                            <li class="nav-item" role="presentation">
                                                                <a class="nav-link" id="pills-mainMeal3-tab" data-toggle="pill" href="#pills-mainMeal<?php echo e($key); ?>sea" role="tab" aria-controls="pills-mainMeal3" aria-selected="false"><?php echo e(__('web.sea')); ?></a>
                                                            </li>
                                                        </ul>
                                                        <div class="tab-content" id="pills-tabContent">
                                                            <div class="tab-pane fade show active" id="pills-mainMeal<?php echo e($key); ?>chicken" role="tabpanel" aria-labelledby="pills-mainMeal1-tab">
                                                                <div class="main-meal" id="mainMeal<?php echo e($key); ?>chicken">
                                                                    <?php $__currentLoopData = dayschicken($row->id); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $keymeal=>$meal): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                                    <div class="item row">
                                                                        <input type="hidden" name="meals[<?php echo e($key); ?>][<?php echo e($keys+$keymeal); ?>][meal_id]" value="<?php echo e($meal->meal_id); ?>">
                                                                        <input type="hidden" name="meals[<?php echo e($key); ?>][<?php echo e($keys+$keymeal); ?>][count]" id="countnewmeal<?php echo e($key); ?><?php echo e($keys+$keymeal); ?>" value="<?php echo e($meal->count); ?>">
                                                                        
                                                                        <div class="col-md-3 col-sm-5">
                                                                            <div class="img">
                                                                                <img src="<?php echo e(asset($meal->meal->image)); ?>" alt="">
                                                                            </div>
                                                                            <button class="delete-butn" data-toggle="tooltip"  onclick="removeitem(this)" row-id="<?php echo e($keys+$keymeal); ?>" key-id="<?php echo e($key); ?>" data-placement="top" title="<?php echo e(__('web.close')); ?>"><i class="far fa-trash-alt"></i> </button>
                                                                        </div>
                                                                        <div class="col-md-5 col-sm-7 valign">
                                                                            <div class="cont">
                                                                                <p><?php echo e(__('web.chicken')); ?></p>
                                                                                <h6><?php echo e(mealname($meal->meal_id)); ?></h6>
                                                                                <div class="inFlex">
                                                                                    <div class="numb">
                                                                                        <label for="spinner"><?php echo e(__('web.count')); ?> :</label>
                                                                                        <p class="data"><?php echo e($meal->count); ?></p>
                                                                                    </div>
                                                                                    <div class="numb mr-3 ml-3">
                                                                                        <label for="spinner"><?php echo e(__('web.extras')); ?> :</label>
                                                                                        <select name="meals[<?php echo e($key); ?>][<?php echo e($keys+$keymeal); ?>][extra_id]" class="form-control additionals-select">
                                                                                            <option selected value=""><?php echo e(__('web.select')); ?></option>
                                                                                            <?php $__currentLoopData = extras($meal->meal_id); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $extra): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                                                            <option <?php if($extra->id == $meal->extra_id): ?> selected <?php endif; ?> value="<?php echo e($extra->id); ?>"><?php echo e(extraname($extra->id)); ?></option>
                                                                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                                                        </select>
                                                                                    </div>
                                                                                </div>
                                                                             
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-4">
                                                                            <div class="info">
                                                                                <ul>
                                                                                    <li>
                                                                                        <div class="type"><?php echo e(__('web.calories')); ?></div>
                                                                                        <div class="numb"><?php echo e($meal->meal->calories); ?> <?php echo e(__('web.gram')); ?></div>
                                                                                    </li>
                                                                                    <li>
                                                                                        <div class="type"><?php echo e(__('web.fats')); ?></div>
                                                                                        <div class="numb"><?php echo e($meal->meal->fats); ?> <?php echo e(__('web.gram')); ?></div>
                                                                                    </li>
                                                                                </ul>
                                                                            </div>

                                                                        </div>
                                                                        <div class="col-md-9 mr-auto mt-1 meal_notes ">
                                                                            <label class="label"><?php echo e(__('web.note')); ?> :</label>
                                                                            <textarea class="form-control" rows="1" name="meals[<?php echo e($key); ?>][<?php echo e($keys+$keymeal); ?>][note]" placeholder="<?php echo e(__('web.write')); ?>"><?php echo e($meal->note); ?></textarea>
                                                                        </div>
                                                                    </div>
                                                                     <?php if(($keys+$keymeal) == 0) { $keys = $keys + 1; } ?>
                                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                                    
                                                                </div>
                                                                <div class="col-md-12 mt-4">
                                                                        <button class="add_meal_butn m-auto" onclick="addMeal(this)" data-id="<?php echo e($key); ?>"  type-id="chicken" type="button" data-toggle="modal" data-target="#addMealModal"><?php echo e(__('web.addnewmeal')); ?></button>
                                                                    </div>
                                                            </div>
                                                            <div class="tab-pane fade" id="pills-mainMeal<?php echo e($key); ?>meat" role="tabpanel" aria-labelledby="pills-mainMeal2-tab">
                                                                <div class="main-meal" id="mainMeal<?php echo e($key); ?>meat">
                                                                    <?php $__currentLoopData = daysmeat($row->id); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $keymeal=>$meal): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                                    <div class="item row">
                                                                        <input type="hidden" name="meals[<?php echo e($key); ?>][<?php echo e($keys+$keymeal); ?>][meal_id]" value="<?php echo e($meal->meal_id); ?>">
                                                                        <input type="hidden" name="meals[<?php echo e($key); ?>][<?php echo e($keys+$keymeal); ?>][count]" id="countnewmeal<?php echo e($key); ?><?php echo e($keys+$keymeal); ?>"  value="<?php echo e($meal->count); ?>">
                                                                        <div class="col-md-3 col-sm-5">
                                                                            <div class="img">
                                                                                <img src="<?php echo e(asset($meal->meal->image)); ?>" alt="">
                                                                            </div>
                                                                            <button class="delete-butn" data-toggle="tooltip" onclick="removeitem(this)" row-id="<?php echo e($keys+$keymeal); ?>" key-id="<?php echo e($key); ?>" data-placement="top" title="<?php echo e(__('web.close')); ?>"><i class="far fa-trash-alt"></i> </button>
                                                                        </div>
                                                                        <div class="col-md-5 col-sm-7 valign">
                                                                            <div class="cont">
                                                                                <p><?php echo e(__('web.meat')); ?></p>
                                                                                <h6><?php echo e(mealname($meal->meal_id)); ?></h6>
                                                                                <div class="inFlex">
                                                                                    <div class="numb">
                                                                                        <label for="spinner"><?php echo e(__('web.count')); ?> :</label>
                                                                                        <p class="data"><?php echo e($meal->count); ?></p>
                                                                                    </div>
                                                                                    <div class="numb mr-3 ml-3">
                                                                                        <label for="spinner"><?php echo e(__('web.extras')); ?> :</label>
                                                                                        <select name="meals[<?php echo e($key); ?>][<?php echo e($keys+$keymeal); ?>][extra_id]" class="form-control additionals-select">
                                                                                            <option selected value=""><?php echo e(__('web.select')); ?></option>
                                                                                            <?php $__currentLoopData = extras($meal->meal_id); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $extra): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                                                            <option <?php if($extra->id == $meal->extra_id): ?> selected <?php endif; ?> value="<?php echo e($extra->id); ?>"><?php echo e(extraname($extra->id)); ?></option>
                                                                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                                                        </select>
                                                                                    </div>
                                                                                </div>
                                                                             
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-4">
                                                                            <div class="info">
                                                                                <ul>
                                                                                    <li>
                                                                                        <div class="type"><?php echo e(__('web.calories')); ?></div>
                                                                                        <div class="numb"><?php echo e($meal->meal->calories); ?> <?php echo e(__('web.gram')); ?></div>
                                                                                    </li>
                                                                                    <li>
                                                                                        <div class="type"><?php echo e(__('web.fats')); ?></div>
                                                                                        <div class="numb"><?php echo e($meal->meal->fats); ?> <?php echo e(__('web.gram')); ?></div>
                                                                                    </li>
                                                                                </ul>
                                                                            </div>

                                                                        </div>
                                                                        <div class="col-md-9 mr-auto mt-1 meal_notes ">
                                                                            <label class="label"><?php echo e(__('web.note')); ?> :</label>
                                                                            <textarea class="form-control" rows="1" name="meals[<?php echo e($key); ?>][<?php echo e($keys+$keymeal); ?>][note]" placeholder="<?php echo e(__('web.write')); ?>"><?php echo e($meal->note); ?></textarea>
                                                                        </div>
                                                                    </div>
                                                                         <?php if(($keys+$keymeal) == 0) { $keys = $keys + 1; } ?>
                                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                                   
                                                                </div>
                                                                 <div class="col-md-12 mt-4">
                                                                        <button class="add_meal_butn m-auto" onclick="addMeal(this)" data-id="<?php echo e($key); ?>"  type-id="meat" type="button" data-toggle="modal" data-target="#addMealModal"><?php echo e(__('web.addnewmeal')); ?></button>
                                                                    </div>
                                                            </div>
                                                            <div class="tab-pane fade" id="pills-mainMeal<?php echo e($key); ?>sea" role="tabpanel" aria-labelledby="pills-mainMeal3-tab">
                                                                <div class="main-meal" id="mainMeal<?php echo e($key); ?>sea">
                                                                    <?php $__currentLoopData = dayssea($row->id); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $keymeal=>$meal): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                                    <div class="item row">
                                                                        <input type="hidden" name="meals[<?php echo e($key); ?>][<?php echo e($keys+$keymeal); ?>][meal_id]" value="<?php echo e($meal->meal_id); ?>">
                                                                        <input type="hidden" name="meals[<?php echo e($key); ?>][<?php echo e($keys+$keymeal); ?>][count]" id="countnewmeal<?php echo e($key); ?><?php echo e($keys+$keymeal); ?>"  value="<?php echo e($meal->count); ?>">
                                                                        <div class="col-md-3 col-sm-5">
                                                                            <div class="img">
                                                                                <img src="<?php echo e(asset($meal->meal->image)); ?>" alt="">
                                                                            </div>
                                                                            <button class="delete-butn" data-toggle="tooltip" onclick="removeitem(this)" row-id="<?php echo e($keys+$keymeal); ?>" key-id="<?php echo e($key); ?>" data-placement="top" title="<?php echo e(__('web.close')); ?>"><i class="far fa-trash-alt"></i> </button>
                                                                        </div>
                                                                        <div class="col-md-5 col-sm-7 valign">
                                                                            <div class="cont">
                                                                                <p><?php echo e(__('web.sea')); ?></p>
                                                                                <h6><?php echo e(mealname($meal->meal_id)); ?></h6>
                                                                                <div class="inFlex">
                                                                                    <div class="numb">
                                                                                        <label for="spinner"><?php echo e(__('web.count')); ?> :</label>
                                                                                        <p class="data"><?php echo e($meal->count); ?></p>
                                                                                    </div>
                                                                                    <div class="numb mr-3 ml-3">
                                                                                        <label for="spinner"><?php echo e(__('web.extras')); ?> :</label>
                                                                                        <select name="meals[<?php echo e($key); ?>][<?php echo e($keys+$keymeal); ?>][extra_id]" class="form-control additionals-select">
                                                                                            <option selected value=""><?php echo e(__('web.select')); ?></option>
                                                                                            <?php $__currentLoopData = extras($meal->meal_id); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $extra): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                                                            <option <?php if($extra->id == $meal->extra_id): ?> selected <?php endif; ?> value="<?php echo e($extra->id); ?>"><?php echo e(extraname($extra->id)); ?></option>
                                                                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                                                        </select>
                                                                                    </div>
                                                                                </div>
                                                                             
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-4">
                                                                            <div class="info">
                                                                                <ul>
                                                                                    <li>
                                                                                        <div class="type"><?php echo e(__('web.calories')); ?></div>
                                                                                        <div class="numb"><?php echo e($meal->meal->calories); ?> <?php echo e(__('web.gram')); ?></div>
                                                                                    </li>
                                                                                    <li>
                                                                                        <div class="type"><?php echo e(__('web.fats')); ?></div>
                                                                                        <div class="numb"><?php echo e($meal->meal->fats); ?> <?php echo e(__('web.gram')); ?></div>
                                                                                    </li>
                                                                                </ul>
                                                                            </div>

                                                                        </div>
                                                                        <div class="col-md-9 mr-auto mt-1 meal_notes ">
                                                                            <label class="label"><?php echo e(__('web.note')); ?> :</label>
                                                                            <textarea class="form-control" rows="1" name="meals[<?php echo e($key); ?>][<?php echo e($keys+$keymeal); ?>][note]" placeholder="<?php echo e(__('web.write')); ?>"><?php echo e($meal->note); ?></textarea>
                                                                        </div>
                                                                    </div>
                                                                         <?php if(($keys+$keymeal) == 0) { $keys = $keys + 1; } ?>
                                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                                    
                                                                </div>
                                                                <div class="col-md-12 mt-4">
                                                                        <button class="add_meal_butn m-auto" onclick="addMeal(this)" data-id="<?php echo e($key); ?>"  type-id="sea" type="button" data-toggle="modal" data-target="#addMealModal"><?php echo e(__('web.addnewmeal')); ?></button>
                                                                    </div>
                                                            </div>
                                                        </div>
                                                       
                                                    </div>

                                                </div>
                                                <div class="col-lg-6">
                                                    <div class="box" >
                                                        <div class="box-titel">
                                                            <h5>
                                                                <?php echo e(__('web.drinks')); ?>

                                                                <img src="<?php echo e(url('')); ?>/assets/web/images/title_heading.svg" alt="" class="title_bg"/>
                                                            </h5>
                                                        </div>
                                                        <div id="drinks<?php echo e($key); ?>">
                                                        <?php $__currentLoopData = daysdrink($row->id); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $meal): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <div class="item row">
                                                            <div class="col-md-3 col-sm-5">
                                                                <div class="img">
                                                                    <img src="<?php echo e(asset($meal->meal->image)); ?>" alt="">
                                                                </div>
                                                                <button class="delete-butn" data-toggle="tooltip" onclick="removeDrink(this)" row-id="<?php echo e($keys+$keymeal); ?>" key-id="<?php echo e($key); ?>" data-placement="top" title="<?php echo e(__('web.close')); ?>"><i class="far fa-trash-alt"></i> </button>

                                                            </div>
                                                            <div class="col-md-5 col-sm-7 valign">
                                                                <div class="cont">
                                                                    <p><?php echo e(mealname($meal->meal_id)); ?></p>
                                                                    <h6><?php echo e(mealdescription($meal->meal_id)); ?></h6>

                                                                    <div class="numb">
                                                                        <label for="spinner"><?php echo e(__('web.count')); ?> :</label>
                                                                        <p class="data"><?php echo e($meal->count); ?></p>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="col-md-4">
                                                                <div class="info">
                                                                    <ul>
                                                                        <li>
                                                                            <div class="type"><?php echo e(__('web.calories')); ?></div>
                                                                            <div class="numb"><?php echo e($meal->meal->calories); ?> <?php echo e(__('web.gram')); ?></div>
                                                                        </li>
                                                                        <li>
                                                                            <div class="type"><?php echo e(__('web.fats')); ?></div>
                                                                            <div class="numb"><?php echo e($meal->meal->fats); ?> <?php echo e(__('web.gram')); ?></div>
                                                                        </li>
                                                                    </ul>
                                                                </div>
                                                                <h4 class="price"><b><?php echo e($meal->meal->cost); ?></b> <small><?php echo e(__('web.sar')); ?></small></h4>
                                                            </div>
                                                            <div class="col-md-9 mr-auto mt-1 meal_notes ">
                                                                <label class="label"><?php echo e(__('web.note')); ?> :</label>
                                                                <textarea class="form-control" rows="1" placeholder="<?php echo e(__('web.write')); ?>"><?php echo e($meal->note); ?></textarea>
                                                            </div>
                                                        </div>
                                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                        </div>
                                                       
                                                    </div>
                                                </div>
                                            <?php if($subscribe->product_id): ?>
                                                <div class="col-lg-6">
                                                    <div class="box">
                                                        <div class="box-titel">
                                                            <h5><?php echo e(__('web.snacks')); ?>

                                                                <img src="<?php echo e(url('')); ?>/assets/web/images/title_heading.svg" alt="" class="title_bg"/>
                                                            </h5>
                                                        </div>
                                                        <div id="snacks<?php echo e($key); ?>">
                                                        <?php $__currentLoopData = dayssnack($row->id); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $keymeal=>$meal): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <div class="item row">
                                                                        <input type="hidden" name="snacks[<?php echo e($key); ?>][<?php echo e($keymeal); ?>][snack_id]" value="<?php echo e($meal->meal_id); ?>">
                                                                        <input type="hidden"  name="snacks[<?php echo e($key); ?>][<?php echo e($keymeal); ?>][count]" id="countnewsnack<?php echo e($key); ?><?php echo e($keymeal); ?>" value="<?php echo e($meal->count); ?>">
                                                            <div class="col-md-3 col-sm-5">
                                                                <div class="img">
                                                                    <img src="<?php echo e(asset($meal->meal->image)); ?>" alt="">
                                                                </div>
                                                                <button class="delete-butn" data-toggle="tooltip" onclick="removeSnack(this)" row-id="<?php echo e($keymeal); ?>" key-id="<?php echo e($key); ?>" data-placement="top" title="<?php echo e(__('web.close')); ?>"><i class="far fa-trash-alt"></i> </button>

                                                            </div>
                                                            <div class="col-md-5 col-sm-7 valign">
                                                                <div class="cont">
                                                                    
                                                                    <p><?php echo e(mealname($meal->meal_id)); ?></p>
                                                                    <h6><?php echo e(mealdescription($meal->meal_id)); ?></h6>

                                                                    <div class="numb">
                                                                        <label for="spinner"><?php echo e(__('web.count')); ?> :</label>
                                                                        <p class="data"><?php echo e($meal->count); ?></p>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="col-md-4">
                                                                <div class="info">
                                                                    <ul>
                                                                        <li>
                                                                            <div class="type"><?php echo e(__('web.calories')); ?></div>
                                                                            <div class="numb"><?php echo e($meal->meal->calories); ?> <?php echo e(__('web.gram')); ?></div>
                                                                        </li>
                                                                        <li>
                                                                            <div class="type"><?php echo e(__('web.fats')); ?></div>
                                                                            <div class="numb"><?php echo e($meal->meal->fats); ?> <?php echo e(__('web.gram')); ?></div>
                                                                        </li>
                                                                    </ul>
                                                                </div>
                                                                <h4 class="price"><b><?php echo e($meal->meal->cost); ?></b> <small><?php echo e(__('web.sar')); ?></small></h4>
                                                            </div>
                                                            <div class="col-md-9 mr-auto mt-1 meal_notes ">
                                                                <label class="label"><?php echo e(__('web.note')); ?> :</label>
                                                                <textarea class="form-control" rows="1" name="snacks[<?php echo e($key); ?>][<?php echo e($keymeal); ?>][note]" placeholder="<?php echo e(__('web.write')); ?>"><?php echo e($meal->note); ?></textarea>
                                                            </div>
                                                        </div>
                                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                        </div>

                                                        <div class="col-md-12 mt-4">
                                                            <button class="add_meal_butn m-auto" type="button" onclick="addSnack(this)" key-id="<?php echo e($key); ?>" data-id="<?php echo e(count(dayssnack($row->id))); ?>"  data-toggle="modal"  data-target="#addSnackModal"><?php echo e(__('web.addsnack')); ?></button>
                                                        </div>
                                                    </div>
                                                </div>
                                                <?php endif; ?>
                                            </div>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </div>
                                         <div class="col-md-12 mt-4">
                                                            <button class="add_meal_butn m-auto" type="submit" ><?php echo e(__('web.save')); ?></button>
                                                        </div>
                                    </div>
                                
                                     <?php else: ?>
                                        <?php echo e(__('web.not_sub')); ?>

                                        <?php endif; ?>
                                </div>
                                
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!-- Modal -->
        <!-- Modal -->
        <?php if($subscribe): ?>
        <div class="modal unsubscribeModal fade" id="unsubscribeModal" tabindex="-1" aria-labelledby="unsubscribeModalLabel" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title" id="unsubscribeModalLabel"><?php echo e(__('web.stopsub')); ?></h5>
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                    <form action="<?php echo e(url(getCurrentLocale().'/stop')); ?>" onsubmit="stopsave(this)" id="stopsave" method="post">
                    <div class="modal-body">
                        <div class="alert-outer ">
                            <span class="icon"><i class="fas fa-info-circle"></i></span>
                            <h6><?php echo e(__('web.atten')); ?></h6>
                            <p class="mb-0"><?php echo e(__('web.limit_ten')); ?></p>
                        </div>
                        
                            <?php echo csrf_field(); ?>
                            <div class="form-wrapper">
                                <div class="row">
                                     <div class="col-12" >
    <div  class="alert alert-danger" id="errorsstop" style="display:none">
</div>
<div  class="alert alert-success" id="successstop" style="display:none">
    <h4 class="title text-center mt-3"><?php echo e(__('web.success')); ?></h4>
</div>

</div>
                                    <div class="col-md-12 mb-3">
                                        <label><?php echo e(__('web.stop_length')); ?></label>
                                        <div class="inFlex">
                                            <div class="custom-control custom-radio">
                                                <input type="radio" id="customRadio1" name="type" onclick="selectradio(this)" checked value="one" class="custom-control-input">
                                                <label class="custom-control-label" for="customRadio1"><?php echo e(__('web.oneday')); ?></label>
                                            </div>
                                            <div class="custom-control custom-radio">
                                                <input type="radio" id="customRadio2" name="type" onclick="selectradio(this)" value="multi" class="custom-control-input">
                                                <label class="custom-control-label" for="customRadio2"><?php echo e(__('web.multiday')); ?></label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label><?php echo e(__('web.start_date')); ?></label>
                                            <input type="date" name="start" min="<?php if(date('Y-m-d') > $start_day): ?><?php echo e(date('Y-m-d')); ?><?php else: ?><?php echo e($start_day); ?><?php endif; ?>" max="<?php echo e($end_day); ?>" class="form-control"/>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group" id="end"  style="display:none">
                                            <label><?php echo e(__('web.end_date')); ?></label>
                                            <input type="date" name="end" min="<?php if(date('Y-m-d') > $start_day): ?><?php echo e(date('Y-m-d')); ?><?php else: ?><?php echo e($start_day); ?><?php endif; ?>" max="<?php echo e($end_day); ?>" class="form-control"/>

                                        </div>
                                    </div>
                                </div>
                            </div>
                        
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo e(__('web.close')); ?></button>
                        <button type="submit" class="btn btn-send"><?php echo e(__('web.save')); ?></button>
                    </div>
                    </form>
                </div>
            </div>
        </div>
        <?php endif; ?>
        <!-- New Meal Modal-->
       
        <div class="modal addMealModal fade" id="addMealModal" tabindex="-1" aria-labelledby="addMealModalLabel" aria-hidden="true">
             <div class="modal-dialog modal-dialog-centered modal-lg">
             
                 
             
                <div class="modal-content" >
                    <button type="button" class="close" data-dismiss="modal" onclick="closeModal(this)" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <div id="mealsFood">
                        
                    </div>
                </div>
                  </div>  
        </div>
        
        <!-- New joice Modal-->
        <!-- New snack Modal-->
        <div class="modal addMealModal fade" id="addSnackModal" tabindex="-1" aria-labelledby="addSnackModalLabel" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered modal-lg">
             
                 
             
                <div class="modal-content" >
                    <button type="button" class="close" data-dismiss="modal" onclick="closeModal(this)" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <div id="mealsSnack">
                        
                    </div>
                </div>
                  </div>  
        </div>
        
        
    </main>
     <div class="modal stateModal fade" id="saveImagePOP" tabindex="-1" aria-labelledby="confirmModalLabel" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered modal-lg">
                <div class="modal-content">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <div class="modal-body">
                        <div class="text-box">
                            <img src="<?php echo e(url('')); ?>/assets/web/images/confirm.png" alt="" class="icon filter_green mb-4"/>
                            <h3 class="title mb-3"><?php echo e(__('web.success')); ?> </h3>
                            <p class="p"><?php echo e(__('web.thanks')); ?> <b><?php echo e(__('web.project')); ?></b> </p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="modal stateModal fade" id="errorImage" tabindex="-1" aria-labelledby="cancelmModalLabel" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered modal-lg">
                <div class="modal-content">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <div class="modal-body">
                        <div class="text-box">
                            <img src="<?php echo e(url('')); ?>/assets/web/images/cancel.png" alt="" class="icon filter_red mb-4"/>
                            <h3 class="title mb-3"id="errorspop"> </h3>
                            <p class="p"><?php echo e(__('web.thanks')); ?> <b><?php echo e(__('web.project')); ?></b> </p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="modal reportModal fade" id="reportModal" tabindex="-1" aria-labelledby="reportModalLabel" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title" id="reportModalLabel"><?php echo e(__('web.reporting')); ?></h5>
                       
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                     
                    <form method="post" onsubmit="reportsaved(this)" id="reportsaved" action="<?php echo e(url(getCurrentLocale().'/report')); ?>">
                        <?php echo csrf_field(); ?>
                    <div class="modal-body">
                         <div class="col-12" >
    <div  class="alert alert-danger" id="errorsrepo" style="display:none">
</div>
<div  class="alert alert-success" id="successsrepo" style="display:none">
    <h4 class="title text-center mt-3"><?php echo e(__('web.success')); ?></h4>
</div>

</div>

                            <div class="form-wrapper">
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label><?php echo e(__('web.title')); ?></label>
                                            <input type="text" name="title" id="title" class="form-control" placeholder="">
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label><?php echo e(__('web.type')); ?></label>
                                            <select name="type"  class="form-control">
                                                <option value="report" ><?php echo e(__('web.reports')); ?></option>
                                                <option value="problem" ><?php echo e(__('web.problem')); ?></option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-md-12">
                                        <div class="form-group">
                                            <label><?php echo e(__('web.message')); ?></label>
                                            <textarea class="form-control"id="message"  name="message" rows="5" placeholder=""></textarea>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo e(__('web.close')); ?></button>
                        <button type="submit" class="btn btn-send"><?php echo e(__('web.save')); ?></button>
                    </div>
                    </form>
                </div>
            </div>
        </div>
<?php $__env->startPush('js'); ?>
<script>

function stopsave(elem){
    
     event.preventDefault();
       let dataform = new FormData( $('#stopsave')[0]);
       let action = $('#stopsave').attr('action');
       

     $.ajax({
          url :  action,
          type : 'POST',        
          data: dataform,
          contentType: false, 
          processData: false, 
          success:function(data)
          {
            $('#errorsstop').css("display", "none");
            $('#successstop').css("display", "block");
             setTimeout(
  function()
  {
      location.reload();
  }, 1000);
          }
           ,error:function(data) {
              $('#errorsstop').html('');
    $('#errorsstop').css("display", "block");
   
   $.each(data.responseJSON.errors, function(key,value) {
       
     $('#errorsstop').append('<h4 class="title text-center mt-3">'+value+'</h4>');
     
     
 }); 
 
}
          })
}
function reportsaved(elem){
    
     event.preventDefault();
       let dataform = new FormData( $('#reportsaved')[0]);
       let action = $('#reportsaved').attr('action');
       
     $.ajax({
          url :  action,
          type : 'POST',        
          data: dataform,
          contentType: false, 
          processData: false, 
          success:function(data)
          {
            $('#errorsrepo').css("display", "none");
            $('#successsrepo').css("display", "block");
             setTimeout(
  function()
  {
      location.reload();
  }, 1000);
          }
           ,error:function(data) {
              $('#errorsrepo').html('');
    $('#errorsrepo').css("display", "block");
   
   $.each(data.responseJSON.errors, function(key,value) {
       
     $('#errorsrepo').append('<h4 class="title text-center mt-3">'+value+'</h4>');
     
     
 }); 
 
}
          })
}
function updateprorfile(elem){
    
     event.preventDefault();
       let dataform = new FormData( $('#updateprorfile')[0]);
       let action = $('#updateprorfile').attr('action');
     $.ajax({
          url :  action,
          type : 'POST',        
          data: dataform,
          contentType: false, 
          processData: false, 
          success:function(data)
          {
            $('#saveImagePOP').modal('show');
             setTimeout(
  function()
  {
      location.reload();
  }, 1000);
          }
           ,error:function(data) {
             $('#errorImage').modal('show');
              $('#errorspop').html('');
    $('#errorspop').css("display", "block");
   
   $.each(data.responseJSON.errors, function(key,value) {
       
     $('#errorspop').append('<h4 class="title text-center mt-3">'+value+'</h4>');
     
     
 }); 
 
}
          })
}
function saveimage(elem){
    
     event.preventDefault();
       let dataform = new FormData( $('#saveimage')[0]);
     $.ajax({
          url : <?php echo json_encode(url(getCurrentLocale().'/saveimage/')); ?>,
          type : 'POST',        
          data: dataform,
          contentType: false, 
          processData: false, 
          success:function(data)
          {
            $('#saveImagePOP').modal('show');
             setTimeout(
  function()
  {
      location.reload();
  }, 1000);
          }
          })
}
<?php if($subscribe): ?>
                           function addMeal(elem){
                               let key = $(elem).attr('data-id');
                               let type = $(elem).attr('type-id');
                               let sub_id = <?php echo json_encode($subscribe->id); ?>;
                               let counter =$('#countmealsday'+key).val();
                               let row = $('#countmealscounter'+key).val();
                               $('#countmealscounter'+key).val(parseInt(row)+1);
                               $.ajax({
          url : <?php echo json_encode(url(getCurrentLocale().'/addmealpro')); ?>+'/'+sub_id+','+key+','+type+','+counter+','+row,
          type: 'GET',              
          data: 'dataform',
          success:function(data)
          {
              $('#addMealModal').modal('show');
              $('#mealsFood').html(data);
                }
        })
                           }
                           
                           
   function savemeal(elem){
       
     event.preventDefault();
    
var result = { };
$.each($(elem).serializeArray(), function() {
    result[this.name] = this.value;
});
    
    let meal = result.meal_id;
    let type = result.type;
    let key = result.key;
    let row = result.row;
    let lengths = <?php echo json_encode($subscribe->mealCount); ?>;
    let note = $('#note'+meal).val();
    let extra = $('#extra'+meal).val();
    let count =$('#count'+meal).val();
    let counterallmeal =$('#countmealsday'+key).val();
    if(parseInt(counterallmeal)+parseInt(count) > parseInt(lengths)){
        $('#mealcountextr').css('display','block');
    }
    else{
    //console.log(result);
     $.ajax({
          url : <?php echo json_encode(url(getCurrentLocale().'/savemeal/')); ?>+'/'+meal+','+key+','+type+','+note+','+extra+','+count+','+row,
          type : 'GET',
          data : 'nothing',
          dataType : 'HTML',
          success:function(data)
          {
             $('#countmealsday'+key).val(parseInt(counterallmeal)+parseInt(count));
            $('#mainMeal'+key+type).append(data);
            calcalories();
          }
          })
           setTimeout(
  function() 
  {
     $('#addMealModal').modal('hide');
  }, 500);
    }
     
   }
                            <?php endif; ?>
function removeDrink(elem){
    
                             let key_id =  $(elem).attr('key-id');
                           
                               $(elem).closest('.item').remove();
}                  
function removeSnack(elem){
    
                             let key_id =  $(elem).attr('key-id');
                             let row_id =  $(elem).attr('row-id');
                             let counter = $('#countnewsnack'+key_id+row_id).val();
                             let reach = $('#countsnacks'+key_id).val();
                             $('#countsnacks'+key_id).val(parseInt(reach)-parseInt(counter));
                               $(elem).closest('.item').remove();
}
function removeitem(elem){
                             
                             let key_id =  $(elem).attr('key-id');
                             let row_id =  $(elem).attr('row-id');
                             let counter = $('#countnewmeal'+key_id+row_id).val();
                             let reach = $('#countmealsday'+key_id).val();
                             $('#countmealsday'+key_id).val(parseInt(reach)-parseInt(counter));
                               $(elem).closest('.item').remove();
    
}
function selectradio(elem){
    let data = $(elem).val();
    if(data == 'multi'){
        $('#end').css('display','block');
    }else{
        
        $('#end').css('display','none');
    }
}
     function savechange(elem){
            event.preventDefault();
              let action = $(elem).attr('action');
       
       let urls = action;
       
       let dataform = new FormData( $(elem)[0]);
        
     
      $.ajax({
          url : urls,
          type: 'POST',              
          data: dataform,
          contentType: false, 
          processData: false, 
          success:function(data)
          {
            $('#confirmModal').modal('show');
            setTimeout(
  function()
  {
      location.reload();
  }, 1000);
               }
          ,error: function (data) {
              
            $('#cancelModal').modal('show');
              
          $('#error').html('');
    $('#error').css("display", "block");
   
   $.each(data.responseJSON.errors, function(key,value) {
       
     $('#error').append('<h4 class="title text-center mt-3">'+value+'</h4>');
     
     
 }); 
 
  //$("#savefailed").modal('show');
  
}
        })

           
        }
     
<?php if($subscribe): ?>   
   function savesnack(elem){
       
     event.preventDefault();
    
var result = { };
$.each($(elem).serializeArray(), function() {
    result[this.name] = this.value;
});
    
    let lengths = $('#lengthsnacks').val();
    let snack = result.snack_id;
    let key = result.key;
    let row = result.row;
    let note = $('#note'+snack).val();
    let count =$('#count'+snack).val();
    let counterallmeal =$('#countsnacks'+key).val();
    if(parseInt(counterallmeal)+parseInt(count) > parseInt(lengths)){
        $('#snackcountextr').css('display','block');
    }
    else{
    //console.log(result);
     $.ajax({
          url : <?php echo json_encode(url(getCurrentLocale().'/savesnack/')); ?>+'/'+snack+','+key+','+note+','+count+','+row,
          type : 'GET',
          data : 'nothing',
          dataType : 'HTML',
          success:function(data)
          {
             $('#countsnacks'+key).val(parseInt(counterallmeal)+parseInt(count));
            $('#snacks'+key).append(data);
            calcalories();
          }
          })
           setTimeout(
  function() 
  {
     $('#addSnackModal').modal('hide');
  }, 500);
    }
    }
                           function addSnack(elem){
                               let key = $(elem).attr('key-id');
                               let data = $(elem).attr('data-id');
                               let sub_id = <?php echo json_encode($subscribe->id); ?>;
                               
                               $(elem).attr('data-id',parseInt(data)+1);
                               $.ajax({
          url : <?php echo json_encode(url(getCurrentLocale().'/addsnackpro')); ?>+'/'+key+','+data+','+sub_id,
          type: 'GET',              
          data: 'dataform',
          success:function(data)
          {
              $('#addSnackModal').modal('show');
              $('#mealsSnack').html(data);
                }
        })
                           }
                           <?php endif; ?>
        function daySelect(elem){
            let data = $(elem).attr('key-id');
                             $('.mealsdata').each(function(i, obj) {
                                $(obj).css('display','none');
                                    });
                             $('#daysmeal'+data).css('display','flex');
        }
        function formemail(elem){
        event.preventDefault(); 
       var action = $('#formemail').attr('action');
       var urls = action;
       var dataform = $('#formemail').serialize();
     
      $.ajax({
          url : urls,
          type: 'POST',              
          data: dataform,
          success:function(data)
          {
           $('#confirmModal').modal('show');
              $('#error').css("display", "none");
              $('#success').css("display", "block");
           
            
             
          }
          ,error:function(data) {
             $('#cancelModal').modal('show');
              $('#success').css("display", "none");
              $('#error').html('');
    $('#error').css("display", "block");
   
   $.each(data.responseJSON.errors, function(key,value) {
       
     $('#error').append('<h4 class="title text-center mt-3">'+value+'</h4>');
     
     
 }); 
 
}
        })
        }
</script>
 <script>
        $(function() {
            $("#input-profile").change(function() {
                readURL1(this);
            });
        });


        function readURL1(input) {
            if (input.files && input.files[0]) {
                var reader = new FileReader();

                reader.onload = function(e) {
                    //alert(e.target.result);
                    $('#img-profile').attr('src', e.target.result);
                    $('#saveImage').fadeIn();
                }

                reader.readAsDataURL(input.files[0]);
            }
        }
    </script>
<script>
    function readURL(input) {
        if (input.files && input.files[0]) {
            var reader = new FileReader();
            reader.onload = function(e) {
                $('#imagePreview').css('background-image', 'url('+e.target.result +')');
                $('#imagePreview').hide();
                $('#imagePreview').fadeIn(650);
            }
            reader.readAsDataURL(input.files[0]);
        }
    }
    $("#imageUpload").change(function() {
        readURL(this);
    });
</script>

<?php $__env->stopPush(); ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('web.layouts.main', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/omaralyomhost/public_html/healthy/resources/views/web/pages/profile.blade.php ENDPATH**/ ?>