<?php require_once("header.php");?>

<?php
if(isset($_POST['send']))
{	
	$sql_check = "SELECT * FROM `usertable` WHERE (`phone` = '".$_REQUEST['userid']."' OR `email` = '".$_REQUEST['userid']."') AND `password` = '".md5($_REQUEST['login_password'])."'";
$exe_check = mysqli_query($connection,$sql_check);
$num_check = mysqli_num_rows($exe_check);
if($num_check>0)
{
	$arr_check = mysqli_fetch_array($exe_check);
	//if($arr_check['is_active'] == 'Yes')
	//{
		$_SESSION['USER_FNAME'] = $arr_check['name'];
		$_SESSION['USER_ID'] = $arr_check['id'];

		header("Location: my-account.php");
	//}
	//else
	//{
		//echo 'fail2';
	//}
}
else
{
	echo 'fail';
}
}
?>

			<!-- page template area start -->
			<section id="about">
				<div class="container mt-10 pb-10 pt-0">
					<div class="row">
						<div class="col-md-7">
							<h1 class="title mt-10 mb-10" style="text-align:left;">We are <span style="color:#ed0d87;"> The Poribes Team</span></h1> 
							<h3 class="mt-0 mb-20" style="color:#777; text-align:left; font-size:19px;">Please login to access your account</h3>
							<?php if(isset($_SESSION['msg_fail'])) { ?>
							<p class="text-left"><img src="images/cross.png" alt="" /> <?php echo $_SESSION['msg_fail'];?></p>
							<?php 
							unset($_SESSION['msg_fail']);
							} 
							?>
							<form id="contact_form" name="contact_form" class="" action="" method="post" onSubmit="return form_validation();">
							<div class="row">
								<div class="col-sm-12">
									<div class="form-group">
										<input name="userid" id="userid" class="form-control" type="text" placeholder="Enter Phone No. or Email Address *" value="">
									</div>
								</div>
								<div class="col-sm-12">
									<div class="form-group">
										<input name="login_password" id="login_password" class="form-control" type="text" placeholder="Enter Password *" value="">
									</div>
								</div>
								<div class="col-sm-12">
									<div class="form-group">
										<input type="radio" name="utype" id="utype" value="General" checked> General <input type="radio" name="utype" id="utype" value="Student"> Student
									</div>
								</div>
							</div>
							<div class="form-group">
								<input type="hidden" name="send" id="send" value="1" />
								<button type="submit" class="btn btn-flat btn-theme-colored border-left-theme-color-2-4px">Login</button>
								<p style="margin:15px 0"><a href="forgot-password.php" style="color:#333;">Forgot Password</a></p>
							</div>
							</form>
						</div>
						<div class="col-md-5">
							<div>
                            	<div style="background:linear-gradient(to right, #2d5d2d, #22842d, #588520, #9fc62d); padding:20px; margin-top:20px;">
                            	    <h3 class="mt-10 mb-15" style="color:#fff;">We are more than just a NGO</h3>
                            	    <p style="color:#fff;">"To seek for a green and healthy environment that shall sow the seeds of trust, hope and aspiration for the generation next."</p>
                            	    <p><button type="submit" class="btn btn-flat btn-theme-colored border-left-theme-color-2-4px mt-10 mb-20" onclick="window.location.href='index.php'">Back To Home</button></p>
                            	</div>
                            </div>
						</div>
					</div>
				</div>
			</section>
			<!-- page template area end -->

<?php require_once("footer.php");?>