<?php
/**
 * admin/automation_tabs.php
 * Full-width Automation bar (Chrome-like segments, RTL)
 * Usage:
 *   set $active_tab then include this file
 *   values: cut,vouchers,sync,invoices,reports,maint
 */

if (!isset($active_tab)) $active_tab = 'billing';

$tabs = [
  'billing'  => ['label' => 'دورة التحصيل والفوترة',      'href' => 'automation_billing.php'],
  'vouchers' => ['label' => 'إعدادات كروت الانترنت (QR)', 'href' => 'automation_vouchers.php'],
  'reports'  => ['label' => 'تقارير أسبوعية',            'href' => 'automation_reports.php'],
  'maint'    => ['label' => 'صيانة تلقائية',             'href' => 'automation_maintenance.php'],
];
?>
<div class="ua-atabs-wrap">
  <div class="ua-atabs" role="tablist" aria-label="لوحة الأتمتة">
    <?php foreach ($tabs as $k => $t): ?>
      <a class="ua-atab <?= ($active_tab === $k ? 'is-active' : '') ?>"
         href="<?= htmlspecialchars($t['href'], ENT_QUOTES, 'UTF-8') ?>"
         role="tab"
         aria-selected="<?= ($active_tab === $k ? 'true' : 'false') ?>">
        <?= htmlspecialchars($t['label'], ENT_QUOTES, 'UTF-8') ?>
      </a>
    <?php endforeach; ?>
  </div>
</div>

