/
home
/
sjslayjy
/
public_html
/
assets
/
storage
/
framework
/
views
/
Upload File
HOME
<?php $__env->startPush('plugin-styles'); ?> <!-- <?php echo Html::style('/assets/plugins/plugin.css'); ?> --> <?php echo Html::style('//cdn.datatables.net/1.10.23/css/jquery.dataTables.min.css'); ?> <?php $__env->stopPush(); ?> <?php $__env->startSection('content'); ?> <div class="row"> <div class="col-lg-12 grid-margin"> <div class="card"> <div class="card-body"> <div class="row grid-margin"> <div style ="display:flex;" class="col-lg-8"> <h4 class="card-title">My OMC Requests</h4> <!--Button to open the popup form --> <button style="margin-left:150px;" id="openButton">Give Edit OMC/OMR Authorization</button> </div> <div class="col-lg-4"> <select class="form-control mr" onchange="get_omc_request_of_warehouse(this)"> <?php $__currentLoopData = $warehouses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $warehouse): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($warehouse); ?>" <?php echo e($current_warehouse == $warehouse ? 'selected' : ''); ?> ><?php echo e($warehouse); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> </div> <div class="table-responsive" style="overflow-y:scroll; height: 650px;"> <table class="table table-striped myTable"> <thead> <tr> <th> MR No. </th> <th> PO No.</th> <th> Warehouse</th> <th> Request By</th> <th> Status </th> <th> Action </th> </tr> </thead> <tbody id="my_omc_request"> <?php $__currentLoopData = $omc_requests; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $omc_request): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <tr> <td><?php echo e($omc_request->mr_no); ?></td> <td><?php echo e($omc_request->po_no); ?></td> <td><?php echo e($omc_request->warehouse); ?></td> <td><?php echo e($omc_request->request_by); ?></td> <td> <?php if($omc_request->status == 'request'): ?> <span class="badge bg-warning">Requested</span> <?php elseif($omc_request->status == 'authorize' || $omc_request->status == 'Authorized'): ?> <span class="badge bg-success">Authorized</span> <?php elseif($omc_request->status == 'rejected' || $omc_request->status == 'reject'): ?> <span class="badge bg-danger">Rejected</span> <?php endif; ?> </td> <td> <?php if($omc_request->edit_permission == 1 && $omc_request->status == 'request'): ?> <a class="btn btn-sm" style="background-color:#34E89E" href="<?php echo e(url('circle-store/view-omcr/'.$omc_request->id)); ?>"><i class="fa fa-eye" style="font-size:15px"></i></a> <a class="btn btn-sm btn-primary" href="<?php echo e(url('circle-store/edit-omc-requests/'.$omc_request->id)); ?>"><i class="fa fa-edit" style="font-size:15px"></i></a> <a class="btn btn-sm btn-danger" href="<?php echo e(url('circle-store/revert-omc/'.$omc_request->id)); ?>"><i class="fa fa-undo" style="font-size:15px"></i></a> <?php else: ?> <a class="btn btn-sm" style="background-color:#34E89E" href="<?php echo e(url('circle-store/view-omcr/'.$omc_request->id)); ?>"><i class="fa fa-eye" style="font-size:15px"></i></a> <?php endif; ?> </td> </tr> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </tbody> </table> </div> </div> </div> </div> </div> <!-- The popup form -----------------------------------------------------> <div class="popup" id="popup"> <span id="closeButton" onclick="closePopup()" style="border: 1px solid #ccc; width: 35px; height: 35px; margin: 0px 20px 0px 0px; text-align: center; padding: 0px 0px 35px 0px; border-radius:50%; background-color:#FFFFFF">×</span> <h4 class="stn">Edit OMC/OMR Authorization</h4> <div class="horizontal-line"></div> <!-- Horizontal line after the heading --> <form method="post" action="<?php echo e(url('circle-store/update-omc-permission')); ?>" onsubmit="return validateForm()"> <?php echo csrf_field(); ?> <label for="stn_id">MR No:</label> <input type="text" name="mr_no" id="mr_no" placeholder="Enter OMR No."> <span class="text-danger"><?php $__errorArgs = ['mr_no']; $__bag = $errors->getBag($__errorArgs[1] ?? 'default'); if ($__bag->has($__errorArgs[0])) : if (isset($message)) { $__messageOriginal = $message; } $message = $__bag->first($__errorArgs[0]); ?><?php echo e($message); ?><?php unset($message); if (isset($__messageOriginal)) { $message = $__messageOriginal; } endif; unset($__errorArgs, $__bag); ?></span> <div class="checkbox-label"> <input type="checkbox" name="edit_permission" id="edit_permission" value="1"> <label for="edit_permission">Edit Permission:</label> <span class="text-danger"><?php $__errorArgs = ['edit_permission']; $__bag = $errors->getBag($__errorArgs[1] ?? 'default'); if ($__bag->has($__errorArgs[0])) : if (isset($message)) { $__messageOriginal = $message; } $message = $__bag->first($__errorArgs[0]); ?><?php echo e($message); ?><?php unset($message); if (isset($__messageOriginal)) { $message = $__messageOriginal; } endif; unset($__errorArgs, $__bag); ?></span> </div> <input type="submit" value="Submit"> </form> </form> </div> <!---------------------------------------------------------------------------> <?php $__env->stopSection(); ?> <?php $__env->startPush('plugin-scripts'); ?> <?php echo Html::script('/assets/plugins/chartjs/chart.min.js'); ?> <?php echo Html::script('/assets/plugins/jquery-sparkline/jquery.sparkline.min.js'); ?> <?php $__env->stopPush(); ?> <?php $__env->startPush('custom-scripts'); ?> <?php echo Html::script('/assets/js/dashboard.js'); ?> <?php echo Html::script('//cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js'); ?> <script type="text/javascript"> $(document).ready( function () { var myTable = $('.myTable').dataTable(); } ); </script> <script type="text/javascript"> function get_omc_request_of_warehouse(t){ var warehouse = $(t).val(); if(warehouse != ""){ var url = window.location.origin + "/circle-store/get-omc-request-of-warehouse"; var data = { warehouse: warehouse, _token: "<?php echo e(csrf_token()); ?>" }; $('#loaderAction').show(); $.ajax({ type: "POST", url: url, data: data, success: function(res){ if(res.success == true){ var html = ""; $.each(res.omc_requests, function(k, val){ html += `<tr> <td>` + val.mr_no + `</td> <td>` + val.po_no + `</td> <td>` + val.warehouse + `</td> <td>` + val.request_by + `</td> <td><label class="badge badge-info">` + val.status + `</label></td> <td>`; if(val.edit_permission == 1 && val.status == 'request'){ html += `<a class="btn btn-sm" style="background-color:#34E89E" href="` + window.location.origin + `/circle-store/view-omcr/` + val.id + `"><i class="fa fa-eye" style="font-size:15px"></i></a> <a class="btn btn-sm btn-primary" href="` + window.location.origin + `/circle-store/edit-omc-requests/` + val.id + `"><i class="fa fa-edit" style="font-size:15px"></i></a> <a class="btn btn-sm btn-danger" href="` + window.location.origin + `/circle-store/revert-omc/` + val.id + `"><i class="fa fa-trash" style="font-size:15px"></i></a>`; } else { html += `<a class="btn btn-sm" style="background-color:#34E89E" href="` + window.location.origin + `/circle-store/view-omcr/` + val.id + `"><i class="fa fa-eye" style="font-size:15px"></i></a>`; } html += `</td></tr>`; }); $('#my_omc_request').html(html); } else { swal(res.msg, { icon: "error" }); } $('#loaderAction').hide(); }, error: function(error){ console.log(error); }, dataType: 'json' }); } } </script> <script> // Get references to the button and popup elements var openButton = document.getElementById("openButton"); var popup = document.getElementById("popup"); // Function to open the popup openButton.onclick = function () { popup.style.display = "block"; }; // Function to close the popup function closePopup() { popup.style.display = "none"; } </script> <script> // Check if the session variable indicates success var sweetAlertMessage = "<?php echo e(session('sweet_alert_success', '')); ?>"; // Display a SweetAlert with the appropriate message and icon if (sweetAlertMessage) { if (sweetAlertMessage.indexOf("Sorry") !== -1) { swal("Sorry!", sweetAlertMessage, "error"); } else { swal("Granted Permission Successfully!", sweetAlertMessage, "success"); } } </script> <script> function validateForm() { var mrNo = document.getElementById("mr_no").value; var editPermission = document.getElementById("edit_permission").checked; if (mrNo === "" || !editPermission) { Swal.fire({ icon: 'Error', title: 'Validation Error', text: 'Both STN no. & Edit Permission fields are required.', }); return false; // Prevent form submission } // If both fields are filled, continue with form submission return true; } </script> <?php $__env->stopPush(); ?> <?php echo $__env->make('layout.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/assets/resources/views/circle-store/omc/edit-my-omc-requests.blade.php ENDPATH**/ ?>