

@extends('../shared/default')

@section('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="">Visitors</a></li>
                		</ol>
                	</div>
                </div>


 <div class="row">
            	<div class="col-xs-12 col-sm-12">
        		<div class="box">
        			<div class="box-header">
        				<div class="box-name">
        					<i class="fa fa-plus"></i>
        					<span>Registration</span>
        				</div>
        				<div class="box-icons">
        					<a class="collapse-link">
        						<i class="fa fa-chevron-up"></i>
        					</a>
        				</div>
        				<div class="no-move"></div>
        			</div>
        			<div class="box-content">
        			 {!! Form::model($visitor, ['method' => 'visitor' ,
                                                               	'url' => action('VisitorsController@store'),
                                                               	'id'   =>  'defaultForm',
                                                               	'role'  =>  'form',
                                                               	'class' => 'form-horizontal']) !!}
        				<div class="form-group">
        						<label class="col-sm-2 control-label">First name</label>
        						<div class="col-sm-4">
        						{!! Form::text("first_name" , null, ['class' => 'form-control',
        						                                    'placeholder'   =>  'First name']) !!}
        						</div>
        						<label class="col-sm-2 control-label">Last name</label>
        						<div class="col-sm-4">
        						{!! Form::text("last_name" , null, ['class' => 'form-control',
                                                                   'placeholder'   =>  'Last name']) !!}
        						</div>
        					</div>
        					<div class="form-group">
                                <label class="col-sm-2 control-label">CIN</label>
                                <div class="col-sm-4">
                                {!! Form::text("cin" , null, ['class' => 'form-control ',
                                                              'placeholder'      =>  'CIN']) !!}
                                </div>
                                <label class="col-sm-2 control-label">Date Visit</label>
                                <div class="col-sm-4">
                                {!! Form::text("date_visit" , null, ['class' => 'form-control',
                                                                     'placeholder'   =>  'Visit date',
                                                                     'id'  =>  'input_date_visit']) !!}
                                </div>
                            </div>
        					<div class="form-group">
        						<label class="col-sm-2 control-label">Phone number</label>
        						<div class="col-sm-4">
        						{!! Form::text("mobile" , null, ['class' => 'form-control',
        						                                'placeholder'   =>  'Phone number']) !!}
        						</div>
        						<label class="col-sm-2 control-label">Email</label>
        						<div class="col-sm-4">
        						{!! Form::text("email" , null, ['class' => 'form-control',
                                        						 'placeholder'   =>  'Email']) !!}
        						</div>
        					</div>
        					<div class="form-group">
        					    <div class="col-sm-offset-2 col-sm-2">
                                    <button type="submit" class="btn btn-default btn-label-left">
                                    <span><i class="fa fa-plus"></i></span>
                                    Registrate
                                    </button>
                                </div>
                            </div>
        				{!! Form::close() !!}
        			</div>
        		</div>
        	</div>
        </div>

 	<div class="row">
    	<div class="col-xs-12">
    		<div class="box">
    			<div class="box-header">
    				<div class="box-name">
    					<i class="fa fa-users"></i>
    					<span>List of visitors</span>
    				</div>
    			</div>
    			<div class="box-content no-padding">
    				<table class="td_link table table-bordered table-striped table-hover table-heading table-datatable" id="datatable-1">
    					<thead>
    						<tr>
    							<th class="col-md-1">CIN</th>
    							<th class=" col-md-1">Fist name</th>
    							<th class=" col-md-1">Last name</th>
    							<th class=" col-md-1">Date of Visit</th>
                                <th class="col-md-1">Email</th>
                                <th class="col-md-1">Phone number</th>
    						</tr>
    					</thead>
    					<tbody>
    					<!-- Start: list_row -->
    					@foreach($visitors as $visitor)
    					<tr onclick="document.location = '{{ route('visitor.show', $visitor) }}';">
                            <td>{{ $visitor->cin }}</td>
                            <td>{{ $visitor->first_name}}</td>
                            <td>{{ $visitor->last_name}}</td>
                            <td>{{ $visitor->date_visit->toDateString() }}</td>
                            <td>{{ $visitor->email }}</td>
                            <td>{{ $visitor->mobile }}</td>
                        </tr>
                        @endforeach
                        {{--<tr>--}}
                        {{--<td>12345678</td>--}}
                            {{--<td>sedsd</td>--}}
                            {{--<td>fsfsdf</td>--}}
                            {{--<td>12-09-10123</td>--}}
                            {{--<td>dfdfsf.dsfsdf.dfr</td>--}}
                            {{--<td>789</td>--}}
                        {{--</tr>--}}
                        {{--<tr>--}}
                                                {{--<td>12345678</td>--}}
                                                    {{--<td>sedsd</td>--}}
                                                    {{--<td>fsfsdf</td>--}}
                                                    {{--<td>12-09-10123</td>--}}
                                                    {{--<td>dfdfsf.dsfsdf.dfr</td>--}}
                                                    {{--<td>789</td>--}}
                                                {{--</tr>--}}
                                                {{--<tr>--}}
                                                                        {{--<td>12345678</td>--}}
                                                                            {{--<td>sedsd</td>--}}
                                                                            {{--<td>fsfsdf</td>--}}
                                                                            {{--<td>12-09-10123</td>--}}
                                                                            {{--<td>dfdfsf.dsfsdf.dfr</td>--}}
                                                                            {{--<td>789</td>--}}
                                                                        {{--</tr>--}}
    					<!-- End: list_row -->
    					</tbody>
    					<tfoot>
    						<tr>
    							<th>CIN</th>
                                <th>Fist name</th>
                                <th>Last name</th>
                                <th>Date of Visit</th>
                                <th>Email</th>
                                <th>Phone number</th>
    						</tr>
    					</tfoot>
    				</table>
    			</div>
    		</div>
    	</div>
    </div>
 @stop