<?php 

  include "../db.php";

    session_start();



if (isset($_POST['start'])) {

    

    $start= mysqli_real_escape_string($con,$_POST['start']);

    $AndWhere ='';



    if (!empty($_POST['FirstFilterValue']) && empty($_POST['SecondFilterValue'])) {



        $AndWhere = "";



    }elseif (empty($_POST['FirstFilterValue']) && !empty($_POST['SecondFilterValue'])) {



        $AndWhere = "";



    }elseif (!empty($_POST['FirstFilterValue']) && !empty($_POST['SecondFilterValue'])) {

        

         $AndWhere = "";

    }





    $sql = "SELECT * FROM class WHERE uploadedby = '$_SESSION[uref]' AND cdisplay !='disable' $AndWhere ORDER BY sid DESC LIMIT $start,10";



    $res = mysqli_query($con,$sql);

    if ($total_rows=mysqli_num_rows($res)>0) {

        $s_output='';

          $c = $start+1;

        while ($rows=mysqli_fetch_assoc($res)) {

            

            $s_output .= 

                "

                <li class='clearfix' style='float: none;'>

                <div class='row'>



                    <div class='col-md-10 col-xs-8 second-item'>

                    <b>Class: </b>  $rows[sclass]

                    <br>

                    <b>Date: </b> <i class='fas fa-clock text-primary'></i> $rows[sdate]

                    </div>

                    <div class='col-md-2 col-xs-4 third-item'>





                    <a href='edit-class.php?edit_id=$rows[sid]' class='m-2 btn btn-success btn-sm' style='width:35px;' title='Click to Edit'><i class='fa fa-pencil-square-o' aria-hidden='true' style='font-size:17px;'></i> </a>

                        <br>

                        <a href='view-class.php?del_id=$rows[sid]' class='delete m-2 btn btn-danger btn-sm' style='width:35px;' title='Click to Delete'><i class='fa fa-trash-o' aria-hidden='true' style='font-size:19px;'></i> </a>



                    </div>

                </div>

                </li>

                ";

          $c++;

        }



        mysqli_close($con);



        echo $s_output;

    }



}

?>