<?php 
include "../db.php";
session_start();

if (isset($_POST['start'])) {
    $start= mysqli_real_escape_string($con,$_POST['start']);
    $AndWhere ='';

    if (!empty($_POST['FirstFilterValue'])) {
        $AndWhere = "WHERE name = '$_POST[FirstFilterValue]'";
    }

    $sql = "SELECT * FROM countries $AndWhere ORDER BY id ASC LIMIT $start,10";

    $res = mysqli_query($con,$sql);
    if ($total_rows=mysqli_num_rows($res)>0) {
        $c = $start+1;
        while ($rows=mysqli_fetch_assoc($res)) {
            ?>
<li class='clearfix' style='float: none;'>
    <div class="single-dis mb-2">
        <div class='row align-items-center'>
            <div class='col-md-10 col-9 text-white'>
                <b>
                    <?php echo $c;?> )
                </b> <?php echo $rows["name"];?>
            </div>
            <div class='col-md-2 col-3 text-end'>
                <a href='country.php?edit_id=<?php echo $rows["id"];?>' class='btn btn-success' title='Click to Edit'><i
                        class='fa fa-edit' aria-hidden='true'></i> </a>
                <a href='country.php?del_id=<?php echo $rows["id"];?>' class='delete btn btn-danger'
                    title='Click to Delete'><i class='fa fa-trash' aria-hidden='true'></i> </a>
            </div>
        </div>
    </div>
</li>
<?php
$c++;
}
mysqli_close($con);
}
}
?>