<?php $__env->startSection('content'); ?>
<div class="side-title">
    <h3><?php echo e($head ?? ''); ?></h3>
</div>

<div class="border-item">
    <form class="form-row" onsubmit="saveproduct(this)" method="post" action="<?php echo e($action); ?>" enctype="multipart/form-data">
        
        <?php if($package ?? ''  && $package->id): ?>
            <?php echo method_field('PUT'); ?>
        <?php endif; ?>
        <?php echo csrf_field(); ?>
       <div id="ajaxErrorResponse" class="col-lg-12">
           <label class=""></label>
       </div>
       <div class="form-group col-lg-6">
            <label><?php echo e(meta('section_id', getCurrentLocale()) ?? __('packages.section')); ?></label>
            <select name="section_id" id="section_id" class="form-control my-editor <?php echo e($errors->has('section_id') ? 'is-invalid' : ''); ?>">
                <option value=""><?php echo e(meta('section_id', getCurrentLocale()) ?? __('packages.section')); ?></option>
                <?php $__currentLoopData = $sections; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $section): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option <?php echo e(old("section_id", $package->section_id ?? "") == $section->id ? 'selected': ''); ?> value="<?php echo e($section->id); ?>"><?php echo e(sectionname($section->id)); ?></option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </select>
        </div>
        <div class="form-group col-lg-6">
             <label><?php echo e(meta('cost_long', getCurrentLocale()) ?? __('packages.cost_long')); ?></label>
            <input type="number"  class="form-control  <?php echo e($errors->has('cost_long') ? 'is-invalid' : ''); ?>" id="cost_long"  name="cost_long" placeholder="<?php echo e(meta('cost_long', getCurrentLocale()) ?? __('packages.cost_long')); ?> " value='<?php echo e(old("cost_long", $package->cost_long ?? "")); ?>'/>
        </div>
        <div class="form-group col-lg-6">
             <label><?php echo e(meta('cost_long_month', getCurrentLocale()) ?? __('packages.cost_long_month')); ?></label>
            <input type="number"  class="form-control  <?php echo e($errors->has('cost_long_month') ? 'is-invalid' : ''); ?>" id="cost_long_month"  name="cost_long_month" placeholder="<?php echo e(meta('cost_long_month', getCurrentLocale()) ?? __('packages.cost_long_month')); ?> " value='<?php echo e(old("cost_long_month", $package->cost_long_month ?? "")); ?>'/>
        </div>
  <div class="form-group col-lg-6">
            <label><?php echo e(meta('cost', getCurrentLocale()) ?? __('packages.cost')); ?></label>
            <input type="number"  class="form-control  <?php echo e($errors->has('cost') ? 'is-invalid' : ''); ?>" id="cost" name="cost" placeholder="<?php echo e(meta('cost', getCurrentLocale()) ?? __('packages.cost')); ?>" value='<?php echo e(old("cost", $package->cost ?? "")); ?>'/>
        </div> 
        <div class="form-group col-lg-6">
            <label><?php echo e(meta('cost_month', getCurrentLocale()) ?? __('packages.cost_month')); ?></label>
            <input type="number"  class="form-control  <?php echo e($errors->has('cost_month') ? 'is-invalid' : ''); ?>" id="cost_month" name="cost_month" placeholder="<?php echo e(meta('cost_month', getCurrentLocale()) ?? __('packages.cost_month')); ?>" value='<?php echo e(old("cost_month", $package->cost_month ?? "")); ?>'/>
        </div> 
         
  <div class="form-group col-lg-6">
        </div> 
         
          
        <?php $__currentLoopData = $languages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <div class="form-group col-lg-6">
            <label><?php echo e(meta('name', $language->local) ?? __('packages.name')); ?> <?php echo e(count($languages) > 1 ? "({$language->name})" : ''); ?> </label>
            <input type="text" class="form-control <?php echo e($errors->has('name_'.$language->local) ? 'is-invalid' : ''); ?>" name="name_<?php echo e($language->local); ?>" id="name_<?php echo e($language->local); ?>" placeholder="<?php echo e(meta('name', $language->local) ?? __('packages.name')); ?>" value='<?php echo e(old("name_{$language->local}", $package[$language->local]->name ?? "")); ?>'/>
        </div>

       <!--<div class="form-group col-lg-12">-->
       <!--     <label><?php echo e(meta('description', $language->local) ?? __('packages.description')); ?> <?php echo e(count($languages) > 1 ? "({$language->name})" : ''); ?> </label>-->
       <!--     <textarea name="description_<?php echo e($language->local); ?>" class="form-control <?php echo e($errors->has('description_'.$language->local) ? 'is-invalid' : ''); ?>" id="description_<?php echo e($language->local); ?>" placeholder="<?php echo e(meta('description', $language->local) ?? __('packages.description')); ?>"><?php echo e(old("description_{$language->local}", $package[$language->local]->description ?? "")); ?></textarea>-->
       <!-- </div>-->


        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
       
     
        <div class="form-group col-lg-12 image_container">
    
            <label><?php echo e(meta('image', getCurrentLocale()) ?? __('packages.image')); ?> </label>
            <input id="image_thumbnail" class="image_thumbnail" type="hidden" name="image" value="<?php echo e(old("image", $package->image ?? "")); ?>"/>

            <div class="photos main_photo <?php echo e(old('image', $package->image ?? '') ? ' wow fadeInUp' : 'hide'); ?>">
                <div class="col-md-4">
                    <div class="items">
                        <div class="img">
                            <a href="#" id="lfm" data-input=".image_thumbnail" data-preview=".image_holder" class="lfm" data-hide=".pick_button">
                                <img src="<?php echo e(asset(old('image', $package->image ?? ''))); ?> "  id="image_holder" class="image_holder"/>
                            </a>
                        </div>
                        <a href="#" class="showHide resetImage close" data-empty=".image_thumbnail" data-hide=".main_photo" data-show=".pick_button"><i class="fas fa-times"></i></a>
                    </div>
                </div>
            </div>

            <div class="clearfix"></div>
            <span class="input-group-btn pick_button <?php echo e(old('image', $package->image ?? '') ? 'hide' : ''); ?> ">
                <a id="lfm"  data-input=".image_thumbnail" data-preview=".image_holder" data-show=".main_photo" data-hide=".pick_button" class="lfm btn btn-primary text-light">
                    <i class="fas fa-camera-retro"></i> Choose
                </a>
             </span>
        </div>
        
         <div class="col-lg-12">
    <div  id="items">
        <?php if($package ?? ''  && $package->id): ?>
      
        <?php $__currentLoopData = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
          <?php if($key%2 == '0' || $key == '0' ): ?>
        <div class="row">
            <?php endif; ?>
        
        <div class="form-group col-lg-5">
            <label><?php echo e(__('web.value')); ?> <?php echo e($row->language->local); ?></label>
             <input type="hidden" class="form-control" id="item_<?php echo e($key); ?>_language_id" name="item[<?php echo e($key); ?>][language_id]" value="<?php echo e($row->language_id); ?>" />
            
            <input type="text" class="form-control" id="item_<?php echo e($key); ?>_value" name="item[<?php echo e($key); ?>][value]" placeholder="Value <?php echo e($row->language->local); ?>" value="<?php echo e($row->value); ?>" />

        </div>
        <?php if($key%2 != 0): ?>
        <div class="form-group col-lg-2" style="font-size: 30px;margin-top:35px;">
    	<i class="fas fa-times-circle" onclick="remove(this)"></i></div>
    	</div>
        <?php endif; ?>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        <?php endif; ?>
    </div>
    </div>
      <div class="col-lg-12">
       <a style="cursor: pointer;" <?php if($package ?? ''  && $package->id): ?> data-id="<?php echo e(count($items)); ?>" <?php else: ?> data-id="0" <?php endif; ?> onclick="additem(this)" class="btn_1 gray "><i class="fa fa-fw fa-plus-circle"></i><?php echo e(__("packages.additem")); ?></a>
                   
