<?php
require_once __DIR__ . '/i18n.php';

function gp_render_project_menu(PDO $pdo, int $projectId): void
{
    if ($projectId <= 0) return;
    ?>
    <div class="page-header-actions" style="margin-bottom:12px">
      <div class="form-actions" style="margin-top:0;flex-wrap:wrap">
        <a class="btn btn-sm btn-outline-light" href="/public/projects/edit.php?id=<?php echo (int)$projectId; ?>"><?php echo h(gp_tr($pdo, 'project')); ?></a>
        <a class="btn btn-sm btn-outline-light" href="/public/projects/equipment.php?project_id=<?php echo (int)$projectId; ?>"><?php echo h(gp_tr($pdo, 'equipment')); ?></a>
        <a class="btn btn-sm btn-outline-light" href="/public/projects/payments.php?project_id=<?php echo (int)$projectId; ?>"><?php echo h(gp_tr($pdo, 'payments')); ?></a>
        <a class="btn btn-sm btn-outline-light" href="/public/projects/expenses.php?project_id=<?php echo (int)$projectId; ?>"><?php echo h(gp_tr($pdo, 'expenses')); ?></a>
        <a class="btn btn-sm btn-outline-light" href="/public/projects/tasks.php?project_id=<?php echo (int)$projectId; ?>"><?php echo h(gp_tr($pdo, 'tasks')); ?></a>
        <a class="btn btn-sm btn-outline-light" href="/public/projects/dispatch.php?project_id=<?php echo (int)$projectId; ?>"><?php echo h(gp_tr($pdo, 'dispatch')); ?></a>
        <a class="btn btn-sm btn-outline-light" href="/public/projects/partners.php?project_id=<?php echo (int)$projectId; ?>"><?php echo h(gp_tr($pdo, 'partners')); ?></a>
        <a class="btn btn-sm btn-outline-light" href="/public/projects/map.php?project_id=<?php echo (int)$projectId; ?>"><?php echo h(gp_tr($pdo, 'map')); ?></a>
        <a class="btn btn-sm btn-outline-light" href="/public/projects/sold_equipment.php?project_id=<?php echo (int)$projectId; ?>"><?php echo h(gp_tr($pdo, 'warranties')); ?></a>
        <a class="btn btn-sm btn-outline-light" href="/public/projects/send.php?project_id=<?php echo (int)$projectId; ?>"><?php echo h(gp_tr($pdo, 'send')); ?></a>
        <a class="btn btn-sm btn-outline-light" href="/public/projects/employee_expenses.php?project_id=<?php echo (int)$projectId; ?>"><?php echo h(gp_tr($pdo, 'employee_expenses')); ?></a>
        <?php if (function_exists('gp_can_manage_project_access') && gp_can_manage_project_access($pdo)): ?>
          <a class="btn btn-sm btn-outline-light" href="/public/projects/access.php?project_id=<?php echo (int)$projectId; ?>"><?php echo h(gp_tr($pdo, 'access')); ?></a>
        <?php endif; ?>
      </div>
    </div>
    <?php
}
