 @extends('adminlte::page') @section('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="#">Operation</a></li>
            <li><a href="#">Manage Client</a></li>
            <li><a href="#">Client Relationship List</a></li>
            <li><a href="#">Create</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>Client Relationship</h3>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12 col-xs-12">
                @if (count($errors) > 0)
                <div class="alert-message alert-danger">
                    <strong>Whoops!</strong> There were some problems with your input.
                    <ul>
                        @foreach ($errors->all() as $error)
                        <li>{{ $error }}</li>
                        @endforeach
                    </ul>
                </div>
                @endif
                <div class="form-wrapper">
                    {!! Form::open(array('route' => 'clients-relationship.store','method'=>'POST','enctype'=>'multipart/form-data')) !!}
                    <div class="row">
                        <!-- <div class="form-group col-sm-6 col-xs-12">
                            <label class="required">Relationship</label>
                            {!! Form::text('clientship_is', null, array('placeholder' => 'relationship','class' => 'form-control','required')) !!}
                        </div> -->
                        <div class="form-group col-sm-6 col-xs-12">
                            <label class="required">Client Fullname</label>
                            {!! Form::text('clientship_fullname', null, array('placeholder' => 'Client Fullname','class' => 'form-control','required')) !!}
                        </div>
                        <div class="form-group col-sm-6 col-xs-12">

                            <label class="required">Gender</label>
                            <select name="clientship_gender" id="" class="select2 form-control">
                                <option value="Male">Male</option>
                                <option value="Female">Female</option>
                            </select>

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

                            <label class="required">Client DOB</label>
                            {!! Form::text('clientship_dob', null, array('placeholder' => 'Client DOB','class' => 'form-control date_picker','required')) !!}

                        </div>

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

                            <label>Nationality</label>
                            {!! Form::text('clientship_national', null, array('placeholder' => 'Nationality','class' => 'form-control')) !!}

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

                            <label>Phone</label>
                            {{-- {!! Form::text('clientship_phone1', null, array('placeholder' => 'Phone','class' => 'form-control number-only','required')) !!} --}}

                            <input type="text" class="form-control number-only" name="clientship_phone1" data-inputmask="'mask': ['999-999-9999', '+099 99 99 9999[9]-9999']" data-mask placeholder="Phone Number">

                        </div>

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

                            <label for="">Phone 2</label>
                            {{-- {!! Form::text('clientship_phone2', null, array('placeholder' => 'Phone 2','class' => 'form-control number-only')) !!} --}}
                            <input type="text" class="form-control number-only" name="clientship_phone2" data-inputmask="'mask': ['999-999-9999', '+099 99 99 9999[9]-9999']" data-mask placeholder="Phone Number">

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

                            <label class="required">Personal Type</label>
                            {!! Form::select('personal_type', ["1"=>"By ID Card","2"=>"By Passport"],1, array('class' => 'form-control select2','required','id'=>'personal-type')) !!}

                        </div>
                        <div id="append-personal-type">
                            <div class="form-group col-sm-6 col-xs-12">

                                <label class="required">ID Card</label>
                                {!! Form::text('clientship_cardid', null, array('placeholder' => 'ID Card','class' => 'form-control','required')) !!}

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

                                <label>ID Card Date</label>
                                {!! Form::text('clientship_datecard', null, array('placeholder' => 'ID Card Date','class' => 'form-control date_picker')) !!}

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

                                <label for="">ID Card Date Valid</label>
                                {!! Form::text('clientship_cardvalid', null, array('placeholder' => 'ID Card Date Valid','class' => 'form-control date_picker')) !!}

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

                            <label class="required">Province </label>
                            {!! Form::select('p_province', $provinces, null, ['class' => 'form-control select2','id'=>'p_province','required']) !!}

                        </div>

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

                            <label  class="required">District </label>
                            <select class="select2 form-control" id="p_district" name="p_district" required>
                                <option value="" disabled selected>Please Choose</option>

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

                            <label  class="required">Commune </label>
                            <select class="select2 form-control" id="p_commune" name="p_commune" required>
                                <option value="" disabled selected>Please Choose</option>

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

                            <label  class="required">Village </label>
                            <select class="select2 form-control" id="p_village" name="p_village" required>
                                <option value="" disabled selected>Please Choose</option>
                            </select>
                        </div>
                        <div class="form-group col-sm-6 col-xs-12">
                            <label class="">House</label>
                            {!! Form::text('house', null, array('placeholder' => 'House','class' => 'form-control')) !!}
                        </div>
                        <div class="form-group col-sm-6 col-xs-12">
                            <label class="">Street</label>
                            {!! Form::text('street', null, array('placeholder' => 'Street','class' => 'form-control')) !!}
                        </div>
                        {{--<div class="form-group col-sm-6 col-xs-12">--}}

                            {{--<label class="required">Address</label>--}}
                            {{--{!! Form::textarea('clientship_address', null, array('placeholder' => 'Address','class' => 'form-control','rows'=>'2','required')) !!}--}}

                        {{--</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>

                {!! Form::close() !!}
            </div>
        </div>
    </div>
    </div>
    @endsection @section('js')
    <script type="text/javascript" src="{{asset('assets/controller/location.js')}}"></script>
    <script type="text/javascript">
        $(document).on("change","#personal-type",function(){
            $("#append-personal-type").empty();
            var opt="";
            if($(this).val()==1){
                opt = `<div class="form-group col-sm-6 col-xs-12">

                            <label class="required">ID Card</label>
                            {!! Form::text('clientship_cardid', null, array('placeholder' => 'ID Card','class' => 'form-control','required')) !!}

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

                            <label>ID Card Date</label>
                            {!! Form::text('clientship_datecard', null, array('placeholder' => 'ID Card Date','class' => 'form-control date_picker')) !!}

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

                            <label for="">ID Card Date Valid</label>
                            {!! Form::text('clientship_cardvalid', null, array('placeholder' => 'ID Card Date Valid','class' => 'form-control date_picker')) !!}

                        </div>`;
            }else{
                opt = `<!--Client with Passport-->
                        <div class="form-group col-sm-6 col-xs-12">

                            <label>Passport Number</label>
                            {!! Form::text('passport_number', null, array('placeholder' => 'Passport Number','class' => 'form-control')) !!}

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

                            <label>Passport Date Of Issue</label>
                            {!! 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-6 col-xs-12 ">

                            <label for="">Passport Expiry Date</label>
                            {!! 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-6 col-xs-12 ">

                            <label>Country Of Passport</label>
                            {!! Form::text('country_of_passport', null, array('placeholder' => 'Country Of Passport','class' => 'form-control')) !!}

                        </div>

                        <div class="form-group col-sm-6 col-xs-12">
                            <label>Visa Type</label>
                            {!! Form::text('visa_type', null, array('placeholder' => 'Visa Type','class' => 'form-control')) !!}
                        </div>
                        <div class="form-group col-sm-6 col-xs-12">
                            <label>Intended Date Of Entry</label>
                            {!! 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-6 col-xs-12">
                            <label>Port Of Entry</label>
                            {!! Form::text('port_of_entry', null, array('placeholder' => 'Port Of Entry','class' => 'form-control')) !!}
                        </div>
                        <!--Client with Passport-->`;
            }
            $("#append-personal-type").append(opt);
            $(".date_picker").datepicker();
        });
    </script>
    @endsection