<?php
$date_birth = "";
$date_recrutment = "";
$date_resignation = "";

if($employee->id){
	 $date_birth = $employee->date_birth->toDateString();

	 if(strcmp($employee->date_recrutment->toDateString(),'-0001-11-30') != 0)
	    $date_recrutment = $employee->date_recrutment->toDateString();

	 if($employee->date_resignation&&strcmp($employee->date_resignation->toDateString(),"-0001-11-30") != 0)
	    $date_resignation = $employee->date_resignation->toDateString();

}

?>



<?php $__env->startSection('content'); ?>

<div class="row">
            	<div id="breadcrumb" class="col-xs-12">
            		<a href="#" class="show-sidebar">
            			<i class="fa fa-bars"></i>
            		</a>
            		<ol class="breadcrumb pull-left">
            			<li><a href="<?php echo e(route('employee.index')); ?>">Employees</a></li>
            			<li><a href="#">Profile</a></li>
            		</ol>
            	</div>
            </div>




<div class="row-fluid">
			<h4 class="page-header"><?php echo e($employee->first_name ."   "); ?><?php echo e($employee->last_name); ?></h4>
			<div class="row">

			<div class="col-lg-3 col-lg-10">
				<div class="box">
					<div class="thumbnail">
						<img src="<?php echo e(asset('/img/profiles/'. $employee->image)); ?>" alt="">
						<div class=" caption">
						<?php echo Form::open(array('method' => 'DELETE', 'route' => array('employee.destroy' , $employee))); ?>

                            <a href="<?php echo e(route('employee.edit' , $employee)); ?>" class="btn btn-default">Edit</a>
                            <?php echo Form::submit('Delete', array('class' => 'btn btn-danger')); ?>

                        <?php echo Form::close(); ?>

						</div>
					</div>
				</div>
			</div>
			<div class="col-xs-6 col-sm-6 col-md-8">
				<br>
				<br>
				<div class="form-group ">
						<label class="col-sm-2 control-label">ID</label>
						<div class="col-md-4">
							<label class="form-control"><?php echo e($employee->id); ?></label>
						</div>
						<label class="col-sm-2 control-label">CIN</label>
						<div class="col-sm-4">
							<label class="form-control"><?php echo e($employee->cin); ?></label>
						</div>
				</div>
				<br>
                <br>
					<div class="form-group  ">
						<label class="col-sm-2 control-label">Mobile</label>
						<div class="col-sm-4">
							<label class="form-control"><?php echo e($employee->mobile); ?></label>
						</div>
						<label class="col-sm-2 control-label">Email</label>
						<div class="col-sm-4">
							<label type="password" class="form-control"><?php echo e($employee->email); ?></label>
						</div>
					</div>
					<br>
                    <br>
					<div class="form-group ">
						<label class="col-sm-2 control-label">Birth Date</label>
						<div class="col-md-4">
							<label class="form-control"><?php echo e($date_birth); ?></label>
						</div>
						<label class="col-sm-2 control-label">State</label>
						<div class="col-sm-4">
							<label class="form-control"><?php echo e($employee->state); ?></label>
						</div>
					</div>
                    <br>
                    <br>
					<div class="form-group ">
						<label class="col-sm-2 control-label">Recrutment Date</label>
						<div class="col-sm-4">
							<label class="form-control"><?php echo e($date_recrutment); ?></label>
						</div>
						<label class="col-sm-2 control-label">Resignation Date</label>
						<div class="col-sm-4">
							<label class="form-control"><?php echo e($date_resignation); ?></label>
						</div>
					</div>
			</div>



<div class="row form-group col-sm-12">
        <div class="row col-xs-12">

            <div class="col-xs-12 col-sm-6">
            		<div class="box">
            			<div class="box-header">
            				<div class="box-name">
            					<i class="fa fa-bullseye"></i>
            					<span>StatisicLogOutPerMonth</span>
            				</div>
            				<div class="no-move"></div>
            			</div>
            			<div class="box-content">
            				<div id="statisticLogOutPerMonth" style="height: 200px; width: 100%;"></div>
            			</div>
            		</div>
            	</div>


<div class="col-xs-12 col-sm-6">
		<div class="box">
			<div class="box-header">
				<div class="box-name">
					<i class="fa fa-bullseye"></i>
					<span>StatisicLogInPerMonth</span>
				</div>
				<div class="no-move"></div>
			</div>
			<div class="box-content">
				<div id="statisticLogInPerMonth" style="height: 200px; width: 100%;"></div>
			</div>
		</div>

</div>

                        	<div class="col-xs-12">
                        		<div class="box">
                        			<div class="box-header">
                        				<div class="box-name">
                        					<i class="fa fa-table"></i>
                        					<span>Logs</span>
                        				</div>
                        				<div class="no-move"></div>
                        			</div>
                        			<div class="box-content no-padding table-responsive">
                        				<table class="table table-bordered table-striped table-hover table-heading table-datatable" id="datatable-2">
                        					<thead>
                        						<tr>
                        						    <th><label><input type="text" name="search_guard" value="Guard" class="search_init" /></label></th>
                        							<th><label><input type="text" name="search_date_log" value="Date" class="search_init" /></label></th>
                        							<th><label><input type="text" name="search_time_log" value="Time" class="search_init" /></label></th>
                        							<th class="col-md-2"><label><input type="text" name="search_in_out" value="IN/OUT" class="search_init" /></label></th>
                        						    <th id="delete"/>
                        						</tr>
                        					</thead>
                        					<tbody>
                        					<?php foreach($employee->logs as $log): ?>
                                                    <tr>
                                                        <td><?php echo e($log->guardian->first_name); ?> <?php echo e($log->guardian->last_name); ?></td>
                                                        <td><?php echo e($log->date_log->toDateString()); ?></td>
                                                        <td><?php echo e($log->date_log->toTimeString()); ?></td>
                                                        <?php if($log->in_out == 0): ?>
                                                            <td style="text-align:center" class="success">IN</td>
                                                            <?php else: ?>
                                                            <td style="text-align:center" class="danger">OUT</td>
                                                        <?php endif; ?>
                                                        <td style="text-align:center; display: block;  padding-bottom: 6%;">
                                                            <?php echo Form::open(array('method' => 'DELETE', 'route' => array('log.destroy' , $log))); ?>

                                                                <button type="submit" class="btn btn-default btn-app-sm"><i class="fa fa-trash"></i></button>
                                                            <?php echo Form::close(); ?>

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

                        					</tbody>
                        					<tfoot>
                        						<tr>
                        							<th>Guard</th>
                        							<th>Date</th>
                        							<th>Time</th>
                        							<th>IN/OUT</th>
                        							<th>Delete</th>
                        						</tr>
                        					</tfoot>
                        				</table>
                        			</div>
                        		</div>
                        	</div>
                        </div>
                   </div>
		      </div>
	</div>

</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('../shared/default', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>