<?php
    include ('db.php');
    ob_start();
    session_start();
    if (!isset($_SESSION['u'])) {
        header('Location:law-adm.php');
    }
    
	if(isset($_POST['logout'])) {
		session_unset();
        header('Location:law-adm.php');
	}
?>
<!DOCTYPE html>
<html lang="en">
    <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
    <meta name="description" content="" />
    <meta name="author" content="" />
    <title> High Court Recruitment </title>
    <link id="favicon" rel="shortcut icon" type="image/png" href="images/fevicon.jpg" />
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.1/font/bootstrap-icons.css" rel="stylesheet" />
    <link href="css/styles.css" rel="stylesheet" />
    <style>
        .head {
            background-color: #ffffff !important;
            border-bottom: 7px solid #1f537e;
        }

        .logo-name {
            font-size: 32px;
            color: #000;
            font-weight: 600;
            font-family: ui-sans-serif;
        }
        .tbl_bdr{
            border: thin solid;
        }
        .scroll-bars{
            overflow-x: auto;
            border: thin solid #08b5ff;
            overflow-y: auto;
            height: 650px;
        }
        .pic{
            height: 200px;
            width: 200px;
        }
    </style>
    </head>
    <body>
        <header>
            <div class="container px-lg-5" style="margin-top: 10px; margin-bottom: 10px;">
                <div class="row p-4 bg-light rounded-3">
                    <div class="col-lg-12">
                        <p class="fs-6 text-center">
                            <b>HIGH COURT OF MADHYA PRADESH : JABALPUR</b>
                            <br>
                            <b>LEGAL ASSISTANT/LAW CLERK-CUM-RESEARCH ASSISTANT EXAMINATION-2022-23</b>
                            <br>
                            <b>ONLINE APPLICATION FORM</b>
                    </div>
                    <div class="section-header">                        
                        <form method="post">
                        Candidate Details
                        <button name = "logout" id = "logout"  class="btn btn-info" style = "float:right">Logout</button>
					    </form>
                    </div>
                    <div class="col-lg-12 scroll-bars">
                        <div class="form-group row top-pad">
                            <div class="col-sm-12"> 
                                <table border = "1" id = "tblCustomers"  cellspacing="0" cellpadding="0">
                                    <tr>
                                    <th class = "tbl_bdr">SNo</th><th class = "tbl_bdr">ID</th><th class = "tbl_bdr">App_No</th>
                                        <th class = "tbl_bdr">Submit_Date</th><th class = "tbl_bdr">Full_Name</th><th class = "tbl_bdr">Father_Name</th><th class = "tbl_bdr">Mother_Name</th>
                                        <th class = "tbl_bdr">Gender</th><th class = "tbl_bdr">DOB</th><th class = "tbl_bdr">Year</th><th class = "tbl_bdr">Month</th><th class = "tbl_bdr">Days</th>
                                        <th class = "tbl_bdr">10Th_Board</th><th class = "tbl_bdr">10Th_Year</th><th class = "tbl_bdr">10Th_Per</th><th class = "tbl_bdr">12Th_Board</th>
                                        <th class = "tbl_bdr">12Th_Year</th><th class = "tbl_bdr">12Th_Per</th><th class = "tbl_bdr">Graduation_Uni</th><th class = "tbl_bdr">Graduation_Year</th>
                                        <th class = "tbl_bdr">Graduation_Per</th><th class = "tbl_bdr">PG_Uni</th><th class = "tbl_bdr">PG_Year</th><th class = "tbl_bdr">PG_Per</th>
                                        <th class = "tbl_bdr">PG</th><th class = "tbl_bdr">I_Secured</th><th class = "tbl_bdr">I_Max</th><th class = "tbl_bdr">II_Secured</th>
                                        <th class = "tbl_bdr">II_Max</th><th class = "tbl_bdr">III_Secured</th><th class = "tbl_bdr">III_Max</th><th class = "tbl_bdr">IV_Secured</th>
                                        <th class = "tbl_bdr">IV_Max</th><th class = "tbl_bdr">V_Secured</th><th class = "tbl_bdr">V_Max</th><th class = "tbl_bdr">VI_Secured</th>
                                        <th class = "tbl_bdr">VI_Max</th><th class = "tbl_bdr">VII_Secured</th><th class = "tbl_bdr">VII_Max</th><th class = "tbl_bdr">VIII_Secured</th>
                                        <th class = "tbl_bdr">VIII_Max</th><th class = "tbl_bdr">IX_Secured</th><th class = "tbl_bdr">IX_Max</th><th class = "tbl_bdr">X_Secured</th>
                                        <th class = "tbl_bdr">X_Max</th><th class = "tbl_bdr">Additional_Quali</th><th class = "tbl_bdr">Achievement</th><th class = "tbl_bdr">Co_Achievement</th>                                            
                                        <th class = "tbl_bdr">MP_Domicile</th><th class = "tbl_bdr">Category</th><th class = "tbl_bdr">Disability</th><th class = "tbl_bdr">Govt_Employee</th>
                                        <th class = "tbl_bdr">Govt_Employee_Details</th><th class = "tbl_bdr">Marital_Status</th><th class = "tbl_bdr">Current_Address</th>
                                        <th class = "tbl_bdr">Permanent_Address</th><th class = "tbl_bdr">Mobile</th><th class = "tbl_bdr">Email</th><th class = "tbl_bdr">Place_Preference</th>
                                        <th class = "tbl_bdr">Case_Details</th><th class = "tbl_bdr">Quest1</th><th class = "tbl_bdr">Quest2</th><th class = "tbl_bdr">Quest3</th><th class = "tbl_bdr">Place</th>
                                        <th class = "tbl_bdr">Photo</th><th class = "tbl_bdr">Sign</th><th class = "tbl_bdr">Check_Dec</th>
                                    </tr>
                                    <?php	
                                        $sql = "SELECT '',id,app_no,submit_date,full_name,father_name,mother_name,gender,dob,year,month,days,10th_board,10th_year,10th_per,12th_board,12th_year,12th_per, 
                                        Graduation_uni,Graduation_year,Graduation_per,pg_uni,pg_year,pg_per,pg,I_secured,I_max,II_secured,II_max,III_secured,III_max, IV_secured,IV_max,V_secured,V_max,
                                        VI_secured,VI_max,VII_secured,VII_max,VIII_secured,VIII_max,IX_secured,IX_max,X_secured,X_max,additional_que,achievement,co_achievement, mp_domicile,category,
                                        handicapped, govt_employee,govt_employee_details,marital_status,current_address,permanent_address,mobile,email,place_preference,case_details, que_1,que_2,que_3,
                                        place,photo,sign,check_dec FROM app_details";

                                        $resource =mysqli_query($link, $sql);			
                                        $count = mysqli_num_rows($resource);
                                        $sno = 0;
                                        if($count>0){	
                                            while($row =mysqli_fetch_row($resource))
                                            {
                                                $sno++;
                                                echo "<tr>";
                                                echo "<td class = 'tbl_bdr'>" .$sno."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[1]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[2]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[3]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[4]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[5]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[6]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[7]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[8]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[9]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[10]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[11]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[12]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[13]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[14]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[15]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[16]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[17]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[18]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[19]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[20]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[21]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[22]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[23]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[24]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[25]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[26]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[27]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[28]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[29]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[30]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[31]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[32]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[33]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[34]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[35]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[36]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[37]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[38]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[39]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[40]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[41]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[42]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[43]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[44]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[45]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[46]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[47]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[48]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[49]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[50]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[51]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[52]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[53]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[54]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[55]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[56]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[57]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[58]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[59]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[60]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[61]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[62]."</td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[63]."</td>";
                                                    echo "<td class = 'tbl_bdr'><img src='images/pic/" .$row[64]."' class = 'pic'></td>";
                                                    echo "<td class = 'tbl_bdr'><img src='images/sign/" .$row[65]."' class = 'pic'></td>";
                                                    echo "<td class = 'tbl_bdr'>" .$row[66]."</td>";
                                                echo "</tr>";
                                            }
                                        }
                                        else
                                        {
                                            echo "<tr><td style='text-align:center;color:red' colspan = '4'>Records not found</td></tr>";
                                        }
                                    ?>
                                </table>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-12">
                        <div class="form-group row">
                            <div class="col-sm-12"> 
                                <span class = "caption">
                                    Total <?php echo $sno; ?> applications received.
                                </span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </header>
    </body>  
</html>