<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
  <title>Chalan</title>
  <link rel="icon" href="{{asset('public')}}/favicon.png" type="image/x-icon" style="height: auto;" />






    <style>
    h1,h2,h3,h4,h5,h6,p,span{
        font-family: sans-serif;
    }
    .sender_company{
        /* margin-top: 10px; */
        border-left: 6px solid #d8d7d7;
        padding-left: 11px;
        font-size: 12px;
    }
    .sender_company p{
        margin: 0;
    }
    .sender_company h5{
        margin: 0;
        font-weight: 800;
        font-size: 15px;
    }
    .recever_company{
        /* margin-top: 10px; */
        /*border-left: 6px solid #d8d7d7;
        padding-left: 11px;*/
        font-size: 12px;
    }
    .recever_company p{
        margin: 0;
    }
    .recever_company h5{
        margin: 0;
        font-weight: 800;
        font-size: 15px;
    }

    .table_header{
        /* padding-top: 14px; */
        padding-left: 14px;
        padding-right: 14px;
    }




    .tbody{
        border: 1px solid black;

    }

    /* Header Top */
    .header_top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: green;
    }

    .header_company_info {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 30px;
        margin-top: 50px;
    }


    /* my css */

    /* Table Style */

    table {
        box-sizing: border-box;
        border: 1px solid #000000;
        border-collapse: collapse;
        width: 100%;
        


        /* background: red; */
    }

    thead {
        background: red;
        border: 1px solid #000000;
        color: #fff;
        font-size: 13px;
    }
    th, td {
        padding: 10px;
        border-right: 1px solid #000000;

    }




    tbody tr td p {
    margin: 0px;
    padding: 0px 5px;
    font-size: 0.8rem;
    font-weight: 400;
    /* text-transform: uppercase; */
    /* background: red; */
  }

    .total_container {
        text-align: right;
        margin-top: 20px;
    }
    .total_container  p{
        margin: 0;
        font-size: 0.8rem;
        font-weight: 600;
    }

    /* my own table */
.signature_container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 70px;
}

.signature_1 {
    width: 50%;

}

.signature_2 {
    width: 50%;
    float: right;
    text-align: right;
}

.table_paid_wrapper{

    background-size: 30%;
    background-repeat: no-repeat;
    background-position: center center;
}

</style>


</head>
<body>

  @php
  $date = substr($viewcart[0]->created_at,0,10);
  $setting = DB::table('settings')->first();
  @endphp




