60 lines
2.0 KiB
PHP
60 lines
2.0 KiB
PHP
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title></title>
|
|
</head>
|
|
<body>
|
|
<script type="text/javascript">
|
|
function logowanie(formularz)
|
|
{
|
|
/* login=formularz.login.value;
|
|
haslo=formularz.haslo.value;
|
|
if (login==""&&haslo=="")
|
|
alert("wprowadz dane");
|
|
else if (login=="a"){
|
|
window.location.replace("../rejestracja/pacjent.php");
|
|
}
|
|
else if (login=="b"){
|
|
window.location.replace("../rejestracja/recepcjonista.php");
|
|
}
|
|
else if (login=="c"){
|
|
window.location.replace("../rejestracja/lekarz.php");
|
|
}*/
|
|
}
|
|
</script>
|
|
<?php
|
|
$loginErr=$hasloErr=$daneErr="";
|
|
$login=$haslo="";
|
|
if ($_SERVER["REQUEST_METHOD"] == "POST")
|
|
{
|
|
if (empty($_POST["login"])) {
|
|
$loginErr= "login jest wymagany";}
|
|
if (empty($_POST["haslo"])) {
|
|
$hasloErr= "haslo jest wymagane";}
|
|
if ($_POST["login"]=="pacjent"&& $_POST["haslo"]=="pacjent") header("Location: pacjent.php");
|
|
if ($_POST["login"]=="lekarz"&& $_POST["haslo"]=="lekarz") header("Location: lekarz.php");
|
|
if ($_POST["login"]=="recepcjonista"&& $_POST["haslo"]=="recepcjonista") header("Location: recepcjonista.php");
|
|
else $daneErr="nieprawidłowe dane";
|
|
}
|
|
?>
|
|
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
|
|
Login: <input type="text" name="login" value="<?php echo $login;?>">
|
|
<span class="error"> <?php echo $loginErr;?></span>
|
|
<br>
|
|
Hasło: <input type="text" name="haslo" value="<?php echo $haslo;?>">
|
|
<span class="error"> <?php echo $hasloErr;?></span><br>
|
|
<input type="submit" name="submit" value="Submit"><br>
|
|
<span class="error"> <?php echo $daneErr;?></span><br>
|
|
<?php print $login;
|
|
?>
|
|
<!--<input type="button" value="wyślij" onClick="logowanie(this.form)">
|
|
<input type="button" value="home" onClick="window.location.replace(\"../rejestracja/index.php\")">-->
|
|
</form>
|
|
</body>
|
|
</html>
|
|
<?php
|
|
|
|
?>
|