<?php 

  include "../db.php";

  session_start();



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

    

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

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





   $sql = "SELECT * FROM users  WHERE upload_ref_code = '$uref_id'  ORDER BY uid 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)) {

            if ($rows['reg_approved'] == 1) {

                $msg = 'Approved';

            }elseif($rows['reg_approved'] == 0){

                $msg = 'Not Approved';

            }

            

            $s_output .= 

                "

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

                <div class='row'>

                    



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



                            <i class='fa fa-pencil-square-o' aria-hidden='true'style='color:orange;font-size:17px;'></i> <b style='color:black;font-size:15px;'>$rows[uname]</b>  ( $msg )

                       

                        <br>

                         <i class='fa fa-list-ul'></i> $rows[uqualification]

                         &nbsp;

                        <i class='fa fa-clock-o text-primary'></i> $rows[ucreated]

                        <br>

                        <i class='fa fa-phone'></i> $rows[ucontact]

                         &nbsp;

                        <i class='fa fa-home text-primary'></i> $rows[saddress] , $rows[dist] - $rows[pin]  



                    </div>

                </div>

                </li>

                ";

          $c++;

        }



        mysqli_close($con);



        echo $s_output;

    }

}



?>