<?php $__env->startSection('content_header'); ?>
    <?php echo notifyCss(); ?>
    <?php echo notifyJs(); ?>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
    <div class="row">
        <div class="col-12">
            <div class="card card-primary">
                <div class="card-header">
                    <h3 class="card-title">View Schedule Details</h3>
                </div>
                <?php echo $__env->make('notify::messages', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                <!-- /.card-header -->
                <!-- form start -->
                <form id="userregform" class="form-horizontal" action="<?php echo e(URL::to('/particiapant_certificate_post')); ?>" method="post" autocomplete="off" enctype="multipart/form-data">
                  <?php echo e(csrf_field()); ?>

                  <div class="card-body">
                      <div class="col-12">
                          <div class="form-group row">
                              <div class="col-3">
                                  <label for="exampleInputEmail1">Organisation</label><br>
                                  <?php echo e($schedules->organisation->organisation_name); ?>

                              </div>
                              <div class="col-3">
                                  <label for="exampleInputEmail1">Department</label><br>
                                  <?php if(isset($schedules->department_id)): ?>
                                    <?php echo e($schedules->department->department_name); ?>

                                  <?php endif; ?>
                              </div>
                              <div class="col-3">
                                  <label for="exampleInputEmail1">Section</label><br>
                                  <?php if(isset($schedules->section_id)): ?>
                                    <?php echo e($schedules->section->section_name); ?>

                                  <?php endif; ?>
                              </div>
                              <div class="col-3">
                                <label for="exampleInputEmail1">Material Type</label><br>
                                  <?php echo e($schedules->material_type->material_type_name); ?>

                              </div>
                          </div>
                          <div class="form-group row">
                              <div class="col-3">
                                  <label for="exampleInputEmail1">Training Title</label><br>
                                  <?php echo e($schedules->training_title); ?>

                                  <input type="hidden" name="schedule_id" id="schedule_id" value="<?php echo e($schedules->id); ?>">
                              </div>
                              <div class="col-3">
                                  <label for="exampleInputEmail1">Venue</label><br>
                                  <?php echo e($schedules->venue); ?>

                              </div>
                              <div class="col-3">
                                  <label for="exampleInputEmail1">Training Period</label><br>
                                  <?php
                                    $period_from = $schedules->period_from;
                                    $period_to = $schedules->period_to;
                                    if($period_from)
                                    {
                                        $period_from = date("d-M-Y", strtotime($period_from));
                                    }
                                    if($period_to)
                                    {
                                        $period_to = date("d-M-Y", strtotime($period_to));
                                    }
                                    echo $period_from." to ".$period_to;
                                  ?> 
                                  
                              </div>
                              <div class="col-3">
                                <label for="exampleInputEmail1">Min & Max seats for training</label><br>
                                  <?php
                                    $min_seat_training = $schedules->min_seat_training;
                                    $max_seat_training = $schedules->max_seat_training;
                                    
                                    echo $min_seat_training." & ".$max_seat_training;
                                  ?> 
                              </div>
                          </div>
                          <div class="form-group row">
                              <div class="col-3">
                                  <label for="exampleInputEmail1">Roles</label><br>
                                  <?php echo e($schedules->training_title); ?>

                              </div>
                          </div>
                          <div class="form-group row">
                              <div class="col-3">
                                  <label for="exampleInputEmail1">Whether Registration is Needed?</label><br>
                                  <?php if($schedules->registration_status==1): ?>
                                    <?php
                                      echo "Yes";
                                    ?>
                                  <?php else: ?>
                                    <?php
                                      echo "No";
                                    ?>
                                  <?php endif; ?>
                              </div>
                              <div class="col-3">
                                  <label for="exampleInputEmail1">Question and Answers for Training</label><br>
                                  <?php if($schedules->question_answer_status==1): ?>
                                    <?php
                                      echo "Yes";
                                    ?>
                                  <?php else: ?>
                                    <?php
                                      echo "No";
                                    ?>
                                  <?php endif; ?>
                              </div>
                              <div class="col-3">
                                  <label for="exampleInputEmail1">Reviews and Feedback Needed?</label><br>
                                  <?php if($schedules->review_status==1): ?>
                                    <?php
                                      echo "Yes";
                                    ?>
                                  <?php else: ?>
                                    <?php
                                      echo "No";
                                    ?>
                                  <?php endif; ?>                                  
                              </div>
                              <div class="col-3">
                                <label for="exampleInputEmail1">Training Certificates Needed?</label><br>
                                  <?php if($schedules->training_certificates==1): ?>
                                    <?php
                                      echo "Yes";
                                    ?>
                                  <?php else: ?>
                                    <?php
                                      echo "No";
                                    ?>
                                  <?php endif; ?>   
                              </div>
                          </div>
                          <div id="listroledata" style="padding: 10px;">
                              <table class="table table-hover table-bordered table-striped datatable" id="dept_details" width="100%">
                                  <thead>
                                      <tr class="success">
                                        <th width="10%">Slno</th>
                                        <th>Participant Name</th>
                                        <th>Number of Presnt Days</th>
                                        <th>Number of Absent Days</th>
                                        <th></th>
                                        <th></th>
                                      </tr>
                                  </thead>
                                  <tbody>
                                    <?php
                                      $n= 0;
                                      $schedule_participant_id = "";
                                    ?>
                                    <?php if(isset($schedules->schedule_participants)): ?>
                                      <?php $__currentLoopData = $schedules->schedule_participants; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $schedule_participant): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <?php
                                          $n++;
                                          $participant_id = $schedule_participant->user_id;
                                          $schedule_id = $schedule_participant->schedule_id;
                                        ?>
                                        <tr>
                                          <td><?php echo e($n); ?></td>
                                          <td><?php echo e($schedule_participant->users->name); ?></td>
                                          <td>
                                            <?php echo e($participant_present_attendance[$participant_id]); ?>

                                          </td>
                                          <td>
                                            <?php echo e($participant_absent_attendance[$participant_id]); ?>

                                          </td>
                                          <td>
                                            <?php if($certificate_status_marked[$participant_id]==1): ?>
                                            <input type="checkbox" checked="checked" name="<?php echo e($participant_id); ?>certificate" id="<?php echo e($participant_id); ?>certificate" value="1">
                                            <?php else: ?>
                                            <input type="checkbox" name="<?php echo e($participant_id); ?>certificate" id="<?php echo e($participant_id); ?>certificate" value="1">
                                            <?php endif; ?>
                                          </td>
                                          <td>
                                            <?php if($certificate_status_marked[$participant_id]==1): ?>
                                              <?php
                                                $schedule_participant_id = $schedule_id."~".$participant_id;
                                              ?>
                                              <a href="<?php echo e(URL::to('/certificatepreview')); ?>/<?php echo e($schedule_participant_id); ?>" class="btn btn-xs btn-info pull-right" target="_blank">View Certificate</a>
                                            <?php endif; ?>
                                          </td>
                                        </tr>
                                      <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    <?php else: ?>
                                      <tr>
                                        <td colspan="3" style=" text-align: center;">
                                            <span style="color: red;">No Participants are assigned yet !!!</span>
                                        </td>
                                      </tr>
                                    <?php endif; ?>
                                  </tbody>
                              </table>
                          </div>                        
                      </div>
                  </div>
                  <!-- /.card-body -->
                  <div class="card-footer">
                    <button type="submit" class="btn btn-primary pull-right">Generate Certificate</button>
                  </div>
                </form>
            </div>
        </div>        
    </div>
    
<?php $__env->stopSection(); ?>

<?php echo $__env->make('adminlte::page', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH E:\xampp7.3\htdocs\kmportal\resources\views/Training/view_participants_details.blade.php ENDPATH**/ ?>