Location: PHPKode > projects > LAMP School > tutori/insn.php
<?php
   @include("../php-ini.php");
   @include("../funzioni.php");
   
   // istruzioni per tornare alla pagina di login 
	session_start();	
    $tipoutente=$_SESSION["tipoutente"]; //prende la variabile presente nella sessione
	if ($tipoutente=="")
	   {
	   header("location: ../login/login.php"); 
	   die;
	   }
   
   //Imposta i colori dei link
   print"<body bgcolor='white' link='$color_link' vlink='$color_alink' alink='$color_vlink'>";	


    //imposta la tabella del titolo
	print("<table border=0 width='100%'>
		<tr>
		   <td align ='center' bgcolor='$bgcolor_titolo'><strong><font size='+1'>NUOVO TUTORE</font></strong></td>
		</tr>
		</table> <br><br>");  

	$Connessione=mysql_connect($db_server,$db_user,$db_password);
	if (!$Connessione)
	{
		print("<H1>Connessione al server mySQL fallita</H1>");
		exit;	
	};
	$DB=mysql_select_DB($db_nome);
	if (!$DB)
	{
		print("<H1>Connessione al database stage fallita</H1>");
		exit;	
	};
	$Query="SELECT * FROM tutori WHERE idtutore='$_GET[id]'";
	$Ris=mysql_query($Query);
	$query1="SELECT * FROM comuni WHERE idcomune='$Data->idcomnasc'";
    $Result1=mysql_query($query1);
	$Data1=mysql_fetch_object($Result1);
	if (!$Ris)
	{
		print "<html><body bgcolor='RED'> AGGIORNAMENTO NON ESEGUITO </body></html>";	
	}
	else
	{
	  
       $aa=substr(($_GET[dat]),0,4);
	   $mm=substr(($_GET[dat]),5,2);
	   $gg=substr(($_GET[dat]),7,2);
	   $query1="SELECT * FROM comuni ORDER BY denominazione";
		 $Result1=(mysql_query($query1));
		 $Data1=mysql_fetch_object($Result1);
		print("<html><body> <center>
  <body> 
    <table>
      <tr >
        
         </tr>
		 <form action='pro.php' method ='GET'> 
          <tr>
         <td>
          Cognome
        </td>
        <td>
          <input type='text' method='GET' size='15' name='cognome' value='$cognome'>
         </td>
         </tr>
          <tr>
         <td>
          Nome
        </td>
        <td>
          <input type='text' method='GET' size='15' name='nome' value='$nome'>
         </td>
          </tr>
         <td>
          data di nascita (aa-mm-gg)	
         </td>
         <td>
		   <input type='text' method='GET' size='4' name='aa' value='$aa' maxlength='4'>
		   /
		   <input type='text' method='GET' size='2' name='mm' value='$mm' maxlength='2'>
		   /
		   <input type='text' method='GET' size='2' name='gg' value='$gg' maxlength='2'>
		 </td>
	     </tr>
		  <tr>
		   <td>
		    comune di nascita
         </td>
		  <td>");
		    $sql2="select * from comuni"; 
			$result2=mysql_query($sql2); 
		    print "<SELECT NAME='COMBO' size='1'>";
			 while ($Data12=mysql_fetch_object($result2)) 
			 {
			    print "<option name='denominazione2' size=10 value='$Data12->idcomune'>";
				print "$Data12->denominazione";				
		     }
			 print ("</select>   
		  </td>
          </tr>
          <tr>
         <td>
          indirizzo
        </td>
        <td>
          <input type='text'  method='GET' size='15' name='indirizzo' value='$indirizzo' >
         </td>
        </tr>
		<tr>
         <td>
          Comune di residenza
        </td>
        <td>");
    		$sql3="select * from comuni"; 
			$result3=mysql_query($sql3); 
		    print "<SELECT NAME='COMBO2' size='1'>";
			 while ($Data13=mysql_fetch_object($result3)) 
			 {
			    print "<option name='denominazione2' value='$Data13->idcomune' size=10>";
				print "$Data13->denominazione";				
		     }
			 print "</select>";   
			
       print "</td>
        </tr>
		<tr>
         <td>
          telefono
        </td>
        <td>
          <input type='text' size='15' name='telefono' value='$telefono'>
         </td>
        </tr>
		<tr>
         <td>
          email
	  </td>
        <td>
          <input type='text' size='15' name='email' value='$email'>
         </td>
        </tr>
		<tr>
         <td>
          tipo
        </td>
		  <td>
		  <SELECT NAME='COMBO3' size='1'>
	      <option name='p' value='p' size='10'>Padre
		   <option name='m' value='m' size='10'>Madre
		   <option name='t' value='t' size='10'>Tutore Legale
		   </select>
		   </td>
		   </tr>
		   <tr>
         <td>
		 
		  </td>
		  <tr>
         <td>
          telefono cellulare
        </td>
        <td>
          <input type='text' size='15' name='telcel' value='$telcel' method='GET'>
         </td>
        </tr>
		  </table><br>				
		  <input type='submit' value='Inserisci'><br><br>
		  </form>
		   <form action='../tutori/mostra1.php' method ='GET'> 
		
		  <input type='submit' value='<< Indietro'>
		  </form>
    </body>
	
</html>
          </body></html>";	
	}
	mysql_close($Connessione);

?>
Return current item: LAMP School