<?php
 session_start();
require_once('admin/includes/config.php');
// Code for login 
if(isset($_POST['login']))
{
$password=$_POST['password'];
$dec_password= base64_encode($_POST['password']);
$ppono=$_POST['ppono'];
// $pay=200;

$ret= mysqli_query($con,"SELECT * FROM users WHERE ppono='$ppono' AND password='$dec_password'");
$num=mysqli_fetch_array($ret);

 
$password = $num['password'];
 if($num>0)
   
{
// if($status === "pending"){
//     $userid1 = base64_encode($userid);
//       $username1 = base64_encode($username);
//       $password1 = base64_encode($password);
//       header("location:registration_success.php?userid=".$userid1."&username=".$username1."&package=".$package."&packageamount=".$packageamount."&password=".$password);
// }
// if ($status === "activated") {

$extra="ress/index.php";
$_SESSION['login']=$_POST['ppono'];
$_SESSION['id']=$num['sid'];
$_SESSION['name']=$num['name'];

$host=$_SERVER['HTTP_HOST'];
$uri=rtrim(dirname($_SERVER['PHP_SELF']),'/\\');
header("location:http://$host$uri/$extra");
exit();
// }
}
else{
echo "<script>alert('Invalid Credintials');
 window.location='index.php';</script>";
$extra="index.php";
$info="Invalid";
$host  = $_SERVER['HTTP_HOST'];
$uri  = rtrim(dirname($_SERVER['PHP_SELF']),'/\\');
//header("location:http://$host$uri/$extra");
exit();
}





}
 ?>