<?php
/* 
 * Sample for testing eID parameters
 */
include_once('eid_functions.inc.php');
session_start();

if ($_REQUEST['MsgId'])
{
    $ret = EID_Initiate($_REQUEST);
    if ($ret['ErrorMsg'] || !$ret['RedirectURL']) die($ret['ErrorMsg']);
	$_SESSION['eidReq'] = $ret;
    if (!headers_sent()) header("Location:".$ret['RedirectURL']); else echo "<META HTTP-EQUIV=Refresh CONTENT=\"1; URL=".$ret['RedirectURL']."\">";
    exit;
}
$MsgId=EID_NewMsgId();

?>
<html>
<body>
<form action="test.php">
<table>
<!-- <tr><td>System:</td><td><select name=System><option>Test</option><option>Abnahme</option><option>Produktion</option></select></td></tr> -->
<tr><td>MsgId:</td><td><input name=MsgId type=text size=10 value="<?=$MsgId?>"></td></tr>
<tr><td>ReturnUrl:</td><td><input name=ReturnUrl size=100 value="<?=$eid_cfg['ReturnUrl']?>"></td></tr>
<tr><td>FirstName:</td><td><input name=IdentityData[FirstName] size=70 maxlength=70 value="Max"></td></tr>
<tr><td>LastName:</td><td><input name=IdentityData[LastName] size=70 maxength=70 value="Mustermann"></td></tr>
<tr><td>DateOfBirth:</td><td><input name=IdentityData[DateOfBirth] size=10 value="1955-11-12"></td></tr>
<tr><td>Street:</td><td><input name=IdentityData[Street] size=140 maxlength=140 value="Tschamlerstraße 2"></tr></tr>
<tr><td>ZipCode:</td><td><input name=IdentityData[ZipCode] size=16 maxlength=16 value="6020"></tr></tr>
<tr><td>Town:</td><td><input name=IdentityData[Town] size=35 maxlength=35 value="Innsbruck"></tr></tr>
<tr><td>Country:</td><td><input name=IdentityData[Country] size=2 maxlength=2 value="AT"></tr></tr>
<tr><td>Title:</td><td><input name=IdentityData[Title] size=70 maxlength=70 value="Dr."></td></tr>
</table>
<input type=submit>
</form></body></html>
