<script>
    $(document).ready(function (){
        $('#category-list').select2();
        $('#module-list').select2();
        $('#mini-cover-list').select2();
        $('#branch-list').select2();
        $('#corporate-categories').select2();
        $('#gender-list').select2();

    });
</script>

{!! Form::open(['route'=>['client.storeEditClientDetails', 'id'=>$id], 'method'=>'POST', 'id'=>'edit-client-account']) !!}
<div class="error" style="text-align: center;"><b>On this Window, You can Update Client Account Details</b></div><br>
<div class="guestDetails_inputDivider"></div>
<button type="submit" disabled style="display: none" aria-hidden="true"></button>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        {!! Form::label('branch', 'Select Branch') !!}<sapn class="error">*</sapn>
    </div>
    <div class="guestDetails_input">
        <select name="branch" id="branch-list" style="width: 80px">
            @if($client->branchDetails != null)
                <option value="{{$client->branch}}">{!! strtoupper($client->branchDetails->name) !!}</option>
            @endif
            <option value="">--Select Branch--</option>
            @foreach(app('CompanyBranches') as $branch)
                <option value="{{$branch->id}}">{!! strtoupper($branch->name) !!}</option>
            @endforeach
        </select>
    </div>
</div>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        {!! Form::label('module', 'Accessible Module') !!}<sapn class="error">*</sapn>
    </div>
    <div class="guestDetails_input">
        <select name="module" id="module-list" style="width: 100px">
            @if($client->module != null)
                <option value="{{$client->module}}">{!! $client->module !!}</option>
            @endif
            <option value="">--Select Module--</option>
            <option value="All">All Modules</option>
            <option value="General">General</option>
        </select>
    </div>
</div>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        {!! Form::label('file-no', 'File Number') !!}<sapn class="error">*</sapn>
    </div>
    <div class="guestDetails_input">
        {!! Form::text('file-no', $client->fl_no, ['class'=>'input-text-height','size'=>'8', 'readonly'=>true]) !!}
    </div>
</div>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        {!! Form::label('category', 'Category') !!}<sapn class="error">*</sapn>
    </div>
    <div class="guestDetails_input">
        <select name="category" id="category-list" style="width: 100px">
            @if($client->category == 1)
                <option value="1">Corporate</option>
            @else
                <option value="0">Individual</option>
            @endif
            <option value="">--Select Category--</option>
            <option value="0">Individual</option>
            <option value="1">Corporate</option>
        </select>
    </div>
</div>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        {!! Form::label('sub-category', 'Sub Category:') !!}
        <span class="error">*</span>
    </div>
    <div class="guestDetails_input">
        <select name="corporate-category" id="corporate-categories"  style="width: 120px">
            <option value="">--Select Sub-Category--</option>
            <option value="Government Institution">Government Institution</option>
            <option value="Multinational">Multinational</option>
            <option value="Industrial">Industrial</option>
            <option value="Retail">Retail</option>
            <option value="SME">SME</option>
        </select>
    </div>
</div>
<div class="guestDetails_inputDividerNone"></div>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        {!! Form::label('title', 'Client Title') !!}
        <span class="error">*</span>
    </div>
    <div class="guestDetails_input">
        {!! Form::text('title', $client->title ?? '', ['class'=>'input-text-height', 'size'=>'10', 'autocomplete'=>'off', 'placeholder'=>'Mr/Mrs/Miss']) !!}
    </div>
</div>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        {!! Form::label('gender', 'Gender') !!}
        <span class="error">*</span>
    </div>
    <div class="guestDetails_input">
        <select name="gender" id="gender-list"  style="width: 100px">
            @if($client->gnd != '')
                <option value="{{$client->gnd}}">{!! $client->gnd !!}</option>
            @endif
            <option value="">--Select Gender--</option>
            <option value="Male">Male</option>
            <option value="Female">Female</option>
            <option value="Other">Other</option>
        </select>
    </div>
