<?php

session_start();
error_reporting(0);

require_once 'dashboard/conn.php';
require_once 'dashboard/config.php';
require_once 'dashboard/dbconfig4.php';

if (isset($_SESSION["reid"])){

    $image_qury=mysqli_query($conn,"SELECT * FROM ormsregister WHERE reid='".$_SESSION["reid"]."'");
    $image_resalt=mysqli_fetch_array($image_qury);

    $fullname=$image_resalt['fullname'];

}

$success_msg=0;

if (isset($_POST['login'])) {
	
    $email = $_POST['email'];
	
    $password = md5($_POST['password']);

    $sql = mysqli_query($conn, "SELECT * FROM ormsregister WHERE email='$email' and status='1'");
	
	if(mysqli_num_rows($sql)>0){
		
		$result = mysqli_fetch_array($sql);
		if($password==$result['password']){

			$_SESSION['reid']=$result['reid'];
				
			echo "<script>window.location='index.php';</script>";

		}
		else{
			//password not match
			echo "<script>window.location='login.php?password_error';</script>";
		}
		
	}
	else{
		//user not found
		echo "<script>window.location='login.php?user_error';</script>";
	}

}

?>

<!DOCTYPE html>
<!-- html -->
<html>
<!-- head -->
<head>
<title>Login | Mobile Recharge and Billing System | ORMS</title>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="all" /><!-- bootstrap-CSS -->
<link rel="stylesheet" href="css/bootstrap-select.css"><!-- bootstrap-select-CSS -->
<link href="css/font-awesome.css" rel="stylesheet" type="text/css" media="all" /><!-- Fontawesome-CSS -->
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script type='text/javascript' src='js/jquery-2.2.3.min.js'></script>
<!-- Custom Theme files -->
<!--theme-style-->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />	
<!--//theme-style-->
<!--meta data-->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Online Recharge Responsive web template, Bootstrap Web Templates, Flat Web Templates, Android Compatible web template, 
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, Sony Ericsson, Motorola web design" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<!--//meta data-->

<!-- online fonts -->
<link href="//fonts.googleapis.com/css?family=Montserrat:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i&amp;subset=latin-ext,vietnamese" rel="stylesheet">
<link href="//fonts.googleapis.com/css?family=Oxygen:300,400,700&amp;subset=latin-ext" rel="stylesheet">
<link href="//fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i&amp;subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext,vietnamese" rel="stylesheet">
<!-- /online fonts -->
       
</head>
<!-- //head -->

<!-- body -->
<body >
<!--header-->
<header>
	<div class="container">
		<!--logo-->
			<div class="logo">
				<h1><a href="index.php"><img class="img-responsive" src="images/logo.png" alt=""></a></h1>
			</div>
		    <!--//logo-->
		    <div class="w3layouts-login">
				<a href="login.php"><i class="glyphicon glyphicon-user"> </i>Login/Register</a>
			</div>    
			<div class="clearfix"></div>
    </div>
</header>

