<?php
	$hash = $_POST["hash"];
	//TEMPLATE
	$q1 = "SELECT `premiumlogin` FROM `Web_Set_Templates` WHERE `device` = '$deviceType'";
	$r1 = mysql_query($q1) or die($q1."<br/><br/>".mysql_error());
	$d1 = mysql_result($r1, 0);
	//ADMIN
	$adminhash1 = "SELECT `admin` FROM `Web_Premium_Login` WHERE `id` = '1'";
	$adminhash2 = mysql_query($adminhash1) or die($adminhash1."<br/><br/>".mysql_error());
	$adminhash3 = mysql_result($adminhash2, 0);
	//SUPPORT
	$supporthash1 = "SELECT `support` FROM `Web_Premium_Login` WHERE `id` = '1'";
	$supporthash2 = mysql_query($supporthash1) or die($supporthash1."<br/><br/>".mysql_error());
	$supporthash3 = mysql_result($supporthash2, 0);
	//PAYMENTS
	$paymentshash1 = "SELECT `payments` FROM `Web_Premium_Login` WHERE `id` = '1'";
	$paymentshash2 = mysql_query($paymentshash1) or die($paymentshash1."<br/><br/>".mysql_error());
	$paymentshash3 = mysql_result($paymentshash2, 0);
	if($hash == $adminhash3) {
		$_POST["hash"] = $hash;
		$_POST["accounttype"] = 'admin';
		include("data/templates/premiumend/$d1/Premium_AdminLogin.php");
	}elseif($hash == $supporthash3) {
		$_POST["hash"] = $hash;
		$_POST["accounttype"] = 'support';
		include("data/templates/premiumend/$d1/Premium_SupportLogin.php");		
	}elseif($hash == $paymentshash3) {
		$_POST["hash"] = $hash;
		$_POST["accounttype"] = 'payments';
		include("data/templates/premiumend/$d1/Premium_PaymentsLogin.php");
	}else {
		echo "bad hash";
	}
?>