  <?php $__env->startSection('content'); ?>
<?php Fun::lang()?>
<div class="title-add">
    <div class="page-bar"> 
        <ul class="page-breadcrumb"> 
            <li> <a class="ng-binding" href="#"><i class="fa fa-dashboard"></i> Dashboard</a> </li>
            <li><a href="#">Manage Client</a></li>
        </ul> 
    </div>
</div>
    <div class="page">
        <div class="top-content">
            <div class="row">
                <div class="col-sm-12 col-xs-12">
                    <div class="title-page">
                        <div class="pull-left">
                            <h3>Edit Client</h3>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12 col-xs-12">
                <?php if(count($errors) > 0): ?>
                <div class="alert-message alert-danger">
                    <strong>Whoops!</strong> There were some problems with your input.
                    <ul>
                        <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <li><?php echo e($error); ?></li>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </ul>
                </div>
                <?php endif; ?>
                <div class="form-wrapper">
                    <?php echo Form::model($client, ['method' => 'PATCH','route' => ['clients.update', $client->id],'enctype'=>'multipart/form-data']); ?>

                    <div class="row">

                        
                        <div class="form-group col-sm-4 col-xs-12">
                            <label class="required">Client First Name</label>
                            <?php echo Form::text('client_firstname', null, array('placeholder' => 'Client First Name','class' => 'form-control','required')); ?>

                        </div>
                        <div class="form-group col-sm-4 col-xs-12">
                            <label class="required">Client Last Name</label>
                            <?php echo Form::text('client_lastname', null, array('placeholder' => 'Client Last Name','class' => 'form-control','required')); ?>

                        </div>
                        <div class="form-group col-sm-4 col-xs-12">
                            <label>Name In Latin</label>
                            <?php echo Form::text('client_nickname', null, array('placeholder' => 'Client Nickname','class' => 'form-control')); ?>

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

                            <label class="required">Gender</label>
                            <select name="client_gender" id="" class="select2 form-control">
                                <option value="<?= $client['client_gender'] ?>"><?= $client['client_gender'] ?></option>
                                <option value="Male">Male</option>
                                <option value="Female">Female</option>
                            </select>

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

                            <label class="required">Client DOB</label>
                            <?php echo Form::text('client_dob', date('d-m-Y', strtotime($client->client_dob)), array('placeholder' => 'Client DOB','class' => 'form-control date_picker','required')); ?>


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

                            <label>Job</label>
                            <?php echo Form::text('client_job', null, array('placeholder' => 'Job','class' => 'form-control')); ?>


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

                            <label>Workplace</label>
                            <?php echo Form::text('client_workplace', null, array('placeholder' => 'Workplace','class' => 'form-control')); ?>


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

                            <label class="required">Nationality</label>
                            <?php echo Form::text('client_national', null, array('placeholder' => 'Nationality','class' => 'form-control','required')); ?>


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

                            <label class="required">Phone</label>
                            
                            <input type="text" class="form-control number-only" name="client_phone1" value="<?php echo e($client->client_phone1); ?>" 
                                        data-inputmask="'mask': ['999-999-9999', '+099 99 99 9999[9]-9999']" data-mask>

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

                            <label for="">Phone 2</label>
                            
                            <input type="text" class="form-control number-only" name="client_phone2" value="<?php echo e($client->client_phone2); ?>" 
                                        data-inputmask="'mask': ['999-999-9999', '+099 99 99 9999[9]-9999']" data-mask>

                        </div>

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

                            <label class="">Personal type</label>
                            <?php echo Form::select('personal_type', array('1'=>'Client By Card','2'=>" Client By Passport"), null, ['class' => 'form-control personal_type select2','']); ?>


                        </div>
                        <!--Client with ID card-->
                        <div class="form-group col-sm-4 col-xs-12 id_card">

                            <label>ID Card</label>
                            <?php echo Form::text('client_cardid',null, array('placeholder' => 'ID Card','class' => 'form-control')); ?>


                        </div>
                        <div class="form-group col-sm-4 col-xs-12 id_card_date">

                            <label>ID Card Date</label>
                            <?php echo Form::text('client_datecard',null, array('placeholder' => 'ID Card Date','class' => 'form-control date_picker')); ?>


                        </div>
                        <div class="form-group col-sm-4 col-xs-12 id_card_valid">

                            <label for="">ID Card Date Valid</label>
                            <?php echo Form::text('client_cardvalid',null, array('placeholder' => 'ID Card Date Valid','class' => 'form-control date_picker')); ?>


                        </div>
                        <!--Client with ID card-->

                        <!--Client with Passport-->
                        <div class="form-group col-sm-4 col-xs-12 passport_id">

                            <label>Passport Number</label>
                            <?php echo Form::text('passport_number', null, array('placeholder' => 'Passport Number','class' => 'form-control passport_number')); ?>


                        </div>
                        <div class="form-group col-sm-4 col-xs-12 passport_date_issue">

                            <label>Passport Date Of Issue</label>
                            <?php echo Form::text('passport_date_issue',null, array('placeholder' => 'Passport Date Of Issue','class' => 'form-control date_picker','autocomplete'=> 'off')); ?>


                        </div>
                        <div class="form-group col-sm-4 col-xs-12 passport_expiry_date">

                            <label for="">Passport Expiry Date</label>
                            <?php echo Form::text('passport_expiry_date', null, array('placeholder' => 'Passport Expiry Date','class' => 'form-control date_picker','autocomplete'=> 'off')); ?>


                        </div>
                        <div class="form-group col-sm-4 col-xs-12 country_of_passport">

                            <label>Country Of Passport</label>
                            <?php echo Form::text('country_of_passport', null, array('placeholder' => 'Country Of Passport','class' => 'form-control')); ?>


                        </div>

                        <div class="form-group col-sm-4 col-xs-12 visa_type">
                            <label>Visa Type</label>
                            <?php echo Form::text('visa_type', null, array('placeholder' => 'Visa Type','class' => 'form-control')); ?>

                        </div>
                        <div class="form-group col-sm-4 col-xs-12 intended_date_of_entry">
                            <label>Intended Date Of Entry</label>
                            <?php echo Form::text('intended_date_of_entry', null, array('placeholder' => 'Intended Date Of Entry','class' => 'form-control date_picker','autocomplete'=> 'off')); ?>

                        </div>
                        <div class="form-group col-sm-4 col-xs-12 port_of_entry">
                            <label>Port Of Entry</label>
                            <?php echo Form::text('port_of_entry', null, array('placeholder' => 'Port Of Entry','class' => 'form-control')); ?>

                        </div>
                        <!--Client with Passport-->


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

                            <label class="required">Province </label>
                            <?php echo Form::select('p_province', $provinces, null, ['class' => 'form-control select2','id'=>'p_province']); ?>

                            <span class="focus-border"></span>

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

                            <label class="required">District </label>
                            <?php echo Form::select('p_district', $districts, null, ['class' => 'form-control select2','id'=>'p_district']); ?>


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

                            <label class="required">Commune </label>
                            <?php echo Form::select('p_commune', $communes, null, ['class' => 'form-control select2','id'=>'p_commune']); ?>


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

                            <label class="required">Village </label>
                            <?php echo Form::select('p_village', $villages, null, ['class' => 'form-control select2','id'=>'p_village']); ?>


                        </div>
                        <div class="form-group col-sm-4 col-xs-12">
                            <label class="">House</label>
                            <?php echo Form::text('house', null, array('placeholder' => 'House','class' => 'form-control')); ?>

                        </div>
                        <div class="form-group col-sm-4 col-xs-12">
                            <label class="">Street</label>
                            <?php echo Form::text('street', null, array('placeholder' => 'Street','class' => 'form-control')); ?>

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

                            <label for="required">Description</label>
                            <?php echo Form::textarea('project_des', null, array('placeholder' => 'Description','class' => 'form-control','rows'=>'2')); ?>

                        </div>
                        <div class="col-sm-12 col-xs-12">
                            <div class="col-sm-2 col-xs-12">
                                <input type="hidden" name="hidden_image_name" value='<?php echo e($client->client_img); ?>'>
                                <img src='/assets/images/resize/<?php echo e($client->client_img); ?>' width="100px" class="hide_img">
                                <div class="imageupload panel panel-default">
                                    <div class="file-tab panel-body">
                                        <label class="btn button_warning btn-file">
                                            <span>Browse</span>
                                            <input type="file" name="image">

                                        </label>
                                        <button type="button" class="btn button_danger">Remove</button>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="col-sm-12 col-xs-12">
                            <div class="form-group">
                                <button type="submit" class="button_sm button_primary pull-right"><span class="fa fa-save"></span> Save</button>
                                <button type="button"  onClick="javascript:history.go(-1)" class="button_sm button_warning pull-right">
                                        <span class=" fa fa-arrow-circle-left"></span> Back</button>

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

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

            </div>
        </div>
    </div>
    </div>
    <?php $__env->stopSection(); ?> <?php $__env->startSection('js'); ?>
    <script type="text/javascript" src="<?php echo e(asset('assets/controller/location.js')); ?>"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            var type=$(".personal_type").val();
            if(type==1){
                $(".id_card").show();
                $(".id_card_date").show();
                $(".id_card_valid").show();
                $(".passport_id").hide();
                $(".passport_date_issue").hide();
                $(".passport_expiry_date").hide();
                $(".country_of_passport").hide();
                $(".visa_type").hide();
                $(".intended_date_of_entry").hide();
                $(".port_of_entry").hide();
            }
            else{
                $(".id_card").hide();
                $(".id_card_date").hide();
                $(".id_card_valid").hide();
                $(".passport_id").show();
                $(".passport_date_issue").show();
                $(".passport_expiry_date").show();
                $(".country_of_passport").show();
                $(".visa_type").show();
                $(".intended_date_of_entry").show();
                $(".port_of_entry").show();
            }
        });
        $(document).on("change",".personal_type",function(){
            var type=1;
            type=$(this).val();
            if(type==1){
                $(".id_card").show();
                $(".id_card_date").show();
                $(".id_card_valid").show();
                $(".passport_id").hide();
                $(".passport_date_issue").hide();
                $(".passport_expiry_date").hide();
                $(".country_of_passport").hide();
                $(".visa_type").hide();
                $(".intended_date_of_entry").hide();
                $(".port_of_entry").hide();
            }
            else{
                $(".id_card").hide();
                $(".id_card_date").hide();
                $(".id_card_valid").hide();
                $(".passport_id").show();
                $(".passport_date_issue").show();
                $(".passport_expiry_date").show();
                $(".country_of_passport").show();
                $(".visa_type").show();
                $(".intended_date_of_entry").show();
                $(".port_of_entry").show();
            }
        });

    </script>
    <?php $__env->stopSection(); ?>
<?php echo $__env->make('adminlte::page', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>