
<?php $__env->startSection('content'); ?>
<div class="app-title">
	<div>
		<h1>
			<i class="fa-regular fa-plus mx-1"></i> Add New Leader
		</h1>
	</div>
</div>

<section class="acc-form">
	<div class="container">
		<div class="row justify-content-center">
			<div class="col-lg-8 col-sm-12 col-xs-12 col-md-8">
				<div class="tile">
					<div class="tile-body">

						<form class="emp-master-form" action="<?php echo e(route('admin.store_leader')); ?>" method="POST" enctype="multipart/form-data">
							<?php echo csrf_field(); ?>
							<div class="row">
								<div class="col-lg-12 col-sm-12 col-md-12 col-xs-12 mt-2 mb-2">
									<div class="form-group">
										<label class="form-head mb-1" for="name">First Name:</label>
										<input type="text" class="form-control" name="first_name" id="first_name" value="<?php echo e(old('first_name')); ?>" placeholder="Enter First Name">
									</div>
									<?php $__errorArgs = ['first_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
									<div class="text-danger mt-1"><?php echo e($message); ?></div>
									<?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
								</div>

								<div class="col-lg-12 col-sm-12 col-md-12 col-xs-12 mt-2 mb-2">
									<div class="form-group">
										<label class="form-head mb-1" for="name">Last Name:</label>
										<input type="text" class="form-control" name="last_name" id="last_name" value="<?php echo e(old('last_name')); ?>" placeholder="Enter Last Name">
									</div>
									<?php $__errorArgs = ['last_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
									<div class="text-danger mt-1"><?php echo e($message); ?></div>
									<?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
								</div>

								<div class="col-lg-12 col-sm-12 col-md-12 col-xs-12 mt-2 mb-2">
									<div class="form-group">
										<label class="form-head mb-1" for="email">Email:</label>
										<input type="email" class="form-control" name="email" id="email" value="<?php echo e(old('email')); ?>" placeholder="Enter Email Address">
									</div>
									<?php $__errorArgs = ['email'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
									<div class="text-danger mt-1"><?php echo e($message); ?></div>
									<?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
								</div>
								<div class="col-lg-12 col-sm-12 col-md-12 col-xs-12 mt-2 mb-2">
									<div class="form-gro0up">
										<label class="form-head mb-1" for="email">Phone No:</label>
										<input type="tel" class="form-control" name="phone_no" id="phone_no" value="<?php echo e(old('phone_no')); ?>" placeholder="Enter Phone no">
									</div>
									<?php $__errorArgs = ['phone_no'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
									<div class="text-danger mt-1"><?php echo e($message); ?></div>
									<?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
								</div>

								<!-- Assign Church Dropdown -->
								<div class="col-lg-12 col-sm-12 col-md-12 col-xs-12 mt-2 mb-2">
									<div class="form-group">
										<label class="form-head mb-1" for="church">Assign Church:</label>
										<select id="options" name="church_id" class="form-control">
											<option value="" disabled <?php echo e(old('church_id') ? '' : 'selected'); ?>>Select Church</option>
											<?php $__currentLoopData = $churches; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $church): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
											<option value="<?php echo e($church->id); ?>" <?php echo e(old('church_id') == $church->id ? 'selected' : ''); ?>>
												<?php echo e($church->church_name); ?>

											</option>
											<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
										</select>
									</div>
									<?php $__errorArgs = ['church_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
									<div class="text-danger mt-1"><?php echo e($message); ?></div>
									<?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
								</div>

								<!-- User Role Dropdown -->
								<div class="col-lg-12 col-sm-12 col-md-12 col-xs-12 mt-2 mb-2">
									<div class="form-group">
										<label class="form-head mb-1" for="user_role">User Role:</label>
										<select id="options" name="user_role" class="form-control">
											<option value="" disabled <?php echo e(old('user_role') ? '' : 'selected'); ?>>Select Role</option>
											<option value="Prayer Warrior" <?php echo e(old('user_role') == 'Prayer Warrior' ? 'selected' : ''); ?>>Prayer Warrior</option>
											<option value="Pastor" <?php echo e(old('user_role') == 'Pastor' ? 'selected' : ''); ?>>Pastor</option>
											<option value="Prayer (Leader)" <?php echo e(old('user_role') == 'Prayer (Leader)' ? 'selected' : ''); ?>>Prayer (Leader)</option>
											<option value="Senior Prayer Warrior (Leader)" <?php echo e(old('user_role') == 'Senior Prayer Warrior (Leader)' ? 'selected' : ''); ?>>Senior Prayer Warrior (Leader)</option>
										</select>
									</div>
									<?php $__errorArgs = ['user_role'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
									<div class="text-danger mt-1"><?php echo e($message); ?></div>
									<?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
								</div>

								<!-- User Status Dropdown -->
								<div class="col-lg-12 col-sm-12 col-md-12 col-xs-12 mt-2 mb-2">
									<div class="form-group">
										<label class="form-head mb-1" for="user_status">User Status:</label>
										<select id="options" name="user_status" class="form-control">
											<option value="" disabled <?php echo e(old('user_status') ? '' : 'selected'); ?>>Select Status</option>
											<option value="Prayer Warrior" <?php echo e(old('user_status') == 'Prayer Warrior' ? 'selected' : ''); ?>>Prayer Warrior</option>
											<option value="Champion Warrior" <?php echo e(old('user_status') == 'Champion Warrior' ? 'selected' : ''); ?>>Champion Warrior</option>
											<option value="Elite Warrior" <?php echo e(old('user_status') == 'Elite Warrior' ? 'selected' : ''); ?>>Elite Warrior</option>
											<option value="Inactive User" <?php echo e(old('user_status') == 'Inactive User' ? 'selected' : ''); ?>>Inactive User</option>
										</select>
									</div>
									<?php $__errorArgs = ['user_status'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
									<div class="text-danger mt-1"><?php echo e($message); ?></div>
									<?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
								</div>

								<div class="col-md-12 col-lg-12 col-sm-12 col-xs-12 mt-4 mb-2">
									<div class="form-group text-center">
										<button class="btn submit-btn w-100" type="submit">
											<i class="fa-sharp fa-light fa-paper-plane mx-2"></i> Send Invitation </button>
									</div>
								</div>
							</div>
						</form>

					</div>
				</div>
			</div>
		</div>
	</div>
</section>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>

<?php if(session('success')): ?>
<script>
	Swal.fire({
		icon: 'success',
		title: 'Success!',
		text: "<?php echo e(session('success')); ?>",
		confirmButtonText: 'OK'
	}).then((result) => {
		if (result.isConfirmed) {
			window.location.href = "<?php echo e(route('admin.leaders')); ?>";
		}
	});
</script>
<?php endif; ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/pragyadbtechserv/public_html/church-admin/resources/views/admin/add_leader.blade.php ENDPATH**/ ?>