<?php
$tracking = [];
if (@($plan->tracking->calorieIntake)) $tracking[] = 'Calorie Intake';
if (@($plan->tracking->dailyCarbIntake)) $tracking[] = 'Daily Carb Intake';
if (@($plan->tracking->portionSize)) $tracking[] = 'Portion Size';
if (@($plan->tracking->eatingSpeed)) $tracking[] = 'Eating Speed';
$tracking = count($tracking) ? implode(', ', $tracking) : '-';
$foodMonitoring = [];
if (@($plan->foodMonitoring->phoneTracker)) $foodMonitoring[] = 'Phone Tracker';
if (@($plan->foodMonitoring->dailyFoodLog)) $foodMonitoring[] = 'Daily Food Log';
$foodMonitoring = count($foodMonitoring) ? implode(', ', $foodMonitoring) : '-';
if (@$plan) {
    ?>
    <div class="mb-1"><span class="text-sm">Number of weigh-ins per week:</span> <?= @($plan->weighInsPerWeek) ?: '-' ?>.</div>
    <div class="mb-1"><span class="text-sm">Track:</span> <?= $tracking ?></div>
    <?php
    if (@($plan->tracking->other) && @($plan->tracking->otherDetail)) {
        ?>
        <div class="mb-1"><span class="text-sm">Other tracking:</span> <?= $plan->tracking->otherDetail ?></div>
        <?php
    }
    ?>
    <div class="mb-1"><span class="text-sm">Food monitoring:</span> <?= $foodMonitoring ?></div>
    <div class="text-secondary"><?= @($plan->memo) ?: '' ?></div>
    <?php
} else {
    ?> - <?php
}
?>

