<?php 
error_reporting(0);
include('inc/functions.php');
require_once("inc/class/class.admin_users.php");
require_once("inc/class/class.login_attempt.php");
require_once("inc/class/class.client_org.php");
$userObj=new admin_users;
$loginObj=new login_attempt;
$clientObj=new client_org;
 if(isset(
$_GET['activationcode'])){
	$activecode=sanitize($_GET['activationcode']);
	if($clientObj->activateUser($activecode))
	{	
	include("emails/email_templates.php");
	$args=array();
	//$clientObj->admin_id;
	//$clientObj->select($clientObj->admin_id);
	$args["email"]=$clientObj->contact_email;
	$args["subject"]=$clientObj->contact_email."- Your account is activated";
	$args["full_name"]="Member";
	sendemail('activate_user',$args);
	$active_msg=1;
	} 
    else
	{
		$active_error=1;
	}
	
}else
{
	$active_error=2;
}
?>
<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
	<title>Web-School Admin Login</title>
	<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
	<link rel="stylesheet" href="css/todc-bootstrap.min.css">
	<link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/custom_style.css">
	<link rel="stylesheet" href="css/theme/color_1.css" id="theme">
	<link href='http://fonts.googleapis.com/css?family=Roboto:300&amp;subset=latin,latin-ext' rel='stylesheet' type='text/css'>
	<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
	<style>
		body {padding:80px 0 0}
		textarea, input[type="password"], input[type="text"], input[type="submit"] {-webkit-appearance: none}
		.navbar-brand {font:300 15px/18px 'Roboto', sans-serif}
		.login_wrapper {position:relative;width:380px;margin:0 auto}
		.login_panel {background:#f8f8f8;padding:20px;-webkit-box-shadow: 0 0 0 4px #ededed;-moz-box-shadow: 0 0 0 4px #ededed;box-shadow: 0 0 0 4px #ededed;border:1px solid #ddd;position:relative}
		.login_head {margin-bottom:20px}
		.login_head h1 {margin:0;font:300 20px/24px 'Roboto', sans-serif}
		.login_submit {padding:10px 0}
		.login_panel label a {font-size:11px;margin-right:4px}
		
		@media (max-width: 767px) {
			body {padding-top:40px}
			.navbar {display:none}
			.login_wrapper {width:100%;padding:0 20px}
		}
	</style>
	<!--[if lt IE 9]>
		<script src="js/ie/html5shiv.js"></script>
		<script src="js/ie/respond.min.js"></script>
	<![endif]-->
</head>
<body>
	<header class="navbar navbar-default navbar-fixed-top">
		<div class="container">
			<div class="navbar-header">
				<a class="navbar-brand" href="index.php">web-school.in</a>
			</div>
			<div class="pull-right">
				<ul class="nav navbar-nav">
					<li class="active"><a href="index.php" class="">School Management Software</a></li>
					
				</ul>
			</div>
		</div>
    </header>

	<div class="login_wrapper">
    <!--Success Message-->
    <?php
	if($active_msg==1){ ?><div class="success" ><h3>Congratulations! </h3><p>Now you are an active member of web-school.in</p><p>Please <a href="index.php">Click Here </a>to login.</p>
    <p>Thank You</p></div> <?php } ?>
    <!--Error Message-->
    <?php
	if($active_error==1 || $active_error==2){ ?><div class="warning" ><h3>Sorry! </h3><p> This activation link is not valid.</p>
    </div> <?php } ?>
		<!---->
		<!---->
	</div>
</body>
</html>