<?php 
include("dbconfig.php");
session_start();
if(!isset($_SESSION['login_user']))
	{
	header("Location: login.php");
	}
	$login_type=$login_type=$_SESSION['login_type'];
?><?php
 $date_array = getdate();?>
 <?php 
$queryyo = "SELECT * FROM college_name where code='$code'";
$numresultsyo=mysql_query($queryyo);
$resultyo= mysql_query($queryyo) or die("Couldn't execute query");
$a_rowwo = mysql_fetch_array( $resultyo );
$codeec=$a_rowwo['code'];
$queryyo = "SELECT * FROM session where code='$code'";
$numresultsyo=mysql_query($queryyo);
$resultyo= mysql_query($queryyo) or die("Couldn't execute query");
$a_rowwo = mysql_fetch_array( $resultyo );
$codeecs=$a_rowwo['code'];
if (function_exists('date_default_timezone_set'))
{
  date_default_timezone_set('Asia/Kolkata');
}

$txt_dob=date('Y-m-d');
 ?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <title>Admin Panel - Advance College Management System - Developed By MD SOFTWARE - Faizabad</title>
    <!-- Font Awesome Icons -->
  <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css">
  <!-- overlayScrollbars -->
  <link rel="stylesheet" href="plugins/overlayScrollbars/css/OverlayScrollbars.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="dist/css/adminlte.min.css">
  <!-- Google Font: Source Sans Pro -->
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet"><script language="javascript" type="text/javascript">document.oncontextmenu = function() {
  return false;
}</script><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

</head>
<body class="hold-transition sidebar-mini layout-fixed layout-navbar-fixed layout-footer-fixed">
<div class="wrapper">
<?php
		
							
$queryyo = "SELECT * FROM college_info where code='$code'";
$numresultsyo=mysql_query($queryyo);
$resultyo= mysql_query($queryyo) or die("Couldn't execute query");
$a_rowwo = mysql_fetch_row( $resultyo );

?>
  <nav class="main-header navbar navbar-expand navbar-white navbar-light">
    <!-- Left navbar links -->
    <ul class="navbar-nav">
      <li class="nav-item">
        <a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>      </li>
      <li class="nav-item d-none d-sm-inline-block">
        <a href="welcome-home.php?title=Dashboard" class="nav-link"><?php echo $a_rowwo['2']; ?> (<?php echo $session; ?>)</a>      </li>
      <li class="nav-item d-none d-sm-inline-block">
        <a href="http://www.mdsoftech.com" class="nav-link">Support</a>      </li>
        
        <?php
	 
$query56 = "SELECT * FROM soft_pay where code='$code'";
$numresults56=mysql_query($query56);
$numrows56=mysql_num_rows($numresults56);
$result56 = mysql_query($query56) or die("Couldn't execute query");


?>
                 
                    <?php
while ( $a_row56 = mysql_fetch_array( $result56 ) )
 {
$amountty+=$a_row56['amount'];
					
					}?>
                   
                   <li class="nav-item d-none d-sm-inline-block" >
        <a href="software_pay.php?active899=1&title=Software%20Payment%20Details" class="nav-link" style="color:#FF0000; font-weight:bold"> Your Dues : <?php echo $amountty; ?></a></li>
        
    </ul>
<?php 
$session_change=$_POST['session_change'];
$session_code=$_POST['session_code'];

if($session_change!=""){
$_SESSION['session']=$session_change;
$_SESSION['code']=$session_code;
?>
<script type="text/javascript">

   	// Javascript URL redirection

    window.location.replace("welcome-home.php?title=Dashboard");

</script>
<?php }
?>
    <!-- SEARCH FORM -->
    <form class="form-inline ml-3" method="post">
      <div class="input-group input-group-sm">
      College
         <select name="session_code" required class="form-control form-control-navbar" style="width:200px;">
   <?php 
   $query = "SELECT * FROM college_name";
$numresults=mysql_query($query);
 $numrows=mysql_num_rows($numresults);
$result = mysql_query($query) or die("Couldn't execute query");

?><?php
while ( $a_row = mysql_fetch_row( $result ) )
 {?>
    <option value="<?php echo $a_row[2]; ?>" <?php if($a_row[2]==$code){ ?>selected<?php } ?>><?php echo $a_row[1]; ?></option>
    <?php }?>
   
    </select>
      Change Session : 
         <select name="session_change" required class="form-control form-control-navbar">
   <?php 
   $query = "SELECT * FROM session where code='$code' ORDER BY name";
$numresults=mysql_query($query);
 $numrows=mysql_num_rows($numresults);
$result = mysql_query($query) or die("Couldn't execute query");