</div>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        {!! Form::label('names', 'Client Full Names') !!}
        <span class="error">*</span>
    </div>
    <div class="guestDetails_input">
        {!! Form::text('names', strtoupper($client->nms) ?? '', ['class'=>'input-text-height', 'size'=>'57', 'autocomplete'=>'off', 'placeholder'=>'Enter Client Full names']) !!}
    </div>
</div>
<div class="guestDetails_inputDividerNone"></div>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        {!! Form::label('phone', 'Client Phone No.') !!}
        <span class="error">*</span>
    </div>
    <div class="guestDetails_input">
        {!! Form::text('phone', $client->pn ?? '', ['class'=>'input-text-height', 'size'=>'33', 'autocomplete'=>'off']) !!}
    </div>
</div>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        {!! Form::label('email-address', 'Client Email Address.') !!}
        <span class="error">*</span>
    </div>
    <div class="guestDetails_input">
        {!! Form::text('email', $client->em ?? '', ['class'=>'input-text-height', 'size'=>'57', 'autocomplete'=>'off']) !!}
    </div>
</div>
<div class="guestDetails_inputDividerNone"></div>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        {!! Form::label('alt-phone', 'Alternative Phone No.') !!}
        <span class="error">*</span>
    </div>
    <div class="guestDetails_input">
        {!! Form::text('alt-phone', $client->alt_pn ?? '', ['class'=>'input-text-height', 'size'=>'33', 'autocomplete'=>'off']) !!}
    </div>
</div>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        {!! Form::label('alt-email', 'Alternative Email Address.') !!}
        <span class="error">*</span>
    </div>
    <div class="guestDetails_input">
        {!! Form::text('alt-email', $client->alt_em ?? '', ['class'=>'input-text-height', 'size'=>'57', 'autocomplete'=>'off']) !!}
    </div>
</div>
<div class="guestDetails_inputDividerNone"></div>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        {!! Form::label('id-no', 'Id No/Passport/CoI.') !!}
        <span class="error">*</span>
    </div>
    <div class="guestDetails_input">
        {!! Form::text('id-no', $client->id_no ?? '', ['class'=>'input-text-height', 'size'=>'33', 'autocomplete'=>'off']) !!}
    </div>
</div>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        {!! Form::label('kra-pin', 'PIN') !!}
        <span class="error">*</span>
    </div>
    <div class="guestDetails_input">
        {!! Form::text('pin', $client->pin ?? '', ['class'=>'input-text-height', 'size'=>'33', 'autocomplete'=>'off']) !!}
    </div>
</div>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        {!! Form::label('dob', 'Date Of Birth') !!}
        <span class="error">*</span>
    </div>
    <div class="guestDetails_input">
        @if($client->dob != null)
            {!! Form::date('dob', date('Y-m-d', strtotime($client->dob)), ['class'=>'input-text-height', 'size'=>'30', 'autocomplete'=>'off']) !!}
        @else
            {!! Form::date('dob', '', ['class'=>'input-text-height', 'size'=>'30', 'autocomplete'=>'off']) !!}
        @endif
    </div>
</div>
<div class="guestDetails_inputDividerNone"></div>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        {!! Form::label('box', 'P.O Box') !!}
        <span class="error">*</span>
    </div>
    <div class="guestDetails_input">
        {!! Form::text('box', $client->pob ?? '', ['class'=>'input-text-height', 'size'=>'33', 'autocomplete'=>'off']) !!}
    </div>
</div>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        {!! Form::label('address', 'Address') !!}
        <span class="error">*</span>
    </div>
    <div class="guestDetails_input">
        {!! Form::text('address', $client->address ?? '', ['class'=>'input-text-height', 'size'=>'33', 'autocomplete'=>'off']) !!}
    </div>
</div>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        {!! Form::label('occupation', 'Occupation') !!}
        <span class="error">*</span>
    </div>
    <div class="guestDetails_input">
        {!! Form::text('occupation', $client->occp ?? '', ['class'=>'input-text-height', 'size'=>'15', 'autocomplete'=>'off']) !!}
    </div>
</div>


{!! Form::close() !!}