</div>

<!--         <div class="col-lg-12">-->
<!--             <div class="row pricing-list-item border-item mb-4" style="background-color: rgba(21,97,203,0.1);height:auto">-->
<!--                   <div class="col-lg-12"><h3><?php echo e(__('packages.files')); ?></h3></div>-->
<!--                  <div class="col-lg-12"id="files" style="height:100%">-->
<!--                      <?php if($package ?? ''  && $package->id): ?>-->
<!--                      <?php $__currentLoopData = $files; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $num=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>-->
                      
          
<!--                       <div class="col-12">-->
<!--                        <div class="row pricing-list-item border-item mb-4">-->
<!--                            <input type="hidden"  name="file[<?php echo e($num); ?>][id]"value="<?php echo e($row->id); ?>">-->
<!--                      <input type="hidden"  name="files[]"value="<?php echo e($row->id); ?>">-->
<!--                                <?php $__currentLoopData = languages(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>-->
<!--                            <div class="form-group col-lg-5">-->
<!--                                <label><?php echo e(__('packages.file')); ?> <?php echo e($language->local); ?></label>-->
<!--                                <input type="text" class="form-control" id="file_<?php echo e($num); ?>_name_<?php echo e($language->local); ?>" name="file[<?php echo e($num); ?>][name_<?php echo e($language->local); ?>]" placeholder="<?php echo e(__('packages.file')); ?> <?php echo e($language->local); ?>" value="<?php echo e(filenamelang($row->id,$language->id)); ?>" />-->
                                
<!--                            </div>-->
                            
<!--                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>-->
                           
<!--                            <div class="form-group col-lg-2" style="font-size: 30px;margin-top:35px;">-->
<!--                        	<i class="fas fa-times-circle" onclick="remove(this)"></i></div>-->
                        	<!--------------- new --------------->
<!--                                <div class="col-lg-12">-->
<!--                                    <div class="form-group">-->
                                       
<!--                                        <div class="box" style="display:block">-->
<!--                                            <div class="js--image-preview"></div>-->
<!--                                            <div class="upload-options">-->
<!--                                                <label>-->
<!--                                                <input type="file" name="file[<?php echo e($num); ?>][image]" class="image-upload" />-->
<!--                                              </label>-->
<!--                                            </div>-->
<!--                                        </div>-->
<!--                                    </div>-->
<!--                                </div>-->
<!--                        	</div>-->
<!--                    	</div>-->
<!--                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>-->
<!--                      <?php endif; ?>-->
<!--                  </div>-->
<!--                  <div class="col-lg-12">-->
<!--       <a style="cursor: pointer;" <?php if($package ?? ''  && $package->id): ?> data-id="<?php echo e(count($files)); ?>" <?php else: ?> data-id="0" <?php endif; ?> onclick="addfile(this)" class="btn_1 gray "><i class="fa fa-fw fa-plus-circle"></i><?php echo e(__("packages.addfile")); ?></a>-->
                   
<!--</div>-->
<!--             </div>-->
<!--         </div>-->
         
<!--          <div class="col-lg-12">-->
<!--             <div class="row pricing-list-item border-item mb-4" style="background-color: rgba(21,97,203,0.1);height:auto">-->
<!--                   <div class="col-lg-12"><h3><?php echo e(__('packages.advices')); ?></h3></div>-->
<!--                  <div class="col-lg-12"id="advices" style="height:100%">-->
<!--                      <?php if($package ?? ''  && $package->id): ?>-->
<!--                      <?php $__currentLoopData = $advices; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $num=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>-->
                      
<!--                       <div class="col-12">-->
<!-- <div class="row pricing-list-item border-item mb-4">-->
<!--     <input type="hidden"  name="advice[<?php echo e($num); ?>][id]"value="<?php echo e($row->id); ?>">-->
<!--                      <input type="hidden"  name="advices[]"value="<?php echo e($row->id); ?>">-->
<!--     <div class="form-group col-lg-6">-->
<!--         <label><?php echo e(__('packages.link')); ?></label>-->
<!--            <input type="text" class="form-control" name="advice[<?php echo e($num); ?>][link]" id="advice_<?php echo e($num); ?>_link" placeholder="<?php echo e(__('packages.link')); ?> " value="<?php echo e($row->link); ?>"  />-->
            
<!--     </div>-->
<!--      <div class="form-group col-lg-6" style="font-size: 30px;margin-top:35px;">-->
<!--    	<i class="fas fa-times-circle" onclick="remove(this)"></i>-->
<!--      </div>-->
<!--            <?php $__currentLoopData = languages(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>-->
<!--        <div class="form-group col-lg-6">-->
<!--            <label><?php echo e(__('packages.advice')); ?> <?php echo e($language->local); ?></label>-->
<!--            <input type="text" class="form-control" name="advice[<?php echo e($num); ?>][name_<?php echo e($language->local); ?>]" id="advice_<?php echo e($num); ?>_name_<?php echo e($language->local); ?>" placeholder="<?php echo e(__('packages.advice')); ?> <?php echo e($language->local); ?>" value="<?php echo e(advicenamelang($row->id,$language->id)); ?>"  />-->
            
<!--        </div>-->
        
<!--        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>-->
       
    	<!--------------- new --------------->
<!--            <div class="col-lg-12">-->
<!--                <div class="form-group">-->
<!--                   <label><?php echo e(__('packages.image')); ?></label>-->
<!--                    <div class="box" style="display:block">-->
<!--                        <div class="js--image-preview"></div>-->
<!--                        <div class="upload-options">-->
<!--                            <label>-->
<!--                            <input type="file" name="advice[<?php echo e($num); ?>][image]" class="image-upload" />-->
<!--                          </label>-->
<!--                        </div>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
           
<!--    	</div>-->
<!--    	</div>-->
   
                      
<!--                      <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>-->
<!--                      <?php endif; ?>-->
                      
<!--                  </div>-->
<!--                    <div class="col-lg-12">-->
<!--       <a style="cursor: pointer;" <?php if($package ?? ''  && $package->id): ?> data-id="<?php echo e(count($advices)); ?>" <?php else: ?> data-id="0" <?php endif; ?> onclick="addadvice(this)" class="btn_1 gray "><i class="fa fa-fw fa-plus-circle"></i><?php echo e(__("packages.addadvice")); ?></a>-->
                   
<!--</div>-->
<!--             </div>-->
<!--         </div>-->
         
<!--          <div class="col-lg-12">-->
<!--             <div class="row pricing-list-item border-item mb-4" style="background-color: rgba(21,97,203,0.1);height:auto">-->
<!--                   <div class="col-lg-12"><h3><?php echo e(__('packages.recipes')); ?></h3></div>-->
<!--                  <div class="col-lg-12"id="recipes" style="height:100%">-->
<!--                      <?php if($package ?? ''  && $package->id): ?>-->
<!--                      <?php $__currentLoopData = $recipes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $keys=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>-->
<!--                        <div class="col-12">-->
<!-- <div class="row pricing-list-item border-item mb-4">-->
<!--                      <input type="hidden"  name="recipe[<?php echo e($keys); ?>][id]"value="<?php echo e($row->id); ?>">-->
<!--                      <input type="hidden"  name="recipes[]"value="<?php echo e($row->id); ?>">-->
<!--            <?php $__currentLoopData = languages(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>-->
<!--        <div class="form-group col-lg-5">-->
<!--            <label><?php echo e(__('packages.recipe')); ?> <?php echo e($language->local); ?></label>-->
<!--            <input type="text" class="form-control" name="recipe[<?php echo e($keys); ?>][name_<?php echo e($language->local); ?>]" id="recipe_<?php echo e($keys); ?>_name_<?php echo e($language->local); ?>" placeholder="<?php echo e(__('packages.recipe')); ?> <?php echo e($language->local); ?>"  value="<?php echo e(recipenamelang($row->id,$language->id)); ?>"  />-->
            
<!--        </div>-->
        
<!--        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>-->
       
<!--        <div class="form-group col-lg-2" style="font-size: 30px;margin-top:35px;">-->
<!--    	<i class="fas fa-times-circle" onclick="remove(this)"></i></div>-->
    	<!--------------- new --------------->
<!--            <div class="col-lg-6">-->
<!--                <div class="form-group">-->
                   
<!--                    <label><?php echo e(__('packages.image')); ?></label>-->
<!--                    <div class="box" style="display:block">-->
<!--                        <div class="js--image-preview"></div>-->
<!--                        <div class="upload-options">-->
<!--                            <label>-->
<!--                            <input type="file" name="recipe[<?php echo e($num); ?>][image]" class="image-upload" />-->
<!--                          </label>-->
<!--                        </div>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
<!--             <div class="col-lg-6">-->
<!--                <div class="form-group">-->
<!--                    <label><?php echo e(__('packages.file')); ?></label>-->
<!--                    <div class="box" style="display:block">-->
<!--                        <div class="js--image-preview"></div>-->
<!--                        <div class="upload-options">-->
<!--                            <label>-->
<!--                            <input type="file" name="recipe[<?php echo e($num); ?>][file]" class="image-upload" />-->
<!--                          </label>-->
<!--                        </div>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
<!--    	</div>-->
<!--    	</div>-->
 
                      
<!--                      <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>-->
<!--                      <?php endif; ?>-->
                      
<!--                  </div>-->
<!--                    <div class="col-lg-12">-->
<!--       <a style="cursor: pointer;" <?php if($package ?? ''  && $package->id): ?> data-id="<?php echo e(count($recipes)); ?>" <?php else: ?> data-id="0" <?php endif; ?> onclick="addrecipe(this)" class="btn_1 gray "><i class="fa fa-fw fa-plus-circle"></i><?php echo e(__("packages.addrecipe")); ?></a>-->
                   
<!--</div>-->
<!--             </div>-->
<!--         </div>-->
         
         
         <hr>
         <div class="col-lg-12">
             <div class="row pricing-list-item border-item mb-4" style="background-color: rgba(21,97,203,0.1);height:auto">
                   <div class="col-lg-12"><h3>
                    <button class="btn btn-link btn-block text-left"  type="button" onclick="collapseDataAll(this)" target-id="four">
                                    <?php echo e(__('packages.weeksFour')); ?>

                                </button>
                   </h3></div>
                  <div class="col-lg-12"id="Allfour" style="height:100%;display:none">
                      <?php if($package ?? ''  && $package->id): ?>
                       <?php $__currentLoopData = daysFour($package->id); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $i=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
    <div class="row pricing-list-item border-item mb-4" >
    <div class="col-lg-12">
        <label>
            <button class="btn btn-link btn-block text-left"  type="button" onclick="collapseData(this)" data-id="<?php echo e($i); ?>" target-id="link">
                                    <?php echo e(__('packages.day')); ?> : <?php echo e($i+1); ?>

                                </button>
            </label>
    </div>
    
    <div class="col-lg-12" style="height:100%" id="link<?php echo e($i); ?>" >
        <?php $__currentLoopData = videos($row->id); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $nums=>$vid): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        
<div class="row pricing-list-item border-item mb-4" style="background-color: rgb(3 5 8 / 10%);">
    
    
    <div class="col-lg-5" >
        <label><?php echo e(__('packages.link')); ?></label>
        <input type="text"  class="form-control <?php echo e($errors->has('link') ? 'is-invalid' : ''); ?>" name="days[<?php echo e($i); ?>][video][<?php echo e($nums); ?>][link]" id="days_<?php echo e($i); ?>_video_<?php echo e($nums); ?>_link" placeholder="<?php echo e(meta('link', getCurrentLocale()) ?? __('packages.link')); ?>" value="<?php echo e($vid->link); ?>"/>
    
    </div>
     <div class="col-lg-5" >
        <label><?php echo e(__('packages.num')); ?></label>
        <input type="text"  class="form-control <?php echo e($errors->has('num') ? 'is-invalid' : ''); ?>" name="days[<?php echo e($i); ?>][video][<?php echo e($nums); ?>][num]" id="days_<?php echo e($i); ?>_video_<?php echo e($nums); ?>_num" placeholder="<?php echo e(meta('num', getCurrentLocale()) ?? __('packages.num')); ?>" value="<?php echo e($vid->num); ?>"/>
    
    </div>
    <div class="form-group col-lg-2" style="font-size: 30px;margin-top:35px;">
    	<i class="fas fa-times-circle" onclick="remove(this)"></i></div>
    	
     <div class="col-lg-6" >
        <label><?php echo e(__('packages.rows')); ?></label>
        <input type="text"  class="form-control <?php echo e($errors->has('rows') ? 'is-invalid' : ''); ?>" name="days[<?php echo e($i); ?>][video][<?php echo e($nums); ?>][rows]" id="days_<?php echo e($i); ?>_video_<?php echo e($nums); ?>_rows" placeholder="<?php echo e(meta('rows', getCurrentLocale()) ?? __('packages.rows')); ?>" value="<?php echo e($vid->rows); ?>"/>
    
    </div>
    <div class="col-lg-6" ></div>
      <?php $__currentLoopData = languages(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <div class="form-group col-lg-6">
            <label><?php echo e(__('packages.name')); ?> <?php echo e($language->local); ?></label>
            <input type="text" class="form-control" name="days[<?php echo e($i); ?>][video][<?php echo e($nums); ?>][name_<?php echo e($language->local); ?>]" id="days_<?php echo e($i); ?>_video_<?php echo e($nums); ?>_name_<?php echo e($language->local); ?>" placeholder="<?php echo e(__('packages.name')); ?> <?php echo e($language->local); ?>" value="<?php echo e(videonamelang($vid->id,$language->id)); ?>" />
            
        </div>
        
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
       
    </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>
    <br>
     <div class="col-lg-12" id="increase<?php echo e($i); ?>"  <?php if($row->type == '0'): ?> style="display:none;" <?php endif; ?>>
       <a style="cursor: pointer;"  data-id="<?php echo e(count(videos($row->id))); ?>" target-id="<?php echo e($i); ?>"  onclick="addvideo(this)" class="btn_1 gray "><i class="fa fa-fw fa-plus-circle"></i><?php echo e(__("packages.addvideo")); ?></a>
                   
</div>
    </div>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    
                  </div>
             </div>
               <div class="row pricing-list-item border-item mb-4 "   style="background-color: rgba(21,97,203,0.1);height:auto">
                   <div class="col-lg-12"><h3>
                   <button class="btn btn-link btn-block text-left"  type="button" onclick="collapseDataAll(this)" target-id="eight">
                                    <?php echo e(__('packages.weeksEight')); ?>

                                </button>
                                </h3>
                   </div>
                  <div class="col-lg-12"id="Alleight" style="height:100%;display:none">
                    
     <?php $__currentLoopData = daysEight($package->id); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $i=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
    <div class="row pricing-list-item border-item mb-4" >
    <div class="col-lg-12">
        <label>
        <button class="btn btn-link btn-block text-left"  type="button" onclick="collapseData(this)" data-id="<?php echo e($i); ?>" target-id="linkEight">
                                    <?php echo e(__('packages.day')); ?> : <?php echo e($i+1); ?>

                                </button>
        </label>
    </div>
    
    <div class="col-lg-12" style="height:100%" id="linkEight<?php echo e($i); ?>" >
        <?php $__currentLoopData = videos($row->id); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $nums=>$vid): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        
<div class="row pricing-list-item border-item mb-4" style="background-color: rgb(3 5 8 / 10%);">
    
    
    <div class="col-lg-5" >
        <label><?php echo e(__('packages.link')); ?></label>
        <input type="text"  class="form-control <?php echo e($errors->has('link') ? 'is-invalid' : ''); ?>" name="daysEight[<?php echo e($i); ?>][video][<?php echo e($nums); ?>][link]" id="days_<?php echo e($i); ?>_video_<?php echo e($nums); ?>_link" placeholder="<?php echo e(meta('link', getCurrentLocale()) ?? __('packages.link')); ?>" value="<?php echo e($vid->link); ?>"/>
    
    </div>
     <div class="col-lg-5" >
        <label><?php echo e(__('packages.num')); ?></label>
        <input type="text"  class="form-control <?php echo e($errors->has('num') ? 'is-invalid' : ''); ?>" name="daysEight[<?php echo e($i); ?>][video][<?php echo e($nums); ?>][num]" id="days_<?php echo e($i); ?>_video_<?php echo e($nums); ?>_num" placeholder="<?php echo e(meta('num', getCurrentLocale()) ?? __('packages.num')); ?>" value="<?php echo e($vid->num); ?>"/>
    
    </div>
    <div class="form-group col-lg-2" style="font-size: 30px;margin-top:35px;">
    	<i class="fas fa-times-circle" onclick="remove(this)"></i></div>
    
     <div class="col-lg-6" >
        <label><?php echo e(__('packages.rows')); ?></label>
        <input type="text"  class="form-control <?php echo e($errors->has('rows') ? 'is-invalid' : ''); ?>" name="daysEight[<?php echo e($i); ?>][video][<?php echo e($nums); ?>][rows]" id="days_<?php echo e($i); ?>_video_<?php echo e($nums); ?>_rows" placeholder="<?php echo e(meta('rows', getCurrentLocale()) ?? __('packages.rows')); ?>" value="<?php echo e($vid->rows); ?>"/>
    
    </div>
    <div class="col-lg-6" ></div>
      <?php $__currentLoopData = languages(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <div class="form-group col-lg-6">
            <label><?php echo e(__('packages.name')); ?> <?php echo e($language->local); ?></label>
            <input type="text" class="form-control" name="daysEight[<?php echo e($i); ?>][video][<?php echo e($nums); ?>][name_<?php echo e($language->local); ?>]" id="days_<?php echo e($i); ?>_video_<?php echo e($nums); ?>_name_<?php echo e($language->local); ?>" placeholder="<?php echo e(__('packages.name')); ?> <?php echo e($language->local); ?>" value="<?php echo e(videonamelang($vid->id,$language->id)); ?>" />
            
        </div>
        
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
       
    </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>
    <br>
     <div class="col-lg-12" id="increaseEight<?php echo e($i); ?>"  <?php if($row->type == '0'): ?> style="display:none;" <?php endif; ?>>
       <a style="cursor: pointer;"  data-id="<?php echo e(count(videos($row->id))); ?>" target-id="<?php echo e($i); ?>"  onclick="addvideoEight(this)" class="btn_1 gray "><i class="fa fa-fw fa-plus-circle"></i><?php echo e(__("packages.addvideo")); ?></a>
                   
</div>
    </div>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    <?php else: ?>
    <?php for($i=0;$i < 20 ;$i++): ?>
    <div class="row pricing-list-item border-item mb-4" >
    <div class="col-lg-12">
        <button class="btn btn-link btn-block text-left"  type="button" onclick="collapseData(this)" data-id="<?php echo e($i); ?>" target-id="link">
                                    <?php echo e(__('packages.day')); ?> : <?php echo e($i+1); ?>

                                </button>
    </div>
  
    
    <div class="col-lg-12" style="height:100%" id="link<?php echo e($i); ?>">
      
    </div>
    <br>
     <div class="col-lg-12" id="increase<?php echo e($i); ?>"  >
       <a style="cursor: pointer;"  data-id="0" target-id="<?php echo e($i); ?>"  onclick="addvideo(this)" class="btn_1 gray "><i class="fa fa-fw fa-plus-circle"></i><?php echo e(__("packages.addvideo")); ?></a>
                   
</div>
    </div>
    <?php endfor; ?>
    <?php endif; ?>
                  </div>
             </div>
         </div>
         <?php if(!($package ?? ''  && $package->id)): ?>
         <div class="col-lg-12">
             <div class="row pricing-list-item border-item mb-4" style="background-color: rgba(21,97,203,0.1);height:auto">
                   <div class="col-lg-12">
                       <h3>
                       <button class="btn btn-link btn-block text-left"  type="button" onclick="collapseDataAll(this)" target-id="eight">
                                    <?php echo e(__('packages.weeksEight')); ?>

                                </button>
                                </h3></div>
                  <div class="col-lg-12"id="Alleight" style="height:100%;display:none">
                      
                      
    
    <?php for($i=0;$i < 40 ;$i++): ?>
    <div class="row pricing-list-item border-item mb-4" >
    <div class="col-lg-12">
         <button class="btn btn-link btn-block text-left"  type="button" onclick="collapseData(this)" data-id="<?php echo e($i); ?>" target-id="linkEight">
                                    <?php echo e(__('packages.day')); ?> : <?php echo e($i+1); ?>

                                </button>
    </div>
  
    
    <div class="col-lg-12" style="height:100%" id="linkEight<?php echo e($i); ?>" >
      
    </div>
    <br>
     <div class="col-lg-12" id="increaseEight<?php echo e($i); ?>" >
       <a style="cursor: pointer;"  data-id="0" target-id="<?php echo e($i); ?>"  onclick="addvideoEight(this)" class="btn_1 gray "><i class="fa fa-fw fa-plus-circle"></i><?php echo e(__("packages.addvideo")); ?></a>
                   
</div>
    </div>
    <?php endfor; ?>
         </div>
             </div>
         </div>
    <?php endif; ?>
             
        
      
      
        <div class="text-center mt-5 col-12">
            <button class="butn"><span><?php echo e(__('dashboard.save')); ?></span></button>
        </div>
    </form>
</div>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('inner_js'); ?>
    <!-- Editor JS files -->
    <script>
        
function saveproduct(elem){
    
       event.preventDefault();
       $('.ajaxErrorResponse').css("display", "none");
       $('form *').removeClass('is-invalid');
       var action = $(elem).attr('action');
       
       var urls = action;
       var dataform = new FormData( $(elem)[0]);
      
       $.ajax({
          url : urls,
          type : 'POST',
          data : dataform,
          dataType : 'json',
  processData: false,
  contentType: false,
          success:function(data)
          {
              window.location.replace("<?php echo e(url(getCurrentLocale().'/admin/packages')); ?>");
          }
          ,error: function (data) {
              
   $('.ajaxErrorResponse').html('<label>'+<?php echo json_encode(__('packages.fill')); ?>+'</label>');
             
    $('.ajaxErrorResponse').css("display", "block");
   $.each(data.responseJSON.errors, function(key,value) {
     
     var keys = key.replaceAll(".","_");
     console.log(keys);
     $('#'+keys).attr('class','form-control is-invalid');
     
 }); 
 
}
        })
   
}
    </script>
    <script>
        
function remove(elem){
            $(elem).closest('.row').remove();
        }
        
        function addfile(elem){
        var num = $(elem).attr('data-id');
        
        var newrow = parseInt(num)+1; 
        $(elem).attr('data-id', newrow);
        
        $.ajax({
          url : urls_file+'/'+num,
          type : 'GET',
          data : 'nothing',
          success:function(data)
          {
            $('#files').append(data);
          }
        }) 
    }
    function addadvice(elem){
        var num = $(elem).attr('data-id');
        
        var newrow = parseInt(num)+1; 
        $(elem).attr('data-id', newrow);
        
        $.ajax({
          url : urls_advice+'/'+num,
          type : 'GET',
          data : 'nothing',
          success:function(data)
          {
            $('#advices').append(data);
          }
        }) 
    }
    function addrecipe(elem){
        var num = $(elem).attr('data-id');
        
        var newrow = parseInt(num)+1; 
        $(elem).attr('data-id', newrow);
        
        $.ajax({
          url : urls_recipe+'/'+num,
          type : 'GET',
          data : 'nothing',
          success:function(data)
          {
            $('#recipes').append(data);
          }
        }) 
    }
    function addvideo(elem){
        var target = $(elem).attr('target-id');
        var num = $(elem).attr('data-id');
        
        var newrow = parseInt(num)+1; 
        $(elem).attr('data-id', newrow);
        
        $.ajax({
          url : urls_video+'/'+num+','+target,
          type : 'GET',
          data : 'nothing',
          success:function(data)
          {
            $('#link'+target).append(data);
          }
        }) 
    }
    function addvideoEight(elem){
         var target = $(elem).attr('target-id');
        var num = $(elem).attr('data-id');
        
        var newrow = parseInt(num)+1; 
        $(elem).attr('data-id', newrow);
        
        $.ajax({
          url : urls_videos+'/'+num+','+target,
          type : 'GET',
          data : 'nothing',
          success:function(data)
          {
            $('#linkEight'+target).append(data);
          }
        }) 
    }
    function additem(elem){
        var num = $(elem).attr('data-id');
        
        var newrow = parseInt(num)+2; 
        $(elem).attr('data-id', newrow);
        
        $.ajax({
          url : urls+'/'+num,
          type : 'GET',
          data : 'nothing',
          success:function(data)
          {
            $('#items').append(data);
          }
        }) 
    }
    function days(elem){
        var num = parseInt($(elem).val())*30 ;
        
        
        
        $.ajax({
          url : url_day+'/'+num,
          type : 'GET',
          data : 'nothing',
          success:function(data)
          {
            $('#days').html(data);
          }
        }) 
    }
    function restday(elem){
        let data = $(elem).attr('data-id');
        let valuing = $(elem).val();
        
        //alert(valuing);
        if(valuing == '0'){
        $('#link'+data).css('display','none');
        $('#increase'+data).css('display','none');
        }
        else{
            $('#link'+data).css('display','block');
            $('#increase'+data).css('display','block');
        }
        
        
        
    }
    
    </script>
     <script>
        function initImageUpload(box) {
            let uploadField = box.querySelector('.image-upload');

            uploadField.addEventListener('change', getFile);

            function getFile(e) {
                let file = e.currentTarget.files[0];
                checkType(file);
            }

            function previewImage(file) {
                let name = file.name;
                let arr = name.split(".");
                
                let thumb = box.querySelector('.js--image-preview'),
                    reader = new FileReader();
                if(arr[1] == 'pdf'){
                   
                   reader.onload = function() {
                    thumb.style.backgroundImage = 'url(https://nawalgym.omar.alyomhost.net/public/assets/web/pdf.png)';
                   }
                }
                else{
                reader.onload = function() {
                    thumb.style.backgroundImage = 'url(' + reader.result + ')';
                
                }
                }
                reader.readAsDataURL(file);
                thumb.className += ' js--no-default';
            }

            function checkType(file) {
                // let imageType = /image.*/;
                // if (!file.type.match(imageType)) {
                //     throw 'Datei ist kein Bild';
                // } else if (!file) {
                //     throw 'Kein Bild gew채hlt';
                // } else {
                    previewImage(file);
                // }
            }

        }

        // initialize box-scope
        var boxes = document.querySelectorAll('.box');

        for (let i = 0; i < boxes.length; i++) {
            let box = boxes[i];
            initDropEffect(box);
            initImageUpload(box);
        }



        /// drop-effect
        function initDropEffect(box) {
            let area, drop, areaWidth, areaHeight, maxDistance, dropWidth, dropHeight, x, y;
            
            // get clickable area for drop effect
            area = box.querySelector('.js--image-preview');
            area.addEventListener('click', fireRipple);

            function fireRipple(e) {
                area = e.currentTarget
                
                    // create drop
                if (!drop) {
                    drop = document.createElement('span');
                    drop.className = 'drop';
                    this.appendChild(drop);
                }
                // reset animate class
                drop.className = 'drop';

                // calculate dimensions of area (longest side)
                areaWidth = getComputedStyle(this, null).getPropertyValue("width");
                areaHeight = getComputedStyle(this, null).getPropertyValue("height");
                maxDistance = Math.max(parseInt(areaWidth, 10), parseInt(areaHeight, 10));

                // set drop dimensions to fill area
                drop.style.width = maxDistance + 'px';
                drop.style.height = maxDistance + 'px';

                // calculate dimensions of drop
                dropWidth = getComputedStyle(this, null).getPropertyValue("width");
                dropHeight = getComputedStyle(this, null).getPropertyValue("height");

                // calculate relative coordinates of click
                // logic: click coordinates relative to page - parent's position relative to page - half of self height/width to make it controllable from the center
                x = e.pageX - this.offsetLeft - (parseInt(dropWidth, 10) / 2);
                y = e.pageY - this.offsetTop - (parseInt(dropHeight, 10) / 2) - 30;

                // position drop and animate
                drop.style.top = y + 'px';
                drop.style.left = x + 'px';
                drop.className += ' animate';
                e.stopPropagation();

            }
        }
        function collapseDataAll(elem){
            let data = $(elem).attr('target-id');
            $('#All'+data).fadeToggle(500);
        }
        function collapseData(elem){
            let data = $(elem).attr('target-id');
            let dataId = $(elem).attr('data-id');
            $('#'+data+dataId).fadeToggle(500);
        }
    </script>
    	
    <script>
        $(".form-group").delegate( ".edit_btn", "click", function() {
            $(this).parentsUntil(".form-group").siblings(".box").toggleClass("d-block");
        })
    </script>
  <script src="<?php echo e(asset('/assets/admin/js/lib/tinymce.min.js')); ?>"></script>
        
    <script>
        let route_prefix = "<?php echo e(url(config('lfm.prefix'))); ?>",
            url = "<?php echo e(url('/')); ?>/",
            urls = "<?php echo e(url('/')); ?>/admin/additem",
            url_type = <?php echo json_encode(url(getCurrentLocale().'/admin/type/')); ?>,
            urls_video = <?php echo json_encode(url(getCurrentLocale().'/admin/addvideo/')); ?>,
            urls_videos = <?php echo json_encode(url(getCurrentLocale().'/admin/addvideos/')); ?>,
            urls_file = <?php echo json_encode(url(getCurrentLocale().'/admin/addfile/')); ?>,
            urls_advice = <?php echo json_encode(url(getCurrentLocale().'/admin/addadvice/')); ?>,
            urls_recipe = <?php echo json_encode(url(getCurrentLocale().'/admin/addrecipe/')); ?>,
            url_day = <?php echo json_encode(url(getCurrentLocale().'/admin/days/')); ?>,
            
            currentLanguage = "<?php echo e(getCurrentLocale()); ?>",
            imagePath = "<?php echo e(asset('')); ?>";
    </script>
    <script src="<?php echo e(asset('assets/admin/js/editor.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/admin/js/lfm.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/admin/js/articles.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/admin/js/cobons.js')); ?>"></script>
<?php $__env->stopSection(); ?>




<?php echo $__env->make('admin.layouts.container', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/omaralyomhost/public_html/raied/resources/views/admin/packages/form.blade.php ENDPATH**/ ?>