@php use Carbon\Carbon; @endphp
@extends('adminlte::page')

@section('title', 'IPRS | Client Details')

@section('content_header')
    <div class="col-9 mx-auto">
        <div class="row">
            <div class="col-sm-8">
                <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a href="{{ route('dashboard') }}">Dashboard</a></li>
                    <li class="breadcrumb-item"><a href="{{ route('client.index') }}">Clients</a></li>
                    <li class="breadcrumb-item active">{{ ucfirst($client->name_fl) ?? '-' }}</li>
                </ol>
            </div>
            <div class="col-sm-12">
                <h1 class="m-0">{{ ucfirst($client->name_fl) ?? '-' }}</h1>
            </div>
        </div>
    </div>
@stop

@section('content')
    <div class="col-9 mx-auto">
        <div class="card card-widget widget-user shadow mb-4">
            <div class="widget-user-header" style="background-color: #356eac; color: white;">
                <h3 class="widget-user-username">{{ ucfirst($client->name_fl) ?? '-' }}</h3>
                <h5 class="widget-user-desc">{{ $client->address ?? '-' }}</h5>
            </div>
            <div class="widget-user-image">
                <img class="img-circle elevation-2" src="{{ asset('images/photo.webp') }}" alt="{{ $client->name_fl ?? '' }}">
            </div>
            <div class="card-footer">
                <div class="row">
                    <div class="col-sm-4 border-right">
                        <div class="description-block">
                            <span class="description-text">No. of Contracts</span>
                            <h5 class="description-header">{{ $client->contracts->count() ?? '-' }}</h5>
                        </div>

                    </div>

                    <div class="col-sm-4 border-right">
                        <div class="description-block">
                            <span class="description-text">Date Created</span>
                            <h5 class="description-header">{{ Carbon::parse($client->date_created)->format("d-m-Y H:i") ?? '-' }}</h5>
                        </div>

                    </div>

                    <div class="col-sm-4">
                        <div class="description-block">
                            <span class="description-text">Created By</span>
                            <h5 class="description-header">{{ $client->created_by ?? '-' }}</h5>
                        </div>

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

        <div class="tab-pane fade active show" id="client" role="tabpanel" aria-labelledby="client-tab">
            <x-adminlte-card>
                <table class="table table-bordered table-hover" id="client-table">
                    <tr>
                        <td colspan="2" class="text-uppercase" style="background-color: #356eac; color: white;">Organization Details</td>
                    </tr>
                    <tr>
                        <td>
                            <p class="font-weight-bold">ID Code:</p>
                            <p class="mb-0">{{ $client->rid ?? '-' }}</p>
                        </td>
                        <td>
                            <p class="font-weight-bold">Full Name:</p>
                            <p class="mb-0">{{ $client->name_fl ?? '-' }}</p>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p class="font-weight-bold">Address:</p>
                            <p class="mb-0">{{ $client->address ?? '-' }}</p>
                        </td>
                        <td>
                            <p class="font-weight-bold">Bank Account:</p>
                            <p class="mb-0">{{ $client->bank_acc ?? '-' }}</p>
                        </td>
                    </tr>

                    <tr>
                        <td colspan="2" class="text-uppercase" style="background-color: #356eac; color: white;">Company Representative</td>
                    </tr>
                    <tr>
                        <td>
                            <p class="font-weight-bold">Name:</p>
                            <p class="mb-0">{{ $client->boss_name ?? '-' }} {{ $client->boss_surn ?? '-' }}</p>
                        </td>
                        <td>
                            <p class="font-weight-bold">Other Name:</p>
                            <p class="mb-0">{{ $client->boss_othname ?? '-' }}</p>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p class="font-weight-bold">Post in Organisation:</p>
                            <p class="mb-0">{{ $client->boss_post ?? '-' }}</p>
                        </td>
                        <td>
                            <p class="font-weight-bold">Phone Number:</p>
                            <p class="mb-0">{{ $client->boss_phone ?? '-' }}</p>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p class="font-weight-bold">Cell Number (Tel)</p>
                            <p class="mb-0">{{ $client->boss_cell ?? '-' }}</p>
                        </td>
                        <td>
                            <p class="font-weight-bold">Email Address:</p>
                            <p class="mb-0">{{ $client->boss_email ?? '-' }}</p>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="text-uppercase" style="background-color: #356eac; color: white;">Accountant Details</td>
                    </tr>
                    <tr>
                        <td>
                            <p class="font-weight-bold">Name:</p>
                            <p class="mb-0">{{ $client->acc_name ?? '-' }} {{ $client->acc_surn ?? '-' }}</p>
                        </td>
                        <td>
                            <p class="font-weight-bold">Other Name:</p>
                            <p class="mb-0">{{ $client->acc_othname ?? '-'}}</p>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p class="font-weight-bold">Post in Organisation:</p>
                            <p class="mb-0">{{ $client->acc_post ?? '-' }}</p>
                        </td>
                        <td>
                            <p class="font-weight-bold">Phone Number:</p>
                            <p class="mb-0">{{ $client->acc_phone ?? '-' }}</p>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p class="font-weight-bold">Cell Number (Tel)</p>
                            <p class="mb-0">{{ $client->acc_cell ?? '-' }}</p>
                        </td>
                        <td>
                            <p class="font-weight-bold">Email Address:</p>
                            <p class="mb-0">{{ $client->acc_email ?? '-' }}</p>
                        </td>
                    </tr>
                </table>
            </x-adminlte-card>
        </div>
    </div>
@stop

@section('css')
    <!-- <link rel="stylesheet" href="{{ asset('vendor/adminlte/dist/css/styles.css') }}"> -->
@stop

@section('js')

@stop
