<?php
session_start();
if(!isset($_SESSION["logged_in"]) && $_SESSION["logged_in"]!=true){
    header("Location: login.php");
    exit;
}

include("db_connect.php");


/**=====================================================**/

//$result_s = mysqli_query($conn,"SELECT id FROM student");
//$student = mysqli_num_rows($result_s);
/*
$result_b = mysqli_query($conn,"SELECT id FROM branch");
$branch = mysqli_num_rows($result_b);


$result_ss = mysqli_query($conn,"SELECT id FROM subject");
$subject = mysqli_num_rows($result_ss);


$result_f = mysqli_query($conn,"SELECT id FROM fees_transaction");
$fees_t = mysqli_num_rows($result_f);

*/


/**=====================================================**/

?>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Online Admission System of H.D.Jain college, Ara, Bhojpur,Bihar</title>

    <!-- BOOTSTRAP STYLES-->
    <link href="css/bootstrap.css" rel="stylesheet" />
    <!-- FONTAWESOME STYLES-->
    <link href="css/font-awesome.css" rel="stylesheet" />
       <!--CUSTOM BASIC STYLES-->
    <link href="css/basic.css" rel="stylesheet" />
    <!--CUSTOM MAIN STYLES-->
    <link href="css/custom.css" rel="stylesheet" />
    <!-- GOOGLE FONTS-->
    <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
</head>
<?php
include("php/header.php");
?>
        <div id="page-wrapper">
            <div id="page-inner">
                <div class="row">
                    <div class="col-md-12">
                        <h1 class="page-head-line">DASHBOARD</h1>
                       
                    </div>
                </div>
                <!-- /. ROW  -->
                <div class="row">
				
				
				
				
				  <div class="col-md-3">
                        <div class="main-box mb-pink">
                            <a href="studentchange.php">
                                <i class="fa fa-users fa-5x"></i>
								<span class="number counter"><?php echo $student ?></span>
                                <h5>Admission UG-Part-II</h5>
                            </a>
                        </div>
                    </div>
					<?php
					//echo "SELECT * FROM `tbl_userregistration` WHERE userid='".$_SESSION['user_id']."' AND response_message='Transaction successful' AND status=1";
					    $checkExists= mysqli_query($conn,"SELECT * FROM `tbl_userregistration_ug2` WHERE userid='".$_SESSION['user_id']."' AND response_message='Transaction successful' AND status=1") or die(mysqli_error($conn));
                        if(mysqli_num_rows($checkExists) > 0){
                            $fetchDetail= mysqli_fetch_assoc($checkExists);
                            //print_r($fetchDetail);
                            $printLink= 'formprint.php?id='.base64_encode($fetchDetail["id"]);
                            $feeRecipt= 'receipt.php?id='.base64_encode($fetchDetail["id"]);
                        } else {
                            $printLink= 'studentchange.php';
                            $feeRecipt= 'studentchange.php';
                        }
					?>
					<div class="col-md-3">
                        <div class="main-box mb-red">
                            <a href="<?php echo $printLink; ?>">
                                <i class="fa fa-print fa-5x"></i>
								<span class="number counter"></span>
                                <h5>Print Application Form</h5>
                            </a>
                        </div>
                    </div>
					
					
					
					
					 <div class="col-md-3">
                        <div class="main-box mb-red">
                            <a href="<?php echo $feeRecipt ?>">
                                <i class="fa fa-file-text fa-5x"></i>
								<span></span>
                                <h5>Print Receipt</h5>
                            </a>
                        </div>
                    </div>
					
					
					
					
				<!--	<div class="col-md-3">
                        <div class="main-box mb-red">
                            <a href="manage_subject.php">
                                <i class="fa fa-book fa-5x"></i>
								<span><?php echo $subject ?></span>
                                <h5>Manage Course</h5>
                            </a>
                        </div>
                    </div>-->
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					
				  
				  
				  
				  
				  
				  
                </div>
                <!-- /. ROW  -->

            
            </div>
            <!-- /. PAGE INNER  -->
        </div>
        <!-- /. PAGE WRAPPER  -->
    </div>
    <!-- /. WRAPPER  -->

  <?php include_once'php/footer.php'; ?>