<?php
include "datacon.php";
if (isset($_POST['login'])){

$username=$_POST['username'];
$password=md5($_POST['password']);


$test= @mysql_query("select premium from operators where Username='$username'");
while ($row = mysql_fetch_array($test))
{
$premium=$row['premium'];
}

$login_query=@mysql_query("select * from operators where Username='$username' and Password='$password' AND status !='Decline'");
$count=mysql_num_rows($login_query);
$row=mysql_fetch_array($login_query);

if ($count > 0){
if ( $premium =='silver'){
session_start();
$_SESSION['id']=$row['Userid'];
$MeUser=$_SESSION['session_var'] ;

header('location:I/');

}
else if ($premium =='gold'){
session_start();
$_SESSION['id']=$row['Userid'];
$MeUser=$_SESSION['session_var'] ;

header('location:I/');

}
else if ( $premium =='platinum'){
session_start();
$_SESSION['id']=$row['Userid'];
$MeUser=$_SESSION['session_var'] ;


header('location:I/');


}
}else{?>
<script>
alert('Please check your Username or Password and Try again');
	window.location = "index";
	</script>
	<?php
}
}
?>
   