<div class="container">
  <div class="col-md-12">
    <div class="row">
     

      <div class="col-xl-9 col-lg-9 col-md-12 col-sm-12 col-12 mt-4 offset-md-2">
        <div class="col-md-12 p-4 invoice">

          <strong>Invoice NO: #{{$viewcart[0]->invoice_id}} {{-- <a href="{{ url('/invoice-pdf') }}/{{$viewcart[0]->session_id}}" class="btn btn-success btn-sm float-end">Download</a> --}}</strong>

          <div class="col-md-12 col-12 p-4 mt-4 border">
            
            <div class="container" id="Invoice">
                  <div class="col-md-12">
                      <div class="text-center">

                          
                      </div>
                  </div>
                  <div class="col-md-12">
                      <!-- Heder Top Logo & Date -->
                      <div class="row  ">
                          <div class="col-md-6" >
                              <img src="{{asset('/public/siteImage')}}/{{$setting->logo}}" alt="" style="width: 123px;">
                          </div>
                          <div class="col-md-6">
                              <h1 style="float: right;color: #e00000;font-weight: bold;font-size: 25px;border: 4px solid #e00000;padding: 10px;margin: 0;">CHALAN</h1>
                              <br>
                              <br>
                              <br>
                              <div style="float: right;font-size: 11px;font-weight: 600;">
                                  <span>Date: {{$date}} </span>
                                  <br>
                                  <span>Chalan No: #{{$viewcart[0]->invoice_id}} </span>
                                  <br>
                                  <span>Payment Status: {{$viewcart[0]->payment_type}}</span>
                              </div>
                          </div>
                      </div>
                  </div>
                 <!-- Company Info -->
                  <div class="col-md-12" style=" margin-top: -50px; padding: 0; ">

                      <div class="row header_company_info">
                          <div class="col-md-6">
                              <div class="sender_company">
                                  <h5>{{$setting->title}}</h5>
                                  <p style="max-width: 200px">{{$setting->address}}</p>
                                  <p>{{$setting->hotline}}</p>
                              </div>
                          </div>
                          <div class="col-md-6">
                              <div class="recever_company" style="float: right;">
                                  <h5>{{$viewcart[0]->first_name}}&nbsp;{{$viewcart[0]->last_name}}</h5>
                                  <p>{{$viewcart[0]->address}}</p>
                                  <p>{{$viewcart[0]->phone}}</p>
                              </div>
                          </div>
                      </div>
                  </div>


                  <!-- Start Table -->
                  <div class="col-md-12">
                      <div class="row table_paid_wrapper">

                              <!-- Start Table -->
                              
                              
                                    <table class="table_wrapper" style=" ">
                            
                                
                                  <thead>
                                      <tr>
                                      <!--<th>QTY</th>-->
                                      <!--<th>SKU</th>-->
                                      <!--<th>Product</th>-->
                                      <!--<th>Price</th>-->
                                      <!--<th>Amount</th>-->
                                      
                                      
                                        <th>SKU</th>
                                        <th>Item Name</th>
                                        <th>Description</th>
                                        <th>Qty</th>
                                        <th>Unit Price</th>
                                        <th>Total</th>
                                      
                                      </tr>
                                  </thead>

                                  <tbody>

                        @php
                        $sl=1;

                        $payment =  $balance->payment;
                        @endphp  

                        @if($payment>0)
                        $payments=$payment;
                        @else

                        @endif

                        @if(isset($viewcart))
                                      @foreach($viewcart as $cart)
                                      <?php
                                        
                                        $product = DB::table('product_productinfo')->where('product_id', $cart->sku)->first();
                                        $cateory = DB::table('product_category')->where('id', $product->category_id)->first();
                                     
                                        
                                      ?>
                                      

                                      <tr>
                                            <td style="text-align: center; width: 95px">
                                              <p>{{$cart->sku}}</p>
                                            </td>
                                            
                                            <td style="text-align: center; width: 95px">
                                              <p>{{$cateory->category_name}}</p>
                                            </td>
                                            
                                           <td style="text-align: center;">
                                              <p>{{$cart->product_name}} - <span>{{ $cart->size ?? '' }} - {{ $cart->color ?? '' }}</span></p>
                                          </td>
                                          
                                          <td style="width: 75px; text-align: center;">
                                              <p>{{$cart->quantity}}</p>
                                          </td>
                                          

                                          <td style="width: 75px; text-align: center;">
                                              <p>0.00 Tk</p>
                                          </td>
                                          
                                          <td style="width: 75px; text-align: center;">
                                              <p>0.00 Tk</p>
                                          </td>

                                      </tr>


                                      @endforeach
                                      @endif

                                      @if(count($viewcart) == 1)
                                          <tr >
                                              <td style="height: 348px; border-right: 1px solid #000000"></td>
                                              <td style="height: 348px; border-right: 1px solid #000000"></td>
                                              <td style="height: 348px; border-right: 1px solid #000000"></td>
                                              <td style="height: 348px; border-right: 1px solid #000000"></td>
                                              <td style="height: 348px; border-right: 1px solid #000000"></td>
                                          </tr>
                                      @elseif(count($viewcart) == 2)
                                          <tr >
                                              <td style="height: 300px; border-right: 1px solid #000000"></td>
                                              <td style="height: 300px; border-right: 1px solid #000000"></td>
                                              <td style="height: 300px; border-right: 1px solid #000000"></td>
                                              <td style="height: 300px; border-right: 1px solid #000000"></td>
                                              <td style="height: 300px; border-right: 1px solid #000000"></td>
                                          </tr>

                                      @elseif(count($viewcart) == 3)
                                          <tr >
                                              <td style="height: 240px; border-right: 1px solid #000000"></td>
                                              <td style="height: 240px; border-right: 1px solid #000000"></td>
                                              <td style="height: 240px; border-right: 1px solid #000000"></td>
                                              <td style="height: 240px; border-right: 1px solid #000000"></td>
                                              <td style="height: 240px; border-right: 1px solid #000000"></td>
                                          </tr>
                                      @elseif(count($viewcart) == 4)
                                          <tr >
                                              <td style="height: 100px; border-right: 1px solid #000000"></td>
                                              <td style="height: 100px; border-right: 1px solid #000000"></td>
                                              <td style="height: 100px; border-right: 1px solid #000000"></td>
                                              <td style="height: 100px; border-right: 1px solid #000000"></td>
                                              <td style="height: 100px; border-right: 1px solid #000000"></td>
                                          </tr>
                                      @elseif(count($viewcart) == 5)
                                          <tr >
                                              <td style="height: 80px; border-right: 1px solid #000000"></td>
                                              <td style="height: 80px; border-right: 1px solid #000000"></td>
                                              <td style="height: 80px; border-right: 1px solid #000000"></td>
                                              <td style="height: 80px; border-right: 1px solid #000000"></td>
                                              <td style="height: 80px; border-right: 1px solid #000000"></td>
                                          </tr>
                                      @endif


                                  </tbody>

                              </table>

                              <div class="col-md-12">
                                <div class="total_container">
                                  <p>Total: 0.00 Tk</p>
                                </div>
                              </div>
                              <!-- End Table -->

                      </div>
                       <!-- <div class="signature_container row">
                          <div class="col-md-6 signature_1">
                              <p style="margin: 0">------------------------------------</p>
                              <p style="margin: 0; margin-left: 20px">Customer Signature</p>
                          </div>
                          <div class="col-md-6  signature_2">
                              <p style="margin: 0">------------------------------------</p>
                              <p style="margin: 0; margin-right: 20px">Authorize Signature</p>
                          </div>
                       </div> -->
                  </div>
              </div>

            <br>
             <div class="signature_container row">
                <div class="col-md-6 signature_1">
                    <p style="margin: 0">------------------------------------</p>
                    <p style="margin: 0; margin-left: 20px">Customer Signature</p>
                </div>
                <div class="col-md-6  signature_2">
                    <p style="margin: 0">------------------------------------</p>
                    <p style="margin: 0; margin-right: 20px">Authorize Signature</p>
                </div>
             </div>
          </div>


        </div>
      </div>
    </div>
  </div>
</div>






</div>

<!-- <div id="thanks">
 <center><a href="{{ url('/invoice-pdf') }}/{{$viewcart[0]->session_id}}" class="btn btn-danger btn-sm" style="background-color: #ff5500; box-shadow: none; outline: none; border:none;">Download</a></center>
</div>  -->


</div>












<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>

<!-- 
<script>
  window.print();
</script> -->

</body>
</html>

