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

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

@section('content_header')
    <div class="container">
        <div class="row mb-2">
            <div class="col-sm-6 px-0">
                <ol class="breadcrumb float-sm-left">
                    <li class="breadcrumb-item"><a href="{{ route('dashboard') }}">Dashboard</a></li>
                    <li class="breadcrumb-item"><a href="{{ route('contract.index') }}">Contracts</a></li>
                    <li class="breadcrumb-item active">{{ ucfirst($contract->client->name_fl) ?? '-' }}</li>
                </ol>
            </div>
        </div>
        <div class="row mb-2">
            <div class="col-sm-12">
                <h1 class="m-0">{{ ucfirst($contract->client->name_fl)  ?? '-' }}</h1>
            </div>
        </div>
    </div>
@stop

@section('content')
    <div class="container">
        <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($contract->client->name_fl) ?? '' }}</h3>
                <h5 class="widget-user-desc">{{ $contract->client->address ?? '-' }}</h5>
            </div>
            <div class="widget-user-image">
                <img class="img-circle elevation-2" src="{{ asset('images/photo.webp') }}" alt="{{ $contract->client->name_fl ?? '' }}">
            </div>
            <div class="card-footer">
                <div class="row">
                    <div class="col-sm-3 border-right">
                        <div class="description-block">
                            <span class="description-text">No. of Contracts</span>
                            <h5 class="description-header">{{ $contract->count() ?? '-' }}</h5>
                        </div>
                    </div>

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

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

                    <div class="col-sm-3">
                        <div class="description-block">
                            <span class="description-text">Tokens</span>
                            <h5 class="description-header">{{ $contract->token ?? '-' }}</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;">Client Details</td>
                    </tr>
                    <tr>
                        <td>
                            <p class="font-weight-bold">Contract Number:</p>
                            <p class="mb-0">{{ $contract->rid ?? '-' }}</p>
                        </td>
                        <td>
                            <p class="font-weight-bold">Full Name:</p>
                            <p class="mb-0">{{ ucfirst($contract->client->name_fl) ?? '-' }}</p>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p class="font-weight-bold">Date of Issue:</p>
                            <p class="mb-0">{{ Carbon::parse($contract->d_doc)->format("d-m-Y") ?? '-' }}</p>
                        </td>
                        <td>
                            <p class="font-weight-bold">Start Date:</p>
                            <p class="mb-0">{{ Carbon::parse($contract->d_bgn)->format("d-m-Y") ?? '-' }}</p>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p class="font-weight-bold">Expiry Date:</p>
                            <p class="mb-0">{{ Carbon::parse($contract->d_end)->format("d-m-Y") ?? '-' }}</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">{{ ucfirst($contract->manager_surn) ?? '-' }} {{ ucfirst($contract->manager_name) ?? '-' }}</p>
                        </td>
                        <td>
                            <p class="font-weight-bold">Other Name:</p>
                            <p class="mb-0">{{ $contract->manager_othnam ?? '-' }}</p>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p class="font-weight-bold">Post:</p>
                            <p class="mb-0">{{ ucfirst($contract->manager_post) ?? '-' }}</p>
                        </td>
                        <td>
                            <p class="font-weight-bold">Phone Number:</p>
                            <p class="mb-0">{{ $contract->manager_phone ?? '-' }}</p>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p class="font-weight-bold">Cell Number</p>
                            <p class="mb-0">{{ $contract->manager_cell ?? '-' }}</p>
                        </td>
                        <td>
                            <p class="font-weight-bold">Email Address:</p>
                            <p class="mb-0">{{ $contract->manager_email ?? '-' }}</p>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="text-uppercase" style="background-color: #356eac; color: white;">Account Details</td>
                    </tr>
                    <tr>
                        <td>
                            <p class="font-weight-bold">Credit Limit:</p>
                            <p class="mb-0">0.00</p>
                        </td>
                        <td>
                            <p class="font-weight-bold">Notification Limit:</p>
                            <p class="mb-0">0.00</p>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="text-uppercase" style="background-color: #356eac; color: white;">Contract Access</td>
                    </tr>
                    <tr>
                            <td class="column">
                                <p><strong>Posted by:</strong></p>
                                <div class="form-check">
                                    <input class="form-check-input" type="checkbox" id="flexCheckDefault1">
                                    <label class="form-check-label" for="flexCheckDefault1">
                                        Internet <a href="" class="access"><strong><u><em>view access</em></u></strong></a>
                                    </label>
                                </div>
                                <div class="form-check">
                                    <input class="form-check-input" type="checkbox" id="flexCheckDefault2">
                                    <label class="form-check-label" for="flexCheckDefault2">
                                        SMS <a href="" class="access"><strong><u><em>view access</em></u></strong></a>
                                    </label>
                                </div>
                                <div class="form-check">
                                    <input class="form-check-input" type="checkbox" id="flexCheckDefault3">
                                    <label class="form-check-label" for="flexCheckDefault3">
                                        E-Mail <a href="" class="access"><strong><u><em>view access</em></u></strong></a>
                                    </label>
                                </div>
                                <div class="form-check">
                                    <input class="form-check-input" type="checkbox" id="flexCheckDefault4">
                                    <label class="form-check-label" for="flexCheckDefault4">
                                        Web-Service <a href="" class="access"><strong><u><em>view access</em></u></strong></a>
                                    </label>
                                </div>
                            </td>
                            <td class="column">
                                <p><strong>Payment type:</strong></p>
                                <div class="form-check">
                                    <input class="form-check-input" type="radio" name="flexRadioDefault" id="flexRadioDefault1">
                                    <label class="form-check-label" for="flexRadioDefault1">
                                        Post-paid
                                    </label>
                                </div>
                                <div class="form-check">
                                    <input class="form-check-input" type="radio" name="flexRadioDefault" id="flexRadioDefault2">
                                    <label class="form-check-label" for="flexRadioDefault2">
                                        Pre-paid
                                    </label>
                                </div>
                                <div class="form-check">
                                    <input class="form-check-input" type="radio" name="flexRadioDefault" id="flexRadioDefault3">
                                    <label class="form-check-label" for="flexRadioDefault3">
                                        Free
                                    </label>
                                </div>
                            </td>
                    </tr>
                </table>
            </x-adminlte-card>
        </div>
    </div>
@stop

@section('css')
    <style>
        fieldset {
            background-color: white;
            padding-block-start: 0.35em;
            padding-inline-start: 1.25em;
            padding-inline-end: 1.25em;
            padding-block-end: 0.625em;
            margin: 0 0 1em 0;
            border: 1px groove rgb(192, 192, 192);
            border-radius: 5px;
        }

        legend {
            background-color: #356eac;
            color: white;
            width: auto;
            font-size: medium;
            padding: 5px 10px;
            border-radius: 5px;
        }

        .access{
            margin-left: 10px;
        }

        .content-header .breadcrumb{
            padding-left: 10px;
        }

        .row{
            margin-bottom: 20px;
        }

    </style>
@stop

@section('js')

@stop
