<?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">
                    Projects
                    <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 Project </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> Project 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><a href="<?php echo e(URL('admin/projects')); ?>">Projects</a></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/projects/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="Search for..."> <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($projects) > 0): ?>


        <table class="table table-striped sortable">
                     <thead>
                         <tr>
                            <th>Project ID</th>
                            <th>Project Title</th>
                            <th>Description</th>
                            <th>Start Date</th>
                            <th>Deadline</th>
                            <th>Duration</th>
                            <th>Status</th>
                         </tr>
                     </thead>
                     <tbody>
                      <?php foreach($projects as $project): ?>
                     <tr>
                            <td> <?php echo e($project->id); ?></td>
                            <td><a class=""  href="<?php echo e(URL::to('admin/projects/edit/' . $project->id)); ?>"><i class="fa fa-external-link"></i> <?php echo e($project->proj_title); ?></a></td>
                            <td><?php echo e($project->proj_desc); ?></td>
<td><?php echo e($project->start_date); ?></td>
<td><?php echo e($project->deadline); ?></td>
<td><?php echo e($project->duration); ?> &nbsp;
    <?php if($project->duration2<0): ?>
    <span class="label label-danger"><?php echo e($project->duration2); ?> day(s) Overdue </span>
    <?php elseif($project->duration2<6): ?>
    <span class="label label-warning"><?php echo e($project->duration2); ?> day(s) to complete </span>
    <?php elseif($project->duration2<10): ?>
    <span class="label label-info"><?php echo e($project->duration2); ?> day(s) to complete </span>
    <?php else: ?>
    <span class="label label-success"><?php echo e($project->duration2); ?> day(s) to complete </span>
    <?php endif; ?>
</td>
<td> 
    <?php if($project->status==1): ?>
    <span class="label label-success label-lg">Finished</span>
    <?php elseif($project->status==2): ?>
    <span class="label label-danger">Stopped</span>
    <?php else: ?>
    <span class="label label-primary">On Going</span>
    <?php endif; ?>
    
<!--<a class="btn btn-link2 btn-xs" href="<?php echo e(URL::to('admin/projects/delete/' . $project->id)); ?>"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span> </a> -->

                            </td>
                        </tr>
                         <?php endforeach; ?>
                     </tbody>

                     </table>
                        <nav class="text-xs-right">
                       <?php echo str_replace('/?', '?', $projects->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> New Project</h4>
      </div>
      <div class="modal-body">
 <form class="form-horizontal" role="form" method="POST" action="<?php echo e(url('/admin/projects/docreate')); ?>">
                        <input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">

                        <div class="form-group">
                            <label class="control-label">Project Title*</label>
                            
                                <input type="text" class="form-control underlined" name="title" value="">
                            
                        </div>

                        <div class="form-group">
                            <label class="control-label">Project Specification*</label>
                            
                                <input type="text" class="form-control underlined" name="description" value="" >
                            
                        </div>

                        <div class="form-group">
                            <label class="control-label">Project 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">Deadline Date*</label>
                            
                            <div class='input-group date'>
<input type='text' class="form-control underlined" id="date-end" name="deadline" data-provide="datepicker" />
  <span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span></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 $__env->stopSection(); ?>

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