@extends('layouts.app')

@section('title')
 Pacakge Payment
@stop

@section('breadcrumb')
<ol class="breadcrumb pull-right">
        <li><a href="{{route('home')}}"><i class="fa fa-dashboard"></i> Home</a></li>

        <li class="active"><a href={{route('openfile.pending.package')}}></a>Pending Packags List</li>
        <li class="active">Pending Package</li>
      </ol>
@stop
@section('css')

<link href="https://cdn.datatables.net/1.10.24/css/jquery.dataTables.min.css" rel="stylesheet">
<link href="https://cdn.datatables.net/buttons/1.7.0/css/buttons.dataTables.min.css"  rel="stylesheet">

{{-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css"> --}}
{{-- <script src="https://cdn.jsdelivr.net/npm/jquery@3.6.1/dist/jquery.slim.min.js"></script> --}}
{{-- <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script> --}}
{{-- <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script> --}}
<style>
body {
    font-size: 1.2rem; /*increase font-size to 1.2rem*/
}
table.dataTable thead .sorting_asc {
    background-image: none !important;
}

.table.dataTable, table.dataTable {
    width: 99.8%!important;
}
</style>

@stop

@section('content')


            <div class="container-fluid">
                <!-- /row -->

                <!--.row-->
                <div class="row">
                    <div class="col-md-12">
                        <div class="panel panel-info">
                            <div class="panel-heading">Pending  Package 
                                <div class="pull-right">
                                     
                                   
                                </div>
                            </div>
                            
                            
                        </div>
                    </div>
                </div>
                <!--./row-->

                <div class="row" id="update-table">
                    <div class="col-sm-12">
                        
                        <div class="white-box">
                        	
                            <h3 class="box-title">Package Request</h3>
                            <form method="post"   action="{{route('openfile.pending.package.store')}}">
                                {{ csrf_field() }}
                               <input type='hidden' name='dealer_package_id' value='{{$pending_packages->id}}'> 
                               
                                <div class="  form-group">
                                  <label for="status">Status:</label>
                                  <select  class="form-control" name="status" id="status">
                                   @if($pending_packages->is_approved)
                                        <option value="1" selected=''>Approved</option>
                                        <option value="0" >Pending</option>
                                        
                                        @else
                                        <option value="1" >Approved</option>
                                        <option value="0" selected=''>Pending</option>
                                    
                                    @endif
                                    
                                    
                                   </select>
                                </div>
                                @if($pending_packages->inventory_status == \App\DealerPackage::inventory_not_created)
                                <div class="form-group">
                                    <label for="pwd">Create Package Open Files:</label>
                                    <select  class="form-control" name="inventory_created" id="inventory_created">
                                   
                                        <option value="1" >Yes</option>
                                        <option value="0" selected="">Not Yet</option>
                                    
                                    
                                    
                                   </select>
                                  </div>
                                
                                 @endif
                              
                                
                                <button type="submit" class="btn btn-default">Submit</button>
                              </form>
                        </div>
                    </div>

                    <div class="col-lg-12">
                        <div class="white-box1 ">
                            <h4 class="box-title " style=" color: white; background-color:#1c3752;line-height: 30px" id="text_detail">&nbsp;&nbsp;Package Information</h4>
                               
                            <div class="pull-left" style="width:100%">
                                <div class="table-responsive">
                                    <table class="table bottom-table" id="main_customer_info">
                                        <tbody class="printFW">
                                            
                                            <tr>
                                                <td style="font-weight: 600; ">Dealer Name:</td>
                                                <td> {{$pending_packages->dealer->name}}</td>
                                 
                                                <td style="font-weight: 600; ">Dealer Code:</td>
                                                <td>{{$pending_packages->dealer->code}} </td>
                                                <td style="font-weight: 600;">Package Name:</td>
                                                <td>{{$pending_packages->package->name}}  </td>
                                                <td style="font-weight: 600; ">Package Total Amount:</td>
                                                <td>{{$pending_packages->package->total_price}}  pkr</td>
                                              

                                               
                                            </tr>
                                            <tr>
                                                <td style="font-weight: 600; ">Package Issue Date:</td>
                                                <td> {{$pending_packages->issue_date}}</td>
                                 
                                                <td style="font-weight: 600; ">Paid Amount:</td>
                                                <td>{{$paid_amount}} pkr </td>
                                                <td style="font-weight: 600;">Remaining Amount:</td>
                                                <td>{{ $pending_packages->package->total_price - $paid_amount }} pkr </td>
                                                {{-- <td style="font-weight: 600; ">Request Paid Amount:</td>
                                                <td>{{$pending_packages->amount}} pkr </td> --}}
                                              

                                                 
                                            </tr>
                                            <tr>
                                                <td style="font-weight: 600; ">Payment Status:</td>
                                                <td>  @if($pending_packages->payment_status == \App\DealerPackage::pending)
                                                    <span class="label label-danger">Pending</span>
                                                     @elseif($pending_packages->payment_status == \App\DealerPackage::completed)
                                                     <span class="label label-success">Completed</span>
                                                     @endif </td>

                                                     <td style="font-weight: 600; ">Package Inventory:</td>
                                                     <td> 
                                                         @if($pending_packages->inventory_status == \App\DealerPackage::inventory_not_created)
                                                        <span class="label label-danger">Not Created</span>
                                                         @elseif($pending_packages->inventory_status == \App\DealerPackage::inventory_created)
                                                         <span class="label label-success">Created</span>
                                                         @endif
                                                         </td>
        
                                            </tr>
            
                                        </tbody>
                                    </table>
            
            
            
                                    
            
            
                                </div>
                                <div class="clear"></div>
                            </div>
                          
                        </div>
                    </div>
                </div>
                <!-- /.row -->
              </div>
            <!-- /.container-fluid -->

            <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  
</div>


<div class="modal fade" id="exampleModal1" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  
</div>

@stop

@section('js')

<script src="https://cdn.datatables.net/1.10.24/js/jquery.dataTables.min.js"></script>
 <script src="https://cdn.datatables.net/buttons/1.7.0/js/dataTables.buttons.min.js"></script>
 <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
 <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
 <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
 <script src="https://cdn.datatables.net/buttons/1.7.0/js/buttons.html5.min.js"></script>
  <script src="https://cdn.datatables.net/buttons/1.7.0/js/buttons.print.min.js"></script>

<script>
    $(function() {
        $('#myTable').DataTable({
            'pageLength':25,
            'paging':false,
            'searching':false,
            'ordering':false,
            'sorting' : false,
            'info':false,
            'dom': 'Bfrtip',
        'buttons': [
            'copy', 'csv', 'excel', 'pdf', 'print'
        ]
        });
    });

        



   







    </script>
@stop