/
home
/
sjslayjy
/
public_html
/
olddevlok
/
resources
/
views
/
dashboard
/
import
/
Upload File
HOME
@extends('dashboard.layouts.app') @section('title','Direct Labour Payment') @section('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="#">Home</a> </li> <li class="active">Import Sale</li> </ul> </div> <div class="page-content"> @if(session()->has('message')) <div class="alert alert-success"> <button type="button" class="close" data-dismiss="alert">×</button> {{ session()->get('message') }} </div> @endif <div class="row"> <div class="col-xs-12"> <h3 class="header smaller lighter blue">Sales Import</h3> <div class="clearfix"> <div class="pull-right tableTools-container"> </div> </div> <div class="table-header"> Results for "Latest Sales" <div class="widget-toolbar no-border"> <a class="btn btn-xs bigger btn-danger dropdown-toggle" data-toggle="modal" href='#importSaleModal'> import <i class="ace-icon fa fa-plus icon-on-right"></i> </a> </div> </div> </div> </div> <div class="table-responsive"> <div class="dataTables_borderWrap"> <table id="dynamic-table" class="table table-striped table-bordered table-hover"> <thead> <tr> <th>#</th> <th>Date</th> <th>Sale Type</th> <th>Chl. No.</th> <th>Dealer</th> <th>Retailer</th> <th>Destination</th> <th>Product</th> <th>Rate</th> <th>QTY</th> <th>Truck</th> <th>Fix Rate</th> <th>Freight</th> </tr> </thead> <tbody> @foreach($sale_detailes as $sale_detaile) <tr id="tr_{{$sale_detaile->id}}"> <td>{{$sale_detaile->id}}</td> <td>{{date('d/m/Y',strtotime($sale_detaile->date))}}</td> <td>{{$sale_detaile->sale_type}}</td> <td>{{$sale_detaile->chl_no}}</td> @if(getdealer($sale_detaile->dealer_code)->name) <td>{{getdealer($sale_detaile->dealer_code)->name}}</td> @else <td><b class="text text-danger">{{$sale_detaile->dealer_code}}</b></td> @endif @if((getretailer($sale_detaile->retailer_code)->name) ||(getretailer($sale_detaile->retailer_code)->name)!=0 ) <td>{{getretailer($sale_detaile->retailer_code)->name}}</td> @else <td><b class="text text-danger">{{$sale_detaile->retailer_code}}</b></td> @endif @if(getdestination($sale_detaile->destination_id)->name) <td>{{getdestination($sale_detaile->destination_id)->name}}</td> @else <td><b class="text text-danger">{{$sale_detaile->destination_code}}</b></td> @endif {{-- <td>{{(getdealer($sale_detaile->dealer_code)->name?getdealer($sale_detaile->dealer_code)->name:$sale_detaile->dealer_code)}}</td> --}} {{-- <td>{{getretailer($sale_detaile->retailer_code)->name}}</td> --}} {{-- <td>{{getdestination($sale_detaile->destination_id)->name}}</td> --}} <td>{{$sale_detaile->product}}</td> <td>{{$sale_detaile->rate}}</td> <td>{{$sale_detaile->quantity}}</td> <td>{{$sale_detaile->truck_no}}</td> <td>{{$sale_detaile->fix_rate}}</td> <td>{{$sale_detaile->freight}}</td> </tr> @endforeach </tbody> </table> </div> </div> </div> </div> </div> </div> <div class="modal fade" id="importSaleModal"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title">Import Sales</h4> </div> <div class="modal-body"> <form action="{{URL('/import/sales')}}" enctype="multipart/form-data" method="post"> <div class="row"> {{csrf_field()}} <div class="col-md-12"> <div class="form-group"> <label for="name">File</label> <input type="file" class="form-control" name="sale_file" id="sale_file"> </div> </div> </div> </div> <div class="modal-footer"> <a href="{{url('/excel_formats/ImportSale.xlsx')}}" class="btn btn-warning btn-rounded" style="margin-right: 270px;">Excel Format</a> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="submit" id="importSaleBtn" class="btn btn-primary">Submit</button> </div> </form> </div> </div> </div> @section('script') {{ Html::script("assets/js/jquery.dataTables.min.js")}} {{ Html::script("assets/js/jquery.dataTables.bootstrap.min.js")}} {{ Html::script("assets/js/dataTables.buttons.min.js")}} {{ Html::script("assets/js/buttons.flash.min.js")}} {{ Html::script("assets/js/buttons.html5.min.js")}} {{ Html::script("assets/js/buttons.print.min.js")}} {{ Html::script("assets/js/buttons.colVis.min.js")}} {{ Html::script("assets/js/dataTables.select.min.js")}} {{ Html::script("assets/js/ace-elements.min.js")}} {{ Html::script("assets/js/ace.min.js")}} {{ Html::script("assets/js/mdtimepicker.min.js")}} {{ Html::script("assets/js/bootstrap-datepicker.min.js")}} <script type="text/javascript"> jQuery(function($) { $('.date-picker').datepicker({ autoclose: true, todayHighlight: true }) .next().on(ace.click_event, function(){ $(this).prev().focus(); }); //initiate dataTables plugin var myTable = $('#dynamic-table').DataTable( { bAutoWidth: false, "aaSorting": [], } ); $.fn.dataTable.Buttons.defaults.dom.container.className = 'dt-buttons btn-overlap btn-group btn-overlap'; new $.fn.dataTable.Buttons( myTable, { buttons: [ { "extend": "colvis", "text": "<i class='fa fa-search bigger-110 blue'></i> <span class='hidden'>Show/hide columns</span>", "className": "btn btn-white btn-primary btn-bold", columns: ':not(:first):not(:last)' }, { "extend": "copy", "text": "<i class='fa fa-copy bigger-110 pink'></i> <span class='hidden'>Copy to clipboard</span>", "className": "btn btn-white btn-primary btn-bold" }, { "extend": "csv", "text": "<i class='fa fa-database bigger-110 orange'></i> <span class='hidden'>Export to CSV</span>", "className": "btn btn-white btn-primary btn-bold" }, { "extend": "excel", "text": "<i class='fa fa-file-excel-o bigger-110 green'></i> <span class='hidden'>Export to Excel</span>", "className": "btn btn-white btn-primary btn-bold" }, { "extend": "pdf", "text": "<i class='fa fa-file-pdf-o bigger-110 red'></i> <span class='hidden'>Export to PDF</span>", "className": "btn btn-white btn-primary btn-bold" }, { "extend": "print", "text": "<i class='fa fa-print bigger-110 grey'></i> <span class='hidden'>Print</span>", "className": "btn btn-white btn-primary btn-bold", autoPrint: false, message: 'This print was produced using the Print button for DataTables' } ] } ); myTable.buttons().container().appendTo( $('.tableTools-container') ); //style the message box var defaultCopyAction = myTable.button(1).action(); myTable.button(1).action(function (e, dt, button, config) { defaultCopyAction(e, dt, button, config); $('.dt-button-info').addClass('gritter-item-wrapper gritter-info gritter-center white'); }); var defaultColvisAction = myTable.button(0).action(); myTable.button(0).action(function (e, dt, button, config) { defaultColvisAction(e, dt, button, config); if($('.dt-button-collection > .dropdown-menu').length == 0) { $('.dt-button-collection') .wrapInner('<ul class="dropdown-menu dropdown-light dropdown-caret dropdown-caret" />') .find('a').attr('href', '#').wrap("<li />") } $('.dt-button-collection').appendTo('.tableTools-container .dt-buttons') }); }) </script> @endsection @endsection