<?php $__env->startSection('content'); ?>
    <div class="container-fluid">
        <div class="page-titles">
            <ol class="breadcrumb">
                <li class="breadcrumb-item"><a href="<?php echo e(URL::to('/facility')); ?>">Facility</a></li>
                <li class="breadcrumb-item active"><a href="javascript:void(0)">Layout</a></li>
            </ol>
        </div>
        <div class="row">
            <div class="col-12">
                <div class="card">
                    <div class="card-primary">
                        <div class="card-body">
                            <form id="organisation_form" class="form-horizontal" action="<?php echo e(URL::to('/layout_create_post')); ?>" method="post" onsubmit="return validation();" autocomplete="off" enctype="multipart/form-data">
                                <?php echo e(csrf_field()); ?>

                                <div class="card bg-light">
                                    <div class="card-header">
                                        <h5 class="card-title"><?php echo e($facilities->facility_name); ?></h5>
                                    </div>
                                    <div class="card-body mb-0">
                                        <p class="card-text">
                                            <b>Organisation Name :</b> <?php echo e($facilities->organisation->organisation_name); ?>&nbsp;&nbsp;<?php echo e($facilities->organisation->city); ?><br>
                                            <b>Number of Seats :</b> <?php echo e($facilities->noofseats); ?>

                                        </p>
                                    </div>
                                </div>
                                <div class="form-group col-md-4">
                                    <label>Total Number of Rows</label>
                                    <input type="text" class="form-control" id="total_rows" name="total_rows" maxlength="3" onkeypress="return isNumber(event);"> 
                                    <input type="hidden" name="facility_id" id="facility_id" value="<?php echo e($facilities->id); ?>">
                                </div>
                                <div class="form-group col-md-4">
                                    <label>Maximum Seat in a Row</label>
                                    <input type="text" class="form-control" id="maxinarow" name="maxinarow" maxlength="3" onkeypress="return isNumber(event);">
                                </div>
                                <div class="form-group col-md-4">
                                    <label>Total Seats (Maximum)</label>
                                    <input type="text" class="form-control" id="maxseats" name="maxseats" maxlength="3" onkeypress="return isNumber(event);">
                                </div>
                                <div class="card-footer">
                                    <button type="submit" class="btn btn-primary">Submit</button>
                                    <a href="<?php echo e(URL::to('/facility')); ?>" title="View Facility" class="btn btn-warning">Back</a>
                                </div>
                            </form>
                        </div> 
                        <div class="card-body  bg-light">      
                            <div class="table-responsive">
                                <?php if(count($layouts)!=0): ?>
                                <table class="display" style="width:100%" id="example">
                                    <thead class="thead-info">
                                        <tr>
                                            <th>Slno</th>
                                            <th>Total Number of Rows</th>
                                            <th>Maximum Seat in a Row</th>
                                            <th>Total Seats (Maximum)total_row</th>
                                            <th></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php if(count($layouts)==0): ?>
                                            <tr>
                                                <td colspan="3"><br><br>
                                                    <div class="alert alert-danger alert-dismissible fade show">
                                                        <strong>No Layouts Added !!!</strong>
                                                    </div>
                                                    
                                                </td>
                                            </tr>
                                        <?php endif; ?>
                                        <?php
                                            $n = 0;
                                            $status_name ="";
                                        ?>
                                        <?php if(isset($layouts)): ?>
                                            <?php $__currentLoopData = $layouts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $layout): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <?php  
                                                    $n++;
                                                ?>
                                                <tr>
                                                    <td><?php echo e($n); ?></td>
                                                    <td><?php echo e($layout->total_row); ?></td>
                                                    <td><?php echo e($layout->maxinarow); ?></td>
                                                    <td><?php echo e($layout->maxseats); ?></td>
                                                    <td>
                                                        <a href="<?php echo e(URL::to('/seat_layout')); ?>/<?php echo e($layout->facility_id); ?>/<?php echo e($layout->id); ?>" title="Seat Layout" class="btn btn-warning shadow btn-xs">Seats</a>
                                                    </td>
                                                </tr>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        <?php endif; ?>
                                    </tbody>
                                </table>
                                <?php endif; ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        /////////validate integer fields///////////////////////////
        function isNumber(evt) 
        {
          evt = (evt) ? evt : window.event;
          var charCode = (evt.which) ? evt.which : evt.keyCode;
          if (charCode > 31 && (charCode < 48 || charCode > 57)) 
          {
            //alert("Please enter only Numbers.");
            return false;
          }

          return true;
        }
        //////////////////////////////////////////
        $(document).ready(function() {
            toastr.options.timeOut = 10000;
            <?php if(Session::has('error')): ?>
                toastr.error('<?php echo e(Session::get('error')); ?>');
            <?php elseif(Session::has('success')): ?>
                toastr.success('<?php echo e(Session::get('success')); ?>');
            <?php endif; ?>
        });
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layout.default', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/ksstmprod/resources/views/Facility/layout_create.blade.php ENDPATH**/ ?>