<?php $__env->startSection('content'); ?>
<script>

    function toEnglishNumber(strNum) {
   var ar = '٠١٢٣٤٥٦٧٨٩'.split('');
   var en = '0123456789'.split('');
   strNum = strNum.replace(/[٠١٢٣٤٥٦٧٨٩]/g, x => en[ar.indexOf(x)]);
   strNum = strNum.replace(/[^\d]/g, '');
   return strNum;
}

$(document).on('keyup', '.arabicNumbers', function(e) {
   var val = toEnglishNumber($(this).val())
   $(this).val(val)
});
</script>

<div class="container" dir="rtl">
    <h3 class="mb-4">تسجيل منظمة جديدة</h3>

     
                        <?php if(session()->has('success')): ?>
                        <div class="alert alert-success">
                            <span class="text-green font-bold"><?php echo e(session('success')); ?></span>
                        </div>
                       <?php endif; ?>
             
    <form action="<?php echo e(route('organizations.store')); ?>" method="POST">
        <?php echo csrf_field(); ?>

        <div class="mb-3">
            <label class="form-label">اسم المنظمة</label>
            <input type="text" name="organizationName" class="form-control" required>
        </div>

        <div class="mb-3">
            <label class="form-label">نوع المنظمة</label>
            <select name="type" class="form-control" required>
                <option value="Local">محلية</option>
                <option value="International">دولية</option>
                <option value="Partner">شريك</option>
            </select>
        </div>

        <div class="mb-3">
            <label class="form-label">اسم الشخص المسؤول</label>
            <input type="text" name="contact_person" class="form-control">
        </div>

        <div class="mb-3">
            <label class="form-label">البريد الإلكتروني</label>
            <input type="email" name="email" class="form-control">
        </div>

        <div class="mb-3">
            <label class="form-label">رقم الهاتف</label>
            <input type="text" name="phone" class="arabicNumbers form-control">
        </div>

        <button type="submit" class="btn btn-success">حفظ</button>
    </form>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.appuser', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/moh-portal/resources/views/organizations/create.blade.php ENDPATH**/ ?>