<?php
require_once("../headers.php");
//session_start();
 

if( isset($_POST['logname']) && isset($_POST['logsecret']) ){
 

$username=$_POST['logname'];

$password=md5($_POST['logsecret']);
 
$rQ=$con->login($username,$password);
if ($rQ->rowCount()>0) {
	$Dr=$rQ->fetch();//
 


	 $ownerid=$Dr['owner_id'];
	 $MyH =$mcon->getEmployee($ownerid);
	 
          if($MyH->rowCount()>0)
          {
           $HN=$MyH->fetch();
           $shopid=$HN["shopid"];
           $C=$mcon->getShopName($shopid)->fetch();
           $ownID=$C['ownerid'];

$id1="qgsfhuw8891o1pggywiuiwpwp8091hhwjmbbbnbsnusbbsggs98202iiahjhabbabbabba89299200gsgshsiisi00200hhshhsbbssbbsbbs2002002002002";
$g ="sqwesgbsynnebbdyyeuueumnennenneeyyyy3yy3uu33iii3o3oo3oo3i3iii3ii3uu3uu3uuu3uuu3uuu3uuu3uuuu3uuu3uu3uu3uuu3uu3ttyy3yy3yy3yy3yy3yyy3yy3yy3yy3yy3shshhshhwhhwhhwhhheh";

 echo "<script> window.location.href='buda_shoping_centerStaff.php?i=$id1&&s=$g&&id=$shopid&&id2=$ownID&&id3=$ownerid' </script>";

          // header("location:buda_shoping_centerStaff.php?id1999dd=$id1&&gssdfhuw8891=$g&&id=$shopid&&id2=$ownID&&id3=$ownerid");
	
           
           }
           else{

	          $r="Unrecognised user!.";
	          
	           echo "<script> window.location.href='defaultShopingCenter.php?id=$r' </script>";
	          
	          //header("location:defaultShopingCenter.php?id=$r");
}
	
}
else{

	$r="Invalid username or password!.";
	
	 echo "<script> window.location.href='defaultShopingCenter.php?id=$r' </script>";
	
	
//	header("location:defaultShopingCenter.php?id=$r");
}

}
else{
	$r="Both username and password required!.";
	
	 echo "<script> window.location.href='defaultShopingCenter.php?id=$r' </script>";
	
	//header("location:defaultShopingCenter.php?id=$r");
}



 
?>