<html>

<head>
	<meta http-equiv='content-type' content='text/html;charset=utf-8'>
	<title>WebBike V1.0</title>
	<SCRIPT language=JavaScript src='valideformulaire.js' type=text/javascript></SCRIPT>
	<link href="style.css" rel="stylesheet" media="screen">
</head>

<body>
	<?php
	require 'database.inc.php';
	//session_start();
	//session_register("lg_user");
	//session_register("lg_password");
	//session_register("lg_admin");
	//session_register("lg_menu1");
	//session_register("lg_menu2");
	//session_register("lg_menu3");
	//session_register("lg_menu4");
	//session_register("lg_menu5");
	if (Test_User($lg_user, $lg_password) == TRUE) {
		echo "<script language=JavaScript>\n";
		if ($ligne = Client::getClientByNoClient($No)) {
			if (isset($Champ)) {
				echo "window.opener.document.info." . $Champ . "Nom.value = " . '"' . $ligne['Nom'] . '"' . ";\n";
				echo "window.opener.document.info." . $Champ . "Prenom.value = " . '"' . $ligne['Prenom'] . '"' . ";\n";
			} else {
				if ($Pos == 0) {
					echo "window.opener.document.info.Nom.value = " . '"' . $ligne['Nom'] . '"' . ";\n";
					echo "window.opener.document.info.Prenom.value = " . '"' . $ligne['Prenom'] . '"' . ";\n";
				} else {
					echo "window.opener.document.info.Nom2.value = " . '"' . $ligne['Nom'] . '"' . ";\n";
					echo "window.opener.document.info.Prenom2.value = " . '"' . $ligne['Prenom'] . '"' . ";\n";
				}
			}
		} else {
			if (isset($Champ)) {
				echo "window.opener.document.info." . $Champ . "Nom.value = 'inconnu';\n";
				echo "window.opener.document.info." . $Champ . "Prenom.value = '';\n";
			} else {
				if ($Pos == 0) {
					echo "window.opener.document.info.Nom.value = 'inconnu';\n";
					echo "window.opener.document.info.Prenom.value = '';\n";
				} else {
					echo "window.opener.document.info.Nom2.value = 'inconnu';\n";
					echo "window.opener.document.info.Prenom2.value = '';\n";
				}
			}
		}
		echo "window.close();\n";
		echo "</script>\n";
	}
	?>
</body>

</html>