
<?php
include "config-result.php";
$className=$_POST['className'];
    $groupName=$_POST['groupName'];
        $examYear=$_POST['examYear'];
        $examName=$_POST['examName'];
        $optionName=$_POST['optionName'];
if ($optionName=='All'){
$subsql=" ";
}else{
    $subsql=" AND a.r_status='$optionName' ";
}
    //$st_id=$_POST['stId'];
    $gptableName="gp_marks_table_".$examName;
    $tebulationtableName="tabulation_".$className."_".$groupName."_".$examName."_".$examYear; 



    $query="SELECT 
    a.st_id as st_id,
    e.st_name as st_name,
    c.st_class as st_class, 
    e.st_mobile as st_mobile 
    FROM 
    $tebulationtableName a
    INNER JOIN
    student_class e
    ON a.st_id=e.st_id
    INNER JOIN
    class_name c
    ON a.st_class=c.class_id
    


WHERE a.exam_name='$examName'
AND a.st_class='$className'
AND a.st_group='$groupName'
AND a.exam_year='$examYear'
$subsql

GROUP BY a.st_id ASC
    ";
 $result=mysqli_query($link, $query);   
 $nCount=0;
    while($row = mysqli_fetch_assoc($result)){

        $nCount++;
       //<td>'.$nCount.'</td>
        echo '<tr>
        
        <td><input type="checkbox" id="checkAll" name="selected_id[]" class="checkboxsms" value="'.$row['st_mobile'].'"> </td>
        <td>'.$row['st_id'].'</td>
        <td>'.$row['st_name'].'</td>
        <td>'.$row['st_class'].'</td>
        <td>'.$row['st_mobile'].'</td>
        <td>'.$nCount.'</td>
        </tr>';
    }
      
    mysqli_close($link);



?>

