<?php
error_reporting(E_ERROR | E_PARSE);
session_start();
include '../class/ClassForm.php';

$query = "select * from qr_invdetails where remarks = '".$_SESSION['user_id']."'";
$result = $ClassForm->Fetch_Result_Set($query);
?>
<table class="table  tesla" id="inv_table">
    <thead>
        <tr>
            <th> Buyer GSTIN
            </th>
            <th> Invoice No
            </th>
            <th> Invoice Date
            </th>
            <th> Total Amount
            </th>
            <th> Download QR
            </th>
            <th> Download Excel
            </th>
            <th> Download JsonFile
            </th>
            
        </tr>
    </thead>
    <tbody>
    <?php
    while($row = mysqli_fetch_assoc($result)){
        ?>
        <tr>
            <td> <?php echo $row['buy_gstin']; ?> </td>
            <td> <?php echo $row['inv_no']; ?> </td>
            <td> <?php echo $row['inv_date']; ?> </td>
            <td> <?php echo $row['tot_amount']; ?> </td>
            <td> <a href="<?php echo $row['qr_url']; ?>" target="_blank">Download QR Image</a> </td>
            <td> <a href="<?php echo $row['excel_url']; ?>" target="_blank">Download File</a></td>
            <td> <a href="<?php echo $row['json_url']; ?>" download="<?php echo $row['buy_gstin']; ?>.json" target="_blank">Download Json</a></td>
        </tr>
        <?php
    }
    ?>
    </tbody>    
</table>