<!--//-->	
	<div class=" header-right">
		<div class="banner">
			 <div class="slider">
			    <div class="callbacks_container">
			      <ul class="rslides" id="slider">		       
					 <li>
			          	 <div class="banner1">
			           		<div class="caption">
					          	
			          		</div>
			          	</div>
			         </li>
					 <li>
			          	 <div class="banner2">
			           		<div class="caption">
					          	
			          		</div>
			          	</div>
			         </li>
			      </ul>
			  </div>
			</div>
		</div>
	</div>
	 

    <!--Vertical Tab-->
	<div class="categories-section main-grid-border" id="mobilew3layouts">
		<div class="container">
			<div class="row">
                            <div class="col-lg-3">
                            </div>
                            <div class="col-lg-6">
                               <div class="login-right-form">
									<h2>Login Account!</h2>
                                    <p>It you don't have an account you can <a href="register.php">Register here!</a></p>
									<hr>
                                    <form method="POST">
                                        <span class="back-or"><?php if(isset($_GET['request'])){ ?><div class="alert alert-info text-center"><strong>Information!</strong><br>Your Re login request send successfully. Waiting for approval your request.</div><?php } ?>
										<?php if(isset($_GET['password_error'])){ ?><div class="alert alert-danger text-center"><strong>Sorry!</strong><br>The username or password that you've entered is incorrect!</div><?php } ?>
										<?php if(isset($_GET['user_error'])){ ?><div class="alert alert-danger text-center"><strong>Sorry!</strong><br>There is a problem with your User name or Password. shck and try again.</div><?php } ?>
										<?php if(isset($_GET['ip_error'])){ ?><div class="alert alert-danger text-center"><strong>Sorry!</strong><br>Your account has been blocked due to unautorised access.<br><br><a style="color: dodgerblue; cursor: pointer;" onClick="JavaScript:window.location='login.php?req_id=<?php echo $_GET['u']; ?>';">Request Re login?</a></div><?php } ?>
										<?php if(isset($_GET['change_pass_success'])){ ?><div class="alert alert-success" style="font-weight:bold;background-color:#28a745;color:#ffffff;">Thank You! Your Password Change Successfull.</div><?php } ?>	
										</span>
                                        <p>
                                        <label for="modalSigninEmail1">
										USERNAME(Phone Number)
										</label>
										<input name="email" id="email" type="text" class="form-control email" required placeholder="Your Email Address" style="border: 2px solid #ccc;">
                                        </p>
                                        <p>
                                        <label for="modalSigninPassword1">
										PASSWORD
										</label>
										<input name="password" type="password" class="form-control" required id="password" placeholder="Your Password" style="border: 2px solid #ccc;">
                                        </p>
                                        <div class="back-check-box">
                                        <p><a href="forgot_password.php" class="lost-your-password">Forgot your password?</a></p>
                                        </div>
										<br>
                                        <input name="login" type="submit" value="Login" class="btn btn-primary btn-block">
                                        <em class="signup"> Don't have an account? <a href="register.php">Register</a></em>
                                    </form>
                                </div>
                </div>
				<div class="col-lg-3">
                </div>
            </div>
		</div>
	</div>
	
	<hr>
	
	<!--Plug-in Initialisation-->
	<script type="text/javascript">
    $(document).ready(function() {

        //Vertical Tab
        $('#parentVerticalTab').easyResponsiveTabs({
            type: 'vertical', //Types: default, vertical, accordion
            width: 'auto', //auto or any width like 600px
            fit: true, // 100% fit in a container
            closed: 'accordion', // Start closed if in accordion view
            tabidentify: 'hor_1', // The tab groups identifier
            activate: function(event) { // Callback function if tab is switched
                var $tab = $(this);
                var $info = $('#nested-tabInfo2');
                var $name = $('span', $info);
                $name.text($tab.text());
                $info.show();
            }
        });
    });
</script>
	<!-- //Categories -->
	
<!-- Support content -->
	<div class="w3l-support">
		<div class="container">
			<div class="col-md-5 w3_agile_support_left">
				<img src="images/cus.jpg" alt=" " class="img-responsive" />
			</div>
			<div class="col-md-7 w3_agile_support_right">
				<h5>ORMS Recharge Platform</h5>
				<h3>24/7 Customer Service Support</h3>
				<div class="agile_more">
					<a href="support.html" class="type-4">
						<span> Live Support </span>
					</a>
				</div>
			</div>
			<div class="clearfix"> </div>
		</div>
	</div>
<!-- //Support content -->

<!--partners-->
	<div class="w3layouts-partners">
		<h2 style="text-align:center;">Our Service Providers</h2>
		<hr>
	 		<div class="container">
				<ul>
					<li><a href="#"><img class="img-responsive" src="images/airtel.png" alt=""></a></li>
					<li><a href="#"><img class="img-responsive" src="images/dialog.png" alt=""></a></li>
					<li><a href="#"><img class="img-responsive" src="images/mobitel.png" alt=""></a></li>
					<li><a href="#"><img class="img-responsive" src="images/hutch2.png" alt=""></a></li>
					<li><a href="#"><img class="img-responsive" src="images/lankabell.png" alt=""></a></li>
				</ul>
				<ul>
					<li><a href="#"><img class="img-responsive" src="images/slt.png" alt=""></a></li>
					<li><a href="#"><img class="img-responsive" src="images/peotv.png" alt=""></a></li>
					<li><a href="#"><img class="img-responsive" src="images/ceb.png" alt=""></a></li>
					<li><a href="#"><img class="img-responsive" src="images/askcv.png" alt=""></a></li>
					<li><a href="#"><img class="img-responsive" src="images/water.png" alt=""></a></li>	
				</ul>
			</div>
	</div>	
<!--//partners-->	

<!--footer-->
<footer>
	<div class="container-fluid">
		<div class="w3-agile-footer-top-at">
			<div class="col-md-2 agileits-amet-sed">
				<h4>Short Link</h4>
				<ul class="w3ls-nav-bottom">
					<li><a href="#about.html">About Us</a></li>
					<li><a href="#support.html">Support</a></li>
					<li><a href="#sitemap.html">Sitemap</a></li>
					<li><a href="#terms.html">Terms & Conditions</a></li>
					
				</ul>	
			</div>
			<div class="col-md-3 agileits-amet-sed ">
				<h4>Mobile Recharges</h4>
					<ul class="w3ls-nav-bottom">
						<li><a href="#mobilew3layouts" class="scroll">Airtel</a></li>
						<li><a href="#mobilew3layouts" class="scroll">Dialog</a></li>
						<li><a href="#mobilew3layouts" class="scroll">Mobitel</a></li>
						<li><a href="#mobilew3layouts" class="scroll">Hutch(072)</a></li>
						<li><a href="#mobilew3layouts" class="scroll">Hutch(078)</a></li>
					</ul>	
			</div>
			<div class="col-md-3 agileits-amet-sed ">
				<h4>DATACARD RECHARGES</h4>
				   <ul class="w3ls-nav-bottom">
						<li><a href="#mobilew3layouts" class="scroll">Data (49)</a></li>
						<li><a href="#mobilew3layouts" class="scroll">Data (99)</a></li>
						<li><a href="#mobilew3layouts" class="scroll">Data (199)</a></li>
						<li><a href="#mobilew3layouts" class="scroll">Data (299)</a></li>
						<li><a href="#mobilew3layouts" class="scroll">Data (499)</a></li>
					</ul>	
			</div>
			<div class="col-md-2 agileits-amet-sed">
				<h4>TV Recharges</h4>
				<ul class="w3ls-nav-bottom">
						<li><a href="#mobilew3layouts" class="scroll"> Dialog Tv</a></li>
						<li><a href="#mobilew3layouts" class="scroll">Ask Cable Tv</a></li>
						<li><a href="#mobilew3layouts" class="scroll">Peo Tv</a></li>
					</ul>	
			</div>
            <div class="col-md-2 agileits-amet-sed ">
				<h4>Payment Options</h4>
				   <ul class="w3ls-nav-bottom">
						<li>Credit Cards</li>
						<li>Debit Cards</li>
						<li>Any Visa Debit Card (VBV)</li>
						<li>Direct Bank Debits</li>
						<li>Cash Cards</li>	
					</ul>	
			</div>
		<div class="clearfix"> </div>
		</div>
    </div>
	<div class="w3l-footer-bottom">
		<div class="container-fluid">
			<div class="col-md-4 w3-footer-logo">
				<h2><a href="index.php"><img class="img-responsive" src="images/logo.png" alt=""></a></h2>
			</div>
			<div class="col-md-8 agileits-footer-class">
				<p >© 2020 OMRS. All Rights Reserved | Devloped by  <a href="" target="_blank">Seopro Designer.</a> </p>
			</div>
		<div class="clearfix"> </div>
	 	</div>
	</div>
</footer>
<!--//footer-->
    
<!-- for bootstrap working -->
		<script src="js/bootstrap.js"></script>
<!-- //for bootstrap working --><!-- Responsive-slider -->
    <!-- Banner-slider -->
<script src="js/responsiveslides.min.js"></script>
   <script>
    $(function () {
      $("#slider").responsiveSlides({
      	auto: true,
      	speed: 500,
        namespace: "callbacks",
        pager: true,
      });
    });
  </script>
    <!-- //Banner-slider -->
<!-- //Responsive-slider -->   
<!-- Bootstrap select option script -->
<script src="js/bootstrap-select.js"></script>
<script>
  $(document).ready(function () {
    var mySelect = $('#first-disabled2');

    $('#special').on('click', function () {
      mySelect.find('option:selected').prop('disabled', true);
      mySelect.selectpicker('refresh');
    });

    $('#special2').on('click', function () {
      mySelect.find('option:disabled').prop('disabled', false);
      mySelect.selectpicker('refresh');
    });

    $('#basic2').selectpicker({
      liveSearch: true,
      maxOptions: 1
    });
  });
</script>
<!-- //Bootstrap select option script -->
    
<!-- easy-responsive-tabs -->    
<link rel="stylesheet" type="text/css" href="css/easy-responsive-tabs.css " />
<script src="js/easyResponsiveTabs.js"></script>
<!-- //easy-responsive-tabs --> 
    <!-- here stars scrolling icon -->
			<script type="text/javascript">
				$(document).ready(function() {
					/*
						var defaults = {
						containerID: 'toTop', // fading element id
						containerHoverID: 'toTopHover', // fading element hover id
						scrollSpeed: 1200,
						easingType: 'linear' 
						};
					*/
										
					$().UItoTop({ easingType: 'easeOutQuart' });
										
					});
			</script>
			<!-- start-smoth-scrolling -->
			<script type="text/javascript" src="js/move-top.js"></script>
			<script type="text/javascript" src="js/easing.js"></script>
			<script type="text/javascript">
				jQuery(document).ready(function($) {
					$(".scroll").click(function(event){		
						event.preventDefault();
						$('html,body').animate({scrollTop:$(this.hash).offset().top},1000);
					});
				});
			</script>
			<!-- start-smoth-scrolling -->
		<!-- //here ends scrolling icon -->
</body>
<!-- //body -->
</html>
<!-- //html -->