<?php

use App\Http\Controllers\MainAcontroller;
use App\Http\Controllers\BillRenderController;

?>

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title></title>

    <style>
        * {
            box-sizing: border-box;
        }

        /* Create three equal columns that floats next to each other */
        .column {

            float: left;
            width: 33.33%;
            padding-top: 10px;
            padding-bottom: 10px;
            height: 130px;
            /* Should be removed. Only for demonstration */
        }

        /* Clear floats after the columns */
        .row:after {
            content: "";
            display: table;
            clear: both;
        }

        .pTextIng {
            font-size: 10px;
            margin: 0;
            padding: 0;
            width: 80px;
            display: inline-block;
        }

        .pTextIngRight {
            font-size: 10px;
            margin: 0;
            padding: 0;
            width: 50px;
            display: inline-block;
        }

        .pTextPor {
            font-size: 10px;
            width: 80px;
            height: auto;
            display: inline-block;
        }

        .pTextPorTime {
            font-size: 10px;
            height: auto;
            width: 150px;
            display: inline-block;
        }

        .center {
            text-align: center;
        }

        .centerimg {
            display: block;
            margin-left: auto;
            margin-right: auto;
            width: 50%;
        }

        th {
            border-left: 1px solid black;
            border-right: 1px solid black;

            font-style: normal;
            font-size: 10px;
            color: white;
            background-color: black;
        }

        td {
            padding-left: 2px;
            padding-left: 2px;
            border-left: 1px solid grey;
            border-right: 1px solid grey;

            font-style: normal;
            font-size: 14px;
            color: black;

        }

        td1 {
            border: 1px solid black;

            font-style: normal;
            font-size: 10px;
            color: black;

        }

        table {
            border-collapse: collapse;
            width: 100%;
        }

        p {
            font-size: 10px;
            margin: 0;
            padding: 0;
            width: 80px;
            display: inline-block;
        }

        p1 {
            font-size: 10px;
            margin: 0;
            padding: 0;
            width: 120px;
            display: inline-block;
        }

        p2 {
            font-size: 10px;
            margin: 0;
            padding: 0;

            display: inline-block;
        }
    </style>

</head>

<body>


    <div style="border: 1px solid; border-color: black ;" class="row">

        <!-- https://api.digitronicsindia.com/aswas/public/uploads/billlogo/50/ACP.png -->

        <div style="padding-left: 10px;" class="column">

            <div class="row">
                <label>From : </label>
                <br>
                <label style="font-size: 13px;"> @if($demo == 1 ) DEMO @else {{ $client }} @endif</label>
                <label style="font-size: 13px;"> @if($demo == 1 ) DEMO @else {{ $area }} , {{ $location }} @endif</label>
                <br>
                <label style="font-size: 13px;"> @if($demo == 1 ) ********** @else  {{ $phone }} @endif</label>
                <br>

                <label>Order No : </label>
                <br>
                <label> {{ $ordernumber }} </label>
                <br>

            </div>

        </div>

        <div class="column">

            <div style="text-align: center;">


                <h4> PURCHASE ORDER </h4>

            </div>

        </div>

        <div style="padding-left: 15px;" class="column">
            <div class="row">
                <label>To : </label>
                <br>
                <label> {{ $supplier }} </label>
                <br>
                <br>
                <label>Order Date : </label>

                <label> <?php echo MainAcontroller::convertDate($orderdate) ?> </label>
            </div>
        </div>



    </div>

    <table style="table-layout: auto; width: 100%;" border="1" frame="below above columns">

        <thead>

            <tr>
                <th align="center" style="width:10%; column-rule: 4px double white;" scope="col">SL NO</th>

                <th align="center" style="width:40%" scope="col">PRODUCT NAME</th>
                
                
                <th align="center" style="width:20%" scope="col">QTY</th>
                
                <th align="center" style="width:20%" scope="col">PACK</th>
              
            </tr>

        </thead>

        <tbody>
            <?php $num = 1;
            $grandTotal = 0;
            ?>
            @foreach( $items as $item )

            <?php $grandTotal = $grandTotal + $item->Rate; ?>

            <tr>

                <td align="center">{{ $num }}</td>

                <td align="left">{{ $item->ProductName }} </td>

                
                <td align="center"> {{ $item->Quantity }} </td>
                
                
                <td align="center">{{ $item->Pack }} </td>

            </tr>
            <?php $num++; ?>
            @endforeach

            <!-- <tr>

                <td colspan="1"> </td>
                <td colspan="2" align="center" style="font-weight: 500;"> GRAND TOTAL </td>
                <td colspan="1" align="right" style="font-weight: 500;"> <?php echo number_format($grandTotal, 2) ?> </td>

            </tr> -->

        </tbody>

    </table>
</body>

</html>