

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

<div class="border-item">
    <form class="form-row" enctype="multipart/form-data" method="post" action="<?php echo e($action); ?>">
        <?php if($codephyscal ?? ''  && $codephyscal->id): ?>
            <?php echo method_field('PUT'); ?>
        <?php endif; ?>
        <?php echo csrf_field(); ?>
         
         <div class="form-group col-lg-6">
                <label><?php echo e(meta('systemphyscals', getCurrentLocale()) ?? __('codes.systemphyscals')); ?> </label>
               <select class="selectpicker form-control <?php echo e($errors->has('system_food_id') ? 'is-invalid' : ''); ?>"  data-show-subtext="true" data-live-search="true"  name="system_physcal_id">
                   <option selected disabled ><?php echo e(__('codes.select')); ?></option>
                    <?php $__currentLoopData = $systemphysics; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option  <?php if($codephyscal ?? ''  && $codephyscal->id): ?> <?php if($codephyscal->system_physcal_id == $row->id): ?> selected <?php endif; ?> <?php endif; ?> value="<?php echo e($row->id); ?>"><?php echo e($row->name); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
               </select>
                </div>
                 <div class="form-group col-lg-6"></div>
                 
        <div class="form-group col-lg-6">
            <label><?php echo e(meta('name', getCurrentLocale()) ?? __('codes.name')); ?> </label>
            <input type="text" class="form-control <?php echo e($errors->has('name') ? 'is-invalid' : ''); ?>" name="name" placeholder="<?php echo e(meta('name', getCurrentLocale()) ??__('codes.name')); ?>" value='<?php echo e(old("name", $codephyscal->name ?? "")); ?>'/>
        </div>
<div class="form-group col-lg-6"></div>
        

       
       
                
                <div class="row pricing-list-item border-item mb-4 col-12" <?php if($codephyscal ?? ''  && $codephyscalphyscal->id): ?> <?php else: ?>  style="display:none" <?php endif; ?> id="physcals">
                    <?php if($codephyscal ?? ''  && $codephyscal->id): ?>
                    <?php $__currentLoopData = $physcals; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data=>$physcal): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="row pricing-list-item border-item mb-4 col-12">
          <div class="form-group col-lg-6">
            <label>التمرين </label>
            <select class="form-control" name="physcal[<?php echo e($data); ?>][physcal_id]" >
                <?php $__currentLoopData = $physcaling; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <option <?php if($row->id == $physcal->physcal_id): ?> selected <?php endif; ?> value="<?php echo e($row->id); ?>"><?php echo e($row->name); ?></option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
        </div>

         <div class="form-group col-lg-5">
            <label>العدد </label>
            <input type="number" min="0" class="form-control" placeholder="العدد" value="<?php echo e($row->count); ?>" />
            </div>
        
        <div class="form-group col-lg-1" style="font-size: 30px;margin-top:35px;">
    	<i class="fas fa-times-circle" onclick="remove(this)"></i></div>
                            </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php endif; ?>
                </div>
<div class="col-lg-12">
       <a style="cursor: pointer;" <?php if($codephyscal ?? ''  && $codephyscal->id): ?> data-id="<?php echo e(count($physcals)); ?>" <?php else: ?>   data-id="0" <?php endif; ?> onclick="addphyscal(this)" class="btn_1 gray "><i class="fa fa-fw fa-plus-circle"></i><?php echo e(__("codes.add_physcal")); ?></a>
                   
</div>

        <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'); ?>
<script>
    function addphyscal(elem){
        $("#physcals").css("display", "block");
        var num = $(elem).attr('data-id');
        
        var newrow = parseInt(num)+1; 
        $(elem).attr('data-id', newrow);
        
         $.ajax({
          url : urls+'/'+num,
          type : 'GET',
          data : 'nothing',
          dataType : 'json',
          success:function(data)
          {
            $('#physcals').append(data);
          }
        })
    }
     function remove(elem){
            $(elem).closest('.row').remove();
        }
</script>
    <!-- Editor JS files -->

            <script src="//cdn.tinymce.com/4/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/addphyscaltype",
            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>
<?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/green_apple/resources/views/admin/codephyscals/form.blade.php ENDPATH**/ ?>