

<?php $__env->startPush('css'); ?>

<?php $__env->stopPush(); ?>

<?php $__env->startSection('page-title'); ?>
    <?php echo $__env->make('admin.components.page-title',['title' => __($page_title)], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('breadcrumb'); ?>
    <?php echo $__env->make('admin.components.breadcrumb',['breadcrumbs' => [
        [
            'name'  => __("Dashboard"),
            'url'   => setRoute("admin.dashboard"),
        ]
    ], 'active' => __($page_title)], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <div class="custom-card">
        <div class="card-header">
            <h6 class="title"><?php echo e(__($page_title)); ?></h6>
        </div>
        <div class="card-body">
            <form class="card-form" method="POST" action="<?php echo e(setRoute('admin.support.ticket.store')); ?>" enctype="multipart/form-data">
                <?php echo csrf_field(); ?>
                <div class="row mb-10-none">
                    <div class="input-fields">
                        <div class="row">
                            <input type="hidden" name="user_type">
                            <div class="col-xl-6 col-lg-6 form-group">
                                <?php echo $__env->make('admin.components.form.input',[
                                    'label'     => __("Email"),
                                    'label_after'   => "*",
                                    'placeholder'   => __("Write Email").'...',
                                    'name'      => 'email',
                                    'value'     => old('email'),
                                ], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                                <label class="exist text-start"></label>
                            </div>
                            <div class="col-xl-6 col-lg-6 form-group new-user d-none">
                                <?php echo $__env->make('admin.components.form.input',[
                                    'label'         => __("First Name")."*",
                                    'name'          => "firstname",
                                    'placeholder'   => __("Enter First Name"),
                                    'value'         => old("firstname"),
                                ], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                            </div>
                            <div class="col-xl-6 col-lg-6 form-group new-user d-none">
                                <?php echo $__env->make('admin.components.form.input',[
                                    'label'         =>__("Last Name")."*",
                                    'name'          => "lastname",
                                    'placeholder'   => __("Enter Last Name"),
                                    'value'         => old("lastname"),
                                ], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                            </div>
                            <div class="col-xl-6 col-lg-6 form-group new-user d-none">
                                <label><?php echo e(__("Password")); ?>*</label>
                                <div class="input-group">
                                    <input type="text" class="form--control place_random_password <?php $__errorArgs = ["password"];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" placeholder="<?php echo e(__('Enter Password')); ?>" name="password">
                                    <button class="input-group-text rand_password_generator" type="button"><?php echo e(__("Generate")); ?></button>
                                </div>
                                <?php $__errorArgs = ["password"];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <span class="invalid-feedback d-block" role="alert">
                                        <strong><?php echo e($message); ?></strong>
                                    </span>
                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                            <div class="col-xl-6 col-lg-6 form-group">
                                <?php echo $__env->make('admin.components.form.input',[
                                    'label'     => __("Subject"),
                                    'label_after'   => "*",
                                    'placeholder'   => __("Write Subject").'...',
                                    'name'      => 'subject',
                                    'value'     => old('subject'),
                                ], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                            </div>
                            <div class="col-xl-12 col-lg-12 form-group">
                                <?php echo $__env->make('admin.components.form.textarea',[
                                    'label'     => __("Message"),
                                    'label_after'   => "*",
                                    'placeholder'   => __("Write Message").'...',
                                    'name'      => 'desc',
                                    'value'     => old('desc'),
                                ], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                            </div>
                            <div class="col-xl-12 col-lg-12 form-group">
                                <label><?php echo e(__("Attachments")); ?></label>
                                <input type="file" name="attachment[]" multiple>
                            </div>
                        </div>
                    </div>
                    <div class="col-xl-12 col-lg-12 form-group">
                        <?php echo $__env->make('admin.components.button.form-btn',[
                            'class'         => "w-100 btn-loading",
                            'text'          => __("Save"),
                            'permission'    => "admin.support.ticket.store",
                        ], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                    </div>
                </div>
            </form>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('script'); ?>
<script>
    $("input[name=email]").keyup(function(){
        var checkUserURL    = "<?php echo e(setRoute('admin.support.ticket.check.user')); ?>";
        var email           = $(this).val();
        var user            = "<?php echo e(support_ticket_const()::USER); ?>";
        var new_user        = "<?php echo e(support_ticket_const()::NEWUSER); ?>";

        if(email == '' || email == null){
            $('.exist').text('');
        }
        $.post(checkUserURL,{email:email,_token:"<?php echo e(csrf_token()); ?>"},function(response){
            if(response.not_exists){
                if($('.exist').hasClass('text--success')){
                    $('.exist').removeClass('text--success');
                }
                $('.exist').addClass('text--danger').text(response.not_exists);
                $('.new-user').removeClass('d-none');
                $('input[name=user_type]').val(new_user);
                return false
            }
            if(response['data'] != null){
                if($('.exist').hasClass('text--danger')){
                    $('.exist').removeClass('text--danger');
                }
                $('.new-user').addClass('d-none');
                $('.exist').text(`Registered user.`).addClass('text--success');
                $('input[name=user_type]').val(user);
            } else {
                if($('.exist').hasClass('text--success')){
                    $('.exist').removeClass('text--success');
                }
                $('.new-user').removeClass('d-none');
                $('.exist').text('Unregistered user.').addClass('text--danger');
                $('input[name=user_type]').val(new_user);
                return false
            }
        });
    });
</script>
<script>
    function placeRandomPassword(clickedButton,placeInput) {
        $(clickedButton).click(function(){
            var generateRandomPassword = makeRandomString(10);
            $(placeInput).val(generateRandomPassword);
        });
    }
    placeRandomPassword(".rand_password_generator",".place_random_password");
</script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('admin.layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\xampp\htdocs\cc_projects_files\salonhub_v1.2.0\salonhub\resources\views/admin/sections/support-ticket/create.blade.php ENDPATH**/ ?>