/
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 $__env->stopPush(); ?> <?php $__env->startSection('content'); ?> <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@11"> <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script> <div class="row"> <div class="col-lg-12 grid-margin"> <div class="card"> <div class="card-body"> <div class="row"> <div class="col-lg-9" style="display:flex; flex-direction:row;"> <h4 class="card-title">List Of Goods Transfer Notes for Plants </h4> <!--Button to open the popup form --> <button id="openButton">Edit Authorization</button> <!--<?php if(auth()->check() && auth()->user()->id === 1): ?>--> <!-- Button to open the popup form --> <!-- <button id="openButton">Edit Authorization</button>--> <!--<?php endif; ?>--> </div> <div class="col-lg-3"> <select class="form-control mr" id="warehouse" onchange="get_ware_house(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"> <table class="table table-striped"> <thead> <tr> <th> STN No </th> <th> Stn Date </th> <th>Warehouse</th> <th> Status </th> <th> action </th> </tr> </thead> <tbody id="all_stn"> <?php $__currentLoopData = $all_stn; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $stn): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <tr> <td class="font-weight-medium"><?php echo e($stn->stn_no); ?></td> <td><?php echo e($stn->stn_date); ?></td> <td><?php echo e($stn->to_warehouse); ?></td> <td><?php echo e($stn->status); ?></td> <td> <?php if($stn->edit_permission == 1 && $stn->status == 'stn_release'): ?> <a target="_blank" href="<?php echo e(url('circle-store/edit-stn/'.$stn->id)); ?>">Edit</a> | <a target="_blank" href="<?php echo e(url('circle-store/revert-stn/'.$stn->id)); ?>"><i class="fa fa-trash-o" style="font-size:20px;color:red;"></i></a> | <a target="_blank" href="<?php echo e(url('circle-store/print-stn/'.$stn->id.'/Original')); ?>">Original</a> | <a target="_blank" href="<?php echo e(url('circle-store/print-stn/'.$stn->id.'/Duplicate')); ?>">Duplicate</a> <?php else: ?> <a target="_blank" href="<?php echo e(url('circle-store/print-stn/'.$stn->id.'/Original')); ?>">Original</a> | <a target="_blank" href="<?php echo e(url('circle-store/print-stn/'.$stn->id.'/Duplicate')); ?>">Duplicate</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> <h3 class="stn">Edit STN Authorization</h2> <div class="horizontal-line"></div> <!-- Horizontal line after the heading --> <form method="POST" action="<?php echo e(url('circle-store/update-stn-permission')); ?>" onsubmit="return validateForm()"> <?php echo csrf_field(); ?> <label for="stn_id">STN ID:</label> <input type="text" name="stn_no" id="stn_no" placeholder="Enter Stn Id"> <span class="text-danger"><?php $__errorArgs = ['stn_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'); ?> <script type="text/javascript"> function get_ware_house(t) { var warehouse = $(t).val(); if (warehouse != "") { var url = window.location.origin + "/circle-store/get-stn-warehouse-wise" var mydata = {}; mydata._token = "<?php echo e(csrf_token()); ?>"; mydata.warehouse = warehouse; $.ajax({ type: "POST", url: url, data: mydata, success: function(res) { console.log(res); if (res.success == true) { var html = ""; $.each(res.allstn, function(key, stn) { html += `<tr> <td class="font-weight-medium">` + stn.stn_no + `</td> <td>` + stn.stn_date + `</td> <td>` + stn.to_warehouse + `</td> <td>` + stn.status + `</td> <td> <a href="<?php echo e(url('circle-store/print-stn/')); ?>/${stn.id}/Original">Original</a> | <a href="<?php echo e(url('circle-store/print-stn/')); ?>/${stn.id}/Duplicate">Duplicate</a>`; if (stn.edit_permission == 1 && stn.status == 'stn_release') { html += ` | <a href="<?php echo e(url('circle-store/edit-stn/')); ?>/${stn.id}"><i class="fa fa-pencil" style="font-size:20px;"></i></a>`; } html += `</td> </tr>`; }); $('#all_stn').html(html); } else { swal(res.msg, { icon: "error", }); } $('#loaderAction').hide(); }, error: function(error) { console.log(error); }, dataType: 'json' }); } else { swal('Please Select warehouse !!', { icon: "error", }); } } </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> <!--------Added to show the popup message on delete-------------------------> <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("Authenticated!", sweetAlertMessage, "success"); } } </script> <script> function validateForm() { var stnNo = document.getElementById("stn_no").value; var editPermission = document.getElementById("edit_permission").checked; if (stnNo === "" || !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/delete-stn.blade.php ENDPATH**/ ?>