@extends('pro.my_teams.view')
@section('content-inner')

    <div class="row mt-3">
    <div class="col-8">

        <div class="table-responsive p-0 bg-white table-sm mb-3">
    <table class="table table-hover text-nowrap table-striped border-left border-right border-bottom">
        <thead>
        <tr>
            <th colspan="2" class="px-2">Basic Details
                <span class="ml-auto"><a up-modal=".form-contents" up-width="800" up-history="false" href='/my_teams/view/<?= $record->uid ?>/ACTION_updateTeamNumber' title='Update Team Number' class='ml-2 text-dark font-weight-normal'><i class='fa fa-pencil-alt text-sm'></i></a></span>
            </th>
        </tr>
        </thead>
        <tbody>
            <tr><td class="w-25 px-2 text-secondary border-right">Team Number</td><td class="w-75 px-2 font-weight-bold"><?= $record->team_number ?><a up-modal=".form-contents" up-width="800" up-history="false" href='/my_teams/view/<?= $record->uid ?>/ACTION_updateTeamNumber' title='Update Team Number' class='ml-2 text-dark font-weight-normal'><i class='fa fa-pencil-alt text-sm'></i></a></td></tr>
<tr><td class="w-25 px-2 text-secondary border-right">Created At</td><td class="w-75 px-2 font-weight-bold"><?= $record->created_at ?></td></tr>
<tr><td class="w-25 px-2 text-secondary border-right">Clients</td><td class="w-75 px-2 font-weight-bold"><?php $_r = \Illuminate\Support\Facades\DB::select("select '- TODO -' as result");
echo ($_r && count($_r)) ? $_r[0]->result : '-'; ?></td></tr>
<tr><td class="w-25 px-2 text-secondary border-right">Active</td><td class="w-75 px-2 font-weight-bold"><?php $_r = \Illuminate\Support\Facades\DB::select("SELECT d as result FROM (VALUES ('1','Yes'),('','No')) T(v,d) WHERE v = '" . ($record->is_active ? $record->is_active : -1) . "' limit 1");
echo ($_r && count($_r)) ? $_r[0]->result : '-'; ?>@if( $record->is_active) <a up-modal=".form-contents" up-width="800" up-history="false" href='/my_teams/view/<?= $record->uid ?>/ACTION_deactivate' title='Deactivate' class='ml-2 text-dark font-weight-normal'><i class='fa fa-pencil-alt text-sm'></i></a> @endif
@if(! $record->is_active) <a up-modal=".form-contents" up-width="800" up-history="false" href='/my_teams/view/<?= $record->uid ?>/ACTION_reactivate' title='Reactivate' class='ml-2 text-dark font-weight-normal'><i class='fa fa-pencil-alt text-sm'></i></a> @endif</td></tr>
        </tbody>
    </table>
</div>

<div class="table-responsive p-0 bg-white table-sm mb-3">
    <table class="table table-hover text-nowrap table-striped border-left border-right border-bottom">
        <thead>
        <tr>
            <th colspan="2" class="px-2">Associated Pros
                <span class="ml-auto"><!-- __GROUP_ACTION__ --></span>
            </th>
        </tr>
        </thead>
        <tbody>
            <tr><td class="w-25 px-2 text-secondary border-right">HCP Pro</td><td class="w-75 px-2 font-weight-bold"><?= value_from_rs($result_pros, 'name_display', [['id', '=', $record->hcp_pro_id], ], 'all'); ?></td></tr>
<tr><td class="w-25 px-2 text-secondary border-right">Ally Pro</td><td class="w-75 px-2 font-weight-bold"><?= value_from_rs($result_pros, 'name_display', [['id', '=', $record->ally_pro_id], ], 'all'); ?></td></tr>
        </tbody>
    </table>
</div>


    </div>
    <div class="col-4">
        <div class="border-left h-100 pl-3">
            @include('pro/my_teams/actions')
        </div>
    </div>
</div>


@endsection
