@extends('layout')
@section('title', 'رپورٹس')
@section('page_title', 'رپورٹس')
{{-- @section('page_sub_title', '') --}}
@section('content')
    <div class="row">
        <div class="col-md-3"></div>
        <div class="col-md-6">
            <div class="panel panel-card">
                <div class="panel-body">
                    <div class="row">
                        <div class="col-md-6">
                            <div class="input-group">
                                <span class="input-group-addon">تاریخ ابتدا</span>
                                <input type="date" id="starting_date" name="starting_date" value="2022-05-01"
                                       class="form-control">
                            </div>
                            <span class="text-danger error" id="starting_date_error"></span>
                        </div>
                        <div class="col-md-6">
                            <div class="input-group">
                                <span class="input-group-addon">تاریخ انتہا</span>
                                <input type="date" id="ending_date" name="ending_date" class="form-control"
                                       value="{{ date('Y-m-d') }}">
                            </div>
                            <span class="text-danger error" id="ending_date_error"></span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-3"></div>
    </div>
    <div class="row mt-2">
        <div class="col-md-4">
            <div class="panel panel-card">
                <div class="panel-body">
                    <div class="row">
                        <div class="col-md-12">
                            <label for="">ٹرپ:</label>
                            <select name="trip" id="trip" class="form-control">
                                <option value="">----------------------------Select Trip----------------------------
                                </option>
                                @forelse ($trips as $trip)
                                    <option value="{{ $trip->id }}"> {{ $trip->id }} &nbsp;
                                        {{ $trip->vehicle->vehicle_no }}</option>
                                @empty
                                @endforelse
                            </select>
                            <span class="text-danger error" id="trip_error"></span>
                        </div>
                    </div>
                    <div class="row mt-3">
                        <div class="col-md-12">
                            <button onclick="trip_report()" class="btn btn-primary">Trip Report</button>
                            <button onclick="all_trip_report()" class="btn btn-success pull-right"> All Trip Report
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-4">
            <div class="panel panel-card">
                <div class="panel-body">
                    <div class="row">
                        <div class="col-md-12">
                            <label for="">پارٹی نام منتخب کریں:</label>
                            <select name="party_name" id="party_name" class="form-control">
                                <option value="">----------------------Select Party For Ledger----------------------
                                </option>
                                <option value="cash" data-table="cash">Cash</option>
                                @forelse($brokers as $broker)
                                    <option value="{{ $broker->id }}" data-table="broker">{{ $broker->name }}</option>
                                @empty
                                @endforelse
                                @forelse($other_accounts as $other_account)
                                    <option value="{{ $other_account->id }}" data-table="other_account">{{ $other_account->name }}</option>
                                @empty
                                @endforelse

                                @forelse($customers as $customer)
                                    <option value="{{ $customer->id }}" data-table="customer">{{ $customer->name }}
                                    </option>
                                @empty
                                @endforelse
                                @forelse($pumps as $pump)
                                    <option value="{{ $pump->id }}" data-table="pump">{{ $pump->name }}</option>
                                @empty
                                @endforelse
                                @forelse($banks as $bank)
                                    <option value="{{ $bank->id }}" data-table="bank">{{ $bank->name }}</option>
                                @empty
                                @endforelse
                                @forelse($drivers as $driver)
                                    <option value="{{ $driver->id }}" data-table="driver">{{ $driver->name }}
                                    </option>
                                @empty
                                @endforelse
                                @forelse($workshops as $workshop)
                                    <option value="{{ $workshop->id }}" data-table="workshop">{{ $workshop->shop_name }}
                                    </option>
                                @empty
                                @endforelse
                                @forelse($suppliers as $supplier)
                                    <option value="{{ $supplier->id }}" data-table="supplier">{{ $supplier->name }}
                                    </option>
                                @empty
                                @endforelse
                                @forelse($vehicles as $vehicle)
                                    <option value="{{ $vehicle->id }}" data-table="vehicle">{{ $vehicle->vehicle_no }}
                                    </option>
                                @empty
                                @endforelse
                            </select>
                            <span class="text-danger error" id="party_name_error"></span>
                        </div>
                    </div>
                    <div class="row mt-3">
                        <div class="col-md-12">
                            <button onclick="party_ledger()" class="btn btn-primary">Ledger</button>
                            <button onclick="trail_balance()" class="btn btn-success pull-right">Trail Balance</button>
                            {{-- <button onclick="balance_sheet()" class="btn btn-info btn-sm">Balance Sheet</button> --}}
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-4">
            <div class="panel panel-card">
                <div class="panel-body">
                    <div class="row">
                        <div class="col-md-12">
                            <label for="">گاڑی:</label>
                            <select name="vehicle" id="vehicle" class="form-control">
                                <option value="">----Select Vehicle----</option>
                                @forelse($vehicles as $vehicle)
                                    <option value="{{ $vehicle->id }}" data-table="vehicle">{{ $vehicle->vehicle_no }}
                                    </option>
                                @empty
                                @endforelse
                            </select>
                            <span class="text-danger error" id="vehicle_error"></span>
                        </div>
                    </div>
                    <div class="row" style="margin-top: 10px;">
                     {{--   <div class="col-md-6">
                            <button onclick="vehicle_wise_pump_pending_slip()" class="btn btn-success pull-right"> Pump Pending Slip Report
                            </button>
                        </div>--}}
                       {{-- <div class="col-md-4">
                            <button class="btn btn-success" onclick="vehicle_p_l_summary()">Profit/Loss
                                Summary
                            </button>
                        </div>--}}
                        <div class="col-md-4">
                            <button class="btn btn-success mt-3" onclick="vehicle_porfit_report()">Profit Ledger
                            </button>

                        </div>
                        <div class="col-md-4">
                            <button class="btn btn-success pull-right" onclick="trip_expense_report()">Trip Expense
                                Report
                            </button>
                        </div>
                    </div>
                    <div class="row " style="margin-top: 10px;">
                        {{--<div class="col-md-6">
                            <button class="btn btn-success mt-3" onclick="vehicle_wise_trip_report()">Trip Report
                            </button>

                        </div>--}}

                    </div>

                </div>
            </div>
            <div class="col-md-4"></div>
        </div>
    </div>
    <div class="row mt-2">
        <div class="col-md-4">
            <div class="panel panel-card">
                <div class="panel-body">
                    <div class="row">
                        <div class="col-md-12">
                            <label for="">مینٹینینس ہیڈ:</label>
                            <select name="head" id="head" class="form-control">
                                <option value="">-------------------Select Maintenance Head-------------------
                                </option>
                                @forelse ($maintenance_heads as $heads)
                                    <option value="{{ $heads->id }}"> {{ $heads->name }} </option>
                                @empty
                                @endforelse
                            </select>
                            <span class="text-danger error" id="head_error"></span>
                        </div>
                    </div>
                    <div class="row mt-3">
                        <div class="col-md-12">
                            <button onclick="head_wise_report()" class="btn btn-primary">Head Wise Report</button>
                            <button onclick="all_maintenance_report()" class="btn btn-success pull-right"> Overall
                                Maintenance Report
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-4">
            <div class="panel panel-card">
                <div class="panel-body">
                    <div class="row">
                        <div class="col-md-12">
                            <label for="">گاڑی:</label>
                            <select name="vehicle" id="broker_vehicle" class="form-control">
                                <option value="">----Select Vehicle----</option>
                                <option value="all">تمام</option>
                                @forelse($vehicles as $vehicle)
                                    <option value="{{ $vehicle->id }}" data-table="vehicle">{{ $vehicle->vehicle_no }}
                                    </option>
                                @empty
                                @endforelse
                            </select>
                            <span class="text-danger error" id="broker_vehicle_error"></span>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <label for="">بروکر:</label>
                            <select name="pump" id="broker" class="form-control">
                                <option value="">----Select Broker----</option>
                                <option value="all">تمام</option>
                                @forelse($brokers as $broker)
                                    <option value="{{ $broker->id }}" data-table="pump">{{ $broker->name }}
                                    </option>
                                @empty
                                @endforelse
                            </select>
                            <span class="text-danger error" id="broker_error"></span>
                        </div>
                    </div>
                    <div class="row" style="margin-top: 10px;">
                        <div class="col-md-6">
                            <button onclick="broker_pending_slip()" class="btn btn-success "> Broker Freight
                                Report
                            </button>
                        </div>
                    </div>

                    {{-- <div class="row">
                         <div class="col-md-12">
                             <label for="">سے (شہر):</label>
                             <select name="from_city" id="from_city" class="form-control select-form">
                                 <option value="">-------------------Select From City-------------------
                                 </option>
                                 @forelse ($cities as $citie)
                                     <option value="{{ $citie->id }}"> {{ $citie->name }} </option>
                                 @empty
                                 @endforelse
                             </select>
                             <span class="text-danger error" id="from_city_error"></span>
                         </div>
                         <div class="col-md-12">
                             <label for="">کو (شہر):</label>
                             <select name="to_city" id="to_city" class="form-control">
                                 <option value="">-------------------Select To City-------------------
                                 </option>
                                 @forelse ($cities as $citie)
                                     <option value="{{ $citie->id }}"> {{ $citie->name }} </option>
                                 @empty
                                 @endforelse
                             </select>
                             <span class="text-danger error" id="to_city_error"></span>
                         </div>
                     </div>
                     <div class="row mt-3">
                         <div class="col-md-12">
                             <button onclick="city_wise_report()" class="btn btn-primary">City Wise Trip Report</button>
                         </div>
                     </div>--}}
                </div>
            </div>
        </div>
        <div class="col-md-4">
            <div class="panel panel-card">
                <div class="panel-body">
                    <div class="row">
                        <div class="col-md-12">
                            <label for="">گاڑی:</label>
                            <select name="vehicle" id="pump_vehicle" class="form-control">
                                <option value="">----Select Vehicle----</option>
                                <option value="all">تمام</option>
                                @forelse($vehicles as $vehicle)
                                    <option value="{{ $vehicle->id }}" data-table="vehicle">{{ $vehicle->vehicle_no }}
                                    </option>
                                @empty
                                @endforelse
                            </select>
                            <span class="text-danger error" id="pump_vehicle_error"></span>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <label for="">پمپ:</label>
                            <select name="pump" id="pump" class="form-control">
                                <option value="">----Select PUMP----</option>
                                <option value="all">تمام</option>
                                @forelse($pumps as $vehicle)
                                    <option value="{{ $vehicle->id }}" data-table="pump">{{ $vehicle->name }}
                                    </option>
                                @empty
                                @endforelse
                            </select>
                            <span class="text-danger error" id="pump_error"></span>
                        </div>
                    </div>
                    <div class="row" style="margin-top: 10px;">
                        <div class="col-md-6">
                            <button onclick="pump_pending_slip()" class="btn btn-success "> Pump Pending Slip Report
                            </button>
                        </div>
                    </div>

                    {{--  <div class="row">
                          <div class="col-md-5">
                              <button onclick="opening_balance_report()" class="btn btn-primary btn-sm">Opening Balance
                                  Report
                              </button>
                          </div>
                          <div class="col-md-7">
                              <button onclick="broker_pending_amount_report()" class="btn btn-success btn-sm">Brokers
                                  Pending Amount Report
                              </button>
                          </div>
                      </div>
                      <div class="row mt-2">
                          <div class="col-md-5">
                              <button onclick="trip_adjustment_report()" class="btn btn-primary btn-sm">Trip Adjustments
                                  Report
                              </button>
                          </div>
                      </div>--}}
                </div>
            </div>
        </div>

    </div>
@endsection
@section('javascript')
    @include('reports.js')
@endsection
