<?php
$date_birth = "";

if($guardian->id){
	$option = ['method' => 'put' ,
	 'url' => action('GuardiansController@update' , $guardian),
	 'id'   =>  'defaultForm',
	 'class' => 'form-horizontal'];
	 $date_birth = $guardian->date_birth->toDateString();
} else{
	$option = ['method' => 'guardian' ,
	'url' => action('GuardiansController@store'),
	'id'   =>  'defaultForm',
	'class' => 'form-horizontal'];
}

?>

<?php echo $__env->make('errors.errors', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<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-user"></i>
                	<span>Guardian informations</span>
                </div>
            </div>
            <div class="box-content">
                <?php echo Form::model($guardian, $option); ?>

                <input type="hidden" name="id" value="<?php echo e($guardian->id); ?>">
                <fieldset>
                	    <legend>Personal informations</legend>
                		<div class="form-group">
                            <label class="col-sm-3 control-label">CIN</label>
                            <div class="col-sm-2">
                            <?php echo Form::text("cin" , null, ['class' => 'form-control ',
                                        			     'name' => 'cin',
                                        			     'data-toggle' => 'CIN']); ?>

                            </div>
                        </div>
                		<div class="form-group">
                		    <label class="col-sm-3 control-label">First name</label>
                			<div class="col-sm-4">
                			    <?php echo Form::text("first_name" , null, ['class' => 'form-control',
                                                                    'name' => 'first_name',
                                			                        'data-toggle' => 'First name']); ?>

                			</div>
                		</div>
                		<div class="form-group">
                            <label class="col-sm-3 control-label">Last name</label>
                            <div class="col-sm-4">
                               <?php echo Form::text("last_name" , null, ['class' => 'form-control',
                                                                    'name' => 'last_name',
                                                               		'data-toggle' => 'Last name']); ?>

                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">Birth Date</label>
                            <div class="col-sm-2">
                            <?php echo Form::text("date_birth" , $date_birth, ['class' => 'form-control',
                                                        			    'name' => 'date_birth',
                                                        			    'data-toggle' => 'Birth Date',
                                                        			    'id'  =>  'input_date_birth']); ?>

                            </div>
                        </div>
                	</fieldset>
                	<fieldset>
                	    <legend>Password</legend>
                		    <div class="form-group">
                			    <label class="col-sm-3 control-label">Password</label>
                				    <div class="col-sm-4">
                				        <input type="password" class="form-control" name="password" />
                					</div>
                			</div>
                			<div class="form-group">
                			    <label class="col-sm-3 control-label">Retype password</label>
                				<div class="col-sm-4">
                				    <input type="password" class="form-control" name="password_confirmation" />
                				</div>
                			</div>
                	</fieldset>
                	<fieldset>
                        <legend>Contact</legend>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">Phone number</label>
                            <div class="col-sm-4">
                            <?php echo Form::text("mobile" , null, ['class' => 'form-control',
                                    			             'name' => 'mobile',
                                    			             'data-toggle' => 'Phone number']); ?>

                            </div>
                        </div>
                    </fieldset>
                	    <div class="form-group">
                			<div class="col-sm-9 col-sm-offset-3">
                                    <button type="submit" class="btn btn-default">Submit</button>
                		    </div>
                	    </div>
                <?php echo Form::close(); ?>

            </div>
        </div>
    </div>
</div>






