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

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

$username=$_POST['logname'];

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


	 $ownID=$Dr['owner_id'];
	 $MyH =$con->getMyOfficeHotel($ownID);
          if($MyH->rowCount()>0)
          {
           $HN=$MyH->fetch();
           $hnm=$HN["hotelid"];
           //$H=$con->getHotelInfo($hnm)->fetch();
           $id1="qsgsfhuw8891o1pggywiuiwpwp8091hhwjmbbbnbsnusbbsggs98202iiahjhabbabbabba89299200gsgshsiisi00200hhshhsbbssbbsbbs2002002002002";
           $g ="srqwesgbsynnebbdyyeuueumnennenneeyyyy3yy3uu33iii3o3oo3oo3i3iii3ii3uu3uu3uuu3uuu3uuu3uuu3uuuu3uuu3uu3uu3uuu3uu3ttyy3yy3yy3yy3yy3yyy3yy3yy3yy3yy3shshhshhwhhwhhwhhheh";

           /*header("location:buda_shoping_centerStaff.php?id1999ddjshhshbsssggsggsggsvjjsksllsllsllsllsllsjsgshshhshhshhhshhs=$id1&&gssdfhuw8891o1pggywiuiwpwp8091hhwjmbbbnbsnusbbsggs98202iiahjhabbabbabba89299200gsgshsiisi00200hhshhsbbssbbsbbs2002002002002=$g&&id=$shopid&&id2=$ownID&&id3=$ownerid");*/
  
           
          // $ownerid=$H['owner_id'];
          
          
	   echo "<script> window.location.href='my_Only_Hotel_in_detail_staff.php?eeid1999ddjshhshbsssggsggsggsvjjsksllsllsllsllsllsjsgshshhshhshhhshhs=$id1&&rrgssdfhuw8891o1pggywiuiwpwp8091hhwjmbbbnbsnusbbsggs98202iiahjhabbabbabba89299200gsgshsiisi00200hhshhsbbssbbsbbs2002002002002=$g&&id=$hnm&&id2=$ownID' </script>";

           //header("location:my_Only_Hotel_in_detail_staff.php?eeid1999ddjshhshbsssggsggsggsvjjsksllsllsllsllsllsjsgshshhshhshhhshhs=$id1&&rrgssdfhuw8891o1pggywiuiwpwp8091hhwjmbbbnbsnusbbsggs98202iiahjhabbabbabba89299200gsgshsiisi00200hhshhsbbssbbsbbs2002002002002=$g&&id=$hnm&&id2=$ownID");//&&id3=$ownerid");
	
           
           }

           /*///

 

	 
          if($MyH->rowCount()>0)
          {
           $HN=$MyH->fetch();
           $shopid=$HN["shopid"];
           $C=$scon->getShopName($shopid)->fetch();
           $ownID=$C['ownerid'];
           header("location:buda_shoping_centerStaff.php?id=$shopid&&id2=$ownID&&id3=$ownerid");
	
           
           }
           */////
           else{

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

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

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



 
?>