<?php
include_once '../session/admin-session.php';
include_once '../classes/class_admin.php';
include_once '../classes/validation.php';
include_once '../classes/common.php';
include_once 'read-configration.php';
ob_start();

$ObjDB = new class_db();

?>
<div class="container-fluid">
    <div class="row">
        <div class="col-xl-12 col-xxl-12 col-sm-12">
            <div class="card">
                <div class="card-header">
                    <h5 class="card-title">Student Semester Registration</h5>
                </div>
                <div class="card-body">

                    <div class="row">
                        <div class="table-responsive">
                            <table class="table table-bordered align-middle">
                                <thead>
                                    <tr>
                                        <th>
                                            Batch
                                        </th>
                                        <th colspan="10">
                                            Student Semester's Registration
                                        </th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php
                                    $query_str = "select distinct batch from isr_stu_main_tbl where substring(batch,1,1) = 'b' order by batch";
                                    $ObjDB->sproc_name = $query_str;
                                    $result_str = $ObjDB->SelectQuery();
                                    while ($row = mysqli_fetch_array($result_str)) {
                                        $nBatch = $row['batch'];
                                        ?>
                                        <tr>
                                            <td>
                                                <?php echo $nBatch; ?>
                                            </td>
                                            <?php
                                            for ($sem = 1; $sem < 11; $sem++) {
                                                $semester = "Sem " . $sem;
                                                ?>
                                                <td><a HREF="registration-register-student-semester.php?sem=<?php echo $sem; ?>&batch_no=<?php echo $nBatch; ?>" target="_blank"><?php echo $semester; ?></a></td>
                                                <?php }
                                            ?>
                                        </tr>

                                    <?php } 
                                    
                                    $query_str1 = "select distinct batch from isr_stu_main_tbl where substring(batch,1,1) = 'r' order by batch";
                                    $ObjDB->sproc_name = $query_str1;
                                    $result_str1 = $ObjDB->SelectQuery();
                                    
                                    while ($row1 = mysqli_fetch_array($result_str1)) {
                                        $nBatch = $row1['batch'];
                                        ?>
                                        <tr>
                                            <td>
                                                <?php echo $nBatch; ?>
                                            </td>
                                            <?php
                                            for ($sem = 11; $sem < 15; $sem++) {
                                                 $sem_show = $sem - 10;
                                                $semester = "Sem ".$sem_show;
                                                ?>
                                                <td><a HREF="registration-registered-student-semester.php?sem=<?php echo $sem; ?>&batch_no=<?php echo $nBatch; ?>" target="_blank"><?php echo $semester; ?></a></td>
                                                <?php }
                                            ?>
                                        </tr>

                                    <?php } 
                                    ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<?php
$pagemaincontent = ob_get_contents();
ob_clean();
$PAGENAME = 'semester-registration';
$HTMLTITLE = '';
$HTMLDESCRIPTION = '';
$HTMLKEYWORDS = '';
include("admin-master.php");
?>