@extends('layouts.master')
@section('content')
<style>

    .user-info {
                margin: 0 auto;
                max-width: 100%;
                background-color: #f9f9f9;
                border: 1px solid #ddd;
                border-radius: 5px;
                padding: 10px;
                margin: 0 0 10px 0;
            }
      </style>
    
<div class="container-fluid px-4">

    <div class="card mt-4">
                   <div class="card-header">
                    @if (session('status'))
                    <div class="alert alert-success">{{ session('status') }}</div>
                @endif

                                  {{-- <h1 class="">{{__('adminList')}}</h1> --}}
                                  <div class="d-flex justify-content-between align-items-center mb-3">
                                    <h1 class="">{{ __('Billing') }}</h1>
                                    {{-- <a href="{{url('admin/admin-billing-store')}}" class="btn btn-primary">{{__('test')}}</a> --}}
                                </div>
                                <div class="modal-body">
                                    <div class="user-info">
                                        <?php
                                        $user = Auth::user();

                                        ?>
                                    @if( $user->plan_type==0)
                                     <p id="Plan">Current Plan: {{ "Free" }}</p>
                                     @elseif( $user->plan_type==1)
                                     <p id="Plan">Current Plan: {{ "Standard" }}</p>
                                     @else
                                     <p id="Plan">Current Plan: {{ "Premium" }}</p>
                                     @endif
                                     @if( $user->status==0)
                                     <p class="Status" id="Status">Status: {{ "Deactive" }}</p>
                                     @else
                                     <p class="Status" id="Status">Status: {{ "Active" }}</p>
                                     @endif
                                       
                                    <p  class="REG" id="REG"> Reg Date: {{$user->created_at }}</p>
                
                                    </div>
                 
                                </div>
                                   
                  <div class="table-responsive text-nowrap">
                    <table id="myDataTable" class="table" width="100%" cellspacing="0">
                      <thead>
                          <tr>
                              {{-- <th>{{__('id')}}</th> --}}
                              <th>{{__('Invoice No')}}</th>
                              <th>{{__('Month')}}</th>
                              <th>{{__('Due Date')}}</th>
                              <th>{{__('Pay Date')}}</th>
                              <th>{{__('Ammount')}}</th>
                              <th>{{__('Status')}}</th>
                              

                          </tr>
                      </thead>
                      <tbody  class="table-border-bottom-0">
                        <!-- Table rows -->
                        @foreach($billing_list as $billing)
                        <tr>
                            {{-- <td>
                            
                          
                              {{ $billing->id }}
                     
                            </td> --}}
                            <td>
                                {{ $billing->inv_no }}
                          </td>
                          <td>
                            {{ $billing->month }}
                      </td>
                      <td>
                       {{$billing->due_date}} 
                        {{-- {{ \Carbon\Carbon::parse($billing->due_date)->format('Y-m-d') }} --}}
                  </td>
                  <td>
                    @if($billing->pay_date!=Null)
                    {{ \Carbon\Carbon::parse($billing->pay_date)->format('Y-m-d H:i') }}
                
                    @else
                    {{"N/A"}}
                    @endif
              </td>
              <td>
                {{ $billing->amount }}
          </td>
          <td>
            @if( $billing->status==0 )
            <a href="{{url('admin/update-billing-store/'.$billing->id)}}"  class="btn btn-success" > {{__('pay')}}</a>
            <a href="" class="btn btn-primary"> {{__('print')}}</a>
            @else
            <span class="text text-success"> {{__('PAID')}} </span>
            <a href="" class="btn btn-primary"> {{__('print')}}</a>
        @endif
      </td>
                          
                        </tr>
                        @endforeach
                    </tbody>

                    
                  </table>
              </div>


                                
                              
                   </div>



  <script>
function confirmDelete() {
    return confirm('Are you sure you want to delete this user?');
}
</script>

    </div>

</div>
 @endsection
