<?php
	
	//////////////////////////////////////////////
    require_once('GptwrAuthService.class.php');
	//////////////////////////////////////////////

	//////////////////////////////////////////////
	$serverIp = "192.168.1.2";
	$port = "1812";
	$secret = "1AABAC6D068EEF6A7BAD3FDF50A05CC8";
	$timeout = "3";
	$username = $_POST['name'];
	$password = $_POST['password'];
	//////////////////////////////////////////////

	//////////////////////////////////////////////
	$result = GptwrAuthService::auth( $serverIp, $port, $secret, $username, $password, $timeout);
	$info = GptwrAuthService::info();
	list($rCode, $authFailCnt, $rMsg) = split('#', $result);
	$success = "";
	if ( $rCode == "0" ){
		$success = "success";
	}else{
		$success = "failed";
	}
	//////////////////////////////////////////////


?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Mirae-Tech Grippin Tower login test(PHP)</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<!-- top navigation start -->
<!-- top navigation end -->
<!-- body start -->
<div id="body">
		<!-- top shadow start -->
		<div id="topShadow">
		 
		</div>
		<!-- top shadow end -->
		<!-- body pannel start -->
		<div id="bodyPannel">
			<!-- login form start-->
			<form method="get" action="index.php" name="login" class="search">
			   <h2>OTP Login Test <span>(php)</span></h2>
			   <span>
                return code=<?php echo $rCode ?> <font color=red>(<?php echo $success ?>)</font><br>
				authFailCnt=<?php echo $authFailCnt ?><br>
                message=<?php echo $rMsg ?> <br>
				<font color='steelblue'><?php echo $info ?> </font>
               </span>
				<br>
				<input name="login" type="submit" id="back" value="back" title="back" class="submit" />
				
			</form>

			<p>
			  <!-- login form end-->
			  <br class="spacer" />
		  </p>
			<p>&nbsp;</p>
			<p>&nbsp;</p>
			<p>&nbsp;</p>
			<p>&nbsp;</p>
			<p>&nbsp;</p>
						
		</div>

		<!-- body pannel end -->
		<!-- top shadow start -->		
		<div id="bottomShadow"></div>
		<div id="bottomShadowCopy">Copyright MiraeTechnology.Co.Ltd. </div>
		<br class="spacer" />
		<!-- bottom shadow end -->

	</div>
	<!-- body end -->
	<!-- footer start -->
<!-- footer end -->	
</body>
</html>

