File manager - Edit - /home/autoph/public_html/projects/tickets-autohub/storage/framework/views/014c7498f508c33626852463eae874830cf4a3b4.php
Back
<style> #fileWrapper { display: flex; align-items: center; } #fileIcon { margin-right: 8px; /* Adjust as needed for spacing */ font-size: 16px; /* Adjust size if needed */ } #fileName { white-space: nowrap; /* Prevent text from wrapping */ overflow: hidden; text-overflow: ellipsis; /* Show ellipsis if text is too long */ max-width: 200px; /* Adjust the width as needed */ } </style> <div class="modal fade" id="create_ticket_modal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true"> <div class="modal-dialog modal-xl"> <div class="modal-content"> <div class="modal-header"> <h1 class="modal-title fs-5" id="staticBackdropLabel">Create Ticket</h1> <span style="cursor: pointer;" data-bs-dismiss="modal" aria-label="Close">X</span> </div> <div class="modal-body"> <form class="_ticketForm" action="POST" enctype="multipart/form-data" novalidate> <?php echo csrf_field(); ?> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label for="" class="form-label">Company: </label> <select name="_companies" id="_companies" class="form-select" style="width: 100%"></select> </div> <div class="form-group"> <label for="" class="form-label">Sender: </label> <input type="hidden" value="<?php echo e(Auth::user()->id); ?>" id="cuid"/> <select name="_users" id="_users" class="form-select" style="width: 100%"></select> </div> <div class="form-group"> <label for="" class="form-label">Destination Department: </label> <select name="_dept" id="_dept" class="form-select" style="width: 100%"></select> </div> <?php /* if(!in_array(Auth::user()->getUserRole(),[3,12])){ ?> <div class="form-group"> <label for="">Category: </label> <select name="_category" id="_category" class="form-control" style="width: 100%"></select> </div> <div class="form-group childCat"> <label for="">Sub-Category: </label> <select name="_Subcategory" id="_Subcategory" class="form-control" style="width: 100%"></select> </div> <div class="form-group"> <label for="" class="form-label">SLA: </label> <label for="" name="_slaLabel" id="_slaLabel" style="font-weight: bolder"></label> <input class="form-control" type="hidden" name="_sla" id="_sla" value=""> </div> <?php } */ ?> </div> <div class="col-md-6"> <div class="form-group"> <label for="">Note: Please describe your issue in detail (e.g., the problem you encountered, steps to reproduce, and any other relevant information) : </label> <textarea class="form-control" name="_desc" id="_desc" cols="30" rows="10"></textarea> </div> <?php /* <div class="row"> <div class="col-md-8"> <div class="form-group"> <?php // <input type="file" name="_attachmentTicket" id="_attachmentTicket"> ?> <label for="_attachmentTicket" title="Add attachment" class="btn btn-light" style="border:1px solid #ccc;"> <i class="fa fa-paperclip" aria-hidden="true"></i> Attach File </label> <input type="file" name="_attachmentTicket" id="_attachmentTicket" style="display: none;"> <span id="fileIcon" style="margin-right: 5px;"></span> <span id="fileName">No file selected</span> </div> </div> <div class="col-md-4 justify-content-end align-content-end"> <button type="reset" title="Clear attachment" class="btn btn-sm btn-danger _clearFile" id="_clearFile" style="float: right;"> <i class="fa fa-trash" aria-hidden="true"></i> </button> </div> </div> */ ?> <div class="row align-items-center"> <div class="col-md-8 d-flex align-items-center"> <div class="form-group d-flex align-items-center"> <!-- Hidden file input --> <input type="file" name="_attachmentTicket" id="_attachmentTicket" style="display: none;"> <!-- Attach File Label --> <label for="_attachmentTicket" title="Add attachment" class="btn btn-light" style="border: 1px solid #ccc; margin-right: 10px;"> <i class="fa fa-paperclip" aria-hidden="true"></i> Attach File </label> <!-- File Details --> <span id="fileIcon" style="margin-right: 5px;"></span> <span id="fileName">No file selected</span> </div> </div> <div class="col-md-4 d-flex justify-content-end"> <button type="reset" title="Clear attachment" class="btn btn-sm btn-danger _clearFile" id="_clearFile"> <i class="fa fa-trash" aria-hidden="true"></i> </button> </div> </div> </div> </div> </div> <div class="modal-footer"> <button type="submit" class="btn btn-primary">Submit</button> </div> </form> </div> </div> </div> <script> $(document).ready(function(){ const currentCompany = '<?php echo e($user_current_company_id); ?>'; const RoleAccess = '<?php echo e(Auth::user()->getUserRole()); ?>'; const UserId = '<?php echo e(Auth::user()->id); ?>'; // Prefetch the company data on page load $.ajax({ url: `/company-list/${currentCompany}`, dataType: 'json', success: function(response) { // Populate the Select2 options with preloaded data const companySelect = $('[name="_companies"]'); // $('[name="_companies"]').select2({ companySelect.select2({ dropdownParent: $('#create_ticket_modal'), allowClear: true, placeholder: "Select Company", data: response.results, // Use the preloaded data language: { noResults: function () { return "Select"; } }, escapeMarkup: function (markup) { return markup; } }); // Set the current company as selected if available if (currentCompany) { const selectedCompany = response.results.find(company => company.id === currentCompany); if (selectedCompany) { const option = new Option(selectedCompany.text, selectedCompany.id, true, true); $('[name="_companies"]').append(option).trigger('change'); } } // companySelect.prop('disabled',true); // if([1,2].includes(RoleAccess)) // { // companySelect.prop('disabled',false); // } } }); $.ajax({ url: "/userList", dataType: "json", success: function (response) { const userSelect = $('[name="_users"]'); // Initialize Select2 with preloaded data userSelect.select2({ dropdownParent: $("#create_ticket_modal"), allowClear: true, placeholder: "Select User", data: response.results.map(user => ({ id: user.id, text: user.text })), // Map data to Select2 format language: { noResults: function () { return "No users found"; } }, escapeMarkup: function (markup) { return markup; } }); // Set the current user as selected, if available const currentUserId = $("#cuid").val(); if (currentUserId) { const selectedUser = response.results.find( user => user.id == currentUserId // Ensure comparison works ); if (selectedUser) { const option = new Option(selectedUser.text, selectedUser.id, true, true); userSelect.append(option).trigger("change"); } } // userSelect.prop('disabled',true); // if([1,2].includes(RoleAccess)) // { // userSelect.prop('disabled',false); // } }, error: function (xhr, status, error) { console.error("Error fetching user list:", error); } }); }); document.addEventListener('DOMContentLoaded', function () { const createTicketModal = document.getElementById('create_ticket_modal'); createTicketModal.addEventListener('hidden.bs.modal', function () { console.log('Modal hidden event triggered'); const form = createTicketModal.querySelector('form'); if (form) { // Clear file input explicitly const fileInputs = form.querySelectorAll('input[type="file"]'); fileInputs.forEach(fileInput => { fileInput.value = ''; // Clear file input $("#fileName").text('No file selected'); $('#fileIcon').html(''); if (fileInput.value !== '') { console.log('Fallback: Replacing file input'); const newInput = fileInput.cloneNode(); fileInput.parentNode.replaceChild(newInput, fileInput); } }); } }); }); </script><?php /**PATH /home/autoph/public_html/projects/tickets-autohub/resources/views/layouts/authentication/ticket_component/create.blade.php ENDPATH**/ ?>
| ver. 1.4 |
.
| PHP 8.1.32 | Generation time: 0 |
proxy
|
phpinfo
|
Settings