/
home
/
sjslayjy
/
public_html
/
tabson_test
/
resources
/
views
/
dashboard
/
report
/
Upload File
HOME
@extends('dashboard.layouts.app') @section('title','Customize Report') @section('style') <style type="text/css"> span.close-now { background: red; width: 25px; height: 25px; display: block; text-align: center; border-radius: 50%; padding: 3px; color: #fff; margin-top: 30px; } </style> @endsection @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">Customize Report</li> </ul> </div> <div class="page-content"> <div class="row"> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title">Customize Report</h3> </div> <div class="panel-body"> <form action="{{ URL('/user/customize-reports') }}" role="form" method="post" id="customizeReport"> {{csrf_field()}} <div class="row grid-margin"> <div class="col-lg-3"> <label>Select Category</label> <select class="e1" id="categories" name="categories[]"class="form-control" multiple> @foreach($categories as $key=>$category) <option value="{{$category->id}}" {{ in_array($category->id, $old_category) ? 'selected' : '' }}>{{ $category->name}}</option> @endforeach </select> </div> <div class="col-lg-3"> <label>Select Description</label> <select class="e1" id="item_description" name="items_description[]"class="form-control" multiple> @foreach($items as $key=>$item) <option value="{{$item->id}}" {{ in_array($item->id, $old_description) ? 'selected' : '' }}>{{ $item->description}}</option> @endforeach </select> </div> <div class="col-lg-3"> <label>Select Department</label> <select class="e1" id="department" name="department[]"class="form-control" multiple> @foreach($departments as $key=>$department) <option value="{{$department->id}}" {{ in_array($department->id, $old_department) ? 'selected' : '' }}>{{ $department->name}}</option> @endforeach </select> </div> </div> <div class="row grid-margin"> <div class="col-lg-3"> <label>Select Business Unit</label> <select class="e1" id="business_unit" name="business_unit[]"class="form-control" multiple> @foreach($business_units as $key=>$business_unit) <option value="{{$business_unit->id}}" {{ in_array($business_unit->id, $old_business_unit) ? 'selected' : '' }}>{{ $business_unit->name}}({{$business_unit->short_name}})</option> @endforeach </select> </div> <div class="col-lg-3"> <label>Select Customer</label> <select class="e1" id="customer" name="customer[]"class="form-control" multiple> @foreach($customers as $key=>$customer) <option value="{{$customer->id}}" {{ in_array($customer->id, $old_customer) ? 'selected' : '' }}>{{ $customer->name}}</option> @endforeach </select> </div> <div class="col-lg-3"> <label>Select Circle</label> <select class="e1" id="circle" name="circle[]"class="form-control" multiple> @foreach($circles as $key=>$circle) <option value="{{$circle->id}}" {{ in_array($circle->id, $old_circle) ? 'selected' : '' }}>{{ $circle->name}}({{$circle->code}})</option> @endforeach </select> </div> </div> <div class="row grid-margin"> <div class="col-lg-3"> <label>Select Vendor</label> <select class="e1" id="vendor" name="vendor[]"class="form-control" multiple> @foreach($vendors as $key=>$vendor) <option value="{{$vendor->id}}" {{ in_array($vendor->id, $old_vendor) ? 'selected' : '' }}>{{ $vendor->vendor_name}}</option> @endforeach </select> </div> <div class="col-lg-3"> <div class="form-group"> <label>Date From:<span class="text text-danger"> <b>*</b></span></label> <input type="date" id="from_date" name="from_date" placeholder="Enter from_date" class="form-control" value="{{$from_date}}"> @error('from_date') <span class="label label-danger"><b>{{$message}}</b></span> @enderror </div> </div> <div class="col-lg-3"> <div class="form-group"> <label>Date To:<span class="text text-danger"> <b>*</b></span></label> <input type="date" id="to_date" name="to_date" placeholder="Enter to_date" class="form-control" value="{{$to_date}}"> @error('to_date') <span class="label label-danger"><b>{{$message}}</b></span> @enderror </div> </div> <div class="col-lg-3" style="padding-top:20px;"> <button type="submit" id="generateCustomizeReportBtn" class="btn btn-primary float-right">Generate Report</button> <button type="button" id="generate_excel" class="btn btn-primary float-right" onclick="generateExcel()">Generate Excel</button> </div> </div> <div class="clearfix"> <div class="pull-right tableTools-container"> </div> </div> </form> </div> </div> </div> <div class="row"> <div class="table-responsive"> <table class="table table-striped table-bordered" id="myTable"> <thead> <tr> <th>Item Category</th> <th>Item Code</th> <th>Item Description</th> <th>Specification</th> <th>Make</th> <th>Department</th> <th>Business Unit</th> <th>Customer</th> <th>Circle</th> <th>PR Number</th> <th>PR Date</th> <th>PO Creater</th> <th>PO Number</th> <th>PO Date</th> <th>Vendor Name</th> <th>PO Qty</th> <th>Unit Price</th> <th>Basic Amount</th> <th>Tax %age</th> <th>Tax Amount</th> <th>Total Amount</th> </tr> </thead> <tbody> @if(isset($report_data)) @foreach($report_data as $key=>$value) <tr id="tr_{{ $value->id }}"> <td>{{ $value->category_name }}</td> <td>{{ $value->item_code }}</td> <td>{{ $value->description }}</td> <td>{{ $value->specification }}</td> <td>{{ $value->make }}</td> <td>{{ $value->department_name }}</td> <td>{{ $value->business_name }}</td> <td>{{ $value->customer_name }}</td> <td>{{ $value->circle_name }}</td> <td>{{ $value->pr_number }}</td> <td>{{ $value->pr_date }}</td> <td>{{ getModelById('User', $value->po_created_by)->name }}</td> <td>{{ $value->po_number }}</td> <td>{{ $value->po_date }}</td> <td>{{ $value->vendor_name }}</td> <td>{{ $value->qty }}</td> <td>{{ $value->rate }}</td> <td>{{ $value->basic_amount }}</td> <td>{{ $value->gst }}</td> <td>{{ $value->tax_amount }}</td> <td>{{ $value->total_amount }}</td> </tr> @endforeach @else <tr> <td colspan="20">No Data Found...</td> </tr> @endif </tbody> </table> </div> </div> </div><!-- /.page-content --> </div> </div> @endsection @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")}} <script> $(document).ready(function() { $(".e1").select2(); }); function generateExcel() { var tab_text="<table border='2px'><tr bgcolor='#87AFC6'>"; var textRange; var j=0; tab = document.getElementById('myTable'); // id of table for(j = 0 ; j < tab.rows.length ; j++) { tab_text=tab_text+tab.rows[j].innerHTML+"</tr>"; //tab_text=tab_text+"</tr>"; } tab_text=tab_text+"</table>"; tab_text= tab_text.replace(/<A[^>]*>|<\/A>/g, "");//remove if u want links in your table tab_text= tab_text.replace(/<img[^>]*>/gi,""); // remove if u want images in your table tab_text= tab_text.replace(/<input[^>]*>|<\/input>/gi, ""); // reomves input params var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) // If Internet Explorer { txtArea1.document.open("txt/html","replace"); txtArea1.document.write(tab_text); txtArea1.document.close(); txtArea1.focus(); sa=txtArea1.document.execCommand("SaveAs",true,"Say Thanks to Alok.xls"); } else //other browser not tested on IE 11 sa = window.open('data:application/vnd.ms-excel,' + encodeURIComponent(tab_text)); return (sa); } function showError(id,error){ if(typeof(error) === "undefined"){ $('#'+id).hide(); }else{ $('#'+id).show(); $('#'+id).text(error); } } </script> @endsection