<!DOCTYPE html>
<html>
<head>
<title>Pagina protetta da password</title>
<style>
html,body { margin: 0; padding: 0; }
body { background-color: #FFF; }
p, td, li, input { font-family: verdana, arial, tahoma; font-size: 16px; color: #333; }
table { margin: 50px auto; border: 1px solid #DDD; background: #EEE; }
.errore td { text-align: center; color: #CC0000; }
input[type="password"] { border: 1px solid #DDD; }
</style>
</head>
<body>
<?php
// -------------------------
$password = '123456789';
// -------------------------
$pwd = isset($_GET['pwd']) ? $_GET['pwd'] : false;
if (!$pwd || $pwd != $password) {
?>
<form method="get" action="<?php echo $_SERVER['PHPSELF']; ?>">
<table border="0" cellspacing="0" cellpadding="10">
<?php if ($pwd !== false): ?><tr class="errore"><td colspan="3">La password inserita non è corretta!</td></tr><?php endif; ?>
<tr>
<td>Password</td>
<td><input type="password" name="pwd" style="width: 180px;"/></td>
<td><input type="submit" value="Entra"/></td>
</tr>
</table>
</form>
<?php
}else{
?>
<form method="POST" name="test" enctype="multipart/form-data" action="inserisci.php">
<table aling="center" cellpadding="20" cellspacing="10" bordercolor="#4d030d" border="6">
<title>Gestione Prenotazioni</title>
<tr>
<td width="26%"><strong>N.Ordine </strong></td>
<td width="74%"><input class="input" type="text" name="n_ordine" placeholder="inserire Numero d'Ordine "size="50" /></td>
</tr>
<tr>
<td width="26%"><strong>Nome </strong></td>
<td width="74%"><input class="input" type="text" name="nome" placeholder="inserire Nome " size="50" /></td>
</tr>
<tr>
<td width="26%"><strong>Cognome </strong></td>
<td width="74%"><input class="input" type="text" name="cognome" placeholder="inserire Cognome " size="50" /></td>
</tr>
<tr>
<td width="26%"><strong>Recapito Telefonico </strong></td>
<td width="74%"><input class="input" type="text" name="recapito" placeholder="inserire Recapito Telefonico " size="50" /></td>
</tr>
<tr>
<td width="26%"><strong>Data Ritiro </strong></td>
<td width="74%"><input class="date" type="date" name="data_ritiro" size="10" /></td>
</tr>
<tr>
<td width="26%"><strong>Prodotto 1 </strong></td>
<td /><?php
//dati di connessione al db
$username = "";
$password = "";
$database = "";
mysql_connect("", $username, $password);
@mysql_select_db($database) or die("Impossibile selezionare il database");
?>
<form action="pagina.php" method="post">
<select name="prodotti">
<?php
$query = mysql_query("SELECT * FROM prodotti ORDER BY descri");
while ($riga=mysql_fetch_array($query)){
$descri=$riga['descri'];
echo "<option value=\"$descri\">$descri</option>";
}
?>
</td>
</tr>
<tr>
<td width="26%"><strong>Prodotto 2 </strong></td>
<td /><?php
//dati di connessione al db
$username = "";
$password = "";
$database = "";
mysql_connect("", $username, $password);
@mysql_select_db($database) or die("Impossibile selezionare il database");
?>
<form action="pagina.php" method="post">
<select name="prodotti">
<?php
$query = mysql_query("SELECT * FROM prodotti ORDER BY descri");
while ($riga=mysql_fetch_array($query)){
$descri=$riga['descri'];
echo " <option value=\"$descri\">$descri</option>";
}
?></td>
</tr>
<tr>
<td width="26%"><strong>Prodotto 3 </strong></td>
<td /><?php
//dati di connessione al db
$username = "";
$password = "";
$database = "";
mysql_connect("", $username, $password);
@mysql_select_db($database) or die("Impossibile selezionare il database");
?>
<form action="pagina.php" method="post">
<select name="prodotti">
<?php
$query = mysql_query("SELECT * FROM prodotti ORDER BY descri");
while ($riga=mysql_fetch_array($query)){
$descri=$riga['descri'];
echo "<option value=\"$descri\">$descri</option>";
}
?>
</tr>
<tr>
<td width="26%"><strong>Prodotto 4 </strong></td>
<td /><?php
//dati di connessione al db
$username = "";
$password = "";
$database = "";
mysql_connect("", $username, $password);
@mysql_select_db($database) or die("Impossibile selezionare il database");
?>
<form action="pagina.php" method="post">
<select name="prodotti">
<?php
$query = mysql_query("SELECT * FROM prodotti ORDER BY descri");
while ($riga=mysql_fetch_array($query)){
$descri=$riga['descri'];
echo "<option value=\"$descri\">$descri</option>";
}
?></td>
</tr>
</tr>
<tr>
<td width="26%"><strong>Note </strong></td>
<td width="74%"><input class="input" type="text" name="Note" placeholder="inserire nota " size="100" /></td>
</tr>
<td>
<div id="buttom">
<input type="submit" value="Inserisci" name="B1" />
<input type="reset" value="Reimposta" name="B2" />
</td>
<td>
<a href="inserimento_prodotti.php" class="buttom">Aggiungi un altro Prodotto</a>
<a href="visualizza.php" class="buttom">Visualizza Ordini</a>
</td>
</div>
</form>
<table>
</table>
<?php
}
?>
</body>
</html>