<?php
session_start();
include('../include/connection.php');

$sql="select * from stats group by batch_id order by id DESC";
$r=$con->run_select_query($sql);
$sn=1;
foreach($r as $value)
{
    echo '<tr>
                                                                <td style="font-size:12px;">'.$sn.'</td>
                                                                <td>'.$value['date_created'].'</td>
                                                                <td>
                                                                    <form method="post" action="../admin/gen">
                                                                        <input type="hidden" name="batchid" value="'.$value['batch_id'].'"/>
                                                                        <input type="submit" name="daily" value="Edit" class="btn btn-warning btn-sm"/>
                                                                    </form>
                                                                </td>
                                                                <td>
                                                                    <button class="btn btn-danger btn-sm" onclick="Delete('.$value['batch_id'].')">Delete</button>
                                                                </td>
                                                            </tr>';
    $sn++;
}
?>