<?php $__env->startSection('content'); ?>
  <article class="content items-list-page">
                    <div class="title-search-block">
               
                        <div class="title-block">
                            <div class="row">
                                <div class="col-md-6">
                                    <h3 class="title">
                    Vacation Requests
                    <button type="button" class="btn btn-primary btn-sm rounded-s btn-pill-right" data-toggle="modal" data-target="#myModal"><i class="fa fa-location-arrow"></i> New Request </button>
                    <!--<a href="<?php echo e(url('admin/emp/create')); ?>" class="btn btn-primary btn-sm rounded-s">
                        <i class="fa fa-location-arrow"></i> New Appointment
                    </a> -->
                    
               <!-- <div class="action dropdown">
                        <button class="btn  btn-sm rounded-s btn-secondary dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                            Reports
                        </button>
                        <div class="dropdown-menu" aria-labelledby="dropdownMenu1">
                            <a class="dropdown-item" href="#">
                                <i class="fa fa-file-text icon"></i> Vacation Requests</a>
                        </div>
                    </div> -->
                </h3>
                                    <p class="title-description"> 
        <ul class='breadcrumb'>
        <li><a href="<?php echo e(URL('admin/dashboard')); ?>"><i class="fa fa-home"></i> Dashboard</a></li>
        <li>Vacation Requests</li>

    </ul>
</p>
                                </div>
                            </div>
                        </div>
                        <div class="items-search">
                            <form class="form-inline" role="form" enctype="multipart/form-data" method="POST" action="<?php echo e(url('/admin/leave/search')); ?>">
                        <input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
                            <!--<form class="form-inline"> -->
                                <div class="input-group"> <input type="text" name="query" class="form-control boxed rounded-s" placeholder="Employee ID"> <span class="input-group-btn">
                    <button class="btn btn-secondary rounded-s" type="submit">
                        <i class="fa fa-search"></i>
                    </button>
                </span> </div>
                            </form>
                        </div>
                    </div>
 <?php if(count($errors) > 0): ?>
                        <div class="alert alert-danger">
                            <strong>Whoops!</strong> There were some problems with your input.<br><br>
                            <ul>
                                <?php foreach($errors->all() as $error): ?>
                                    <li><?php echo e($error); ?></li>
                                <?php endforeach; ?>
                            </ul>
                        </div>
                    <?php endif; ?>

                 <?php if(Session::has('message')): ?>
                        <div class="alert alert-success">
                            <strong>  <?php echo e(Session('message')); ?> </strong>
                        </div>
                    <?php endif; ?>
<section class="section">
                        <div class="row sameheight-container">
                            <div class="col-xl-12">
                                <div class="card sameheight-item">
                                    <div class="card-block">

                       <?php if(count($employees) > 0): ?>

<div class="table-responsive">
                                          <table class="table table-striped sortable">
                     <thead>
                         <tr>
                            <th># ID</th>
                            <th>Employee</th>
                            <th>Period</th>
                            <th>No. of Days</th>
                            <th>Reason</th>
                            <th>Status</th>
                           
                         </tr>
                     </thead>
                     <tbody>
                      <?php foreach($employees as $emp): ?>
                     
                            <td><?php echo e($emp->id); ?></td>
                            <td><strong><?php echo e($emp->emp_id); ?>#</strong> <?php echo e($emp->emp->name); ?> </td>
                            <td><?php echo e($emp->start_date); ?> to <?php echo e($emp->end_date); ?> </td>
                            <td><?php echo e($emp->duration); ?></td>
                            <td><?php echo e($emp->reason); ?></td>
                            <td>
                            <?php if($emp->status==0): ?>  
                            <span class="label label-info">Pending</span>
                            <?php elseif($emp->status==2): ?>  
                            <span class="label label-danger">Rejected</span>
                            <?php else: ?>
                            <span class="label label-success">Approved</span>
                            <?php endif; ?>
                            &nbsp;  <a href="<?php echo e(URL::to('admin/leave/edit/' . $emp->id)); ?>"><i class="fa fa-edit"></i></a>
                            &nbsp;  <a href="<?php echo e(URL::to('admin/leave/delete/' . $emp->id)); ?>"><i class="fa fa-remove"></i></a>
                          </td>
                          
                            
                            
                            
                        
                        </tr>
                         <?php endforeach; ?>
                     </tbody>

                     </table>
                 </div>
                        <nav class="text-xs-right">
                       <?php echo str_replace('/?', '?', $employees->render()); ?>

</nav>
                    <?php else: ?>
                       <h3>No Data Found!</h3>
                    <?php endif; ?>
                    
                    </div>
  </div>
                                    <!-- /.card-block -->
                                </div>
                                <!-- /.card -->
                            </div>
                           
                        </div>
                    </section>      
                   
                </article>



<!-- new creation -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">

  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel"><i class="fa fa-location-arrow"></i> Vacation Request</h4>
      </div>
      <div class="modal-body">
 <form class="form-horizontal" role="form" method="POST" action="<?php echo e(url('/admin/leave/docreate')); ?>">
                        <input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
                        
        

                        
                            <div class="form-group">
                            <label class="control-label">Employee*</label>
                            
                            <select class="form-control underlined" name="emp_id">
  <?php foreach($posts as $post): ?>
  <option value="<?php echo e($post->id); ?> "><?php echo e($post->name); ?></option>
  <?php endforeach; ?>
</select>


                            
                        </div>
    <div class="form-group">
                            <label class="control-label">Start Date*</label>
                            
                            <div class='input-group date'>
<input type='text' class="form-control underlined" id="date-start" name="start_date" data-provide="datepicker" />
  <span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span></div>

                            
                        </div>
    <div class="form-group">
                            <label class="control-label">End Date*</label>
                            
                            <div class='input-group date'>
<input type='text' class="form-control underlined" id="date-end" name="end_date" data-provide="datepicker" />
  <span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span></div>

                            
                        </div>                                          
<div class="form-group">    
                            <label class="control-label">Reason*</label>
                            
                                <input type="text" class="form-control underlined" name="reason" value="" >
                            
                        </div>          
<div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-times"></i> Cancel</button>
        <button type="submit" class="btn btn-primary"><i class="fa fa-check"></i> Save changes</button>
        </form>
      </div>
            
                                
      
                       

      </div>
      
    </div>
  </div>
</div>

        
    </div>
  </div>
</div>
</div></div></div>



<?php $__env->stopSection(); ?>

<?php echo $__env->make('app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>