Current File : //home/tradevaly/public_html/resources/views/user/pages/selling/index.blade.php
@extends('user.ayaan.master')
@push('title','Selling Progress')
@push('style')
    
@endpush

@section('content')
<div class="container-fluid">
  <div class="row">
    <div class="col-md-12">
      <div class="card">
        <div class="card-header card-header-info card-header-icon">
          <h4 class="card-title">Selling Progress</h4>
        </div>
        <div class="card-header m-0 row">
          <div class="col-md-3 p-3 border">
              <h4 class="text-success">Pending Amount</h4>
              <h4 class="">{{$totalPending}}</h4>
          </div>
          <div class="col-md-3 p-3 border">
              <h4 class="text-success">Waiting For Delivery</h4>
              <h4 class="">{{$waiting_del}}</h4>
          </div>
          <div class="col-md-3 p-3 border">
              <h4 class="text-success">Lifetime Sell</h4>
              <h4 class="">{{auth()->user()->total_income}}</h4>
          </div>
          <div class="col-md-3 p-3 border">
              <h4 class="text-success">Total Balance</h4>
              <h4 class="">{{auth()->user()->balance}}</h4>
          </div>
        </div>
        <div class="card-body">
            <div class='row'>
                <div class="col"><strong>#</strong></div>
                <div class="col"><strong>Order Number</strong></div>
                <div class="col"><strong>Order Date</strong></div>
                <div class="col"><strong>Order Status</strong></div>
                <div class="col"><strong>Amount</strong></div>
                <div class="col"><strong>Delevary Date</strong></div>
                <div class="col"><strong>Amount Relese date</strong> </div>
                <div class="col"><strong>Remain Days</strong></div>
            </div>
            <hr>
            @foreach($selling_progresses as $selling_progress)
                @php 
                    
                    $today = \Carbon\Carbon::now();
                    $releseDate = \Carbon\Carbon::parse($selling_progress->amount_relese_date);
                    $hourDifference = $today->diffInHours($releseDate);
                    $remainDate = $today->diffInDays($releseDate);
                    $progress = 100 - $hourDifference*100/168;
                @endphp
            <div class="row" style="padding: 25px 0px;">
                <div class="col">{{$loop->iteration}}</div>
                <div class="col">{{$selling_progress->order_number}}</div>
                <div class="col">{{ \Carbon\Carbon::parse($selling_progress->order_date)->format('Y-m-d') }}</div>
                <div class="col">{{$selling_progress->payment_status}}</div>
                <div class="col">{{$selling_progress->amount}}</div>
                <div class="col">{{$selling_progress->created_at->format('d-m-Y')}}</div>
                <div class="col">{{ \Carbon\Carbon::parse($selling_progress->amount_relese_date)->format('Y-m-d') }}</div>
                <div class="col">
                    @if($selling_progress->payment_status=="compleate")
                    <span class='bg-success text-white p-2' style="width: 100px;display: block;text-align: center;">
                        Compleate
                    </span>
                    @elseif($remainDate<1)
                    <span class='bg-success text-white text-center rounded-pill' style="width: 100px;display: block;text-align: center;">
                        Very Soon
                    </span>
                    @else
                    <span class='bg-warning text-white text-center rounded-pill' style="width: 100px;display: block;text-align: center;">
                        {{$remainDate}} Days
                    </span>
                    
                    @endif
                </div>
            </div>
            <div class="progress">
                <div class="progress-bar progress-bar-striped bg-success" role="progressbar" style="width:{{($selling_progress->payment_status=="compleate")?"100":$progress}}%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
            </div> 
            <hr>
            @endforeach
          
        </div>
        <div class="card-footer">
            {{$selling_progresses->links()}}
        </div>
      </div>
  </div>
</div>
@stop

@push('script')
   
@endpush