<?php

use App\Models\Client;
use App\Models\Point;
use App\Models\Note;
/** @var Client $patient */
/** @var Note $note */

$point = Point::getGlobalSingletonOfCategory($patient, 'LIFESTYLE_PHYSICAL_ACTIVITY', false);

if ($point && @$point->data) {
    $contentData = $point->data;
?>

<div id="v2_physical_assessment_Section" class="mt-3">

    <p class="font-weight-bold my-3 font-size-14"><i>Exercise</i></p>
    <p><b>EXERCISE HABITS: AEROBIC/CARDIO TRAINING</b></p>
    <div class="d-flex align-items-baseline mb-3">
        <div class="pr-2 text-secondary font-weight-bold width-30px">a.</div>
        <div class="flex-grow-1">
            <div class="row">
                <div class="col-8">
                    During the average week, how many <b>days</b> do you exercise at a moderate to strenuous
                    intensity
                    (i.e. brisk walking or enough to break a light sweat)?
                </div>
                <div class="col-4">
                    <div class="d-flex">
                        <?= @$contentData->days_exercise ?> days
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="d-flex align-items-baseline mb-3">
        <div class="pr-2 text-secondary font-weight-bold width-30px">b.</div>
        <div class="flex-grow-1">
            <div class="row">
                <div class="col-8">
                    During an average session, how many <b>minutes</b> do you exercise at a moderate to
                    strenuous
                    intensity (i.e. brisk walking or enough movement to break a light sweat)?
                </div>
                <div class="col-4">
                    <div class="d-flex">
                        <?= @$contentData->min_exercise ?> mins
                    </div>
                    <span><b><?= @$contentData->total_exercise ?></b> Total min/week (days x min)</span>
                </div>
            </div>
        </div>
    </div>
    <div class="d-flex align-items-baseline mb-3">
        <div class="pr-2 text-secondary font-weight-bold width-30px">c.</div>
        <div class="flex-grow-1">
            <div class="row">
                <div class="col-8">
                    List types of activities you do (i.e. weightlifting, Pilates, kettle ball, resistance
                    machines,
                    exercise bands, etc.):
                </div>
                <div class="col-4">
                    <?= @$contentData->activities_done ?>
                </div>
            </div>
        </div>
    </div>
    <div class="row mb-3">
        <div class="col-6">
            <p><b>What MOTIVATES you or would motivate you to exercise?</b> <em>Check top three</em></p>
            <table class="table table-sm table-striped table-bordered m-0">
                <tbody>
                <tr>
                    <td class="text-nowrap align-middle width-40px text-center">
                        <?php if (@$contentData->exercise_motivation && in_array('Nothing would motivate me', $contentData->exercise_motivation)): ?>
                        <i class="fa fa-check"></i>
                        <?php endif; ?>
                    </td>
                    <td class="text-nowrap align-middle" colspan="2">Nothing would motivate me</td>
                </tr>
                <tr>
                    <td class="text-nowrap align-middle width-40px text-center">
                        <?php if (@$contentData->exercise_motivation && in_array('Control Blood glucose', $contentData->exercise_motivation)): ?>
                        <i class="fa fa-check"></i>
                        <?php endif; ?>
                    </td>
                    <td class="text-nowrap align-middle" colspan="2">Control Blood glucose</td>
                </tr>
                <tr>
                    <td class="text-nowrap align-middle width-40px text-center">
                        <?php if (@$contentData->exercise_motivation && in_array('Decrease stress', $contentData->exercise_motivation)): ?>
                        <i class="fa fa-check"></i>
                        <?php endif; ?>
                    </td>
                    <td class="text-nowrap align-middle" colspan="2">Decrease stress</td>
                </tr>
                <tr>
                    <td class="text-nowrap align-middle width-40px text-center">
                        <?php if (@$contentData->exercise_motivation && in_array('Increase self-esteem', $contentData->exercise_motivation)): ?>
                        <i class="fa fa-check"></i>
                        <?php endif; ?>
                    </td>
                    <td class="text-nowrap align-middle" colspan="2">Increase self-esteem</td>
                </tr>
                <tr>
                    <td class="text-nowrap align-middle width-40px text-center">
                        <?php if (@$contentData->exercise_motivation && in_array('Family or partner', $contentData->exercise_motivation)): ?>
                        <i class="fa fa-check"></i>
                        <?php endif; ?>
                    </td>
                    <td class="text-nowrap align-middle" colspan="2">Family or partner</td>
                </tr>
                <tr>
                    <td class="text-nowrap align-middle width-40px text-center">
                        <?php if (@$contentData->exercise_motivation && in_array('Body Image', $contentData->exercise_motivation)): ?>
                        <i class="fa fa-check"></i>
                        <?php endif; ?>
                    </td>
                    <td class="text-nowrap align-middle" colspan="2">Body Image</td>
                </tr>
                <tr>
                    <td class="text-nowrap align-middle width-40px text-center">
                        <?php if (@$contentData->exercise_motivation && in_array('Prevent heart disease', $contentData->exercise_motivation)): ?>
                        <i class="fa fa-check"></i>
                        <?php endif; ?>
                    </td>
                    <td class="text-nowrap align-middle" colspan="2">Prevent heart disease</td>
                </tr>
                <tr>
                    <td class="text-nowrap align-middle width-40px text-center">
                        <?php if (@$contentData->exercise_motivation && in_array('Improve mood', $contentData->exercise_motivation)): ?>
                        <i class="fa fa-check"></i>
                        <?php endif; ?>
                    </td>
                    <td class="text-nowrap align-middle" colspan="2">Improve mood</td>
                </tr>
                <tr>
                    <td class="text-nowrap align-middle width-40px text-center">
                        <?php if (@$contentData->exercise_motivation && in_array('Increase Energy', $contentData->exercise_motivation)): ?>
                        <i class="fa fa-check"></i>
                        <?php endif; ?>
                    </td>
                    <td class="text-nowrap align-middle" colspan="2">Increase Energy</td>
                </tr>
                <tr>
                    <td class="text-nowrap align-middle width-40px text-center">
                        <?php if (@$contentData->exercise_motivation && in_array('Prevent Bone loss', $contentData->exercise_motivation)): ?>
                        <i class="fa fa-check"></i>
                        <?php endif; ?>
                    </td>
                    <td class="text-nowrap align-middle" colspan="2">Prevent Bone loss</td>
                </tr>
                <tr>
                    <td class="text-nowrap align-middle width-40px text-center">
                        <?php if (@$contentData->exercise_motivation && in_array('Weight reduction', $contentData->exercise_motivation)): ?>
                        <i class="fa fa-check"></i>
                        <?php endif; ?>
                    </td>
                    <td class="text-nowrap align-middle" colspan="2">Weight reduction</td>
                </tr>
                <tr>
                    <td class="text-nowrap align-middle width-40px text-center">
                        <?php if (@$contentData->exercise_motivation && in_array('Reduce blood pressure', $contentData->exercise_motivation)): ?>
                        <i class="fa fa-check"></i>
                        <?php endif; ?>
                    </td>
                    <td class="text-nowrap align-middle" colspan="2">Reduce blood pressure</td>
                </tr>
                <tr>
                    <td class="text-nowrap align-middle width-40px text-center">
                        <?php if (@$contentData->exercise_motivation && in_array('Improve sleep', $contentData->exercise_motivation)): ?>
                        <i class="fa fa-check"></i>
                        <?php endif; ?>
                    </td>
                    <td class="text-nowrap align-middle" colspan="2">Improve sleep</td>
                </tr>
                <tr>
                    <td class="text-nowrap align-middle width-40px text-center">
                        <?php if (@$contentData->exercise_motivation && in_array('Other', $contentData->exercise_motivation)): ?>
                        <i class="fa fa-check"></i>
                        <?php endif; ?>
                    </td>
                    <td class="text-nowrap align-middle">Other</td>
                    <td class="p-0">
                        <?= @$contentData->exercise_motivation_other ?>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="col-6">
            <p><b>Are there any BARRIERS or PROBLEMS that limit exercise?</b> <em>Check all that apply</em></p>
            <table class="table table-sm table-striped table-bordered m-0">
                <tbody>
                <tr>
                    <td class="text-nowrap align-middle width-40px text-center">
                        <?php if (@$contentData->barriers_exercise && in_array('No barriers', $contentData->barriers_exercise)): ?>
                        <i class="fa fa-check"></i>
                        <?php endif; ?>
                    </td>
                    <td class="text-nowrap align-middle" colspan="2">No barriers</td>
                </tr>
                <tr>
                    <td class="text-nowrap align-middle width-40px text-center">
                        <?php if (@$contentData->barriers_exercise && in_array('Life Transition Period', $contentData->barriers_exercise)): ?>
                        <i class="fa fa-check"></i>
                        <?php endif; ?>
                    </td>
                    <td class="text-nowrap align-middle" colspan="2">Life Transition Period</td>
                </tr>
                <tr>
                    <td class="text-nowrap align-middle width-40px text-center">
                        <?php if (@$contentData->barriers_exercise && in_array('Family Responsibility', $contentData->barriers_exercise)): ?>
                        <i class="fa fa-check"></i>
                        <?php endif; ?>
                    </td>
                    <td class="text-nowrap align-middle" colspan="2">Family Responsibility</td>
                </tr>
                <tr>
                    <td class="text-nowrap align-middle width-40px text-center">
                        <?php if (@$contentData->barriers_exercise && in_array('Depression', $contentData->barriers_exercise)): ?>
                        <i class="fa fa-check"></i>
                        <?php endif; ?>
                    </td>
                    <td class="text-nowrap align-middle" colspan="2">Depression</td>
                </tr>
                <tr>
                    <td class="text-nowrap align-middle width-40px text-center">
                        <?php if (@$contentData->barriers_exercise && in_array('Time', $contentData->barriers_exercise)): ?>
                        <i class="fa fa-check"></i>
                        <?php endif; ?>
                    </td>
                    <td class="text-nowrap align-middle" colspan="2">Time</td>
                </tr>
                <tr>
                    <td class="text-nowrap align-middle width-40px text-center">
                        <?php if (@$contentData->barriers_exercise && in_array('Apparel', $contentData->barriers_exercise)): ?>
                        <i class="fa fa-check"></i>
                        <?php endif; ?>
                    </td>
                    <td class="text-nowrap align-middle" colspan="2">Apparel</td>
                </tr>
                <tr>
                    <td class="text-nowrap align-middle width-40px text-center">
                        <?php if (@$contentData->barriers_exercise && in_array('Work Responsibility', $contentData->barriers_exercise)): ?>
                        <i class="fa fa-check"></i>
                        <?php endif; ?>
                    </td>
                    <td class="text-nowrap align-middle" colspan="2">Work Responsibility</td>
                </tr>
                <tr>
                    <td class="text-nowrap align-middle width-40px text-center">
                        <?php if (@$contentData->barriers_exercise && in_array('Fear', $contentData->barriers_exercise)): ?>
                        <i class="fa fa-check"></i>
                        <?php endif; ?>
                    </td>
                    <td class="text-nowrap align-middle" colspan="2">Fear</td>
                </tr>
                <tr>
                    <td class="text-nowrap align-middle width-40px text-center">
                        <?php if (@$contentData->barriers_exercise && in_array('Energy', $contentData->barriers_exercise)): ?>
                        <i class="fa fa-check"></i>
                        <?php endif; ?>
                    </td>
                    <td class="text-nowrap align-middle" colspan="2">Energy</td>
                </tr>
                <tr>
                    <td class="text-nowrap align-middle width-40px text-center">
                        <?php if (@$contentData->barriers_exercise && in_array('Cost', $contentData->barriers_exercise)): ?>
                        <i class="fa fa-check"></i>
                        <?php endif; ?>
                    </td>
                    <td class="text-nowrap align-middle" colspan="2">Cost</td>
                </tr>
                <tr>
                    <td class="text-nowrap align-middle width-40px text-center">
                        <?php if (@$contentData->barriers_exercise && in_array('Other', $contentData->barriers_exercise)): ?>
                        <i class="fa fa-check"></i>
                        <?php endif; ?>
                    </td>
                    <td class="text-nowrap align-middle" colspan="2">Other</td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>

    <p><b>EXERCISE SAFETY</b></p>
    <div class="d-flex align-items-baseline mb-3">
        <div class="pr-2 text-secondary font-weight-bold width-30px">a.</div>
        <div class="flex-grow-1">
            <div class="row">
                <div class="col-6">
                    Do you have any injuries that would make it difficult to exercise?
                </div>
                <div class="col-6">
                    <b><?= @$contentData->injuries_difficult ?></b>
                    <div><?= @$contentData->injuries_difficult_yes ?></div>
                </div>
            </div>
        </div>
    </div>
    <div class="d-flex align-items-baseline mb-3">
        <div class="pr-2 text-secondary font-weight-bold width-30px">b.</div>
        <div class="flex-grow-1">
            <div class="row">
                <div class="col-6">
                    Do you have any joint, muscle, or bone problems that might get worse with exercise?
                </div>
                <div class="col-6">
                    <b><?= @$contentData->bone_problems ?></b>
                    <div><?= @$contentData->bone_problems_yes ?></div>
                </div>
            </div>
        </div>
    </div>
    <div class="d-flex align-items-baseline mb-3">
        <div class="pr-2 text-secondary font-weight-bold width-30px">c.</div>
        <div class="flex-grow-1">
            <div class="row">
                <div class="col-6">
                    Do you have any breathing problems while exercising?
                </div>
                <div class="col-6">
                    <b><?= @$contentData->breathing_problems ?></b>
                    <div><?= @$contentData->breathing_problems_yes ?></div>
                </div>
            </div>
        </div>
    </div>
    <div class="d-flex align-items-baseline mb-3">
        <div class="pr-2 text-secondary font-weight-bold width-30px">d.</div>
        <div class="flex-grow-1">
            <div class="row">
                <div class="col-6">
                    Do you have any balance problems or have had a fall in the last 6 months?
                </div>
                <div class="col-6">
                    <b><?= @$contentData->balance_problems ?></b>
                    <div><?= @$contentData->balance_problems_yes ?></div>
                </div>
            </div>
        </div>
    </div>
    <div class="d-flex align-items-baseline mb-3">
        <div class="pr-2 text-secondary font-weight-bold width-30px">e.</div>
        <div class="flex-grow-1">
            <div class="row">
                <div class="col-6">
                    Do you have any difficulty completing your activities of daily living (i.e. showering,
                    dressing,
                    toileting)?
                </div>
                <div class="col-6">
                    <b><?= @$contentData->completing_activities_difficult ?></b>
                    <div><?= @$contentData->completing_activities_difficult_yes ?></div>
                </div>
            </div>
        </div>
    </div>

    <p><b>Do you have any of the following health problems? Check all that apply</b></p>
    <table class="table table-sm table-striped table-bordered m-0">
        <tbody>
        <tr>
            <td class="text-nowrap align-middle width-40px text-center">
                <?php if (@$contentData->health_problems && in_array('Arrhythmia or irregular heartbeat', $contentData->health_problems)): ?>
                <i class="fa fa-check"></i>
                <?php endif; ?>
            </td>
            <td class="text-nowrap align-middle" colspan="2">Arrhythmia or irregular heartbeat</td>
        </tr>
        <tr>
            <td class="text-nowrap align-middle width-40px text-center">
                <?php if (@$contentData->health_problems && in_array('Arthritis or significant joint pain', $contentData->health_problems)): ?>
                <i class="fa fa-check"></i>
                <?php endif; ?>
            </td>
            <td class="text-nowrap align-middle" colspan="2">Arthritis or significant joint pain</td>
        </tr>
        <tr>
            <td class="text-nowrap align-middle width-40px text-center">
                <?php if (@$contentData->health_problems && in_array('Chest pain/angina', $contentData->health_problems)): ?>
                <i class="fa fa-check"></i>
                <?php endif; ?>
            </td>
            <td class="text-nowrap align-middle" colspan="2">Chest pain/angina</td>
        </tr>
        <tr>
            <td class="text-nowrap align-middle width-40px text-center">
                <?php if (@$contentData->health_problems && in_array('Uncontrolled diabetes', $contentData->health_problems)): ?>
                <i class="fa fa-check"></i>
                <?php endif; ?>
            </td>
            <td class="text-nowrap align-middle" colspan="2">Uncontrolled diabetes</td>
        </tr>
        <tr>
            <td class="text-nowrap align-middle width-40px text-center">
                <?php if (@$contentData->health_problems && in_array('Severe or uncontrolled heart failure', $contentData->health_problems)): ?>
                <i class="fa fa-check"></i>
                <?php endif; ?>
            </td>
            <td class="text-nowrap align-middle" colspan="2">Severe or uncontrolled heart failure</td>
        </tr>
        <tr>
            <td class="text-nowrap align-middle width-40px text-center">
                <?php if (@$contentData->health_problems && in_array('Uncontrolled asthma', $contentData->health_problems)): ?>
                <i class="fa fa-check"></i>
                <?php endif; ?>
            </td>
            <td class="text-nowrap align-middle" colspan="2">Uncontrolled asthma</td>
        </tr>
        <tr>
            <td class="text-nowrap align-middle width-40px text-center">
                <?php if (@$contentData->health_problems && in_array('Recent heart attack', $contentData->health_problems)): ?>
                <i class="fa fa-check"></i>
                <?php endif; ?>
            </td>
            <td class="text-nowrap align-middle" colspan="2">Recent heart attack</td>
        </tr>
        <tr>
            <td class="text-nowrap align-middle width-40px text-center">
                <?php if (@$contentData->health_problems && in_array('Chronic or unusual fatigue/tiredness', $contentData->health_problems)): ?>
                <i class="fa fa-check"></i>
                <?php endif; ?>
            </td>
            <td class="text-nowrap align-middle" colspan="2">Chronic or unusual fatigue/tiredness</td>
        </tr>
        <tr>
            <td class="text-nowrap align-middle width-40px text-center">
                <?php if (@$contentData->health_problems && in_array('Difficulty breathing with activity', $contentData->health_problems)): ?>
                <i class="fa fa-check"></i>
                <?php endif; ?>
            </td>
            <td class="text-nowrap align-middle" colspan="2">Difficulty breathing with activity</td>
        </tr>
        <tr>
            <td class="text-nowrap align-middle width-40px text-center">
                <?php if (@$contentData->health_problems && in_array('Other', $contentData->health_problems)): ?>
                <i class="fa fa-check"></i>
                <?php endif; ?>
            </td>
            <td class="text-nowrap align-middle" colspan="2">Other</td>
        </tr>
        </tbody>
    </table>
</div>

<?php
} else {
    echo '<div class="text-secondary">-</div>';
}
?>

