<?php echo $__env->make('admin.layouts.alert-modal', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?> 
<form method="post" action="<?php echo e(request()->url()); ?>" id="input_form">
	<?php echo csrf_field(); ?>
	<div class="form-group">
		<label>Nama Lengkap <text class="text-danger">*</text></label>
		<input type="text" class="form-control" name="full_name" id="full_name" value="<?php echo e(old('full_name') ?? $target->full_name); ?>">
        <small id="full_name"></small>
	</div>
	<div class="form-group">
		<label>Nomor Telepon <text class="text-danger">*</text></label>
		<input class="form-control" type="number" name="phone_number" id="phone_number" value="<?php echo e(old('phone_number') ?? $target->phone_number); ?>">
        <small id="phone_number"></small>
	</div>
	<div class="form-group">
		<label>Email <text class="text-danger">*</text></label>
		<input class="form-control" type="email" name="email" id="email" value="<?php echo e(old('email') ?? $target->email); ?>">
        <small id="email"></small>
	</div>
	<div class="form-group">
		<label>Username <text class="text-danger">*</text></label>
		<input type="text" class="form-control" name="username" id="username" value="<?php echo e(old('username') ?? $target->username); ?>">
        <small id="username"></small>
	</div>
	<div class="form-group">
		<label>Password <?php echo request()->segment(4) == null ? '<text class="text-danger">*</text>' : ''; ?></label>
		<input type="password" class="form-control" name="password" id="password" placeholder="<?php echo e(request()->segment(4) == true ? 'Kosongkan jika tidak dibutuhkan' : ''); ?>" value="<?php echo e(old('password')); ?>">
        <small id="password"></small>
	</div>
	<div class="form-group">
		<label>Saldo <text class="text-danger">*</text></label>
		<input type="text" class="form-control autonumeric-currency" name="balance" id="balance" value="<?php echo e(old('balance') ?? $target->balance); ?>">
        <small id="balance"></small>
	</div>
	<?php if(request()->segment(4) == true): ?>
	<div class="form-group">
		<label>Kunci API <text class="text-danger">*</text></label>
		<div class="input-group">
			<input type="text" class="form-control" name="api_key" id="api_key" value="<?php echo e(old('api_key') ?? $target->api_key); ?>" id="api_key">
			<div class="input-group-append">
				<button class="btn btn-dark" type="button" onclick="create_api_key()"><i class="fa fa-random fa-fw"></i></button>
			</div>
			<small id="api_key"></small>
		</div>
	</div>
	<?php endif; ?>
	<div class="form-group">
		<label>Level <text class="text-danger">*</text></label>
		<select class="custom-select" name="level" id="level">
			<option value="" selected>Pilih...</option>
			<?php $__currentLoopData = $levels; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
				<option value="<?php echo e($item); ?>" <?php echo e(old('level') ? (old('level') == $item ? 'selected' : '') : ($target->level == $item ? 'selected' : '')); ?>><?php echo e($item); ?></option>
			<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
		</select>
		<small id="level"></small>
	</div>
    <hr />
    <div class="button-items d-grid gap-2 hidden" id="process-button">
        <button type="button" class="btn btn-primary btn-block waves-effect waves-light mt-0" disabled>Mohon Tunggu...</button>
    </div>
    <div class="row" id="main-button">
        <div class="col-6">
            <div class="button-items d-grid gap-2">
                <button type="reset" class="btn btn-secondary btn-block waves-effect waves-light mt-0"><i class="mdi mdi-refresh"></i> Reset</button>
            </div>
        </div>
        <div class="col-6">
            <div class="button-items d-grid gap-2">
                <button type="submit" class="btn btn-custom btn-block waves-effect waves-light mt-0"><i class="mdi mdi-send-outline"></i> Submit</button>
            </div>
        </div>
    </div>
</form>
<script src="<?php echo e(asset('assets/js/modal-form.js')); ?>"></script>
<script src="<?php echo e(asset('assets/js/app.js')); ?>"></script>
<script>
	function create_api_key() {
		$.ajax({
			type: "GET",
			url: "<?php echo e(url('ajax/create_api_key')); ?>",
			success: function(data) {
				$('#api_key').val(data);
			}
		});
	}
</script><?php /**PATH /home/glor5228/public_html/resources/views/admin/user/form.blade.php ENDPATH**/ ?>