<?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';

$ObjDB = new class_db();
$log = new common();
$objadm = new class_admin();
$val = new validation();

if ($_POST) {

    $stu_roll = $val->ValidateString($_REQUEST["roll_no"]);

    $objadm->roll_number = $stu_roll;
    $RollNumberArr = $objadm->GetStudentDetailsbyRollNumber();

    $num = mysqli_num_rows($RollNumberArr);
    if ($num == 0) {
        $error_msg = "Incorrect Roll Number";
    } else {
        $row = mysqli_fetch_array($RollNumberArr);
        $stu_name = $row["name"];
        $batch = $row["batch"];
    }
}
?>
<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">Permit Late Registration</h5>
                </div>
                <div class="card-body">
                    <form action="" method="POST">
                        <div class="row"><div class="col-lg-12"><?php echo $error_msg; ?></div></div>
                        <div class="row">
                            <div class="col-lg-3">
                                <label>Roll Number:</label>
                                <input type="text" name="roll_no" id="roll_no" class="form-control"/>
                            </div>
                            <div class="col-lg-3">
                                <input type="submit" name="per_reg_btn" id="per_reg_btn" value="SUBMIT" class="btn btn-primary"/>
                            </div>
                        </div>
                    </form>
                    <?php
                    if ($_POST) {

                        if ($num > 0) {
                            ?>

                            <div class="table-responsive">
                                <FORM METHOD="POST" ACTION="control-permit-late-allowed.php">
                                    <INPUT TYPE="hidden" NAME="stu_roll" value="<?php echo $stu_roll ?>">
                                    <b>Permit Late Reg. for 24 hrs</b><br/>
                                    <TABLE class="table table-bordered align-middle">
                                                <TR><TD>
                                            <INPUT TYPE="submit" class="submit" NAME="Submit" value="Submit">
                                            </TD></TR>
                                 

                                    </TABLE>
                                </FORM>
                            </div>
                            <?php
                        }
                    }
                    ?>

                </div>
            </div>
        </div>
    </div>
</div>
<?php
$pagemaincontent = ob_get_contents();
ob_clean();
$PAGENAME = 'control-permit-late-reg';
$HTMLTITLE = '';
$HTMLDESCRIPTION = '';
$HTMLKEYWORDS = '';
include("admin-master.php");
?>