<?php

include '../includes/connection.php';
$from=$_GET['from'];


$sql= mysqli_query($con,"SELECT id,quantity,price,Reason,date,(select product_name from products where id=returns_out.product_id)as name from returns_out where date>='$from'");
//$result = mysqli_query($con, $sql);

if (mysqli_num_rows($sql) > 0) {
    // output data of each row
    


                                   ?>

                                        
                                        <?php
                                        $n=0;
              while($row = mysqli_fetch_assoc($sql)) {
                
                        $n++;
                    ?>
                            <tr class="odd gradeX">
                                <td><?php echo $n; ?></td>
                                
                                <td><?php echo $row['name']; ?></td>
                                <td><?php echo $row['quantity']; ?></td>
                                <td><?php echo $row['price']; ?></td>
                                <td><?php echo $row['date']; ?></td>
                                <td><?php echo $row['Reason']; ?></td>
                                
                                
                                
                            </tr>
               <?php                             
    }
} else {
    echo "<td>No results</td><td></td><td></td><td></td><td></td><td></td>";
}

//mysqli_close($conn);
?>
                                            
                                       