<?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">
                   Departments <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 Department </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> -->
                    
               
                </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>Departments</li>

    </ul>
</p>
                                </div>
                            </div>
                        </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($departments) > 0): ?>

                     <table class="table table-striped">
                     <thead>
                         <tr>
                            <th></th>
                            <th></th>
                            <th></th>
                         </tr>
                     </thead>
                     <tbody>
                      <?php foreach($departments as $dept): ?>
                     <tr>
                        <td><h4><a href="<?php echo e(URL::to('admin/company/dept/edit/' . $dept->id)); ?>"><?php echo e($dept->department); ?></a> </h4>
                          <?php echo e($dept->function); ?>

                                </td>                          
                        <td><h5><i class="fa fa-building-o"></i> <?php echo e($dept->count); ?> Designations</h5></td>
                        <td><h5><i class="fa fa-group"></i> <?php echo e($dept->count2); ?> Employees</h5></td>
                        </tr> 
                         <?php endforeach; ?>
                     </tbody>

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

</nav>
                    <?php else: ?>
                       <h3>No Data Found!</h3>
                    <?php endif; ?>
                       
                        
                     



                      
                   
                </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 Department</h4>
      </div>
      <div class="modal-body">
  <form class="form-horizontal" role="form" method="POST" action="<?php echo e(url('/admin/dept/docreate')); ?>">
                        <input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
                        <div class="form-group">
                            <label class="control-label">Department*</label>
                            
                                <input type="text" class="form-control underlined" name="department" value="">
                            
                        </div>

                        <div class="form-group">
                            <label class="control-label">Functionality*</label>
                            
                                <input type="text" class="form-control underlined" name="function" value="" >
                            
                        </div>
                            

                        </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 foreach($departments as $dept): ?>
<div class="modal fade" id="model-<?php echo e($dept->id); ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      
    </div>
  </div>
</div>
<?php endforeach; ?>
<?php $__env->stopSection(); ?>

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