/
home
/
sjslayjy
/
public_html
/
olddevlok
/
storage
/
framework
/
views
/
Upload File
HOME
<?php $__env->startSection('title','Product Allotments'); ?> <?php $__env->startSection('content'); ?> <div class="main-content"> <div class="main-content-inner"> <div class="breadcrumbs ace-save-state" id="breadcrumbs"> <ul class="breadcrumb"> <li> <i class="ace-icon fa fa-home home-icon"></i> <a href="#"><?php echo e(__('messages.Home')); ?></a> </li> <li class="active"><?php echo e(__('messages.Product')); ?> <?php echo e(__('messages.Allotment')); ?></li> </ul> </div> <div class="page-content"> <div class="page-header"> <h1> <?php echo e(__('messages.Update')); ?> <?php echo e(__('messages.Rake')); ?> <?php echo e(__('messages.Product')); ?> <?php echo e(__('messages.Allotment')); ?> # <?php echo e($allotment->id); ?> </h1> </div><!-- /.page-header --> <form action="" role="form" id="AllotProductForm"> <input type="hidden" name="id" value="<?php echo e($allotment->id); ?>"> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title"> <?php echo e(__('messages.Rake')); ?> <?php echo e(__('messages.Product')); ?> <?php echo e(__('messages.Allotment')); ?> </h3> </div> <div class="panel-body"> <div class="row"> <div class="col-md-4"> <div class="form-group"> <label for="master_rake_id"> <?php echo e(__('messages.masterrake')); ?></label> <select class="form-control select2" name="master_rake_id" id="master_rake_id" disabled="disabled"> <option value=""><?php echo e(__('messages.SelectMasterRake')); ?></option> <?php $__currentLoopData = $master_rakes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $master_rake): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($master_rake->id); ?>" <?php echo e($master_rake->id == $allotment->master_rake_id ? "selected":""); ?>><?php echo e($master_rake->name); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> <span class="label label-danger" id="add_master_rake_error" style="display: none;"></span> </div> </div> <div class="col-md-3"> <div class="form-group"> <label for="dealer_id"><?php echo e(__('messages.Dealer')); ?></label> <select class="form-control select2" name="dealer_id[]" id="dealer_id" disabled="disabled"> <option value=""> <?php echo e(__('messages.Dealer')); ?> <?php echo e(__('messages.Select')); ?></option> <?php $__currentLoopData = $dealers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $dealer): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($dealer->id); ?>" <?php echo e($dealer->id == $allotment->dealer_id ? "selected":""); ?>><?php echo e($dealer->name); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> <span class="label label-danger" id="add_dealer_id_error" style="display: none;"></span> </div> </div> </div> <div class="row"> <input type="hidden" name="product" value="<?php echo e($allotment->product_id); ?>"> <div class="col-md-4"> <div class="form-group"> <label for="product_id"> <?php echo e(__('messages.Product')); ?></label> <select class="form-control checkIfValid select2" name="product_id[]" disabled="disabled"> <option value=""> <?php echo e(__('messages.Product')); ?> <?php echo e(__('messages.Select')); ?></option> <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($product->id); ?>" <?php echo e($product->id == $allotment->product_id ? "selected":""); ?>><?php echo e($product->name); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> <span class="label label-danger" id="add_product_error" style="display: none;"></span> </div> </div> <div class="col-md-2"> <div class="form-group"> <label for="unit_id"><?php echo e(__('messages.Unit')); ?></label> <select class="form-control checkIfValid select2" name="unit_id[]" disabled="disabled"> <option value=""> <?php echo e(__('messages.Unit')); ?> <?php echo e(__('messages.Select')); ?></option> <?php $__currentLoopData = $units; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $unit): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($unit->id); ?>" <?php echo e($unit->id == $allotment->unit_id ? "selected":""); ?>><?php echo e($unit->unit); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> <span class="label label-danger" id="add_unit_error" style="display: none;"></span> </div> </div> <div class="col-md-2"> <div class="form-group"> <label for="quantity"><?php echo e(__('messages.Alloted')); ?> <?php echo e(__('messages.Quantity')); ?></label> <input type="text" name="quantity" class="form-control checkIfValid" value="<?php echo e($allotment->alloted_quantity); ?>"> <span class="label label-danger" id="add_quantity_error" style="display: none;"></span> </div> </div> </div> <div class="pull-right"> <a href="<?php echo e(URL('/user/rake-product-allotments')); ?>" class="btn btn-default" >Back</a> <button type="button" id="allotProductBtn" class="btn btn-primary">Submit</button> </div> </div> </div> </form> </div> </div><!-- /.page-content --> </div><!-- /.main-content --> <?php $__env->startSection('script'); ?> <?php echo e(Html::script("assets/js/ace-elements.min.js")); ?> <?php echo e(Html::script("assets/js/ace.min.js")); ?> <?php echo e(Html::script("assets/js/bootstrap-datepicker.min.js")); ?> <script type="text/javascript"> $(document).ready(function() { $('#allotProductBtn').click(function(e){ e.preventDefault(); if(validateField()){ return false; }else{ $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content') } }); $('.loading-bg').show(); $.ajax({ url: $('#AllotProductForm').attr('action'), method: 'POST', data: $('#AllotProductForm').serialize(), success: function(data){ $('.loading-bg').hide(); if(!data.flag){ showError('add_master_rake_error',data.errors.master_rake_id); showError('add_company_error',data.errors.company_id); showError('add_product_error',data.errors.product_id); showError('add_unit_error',data.errors.unit_id); showError('add_quantity_error',data.errors.quantity); }else{ swal({ title: "Success!", text: data.message, type: "success" }, function() { window.location.reload(); }); } } }); } }); }); function validateField(){ var errorCount = 0; $('.checkIfValid').each(function(){ if($(this).val() == ""){ errorCount = errorCount + 1; $(this).closest('.form-group').find('.label-danger').text('Required'); $(this).closest('.form-group').find('.label-danger').show(); }else{ $(this).closest('.form-group').find('.label-danger').hide(); } }); if(errorCount > 0){ return true; }else{ return false; } } function removeRow(id){ $('#newRow'+id).remove(); } function showError(id,error){ if(typeof(error) === "undefined"){ $('#'+id).hide(); }else{ $('#'+id).show(); $('#'+id).text(error); } } </script> <?php $__env->stopSection(); ?> <?php $__env->stopSection(); ?> <?php echo $__env->make('dashboard.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/pmmsanvp/public_html/srt/resources/views/dashboard/rake/edit-allot-product.blade.php ENDPATH**/ ?>