<?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">
                    Timesheet <small><?php echo e(date('H:i', strtotime($tot))); ?> Hours </small>
                    <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 Entry </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> Employee Log Report</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>Timesheet</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/timesheet/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="Emp/Project 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; ?>


                       <?php if(count($employees) > 0): ?>
<section class="section">
                        <div class="row sameheight-container">
                            <div class="col-xl-12">
                                <div class="card sameheight-item">
                                    <div class="card-block">                       
<section class="example">
<div class="table-responsive">
                      <table class="table table-striped sortable">
                     <thead>
                         <tr>
                            <th>#</th>
                            <th>Employee</th>
                            <th>Task</th>
                            <th>Start <i class="fa fa-arrows-h"></i> End</th>
                            <th>Duration</th>
                            <th>Notes</th>
                            <th></th>
                            
                         </tr>
                     </thead>
                     <tbody>
                      <?php foreach($employees as $emp): ?>
                     <tr>
                            <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->task); ?> <br />
                              <span class="label label-default"><strong><?php echo e($emp->proj_id); ?>#</strong> <?php echo e($emp->project->proj_title); ?></label></td>
                            <td><?php echo e(date('d-m-y', strtotime($emp->end_time))); ?><br />
                            <?php echo e(date('H:i:s', strtotime($emp->start_time))); ?> <i class="fa fa-arrows-h"></i> <?php echo e(date('H:i:s', strtotime($emp->end_time))); ?></td>
                            <td><?php echo e($emp->duration); ?></td>
                            
                            <td><?php echo e($emp->notes); ?></td>
                            <td class="hidden-print" align="right">
                              <a href="<?php echo e(URL::to('admin/timesheet/edit/' . $emp->id)); ?>"><i class="fa fa-edit"></i></a>
                            &nbsp;  <a href="<?php echo e(URL::to('admin/timesheet/delete/' . $emp->id)); ?>"><i class="fa fa-remove"></i></a>
                                <a class="btn btn-link2 btn-xs" href="<?php echo e(URL::to('admin/timesheet/delete/' . $emp->id)); ?>"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></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>
  </section>
  </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> New Entry</h4>
      </div>
      <div class="modal-body">
 <form class="form-horizontal" role="form" method="POST" action="<?php echo e(url('/admin/timesheet/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">Project*</label>
                            
                            <select class="form-control underlined" name="proj_id">
  <?php foreach($projects as $project): ?>
  <option value="<?php echo e($project->id); ?> "><?php echo e($project->proj_title); ?></option>
  <?php endforeach; ?>
</select>


                            
                        </div>
                <div class="form-group">
                 
          <div class="col-md-4">
               <label class="control-label">Time*</label>
             </div>
              <div class="col-md-4">
              
                <input type="text" id="time-start" name="start_time" class="form-control underlined floating-label" placeholder="Start Time">
              </div>
          
               <div class="col-md-4">
                <input type="text" id="time-end" name="end_time" class="form-control underlined floating-label" placeholder="End Time">
              
            </div></div>
          
                                                    
    
<div class="form-group">    
                            <label class="control-label">Task*</label>
                            
                                <input type="text" class="form-control underlined" name="task" value="" required >
                            
                        </div>  
<div class="form-group">    
                            <label class="control-label">Notes*</label>
                            
                                <input type="text" class="form-control underlined" name="notes" value="" required >
                            </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>
      </div>
        </form>
      
            
                                
      
                       

      </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(); ?>