

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

<div class="border-item">
    <form class="form-row" method="post" action="<?php echo e($action); ?>">
        <?php if($physcalneed ?? ''  && $physcalneed->id): ?>
            <?php echo method_field('PUT'); ?>
            <input type="hidden" name="id" value="<?php echo e($physcalneed->id); ?>">
        <?php endif; ?>
        <?php echo csrf_field(); ?>

        <div class="form-group col-lg-6">
            <label><?php echo e(meta('trainner', getCurrentLocale()) ?? __('physcalneeds.trainner')); ?> </label>
           <select class="form-control <?php echo e($errors->has('trainner_id') ? 'is-invalid' : ''); ?>" name="trainner_id" id="trainner">
               <option selected disabled><?php echo e(__('physcalneeds.select')); ?></option>
               <?php $__currentLoopData = $trainners; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
               <option  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">
            <label><?php echo e(meta('branch', getCurrentLocale()) ?? __('reservations.branch')); ?> </label>
           <select class="form-control <?php echo e($errors->has('branch_id') ? 'is-invalid' : ''); ?>" name="branch_id" id="branch">
               <option selected disabled><?php echo e(__('reservations.selectdoctor')); ?></option>
               
           </select>
            </div>
              <input type="hidden"  name="patient_id" value="<?php echo e($physcalneed->patient_id); ?>">
            
         <div class="form-group col-lg-6">
            <label><?php echo e(meta('dating', getCurrentLocale()) ?? __('physcalneeds.dating')); ?> </label>
            <input type="date" class="form-control <?php echo e($errors->has('dating') ? 'is-invalid' : ''); ?>" name="dating" id="dating" placeholder="<?php echo e(meta('dating', getCurrentLocale()) ??__('physcalneeds.dating')); ?>" value='<?php echo e(old("dating")); ?>'/>
        </div>
         <div class="form-group col-lg-6">
            <label><?php echo e(meta('timing', getCurrentLocale()) ?? __('physcalneeds.timing')); ?> </label>
            <input type="time" class="form-control <?php echo e($errors->has('timing') ? 'is-invalid' : ''); ?>" name="timing" placeholder="<?php echo e(meta('timing', getCurrentLocale()) ??__('physcalneeds.timing')); ?>" value='<?php echo e(old("timing")); ?>'/>
        </div>
         <?php if($physcalneed ?? ''  && $physcalneed->id): ?>
        <?php if(!is_null($physcalneed->count)): ?>
         <div class="form-group col-lg-6">
            <label><?php echo e(meta('count', getCurrentLocale()) ?? __('physcalneeds.count')); ?> </label>
            <input type="number" min="0" class="form-control <?php echo e($errors->has('count') ? 'is-invalid' : ''); ?>" name="count" id="count" placeholder="<?php echo e(meta('count', getCurrentLocale()) ??__('physcalneeds.count')); ?>" value='<?php echo e(old("count")); ?>'/>
        </div>
         <?php endif; ?>
         <?php endif; ?>
         
            
         <div id="table" class="text-center mt-4 col-12">
            
         </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>
     $(document).ready(function(){
   
    $(document).on('change','#trainner',function(){
      
      var trainner = $('#trainner').val();
     
          var dates = $('#dating').val();
        var data = trainner + ','+ dates;
       
        
        $.ajax({
          url : urls+data,
          type : 'GET',
          data : 'nothing',
          dataType : 'json',
          success:function(data)
          {
            $('#table').html(data);
            
          }
        })
         $.ajax({
          url : url_branch+trainner,
          type : 'GET',
          data : 'nothing',
          dataType : 'json',
          success:function(data)
          {
            $('#branch').html(data);
            
          }
        })  
      

    });
    $(document).on('change','#dating',function(){
      
      var trainner = $('#trainner').val();
     
          var dates = $('#dating').val();
        var data = trainner + ','+ dates;
        if(trainner != null)
        $.ajax({
          url : urls+data,
          type : 'GET',
          data : 'nothing',
          dataType : 'json',
          success:function(data)
          {
              
            $('#table').html(data);
            
          }
        })
        
      

    });
    
  });

</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/datingtrain')); ?>/",
            url_branch ="<?php echo e(url('admin/branch')); ?>/",
            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/physcalneeds/form.blade.php ENDPATH**/ ?>