/
home
/
sjslayjy
/
public_html
/
devlok
/
resources
/
views
/
dashboard
/
stock
/
Upload File
HOME
<form id="editStockTransferWarehouseForm" method="POST"> <input type="hidden" name="_token" value="{{ csrf_token() }}"> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label for="rake_point">Rake Point</label> <select class="form-control select2" name="rake_point" id="edit_rake_point"> <option value="">Select Rake Point</option> @foreach($rake_points as $rake_point) <option value="{{$rake_point->id}}" {{ $rakeTransfer->rake_id == $rake_point->id ? 'selected' : '' }}>{{$rake_point->rake_point}}</option> @endforeach </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="warehouse_id">Warehouse</label> <select class="form-control select2" name="warehouse_id" id="edit_warehouse_id"> <option value="">Select Warehouse</option> @foreach($warehouse as $wh) <option value="{{$wh->id}}" {{ $rakeTransfer->warehouse_id == $wh->id ? 'selected' : '' }}>{{$wh->name}}</option> @endforeach </select> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="form-group"> <label>Products</label> <table class="table table-striped table-bordered"> <thead> <tr> <th>Product Name</th> <th>Fresh Quantity</th> <th>Damage Quantity</th> </tr> </thead> <tbody> @foreach($productDetails as $key => $detail) <tr> <td> <select name="product_id[]" class="form-control select2"> <option value="">Select Product</option> @foreach($products as $product) <option value="{{$product->id}}" {{ $detail->product_id == $product->id ? 'selected' : '' }}>{{$product->name}}</option> @endforeach </select> </td> <td> <input type="number" name="fresh_qty[]" class="form-control" value="{{$detail->fresh_qty}}" min="0"> </td> <td> <input type="number" name="demage_qty[]" class="form-control" value="{{$detail->damage_qty}}" min="0"> </td> </tr> @endforeach </tbody> </table> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label for="transporter_id">Transporter</label> <select class="form-control select2" name="transporter_id" id="edit_transporter_id"> <option value="">Select Transporter</option> @foreach($transporters as $transporter) <option value="{{$transporter->id}}" {{ $rakeTransfer->transporter_id == $transporter->id ? 'selected' : '' }}>{{$transporter->name}}</option> @endforeach </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="transport_mode">Transport Mode</label> <select class="form-control select2" name="transport_mode" id="edit_transport_mode"> <option value="">Select Transport Mode</option> @foreach($transport_modes as $mode) <option value="{{$mode->id}}" {{ $rakeTransfer->transporter_mode == $mode->id ? 'selected' : '' }}>{{$mode->name}}</option> @endforeach </select> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label for="vehicle_no">Vehicle No</label> <input type="text" class="form-control" name="vehicle_no" value="{{$rakeTransfer->vehicle_no}}" required> </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="driver_no">Driver No</label> <input type="text" class="form-control" name="driver_no" value="{{$rakeTransfer->driver_no}}" required> </div> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" id="editStockTransferWarehouseBtn" class="btn btn-primary">Update</button> </div> </form> <script> $(function() { $('.select2').select2(); $('#editStockTransferWarehouseBtn').click(function(e) { e.preventDefault(); var form = $('#editStockTransferWarehouseForm'); $.ajax({ url: '/stock/stock-transfer-warehouse/update/{{$rakeTransfer->id}}', type: 'POST', data: form.serialize(), success: function(data) { if(data.flag) { swal({ title: 'Success!', text: data.message, type: 'success' }, function() { window.location.reload(); }); $('#editStockTransferWarehouseModal').modal('hide'); } else { swal('Error', 'Please check the form for errors.', 'error'); } }, error: function(xhr) { swal('Error', 'Could not update record.', 'error'); } }); }); }); </script>