<?php $__template->layout('Layout.main'); ?>

<?php $__template->section('title'); ?>تعديل حساب بنكي<?php $__template->endSection(); ?>

<?php $__template->section('content'); ?>
<div class="card">
    <div style="padding:15px 20px;border-bottom:1px solid #E5E7EB;">
        <h3 style="margin:0;">تعديل: <?= e($account['account_name_ar']) ?></h3>
    </div>
    <div style="padding:20px;">
        <form method="POST" action="/accounting/bank-accounts/<?= (int)$account['id'] ?>">
            <?= csrf_field() ?>
            <div style="display:grid;grid-template-columns:1fr 1fr;gap:15px;">
                <div>
                    <label class="form-label">اسم الحساب (عربي) <span style="color:#DC2626;">*</span></label>
                    <input type="text" name="account_name_ar" class="form-input" value="<?= e($account['account_name_ar']) ?>" required>
                </div>
                <div>
                    <label class="form-label">اسم الحساب (إنجليزي)</label>
                    <input type="text" name="account_name_en" class="form-input" value="<?= e($account['account_name_en'] ?? '') ?>" dir="ltr">
                </div>
                <div>
                    <label class="form-label">اسم البنك (عربي) <span style="color:#DC2626;">*</span></label>
                    <input type="text" name="bank_name_ar" class="form-input" value="<?= e($account['bank_name_ar']) ?>" required>
                </div>
                <div>
                    <label class="form-label">اسم البنك (إنجليزي)</label>
                    <input type="text" name="bank_name_en" class="form-input" value="<?= e($account['bank_name_en'] ?? '') ?>" dir="ltr">
                </div>
                <div>
                    <label class="form-label">IBAN</label>
                    <input type="text" name="iban" class="form-input" value="<?= e($account['iban'] ?? '') ?>" dir="ltr">
                </div>
                <div>
                    <label class="form-label">SWIFT Code</label>
                    <input type="text" name="swift_code" class="form-input" value="<?= e($account['swift_code'] ?? '') ?>" dir="ltr">
                </div>
                <div>
                    <label class="form-label" style="display:flex;align-items:center;gap:8px;">
                        <input type="checkbox" name="is_active" value="1" <?= (int)$account['is_active'] ? 'checked' : '' ?>> نشط
                    </label>
                </div>
                <div style="grid-column:1/-1;">
                    <label class="form-label">ملاحظات</label>
                    <textarea name="notes" class="form-textarea" rows="2"><?= e($account['notes'] ?? '') ?></textarea>
                </div>
            </div>
            <div style="margin-top:20px;display:flex;gap:8px;">
                <button type="submit" class="btn btn-primary">حفظ</button>
                <a href="/accounting/bank-accounts" class="btn btn-outline">إلغاء</a>
            </div>
        </form>
    </div>
</div>
<?php $__template->endSection(); ?>
