<?php require __DIR__ . '/../../layouts/header.php'; ?>

<div class="container-fluid py-3">
  <div class="d-flex align-items-center justify-content-between mb-3">
    <h4 class="mb-0"><?= e(t('settings') ?? 'Settings') ?></h4>
  </div>

  <div class="card shadow-sm border-0">
    <div class="card-body">
      <form method="post" action="<?= e(base_path('action/settings/save')) ?>" class="row g-3">
        <div class="col-md-3">
          <label class="form-label">Default Lang</label>
          <select name="default_lang" class="form-select">
            <option value="ar" <?= (($settings['default_lang']??'')==='ar')?'selected':'' ?>>Arabic</option>
            <option value="en" <?= (($settings['default_lang']??'')==='en')?'selected':'' ?>>English</option>
          </select>
        </div>

        <div class="col-md-4">
          <label class="form-label">Brand Name (EN)</label>
          <input name="brand_name_en" class="form-control" value="<?= e((string)($settings['brand_name_en']??'')) ?>">
        </div>

        <div class="col-md-5">
          <label class="form-label">Brand Name (AR)</label>
          <input name="brand_name_ar" class="form-control" value="<?= e((string)($settings['brand_name_ar']??'')) ?>">
        </div>

        <div class="col-md-3">
          <label class="form-label">SMTP Enabled</label>
          <select name="smtp_enabled" class="form-select">
            <option value="1" <?= (($settings['smtp_enabled']??'')==='1')?'selected':'' ?>>Yes</option>
            <option value="0" <?= (($settings['smtp_enabled']??'')==='0')?'selected':'' ?>>No</option>
          </select>
        </div>

        <div class="col-md-4">
          <label class="form-label">From Email</label>
          <input name="smtp_from_email" class="form-control" value="<?= e((string)($settings['smtp_from_email']??'')) ?>">
        </div>

        <div class="col-md-5">
          <label class="form-label">From Name (EN)</label>
          <input name="smtp_from_name_en" class="form-control" value="<?= e((string)($settings['smtp_from_name_en']??'')) ?>">
        </div>

        <div class="col-md-5">
          <label class="form-label">From Name (AR)</label>
          <input name="smtp_from_name_ar" class="form-control" value="<?= e((string)($settings['smtp_from_name_ar']??'')) ?>">
        </div>

        <div class="col-12">
          <button class="btn btn-primary">
            <i class="fa fa-save"></i> Save
          </button>
        </div>
      </form>
    </div>
  </div>
</div>

<?php require __DIR__ . '/../../layouts/footer.php'; ?>
