<?php $__env->startSection('content'); ?>
    <div class="card custom--card">
        <div class="card-body">
            <form action="<?php echo e(route('ticket.store')); ?>" class="disableSubmission" method="post" enctype="multipart/form-data">
                <?php echo csrf_field(); ?>
                <div class="row gy-4">
                    <div class="col-md-6">
                        <label class="form--label required"><?php echo app('translator')->get('Subject'); ?></label>
                        <input type="text" name="subject" value="<?php echo e(old('subject')); ?>" class="form-control form--control"
                            required>
                    </div>
                    <div class="col-md-6">
                        <label class="form--label required"><?php echo app('translator')->get('Priority'); ?></label>
                        <select name="priority" class="form-select form--control select2-basic"
                            data-minimum-results-for-search="-1" required>
                            <option value="3"><?php echo app('translator')->get('High'); ?></option>
                            <option value="2"><?php echo app('translator')->get('Medium'); ?></option>
                            <option value="1"><?php echo app('translator')->get('Low'); ?></option>
                        </select>
                    </div>
                    <div class="col-12">
                        <label class="form--label required"><?php echo app('translator')->get('Message'); ?></label>
                        <textarea name="message" id="inputMessage" rows="6" class="form-control form--control" required><?php echo e(old('message')); ?></textarea>
                    </div>
                    <div class="col-12">
                        <div class="d-flex flex-wrap align-items-center justify-content-between">
                            <button type="button" class="btn btn--dark addAttachment btn--lg">
                                <i class="fas fa-plus"></i> <?php echo app('translator')->get('Add Attachment'); ?>
                            </button>
                            <button class="btn btn--base  btn--lg" type="submit">
                                <i class="las la-paper-plane"></i> <?php echo app('translator')->get('Submit'); ?>
                            </button>
                        </div>
                        <p class="text--info mt-2">
                            <?php echo app('translator')->get('Max 5 files can be uploaded'); ?> | <?php echo app('translator')->get('Maximum upload size is'); ?>
                            <?php echo e(convertToReadableSize(ini_get('upload_max_filesize'))); ?> |
                            <?php echo app('translator')->get('Allowed File Extensions: .jpg, .jpeg, .png, .pdf, .doc, .docx'); ?>
                        </p>
                    </div>
                    <div class="col-12">
                        <div class="row gy-2 fileUploadsContainer"></div>
                    </div>
                </div>
            </form>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('style'); ?>
    <style>
        .input-group-text:focus {
            box-shadow: none !important;
        }

        .form-group {
            margin-top: 15px;
        }

        .input--group .input-group-text {
            border-radius: 4px;
            color: hsl(var(--white)) !important;
            background-color: hsl(var(--danger)) !important;
        }
    </style>
<?php $__env->stopPush(); ?>
<?php $__env->startPush('script'); ?>
    <script>
        (function($) {
            "use strict";

            let fileAdded = 0;
            const MAX_FILES = 5;

            $('.addAttachment').on('click', function() {
                fileAdded++;

                if (fileAdded === MAX_FILES) {
                    $(this).attr('disabled', true);
                }

                $(".fileUploadsContainer").append(`
                    <div class="col-md-6 removeFileInput">
                        <div class="form-group">
                            <div class="input-group input--group">
                                <input
                                    type="file"
                                    name="attachments[]"
                                    class="form-control form--control"
                                    accept=".jpeg,.jpg,.png,.pdf,.doc,.docx"
                                    required
                                >
                                <button
                                    type="button"
                                    class="input-group-text removeFile"
                                >
                                    <i class="fas fa-times"></i>
                                </button>
                            </div>
                        </div>
                    </div>
                `);
            });

            $(document).on('click', '.removeFile', function() {
                $('.addAttachment').removeAttr('disabled', true)
                fileAdded--;
                $(this).closest('.removeFileInput').remove();
            });

        })(jQuery);
    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('Template::layouts.master', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/mojibor/work.mojibor.com/core/resources/views/templates/basic/user/support/create.blade.php ENDPATH**/ ?>