/
home
/
sjslayjy
/
public_html
/
olddevlok
/
storage
/
framework
/
views
/
Upload File
HOME
<?php $__env->startSection('title','Token'); ?> <?php $__env->startSection('style'); ?> <?php echo e(Html::style("assets/css/bootstrap-datepicker3.min.css")); ?> <?php $__env->stopSection(); ?> <?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.Home')); ?></li> </ul> </div> <div class="page-content"> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title"><?php echo e(__('messages.Update')); ?> <?php echo e(__('messages.Home')); ?> #<?php echo e($token->id); ?></h3> </div> <div class="panel-body"> <form action="" role="form" id="updateTokenForm"> <input type="hidden" name="id" value="<?php echo e($token->id); ?>"> <div class="container"> <div class="row"> <div class="col-md-4" style="display: none;"> <div class="form-group"> <label for="token_type"><?php echo e(__('messages.tokentype')); ?></label> <select class="form-control select2" name="token_type" id="token_type"> <option value="1" selected><?php echo e(__('messages.Rake')); ?> <?php echo e(__('messages.Unloading')); ?></option> <option value="2"><?php echo e(__('messsages.Stockin')); ?></option> </select> </div> </div> <div class="clearfix"></div> <!-- <div class="col-md-4"> <div class="form-group"> <label for="company_id"><?php echo e(__('messages.company')); ?></label> <select class="form-control select2" name="company_id" id="company_id"> <?php $__currentLoopData = $companies; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $company): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($company->id); ?>" <?php echo e($acting_company == $company->id ? "selected":""); ?>><?php echo e($company->name); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> </div> --> <div class="col-md-4"> <div class="form-group"> <label for="to_type"><?php echo e(__('messages.To')); ?></label> <select class="form-control select2" name="to_type" id="to_type" onchange="handleToType(this.value)" disabled=""> <option value="1" <?php echo e(1 == $token->to_type ? "selected":""); ?>>Warehouse</option> <option value="2" <?php echo e(2 == $token->to_type ? "selected":""); ?>>Retailer</option> <option value="3" <?php echo e(3 == $token->to_type ? "selected":""); ?>>Dealer</option> </select> </div> </div> <div class="col-md-4" id="warehouses_section" style="display: <?php echo e(1 == $token->to_type ? 'block':'none'); ?>;"> <div class="form-group"> <label for="warehouse_id"><?php echo e(__('messages.Warehouses')); ?></label> <select class="form-control select2" name="warehouse_id" id="warehouse_id" disabled=""> <option value=""><?php echo e(__('messsages.Warehouses')); ?> <?php echo e(__('messsages.Select')); ?></option> <?php $__currentLoopData = $warehouses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $warehouse): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($warehouse->id); ?>" <?php echo e($token->warehouse_id == $warehouse->id ? "selected":""); ?>><?php echo e($warehouse->name); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> <span class="label label-danger" id="add_warehouse_id_error" style="display: none;"></span> </div> </div> <div class="col-md-4" id="retailer_section" style="display: <?php echo e(2 == $token->to_type ? 'block':'none'); ?>;"> <div class="form-group"> <label for="retailer_id"><?php echo e(__('messages.Retailers')); ?></label> <select class="form-control select2" name="retailer_id" id="retailer_id" disabled=""> <option value=""><?php echo e(__('messsages.Retailers')); ?> <?php echo e(__('messsages.Select')); ?></option> <?php $__currentLoopData = $retailers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $retailer): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($retailer->id); ?>" <?php echo e($token->retailer_id == $retailer->id ? "selected":""); ?>><?php echo e($retailer->name); ?>(<?php echo e($retailer->address); ?>)</option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> <span class="label label-danger" id="add_warehouse_id_error" style="display: none;"></span> </div> </div> <div class="col-md-4" id="dealer_section" style="display: <?php echo e(3 == $token->to_type ? 'block':'none'); ?>;"> <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" onchange="handleDealer(this.value)" disabled=""> <option value=""><?php echo e(__('messsages.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($token->dealer_id == $dealer->id ? "selected":""); ?>><?php echo e($dealer->name); ?> (<?php echo e($dealer->address1); ?>)</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 class="clearfix"></div> <div class="col-md-4"> <div class="form-group"> <label for="date_of_generation"><?php echo e(__('messages.Date')); ?></label> <input type="text" class="form-control date-picker" name="date_of_generation" id="date_of_generation" placeholder="Date" value="<?php echo e(date('m/d/Y',strtotime($token->date_of_generation))); ?>" disabled=""> <span class="label label-danger" id="add_date_error" style="display: none;"></span> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="product_company_id"><?php echo e(__('messages.ProductCompany')); ?></label> <select class="form-control select2" name="product_company_id" id="product_company_id" disabled=""> <option value=""> <?php echo e(__('messsages.ProductCompany')); ?> <?php echo e(__('messsages.Select')); ?></option> <?php $__currentLoopData = $product_companies; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product_company): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($product_company->id); ?>" <?php echo e($product_company->id == $token->product_company_id ? "selected":""); ?>><?php echo e($product_company->name); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> <span class="label label-danger" id="add_product_company_id_error" style="display: none;"></span> </div> </div> <div class="clearfix"></div> <div class="col-md-4"> <div class="form-group"> <label for="quantity"><?php echo e(__('messages.Quantity')); ?></label> <input type="text" class="form-control" name="quantity" id="quantity" value="<?php echo e($token->quantity); ?>" placeholder="Quantity" > <span class="label label-danger" id="add_quantity_error" style="display: none;"></span> </div> </div> <div class="clearfix"></div> <div class="col-md-4"> <div class="form-group"> <label for="unit_id"><?php echo e(__('messages.Unit')); ?></label> <select class="form-control select2" name="unit_id" id="unit_id" 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 == $token->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_id_error" style="display: none;"></span> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="rate"><?php echo e(__('messages.Rate')); ?></label> <input type="text" class="form-control" name="rate" id="rate" placeholder="Rate" value="<?php echo e($token->rate); ?>" disabled=""> <span class="label label-danger" id="add_rate_error" style="display: none;"></span> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="transporter_id"><?php echo e(__('messages.Transporter')); ?></label> <select class="form-control select2" name="transporter_id" id="transporter_id" disabled=""> <option value=""><?php echo e(__('messages.Transporter')); ?> <?php echo e(__('messages.Select')); ?></option> <?php $__currentLoopData = $transporters; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $transporter): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($transporter->id); ?>" <?php echo e($transporter->id == $token->transporter_id ? "selected":""); ?>><?php echo e($transporter->name); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> <span class="label label-danger" id="add_transporter_id_error" style="display: none;"></span> </div> </div> <div class="clearfix"></div> <div class="col-md-4"> <div class="form-group"> <label for="warehouse_keeper_id"><?php echo e(__('messages.WarehouseKeeper')); ?></label> <select class="form-control select2" name="warehouse_keeper_id" id="warehouse_keeper_id" disabled=""> <option value=""><?php echo e(__('messages.WarehousesKeeper')); ?> <?php echo e(__('messages.Select')); ?></option> <?php $__currentLoopData = $warehouse_keepers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $warehouse_keeper): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($warehouse_keeper->id); ?>" <?php echo e($warehouse_keeper->id == $token->warehouse_keeper_id ? "selected":""); ?>><?php echo e($warehouse_keeper->name); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> <span class="label label-danger" id="add_Warehouse_keeper_id_error" style="display: none;"></span> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="truck_number"><?php echo e(__('messages.TruckNumber')); ?></label> <input type="text" class="form-control" name="truck_number" id="truck_number" placeholder="Truck Number" value="<?php echo e($token->truck_number); ?>" disabled=""> <span class="label label-danger" id="add_truck_number_error" style="display: none;"></span> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="delivery_payment_mode"><?php echo e(__('messages.DeliveryPaymentMode')); ?></label> <select class="form-control select2" name="delivery_payment_mode" id="delivery_payment_mode" disabled=""> <option value="EX">EX</option> <option value="FOR">FOR</option> </select> <span class="label label-danger" id="add_delivery_payment_mode_error" style="display: none;"></span> </div> </div> <div class="clearfix"></div> <div class="col-md-4"> <div class="form-group"> <label for="description"><?php echo e(__('messages.Description')); ?></label> <textarea name="description" id="description" class="form-control" rows="3" required="required" disabled=""><?php echo e($token->description); ?></textarea> <span class="label label-danger" id="add_description_error" style="display: none;"></span> </div> </div> </div> </div> <a href="<?php echo e(URL('/user/generated-token')); ?>" class="btn btn-default" >Back</a> <button type="button" id="updateTokenBtn" class="btn btn-primary">Submit</button> </form> </div> </div> </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() { $('.date-picker').datepicker({ autoclose: true, todayHighlight: true }) .next().on(ace.click_event, function(){ $(this).prev().focus(); }); $('#updateTokenBtn').click(function(e){ e.preventDefault(); $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content') } }); // $('.loading-bg').show(); $.ajax({ url: $('#updateTokenForm').attr('action'), method: 'POST', data: $('#updateTokenForm').serialize(), success: function(data){ $('.loading-bg').hide(); if(!data.flag){ showError('add_rake_id_error',data.errors.master_rake_id); showError('add_company_id_error',data.errors.company_id); showError('add_dealer_id_error',data.errors.dealer_id); showError('add_product_company_id_error',data.errors.product_company_id); showError('add_product_id_error',data.errors.product_id); showError('add_warehouse_id_error',data.errors.warehouse_id); showError('add_quantity_error',data.errors.quantity); showError('add_rate_error',data.errors.rate); showError('add_unit_id_error',data.errors.unit_id); showError('add_date_error',data.errors.date_of_generation); showError('add_account_from_id_error',data.errors.account_from_id); }else{ swal({ title: "Success!", text: data.message, type: "success" }, function() { window.location.reload(); }); } } }); }); }); function handleToType(type){ $('.loading-bg').show(); if(type == 1){ $('#warehouses_section').show(); $('#retailer_section').hide(); $('#dealer_section').hide(); }else if(type == 2){ $('#warehouses_section').hide(); $('#retailer_section').show(); $('#dealer_section').hide(); }else if(type == 3){ $('#warehouses_section').hide(); $('#retailer_section').hide(); $('#dealer_section').show(); } $('.loading-bg').hide(); } function handleDealer(id){ console.log(id); $('.loading-bg').show(); $('#account_from_id').val(id).trigger('change'); $('.loading-bg').hide(); } // function getMasterRakeDetails(id){ // if(id == ""){ // swal('Error','Master Rake id is missing','warning'); // }else{ // $('.loading-bg').show(); // $.ajax({ // url: "<?php echo e(url('/get-master-rake-details/')); ?>"+"/"+id, // type: 'GET', // success:function(data){ // console.log(data); // $('.loading-bg').hide(); // if(data.flag){ // var company_option = "<option value='"+data.master_rake.product_company.id+"'>"+data.master_rake.product_company.name+"</option>" // $('#product_company_id').html(company_option).trigger('change'); // var account_from_option = "<option value=''>Select Product</option>"; // $.each(data.master_rake.rake_allotments, function(i, value) { // account_from_option += "<option value="+value.dealer_id+">"+value.dealer.name+"("+value.dealer.address1+")</option>"; // }); // $('#account_from_id').html(account_from_option); // }else{ // swal('Error',data.message,'warning'); // } // } // }); // } // } function getRakeAllotmentDetails(dealer_id){ $('#product_id').html('').trigger('change'); $('#remaining_quantity').val(''); $('#quantity').val(''); var master_rake_id = $('#master_rake_id option:selected').val(); if(master_rake_id == ""){ $('#master_rake_id option:selected').focus(); $('#dealer_id').val(''); swal('Error','Please Select Master Rake','warning'); }else if(dealer_id == ""){ // swal('Error','Dealer is missing','warning'); }else{ $('.loading-bg').show(); $.ajax({ url: "<?php echo e(url('/get-dealer-rake-allotment/')); ?>"+"/"+master_rake_id+"/"+dealer_id, type: 'GET', success:function(data){ console.log(data); $('.loading-bg').hide(); if(data.flag){ $('#product_id').html(data.product_options); $('#account_id').val(dealer_id).trigger('change'); }else{ $('#company_id').val(''); swal('Error',data.message,'warning'); } } }); } } function getAllotedProductDetails(product_id){ var master_rake_id = $('#master_rake_id option:selected').val(); var dealer_id = $('#account_from_id option:selected').val(); if(master_rake_id == ""){ $('#master_rake_id option:selected').focus(); $('#dealer_id').val(''); swal('Error','Please Select Master Rake','warning'); }else if(dealer_id == ""){ // swal('Error','Dealer is missing','warning'); }else if(product_id == ""){ $('#product_id').val(''); swal('Error','Product missing','warning'); }else{ $('.loading-bg').show(); $.ajax({ url: "<?php echo e(url('/get-alloted-product-details/')); ?>"+"/"+master_rake_id+"/"+dealer_id+"/"+product_id, type: 'GET', success:function(data){ console.log(data); $('.loading-bg').hide(); if(data.flag){ $('#remaining_quantity').val(data.product_details.remaining_quantity); $('#quantity').val(data.product_details.remaining_quantity); $('#unit_id').val(data.product_details.unit_id).trigger('change'); }else{ $('#product_id').val(''); swal('Error',data.message,'warning'); } } }); } } 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/token/edit-token.blade.php ENDPATH**/ ?>