?><?php
while ( $a_row = mysql_fetch_row( $result ) )
 {?>
    <option value="<?php echo $a_row[1]; ?>" <?php if($a_row[1]==$session){ ?>selected<?php } ?>><?php echo $a_row[1]; ?></option>
    <?php }?>
   
    </select>
        <div class="input-group-append">
          <button class="btn btn-navbar" type="submit">
            <i class="fas fa-search"></i>
          </button>
        </div>
      </div>
    </form>
    <!-- Right navbar links -->
    <ul class="navbar-nav ml-auto">
      <!-- Messages Dropdown Menu -->
      <li class="nav-item dropdown">
        <a class="nav-link" data-toggle="dropdown" href="#">
          <i class="far fa-user"></i>
          <span class="badge badge-danger navbar-badge">1</span>        </a>
        <div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
          <a href="#" class="dropdown-item">
            <!-- Message Start -->
            <div class="media">
             <?php
								if(isset($_SESSION['login_user']))
	{
	$login_session=$_SESSION['login_user'];
	$login_type=$_SESSION['login_type'];
	
	}
	if($a_rowwo[4]!=""){
	 ?>
                                 
                                 
              <img src="../<?php echo $a_rowwo['5']; ?>" alt="User" class="img-size-50 mr-3 img-circle"> 
<?php }else{ ?>
<img src="http://rnsc.mdsoftware.co.in/old/no-image.png" alt="User" class="img-size-50 mr-3 img-circle"> 

<?php } ?>
<div class="media-body">
<h3 class="dropdown-item-title">
<?php
echo $login_session;
?>
                 
                  <span class="float-right text-sm text-danger"><i class="fas fa-star"></i></span>                </h3>
               
              </div>
            </div>
            <!-- Message End -->
          </a>
         
         
          <div class="dropdown-divider"></div>
          <a href="logout.php" class="dropdown-item dropdown-footer">Logout</a>        </div>
      </li>
      <!-- Notifications Dropdown Menu -->
      
     
    </ul>
  </nav>
   <!-- /.navbar -->

  <!-- Main Sidebar Container -->
  <aside class="main-sidebar sidebar-dark-primary elevation-4">
    <!-- Brand Logo -->
    <a href="welcome-home.php?title=Dashboard" class="brand-link">
    <?php if($a_rowwo['4']==""){ ?>
    <img src="http://rnsc.mdsoftware.co.in/old/Building.jpg" alt="Logo" class="brand-image img-circle elevation-3"
           style="opacity: .8">
    <?php }else{?>
      <img src="../<?php echo $a_rowwo['4']; ?>" alt="Logo" class="brand-image img-circle elevation-3"
           style="opacity: .8"><?php } ?>
      <span class="brand-text font-weight-light"><?php echo $a_rowwo['1']; ?></span>
    </a>

    <!-- Sidebar -->
    <div class="sidebar">
      <!-- Sidebar user panel (optional) -->
      <div class="user-panel mt-3 pb-3 mb-3 d-flex">
        <div class="image">
        <?php 
		$query = "SELECT * FROM user where code='$code'";
$numresults=mysql_query($query);
echo $numrows=mysql_num_rows($numresults);
$result = mysql_query($query) or die("Couldn't execute query");
$a_rowx = mysql_fetch_row( $result );
if($a_rowx[5]==""){
?>
<img src="http://rnsc.mdsoftware.co.in/old/Building.jpg" class="img-circle elevation-2" alt="User Image">
          <?php }else{?>
<img src="../<?php echo $a_rowwo['4']; ?>" class="img-circle elevation-2" alt="<?php echo $a_rowx[2]; ?>">
          <?php }?>
        </div>
        <div class="info">
          <a href="#" class="d-block"><?php
if(isset($_SESSION['login_user']))
{
$login_type=$_SESSION['login_type'];
}
 ?>
                                  
                 <?php
	
	echo $login_type;
	
	?></a>
        </div>
      </div>

      <!-- Sidebar Menu -->
      <nav class="mt-2">
  
  

<?php
include "nav.php" 
 ?>
 </nav>
      <!-- /.sidebar-menu -->
    </div>
    <!-- /.sidebar -->
  </aside>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <div class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h1 class="m-0 text-dark"><?php echo $_GET['title']; ?></h1>
          </div><!-- /.col -->
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item"><a href="welcome-home.php?title=Dashboard">Home</a></li>
              <li class="breadcrumb-item active"><?php echo $_GET['title']; ?></li>
            </ol>
          </div><!-- /.col -->
        </div><!-- /.row -->
      </div><!-- /.container-fluid -->
    </div>
    <!-- /.content-header -->

    <!-- Main content -->