<div class="mt-0 pb-1">
    <div class="d-flex align-items-center mb-1 pt-2 pb-1 border-top">
        <h6 class="my-0 font-weight-bold text-secondary">Programs</h6>
    </div>
    <table class="table table-bordered table-sm table-striped m-0">
        <tbody>
        <?php $programNumber = 1; ?>
        @foreach($patient->clientPrograms as $clientProgram)
            <?php $program = $clientProgram; ?>
            <tr>
                <td class="text-black px-2 py-3">
                    <div class="d-flex align-items-center pb-1">
                        <span class="font-weight-bold">{{ $programNumber }}. {{ $program->title }}</span>
                        <span class="mx-2 text-secondary ml-auto"><i class="fa fa-clock"></i></span>
                        <?php $programMonth = $program->getProgramMonth(strtoupper(date('F')), date('Y')); ?>
                        <b class="text-success">{{ $programMonth ? $programMonth->time_in_minutes : 0 }}</b>&nbsp;mins billed
                        <span class="mx-2 text-secondary">|</span>
                        <b>{{ $program->max_monthly_time_in_minutes - ($programMonth ? $programMonth->time_in_minutes : 0) }}</b>&nbsp;mins remaining
                    </div>
                    <?php $programNumber++; ?>
                    <div class="mt-1 pl-3 d-flex align-items-center flex-wrap">
                        <span class="pr-1">MCP: <b class="text-secondary">{{ $clientProgram->mcp ? $clientProgram->mcp->displayName() : '' }}</b></span>
                        <span class="mx-2 text-secondary on-hover-opaque">|</span>
                        <span class="pr-1">Manager: <b class="text-secondary">{{ $clientProgram->manager ? $clientProgram->manager->displayName() : '' }}</b></span>
                    </div>
                    <div class="mt-1 pl-3 d-flex align-items-center flex-wrap">
                        <span class="pr-1">OB Visit: <b class="text-secondary">{{ $clientProgram->has_mcp_done_onboarding_visit }}</b></span>
                        <span class="mx-2 text-secondary on-hover-opaque">|</span>
                        <span class="pr-1">Setup: <b class="text-secondary">{{ $clientProgram->is_setup_complete }}</b></span>
                    </div>
                </td>
            </tr>
        @endforeach
        </tbody>
    </table>
    @if(!$patient->clientPrograms || count($patient->clientPrograms) === 0)
        <div class="p-2 border-top">
            <span class="text-secondary">
                No programs
            </span>
        </div>
    @endif
</div>

