

<?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($patient ?? ''  && $patient->id): ?>
            <?php echo method_field('PUT'); ?>
        <?php endif; ?>
        <?php echo csrf_field(); ?>
<?php if($patient ?? ''  && $patient->id): ?>
 <div class="text-center mt-5 col-12">
            <a href="<?php echo e(url('admin/patients/'.$patient->id)); ?>" class="butn">عرض التفاصيل</a>
        </div>
<?php endif; ?>

<?php if($patient ?? ''  && $patient->id): ?>
         <?php if(count($histories)>0): ?>
          <h3><?php echo e(__('reads.readpatient')); ?></h3>
          <table class="table table-bordered table-hover" style="word-break: break-word;text-align:center;">
            <thead>
                
                <th>#</th>
                <th><?php echo e(__('histories.date')); ?></th>
                <th><?php echo e(__('histories.weight')); ?></th>
                <th><?php echo e(__('histories.fat')); ?></th>
                <th><?php echo e(__('histories.muscle')); ?></th>
                <th><?php echo e(__('histories.liquid')); ?></th>
                <th><?php echo e(__('histories.bone')); ?></th>
                <th><?php echo e(__('histories.trust')); ?></th>
                <th><?php echo e(__('histories.sport')); ?></th>
                <th><?php echo e(__('histories.recommend')); ?></th>
                <th><?php echo e(__('histories.complain')); ?></th>
                <th><?php echo e(__('histories.system')); ?></th>
                <th><?php echo e(__('histories.note')); ?></th>
            </thead>
            
            <tbody>
                 <?php $__currentLoopData = $histories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr>
                    <td><?php echo e($key+1); ?></td>
                    <td><?php echo e($row->date); ?></td>
                    <td><?php echo e($row->weight); ?></td>
                    <td><?php echo e($row->fat); ?></td>
                    <td><?php echo e($row->muscle); ?></td>
                    <td><?php echo e($row->liquid); ?></td>
                    <td><?php echo e($row->bone); ?></td>
                    <td><?php echo e($row->trust); ?></td>
                    <td><?php echo e($row->sport); ?></td>
                    <td><?php echo e($row->recommend); ?></td>
                    <td><?php echo e($row->complain); ?></td>
                    <td><?php echo e($row->system); ?></td>
                    <td><?php echo e($row->note); ?></td>
                    
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
               
            </tbody>
        </table>
  
        
        <?php endif; ?>
         <?php endif; ?>
           <?php if($patient ?? ''  && $patient->id): ?>
         <?php if(count(reads($patient->id))>0): ?>
         <h3><?php echo e(__('reads.readdevice')); ?></h3>
          <table class="table table-bordered table-hover" style="text-align:center">
           <thead>
                
                <th>#</th>
                <th><?php echo e(__('devices.name')); ?></th>
                <th><?php echo e(__('reads.number')); ?></th>
                <th><?php echo e(__('sessions.dating')); ?></th>
                
            </thead>
            
            <tbody>
                 <?php $__currentLoopData = reads($patient->id); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr>
                    <td><?php echo e($key+1); ?></td>
                    <td><?php echo e($row->device->name); ?></td>
                    <td><?php echo e($row->number); ?></td>
                    <td><?php echo e(date_format($row->created_at, 'Y-m-d')); ?></td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
               
            </tbody>
  
  
       
  
         </table>
        <?php endif; ?>
         <?php endif; ?>
         <?php if($patient ?? ''  && $patient->id): ?>
         <?php if(count($reservation)>0): ?>
          <h3><?php echo e(__('reservations.reservations')); ?></h3>
          <table class="table table-bordered table-hover" style="text-align:center">
            <thead>
                
                <th>#</th>
                <th><?php echo e(__('reservations.branch')); ?></th>
                <th><?php echo e(__('reservations.doctor')); ?></th>
                <th><?php echo e(__('reservations.count')); ?></th>
                <th><?php echo e(__('reservations.remain')); ?></th>
                <th><?php echo e(__('reservations.expired')); ?></th>
            </thead>
            
            <tbody>
                 <?php $__currentLoopData = $reservation; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr>
                    <td><?php echo e($key+1); ?></td>
                    <td><?php echo e($row->branch->name); ?></td>
                    <td><?php echo e($row->doctor->name); ?></td>
                    <td><?php echo e($row->count); ?></td>
                    <td><?php echo e($row->count - remain($row->id)); ?></td>
                    <td><?php if($row->expired == '1'): ?> <?php echo e(__('reservations.notcontinue')); ?> <?php else: ?> <?php echo e(__('reservations.remain')); ?> <?php endif; ?></td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
               
            </tbody>
        </table>
  
        
        <?php endif; ?>
         <?php endif; ?>
         
       
         
        <div class="form-group col-lg-6">
            <label><?php echo e(meta('name', getCurrentLocale()) ?? __('patients.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()) ??__('patients.name')); ?>" value='<?php echo e(old("name", $patient->name ?? "")); ?>'/>
        </div>
        <div class="form-group col-lg-6">
            <label><?php echo e(meta('email', getCurrentLocale()) ?? __('patients.email')); ?> </label>
            <input type="email" class="form-control <?php echo e($errors->has('email') ? 'is-invalid' : ''); ?>" name="email" placeholder="<?php echo e(meta('email', getCurrentLocale()) ??__('patients.email')); ?>" value='<?php echo e(old("email", $patient->email ?? "")); ?>'/>
        </div>
         <div class="form-group col-lg-6">
            <label><?php echo e(meta('password', getCurrentLocale()) ?? __('patients.password')); ?> </label>
            <input type="password" class="form-control <?php echo e($errors->has('password') ? 'is-invalid' : ''); ?>" name="password" placeholder="<?php echo e(meta('password', getCurrentLocale()) ??__('patients.password')); ?>" value='<?php echo e(old("password")); ?>'/>
        </div>

        <div class="form-group col-lg-6">
            <label><?php echo e(meta('date_of_birth', getCurrentLocale()) ?? __('patients.date_of_birth')); ?> </label>
            <input type="date" class="form-control <?php echo e($errors->has('date_of_birth') ? 'is-invalid' : ''); ?>" name="date_of_birth" placeholder="<?php echo e(meta('date_of_birth', getCurrentLocale()) ?? __('patients.date_of_birth')); ?>" value='<?php echo e(old("date_of_birth", $patient->details->date_of_birth ?? "")); ?>'/>
        </div>
        
           <div class="form-group col-lg-6">
            <label><?php echo e(meta('job', getCurrentLocale()) ?? __('patients.job')); ?> </label>
            <input type="text" class="form-control <?php echo e($errors->has('job') ? 'is-invalid' : ''); ?>" name="job" placeholder="<?php echo e(meta('job', getCurrentLocale()) ?? __('patients.job')); ?>" value='<?php echo e(old("job", $patient->details->job ?? "")); ?>'/>
        </div>
        
        
         <div class="form-group col-lg-6">
            <label><?php echo e(meta('appetite', getCurrentLocale()) ?? __('patients.appetite')); ?> </label>
            <input type="text" class="form-control <?php echo e($errors->has('appetite') ? 'is-invalid' : ''); ?>" name="appetite" placeholder="<?php echo e(meta('appetite', getCurrentLocale()) ?? __('patients.appetite')); ?>" value='<?php echo e(old("appetite", $patient->appetite ?? "")); ?>'/>
        </div>
        
         <div class="form-group col-lg-6">
            <label><?php echo e(meta('type_food', getCurrentLocale()) ?? __('patients.type_food')); ?> </label>
            <input type="text" class="form-control <?php echo e($errors->has('type_food') ? 'is-invalid' : ''); ?>" name="type_food" placeholder="<?php echo e(meta('type_food', getCurrentLocale()) ?? __('patients.type_food')); ?>" value='<?php echo e(old("type_food", $patient->type_food ?? "")); ?>'/>
        </div>
        
         <div class="form-group col-lg-6">
            <label><?php echo e(meta('time_wake', getCurrentLocale()) ?? __('patients.time_wake')); ?> </label>
            <input type="text" class="form-control <?php echo e($errors->has('time_wake') ? 'is-invalid' : ''); ?>" name="time_wake" placeholder="<?php echo e(meta('time_wake', getCurrentLocale()) ?? __('patients.time_wake')); ?>" value='<?php echo e(old("time_wake", $patient->time_wake ?? "")); ?>'/>
        </div>
        
         <div class="form-group col-lg-6">
            <label><?php echo e(meta('time_meal', getCurrentLocale()) ?? __('patients.time_meal')); ?> </label>
            <input type="text" class="form-control <?php echo e($errors->has('time_meal') ? 'is-invalid' : ''); ?>" name="time_meal" placeholder="<?php echo e(meta('time_meal', getCurrentLocale()) ?? __('patients.time_meal')); ?>" value='<?php echo e(old("time_meal", $patient->time_meal ?? "")); ?>'/>
        </div>
        
         <div class="form-group col-lg-6">
            <label><?php echo e(meta('time_sleep', getCurrentLocale()) ?? __('patients.time_sleep')); ?> </label>
            <input type="text" class="form-control <?php echo e($errors->has('time_sleep') ? 'is-invalid' : ''); ?>" name="time_sleep" placeholder="<?php echo e(meta('time_sleep', getCurrentLocale()) ?? __('patients.time_sleep')); ?>" value='<?php echo e(old("time_sleep", $patient->time_sleep ?? "")); ?>'/>
        </div>
        
         <div class="form-group col-lg-6">
            <label><?php echo e(meta('time_work', getCurrentLocale()) ?? __('patients.time_work')); ?> </label>
            <input type="text" class="form-control <?php echo e($errors->has('time_work') ? 'is-invalid' : ''); ?>" name="time_work" placeholder="<?php echo e(meta('time_work', getCurrentLocale()) ?? __('patients.time_work')); ?>" value='<?php echo e(old("time_work", $patient->time_work ?? "")); ?>'/>
        </div>
        
           <div class="form-group col-lg-6">
            <label><?php echo e(meta('phone', getCurrentLocale()) ?? __('patients.phone')); ?> </label>
            <input type="number" class="form-control <?php echo e($errors->has('phone') ? 'is-invalid' : ''); ?>" name="phone" placeholder="<?php echo e(meta('phone', getCurrentLocale()) ?? __('patients.phone')); ?>" value='<?php echo e(old("phone", $patient->phone ?? "")); ?>'/>
        </div>
          
        
           <div class="form-group col-lg-6">
            <label><?php echo e(meta('status', getCurrentLocale()) ?? __('patients.status')); ?> </label>
            <input type="text" class="form-control <?php echo e($errors->has('status') ? 'is-invalid' : ''); ?>" name="status" placeholder="<?php echo e(meta('status', getCurrentLocale()) ?? __('patients.status')); ?>" value='<?php echo e(old("status", $patient->details->status ?? "")); ?>'/>
        </div>
      
        
           <div class="form-group col-lg-6">
            <label><?php echo e(meta('gender', getCurrentLocale()) ?? __('patients.gender')); ?> </label>
            <select class="form-control <?php echo e($errors->has('gender') ? 'is-invalid' : ''); ?>" name="gender">
                <option selected disabled><?php echo e(__('patients.select')); ?></option>
                
                <option <?php if($patient ?? ''  && $patient->id): ?> <?php if($patient->details->gender == '1'): ?> selected <?php endif; ?> <?php endif; ?> value="1"><?php echo e(__('patients.male')); ?></option>
                <option <?php if($patient ?? ''  && $patient->id): ?> <?php if($patient->details->gender == '0'): ?> selected <?php endif; ?> <?php endif; ?> value="0"><?php echo e(__('patients.female')); ?></option>
            </select>
        </div>
          <div class="form-group col-lg-6">
            <label><?php echo e(meta('knowledge', getCurrentLocale()) ?? __('patients.knowledge')); ?> </label>
            <select class="form-control <?php echo e($errors->has('knowledge') ? 'is-invalid' : ''); ?>" name="knowledge">
                <option selected disabled><?php echo e(__('patients.select')); ?></option>
                <option <?php if($patient ?? ''  && $patient->id): ?> <?php if($patient->details->knowledge == '1'): ?> selected <?php endif; ?> <?php endif; ?> value="1"><?php echo e(__('patients.social')); ?></option>
                <option <?php if($patient ?? ''  && $patient->id): ?> <?php if($patient->details->knowledge == '2'): ?> selected <?php endif; ?> <?php endif; ?> value="2"><?php echo e(__('patients.friend')); ?></option>
                <option <?php if($patient ?? ''  && $patient->id): ?> <?php if($patient->details->knowledge == '3'): ?> selected <?php endif; ?> <?php endif; ?> value="3"><?php echo e(__('patients.other')); ?></option>
            </select>
        </div>

  <div class="form-group col-lg-6">
            <label><?php echo e(meta('branches', getCurrentLocale()) ?? __('patients.branches')); ?> </label>
            <select class="form-control <?php echo e($errors->has('branches') ? 'is-invalid' : ''); ?>" name="branches">
                <option selected disabled><?php echo e(__('patients.select')); ?></option>
                 <?php $__currentLoopData = $branches; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <option <?php if($patient ?? ''  && $patient->id): ?> <?php if(branchestrue($row->id,$patient->id,'0')): ?> 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">
            <label><?php echo e(meta('joinned', getCurrentLocale()) ?? __('main.joinned')); ?> </label>
            <input type="date" class="form-control <?php echo e($errors->has('joinned') ? 'is-invalid' : ''); ?>" name="joinned" placeholder="<?php echo e(meta('joinned', getCurrentLocale()) ?? __('main.joinned')); ?>" value='<?php echo e(old("joinned", $user->details->joinned ?? "")); ?>'/>
        </div>
          <div class="form-group col-lg-12">
                <label><?php echo e(meta('specialties', getCurrentLocale()) ?? __('meals.specialties')); ?> </label>
               
                     <div class="row">
                    <?php $__currentLoopData = $specialties; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="col-3"><input type="checkbox"  <?php if($patient ?? ''  && $patient->id): ?> <?php if(specialties($row->id,$patient->id)): ?> checked <?php endif; ?> <?php endif; ?> name="specialties[]" value="<?php echo e($row->id); ?>"> <?php echo e($row->name); ?></div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
               </div>
                </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'); ?>
    <!-- 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('/')); ?>/",
            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/patients/form.blade.php ENDPATH**/ ?>