You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							145 lines
						
					
					
						
							6.4 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							145 lines
						
					
					
						
							6.4 KiB
						
					
					
				| 
 | |
| <br> | |
| 
 | |
| <?php | |
| if($_POST['go']){ | |
| 
 | |
| $q=mysqli_query($dbConn, "UPDATE farmacie SET nome='".converti($_POST['nome'])."', descrizione='".converti($_POST['descrizione'])."', indirizzo='".converti($_POST['indirizzo'])."', | |
| 		comune='".$_POST['comune']."', cap='".$_POST['cap']."', asl='".$_POST['asl']."', ambito='".$_POST['ambito']."', telefono='".converti($_POST['telefono'])."', | |
| 		email='".converti($_POST['email'])."', r_indirizzo='".converti($_POST['r_indirizzo'])."',r_telefono='".converti($_POST['r_telefono'])."', | |
| 		r_comune='".$_POST['r_comune']."', r_messaggio='".converti($_POST['r_messaggio'])."' WHERE id='".$_POST['id']."'"); | |
| 
 | |
| if($q){ | |
| @include 'res_ok.php'; | |
| }else{ | |
| @include 'res_ko.php'; | |
| } | |
| 
 | |
| 
 | |
| }else{ | |
| ?> | |
|  | |
| <form method="post"> | |
| <table border="0" cellspacing="2" cellpadding="0" width="750"> | |
| <tr><td align="left" valign="middle" class="title">  <b>Ambito territoriale</b></td></tr> | |
| <tr><td width="750"><select name="ida" style="width: 750px" onChange="this.form.submit()"> | |
| <option value=""> - Seleziona l'ambito territoriale - </option> | |
| <?php | |
| $qa=mysqli_query($dbConn, "SELECT * FROM ambiti ORDER BY descrizione"); | |
| while($ra=mysqli_fetch_array($qa)){ | |
| echo "<option value=\"".$ra['id']."\" "; | |
| if($ra['id']==@$_POST['ida']){echo "selected";} | |
| echo ">".$ra['descrizione']."</option>\n"; | |
| } | |
| ?> | |
| </select></td></tr> | |
|  | |
| <?php | |
| if(@$_POST['ida']){ | |
| $qac=mysqli_query($dbConn, "SELECT comuni FROM ambiti WHERE id='".@$_POST['ida']."'"); | |
| $rac=mysqli_fetch_array($qac); | |
| ?> | |
| <tr><td align="center" valign="top"> </td></tr> | |
| <tr><td align="left" valign="middle" class="title">  <b>Farmacia</b></td></tr> | |
| <tr><td width="750"><select name="id" style="width: 750px" onChange="this.form.submit()"> | |
| <option value=""> - Seleziona la farmacia - </option> | |
| <?php | |
| $q=mysqli_query($dbConn, "SELECT * FROM farmacie WHERE comune IN(".str_replace("#",",",$rac['comuni']).") ORDER BY nome"); | |
| while($r=mysqli_fetch_array($q)){ | |
| echo "<option value=\"".$r['id']."\" "; | |
| if($r['id']==@$_POST['id']){echo "selected";} | |
| echo ">".$r['nome']."</option>\n"; | |
| } | |
| ?> | |
| </select></td></tr> | |
|  | |
| <?php | |
| } | |
| ?> | |
|  | |
| <tr><td align="center" valign="top"> </td></tr> | |
| </table></form> | |
|  | |
| <?php | |
| if(@$_POST['id']){ | |
| $q=mysqli_query($dbConn, "SELECT * FROM farmacie WHERE id='".@$_POST['id']."'"); | |
| $r=mysqli_fetch_array($q); | |
| ?> | |
|  | |
| <form method="post"> | |
| <input type="hidden" name="id" value="<?php echo $r['id'];?>"> | |
| <table border="0" cellspacing="2" cellpadding="2" width="750"> | |
| <tr><td align="left" valign="middle" class="title" colspan="4">  <b>Modifica farmacia</b></td></tr> | |
| <tr><td width="150" valign="top" align="right" class="txt_lit_grey">Farmacia: </td><td width="275"><input type="text" name="nome" style="width: 275px" value="<?php echo $r['nome'];?>"></td> | |
| <td width="150" valign="top" align="right" class="txt_lit_grey" rowspan="2">Descrizione: </td><td width="275" rowspan="2"><textarea name="descrizione" cols="40" rows="2" style="width: 275px"><?php echo $r['descrizione'];?></textarea></td> | |
| </tr> | |
|  | |
| <tr><td width="150" valign="top" align="right" class="txt_lit_grey">Indirizzo: </td><td width="275"><input type="text" name="indirizzo" style="width: 275px" value="<?php echo $r['indirizzo'];?>"></td></tr> | |
| <tr><td width="150" valign="top" align="right" class="txt_lit_grey">Comune: </td><td width="275"><select name="comune" style="width: 275px"> | |
|  | |
| <?php | |
| $qc=mysqli_query($dbConn, "SELECT * FROM comuni ORDER BY comune"); | |
| while($rc=mysqli_fetch_array($qc)){ | |
| echo "<option value=\"".$rc['id']."\" "; | |
| if($rc['id']==$r['comune']){echo "selected";} | |
| echo "> ".$rc['comune']."</option>\n"; | |
| } | |
| ?> | |
| </select> | |
| </td><td width="150" valign="top" align="right" class="txt_lit_grey">CAP: </td><td width="275" align="left"><input type="text" name="cap" style="width: 80px" value="<?php echo $r['cap'];?>"></td> | |
| </tr> | |
|  | |
| <tr><td width="150" valign="top" align="right" class="txt_lit_grey">ASL: </td><td width="275"><select name="asl" style="width: 275px"> | |
| <option value="A.S.L. Salerno 1" <?php if($r['asl']=="A.S.L. Salerno 1"){echo "selected";}?>>A.S.L. Salerno 1</option> | |
| <option value="A.S.L. Salerno 2" <?php if($r['asl']=="A.S.L. Salerno 2"){echo "selected";}?>>A.S.L. Salerno 2</option> | |
| <option value="A.S.L. Salerno 3" <?php if($r['asl']=="A.S.L. Salerno 3"){echo "selected";}?>>A.S.L. Salerno 3</option> | |
| </select> | |
| </td><td width="150" valign="top" align="right" class="txt_lit_grey">Ambito: </td><td width="275"><select name="ambito" style="width: 275px"> | |
|  | |
| <?php | |
| $qd=mysqli_query($dbConn, "SELECT * FROM ambiti ORDER BY descrizione"); | |
| while($rd=mysqli_fetch_array($qd)){ | |
| echo "<option value=\"".$rd['id']."\" "; | |
| if($rd['id']==$r['ambito']){echo "selected";} | |
| echo "> ".$rd['descrizione']."</option>\n"; | |
| } | |
| ?> | |
| </select></td> | |
| </tr> | |
|  | |
| <tr><td width="150" valign="top" align="right" class="txt_lit_grey">Telefono: </td><td width="275"><input type="text" name="telefono" style="width: 275px" value="<?php echo $r['telefono'];?>"></td> | |
| <td width="150" valign="top" align="right" class="txt_lit_grey">E-Mail: </td><td width="275"><input type="text" name="email" style="width: 275px" value="<?php echo $r['email'];?>"></td> | |
| </tr> | |
|  | |
|  | |
| <tr><td align="center" valign="top" colspan="4"> </td></tr> | |
| <tr><td align="left" valign="middle" class="title" colspan="4">  <b>Reperibilità</b></td></tr> | |
| <tr><td width="150" valign="top" align="right" class="txt_lit_grey">Indirizzo: </td><td width="275"><input type="text" name="r_indirizzo" style="width: 275px" value="<?php echo $r['r_indirizzo'];?>"></td> | |
| <td width="150" valign="top" align="right" class="txt_lit_grey">Telefono: </td><td width="275"><input type="text" name="r_telefono" style="width: 275px" value="<?php echo $r['r_telefono'];?>"></td> | |
| </tr> | |
| <tr><td width="150" valign="top" align="right" class="txt_lit_grey">Comune: </td><td width="275"><select name="r_comune" style="width: 275px"> | |
|  | |
| <?php | |
| $qc=mysqli_query($dbConn, "SELECT * FROM comuni ORDER BY comune"); | |
| while($rc=mysqli_fetch_array($qc)){ | |
| echo "<option value=\"".$rc['id']."\" "; | |
| if($rc['id']==$r['comune']){echo "selected";} | |
| echo "> ".$rc['comune']."</option>\n"; | |
| } | |
| ?> | |
| </select></td> | |
| <td width="150" valign="top" align="right" class="txt_lit_grey">Messaggio: </td><td width="275"><input type="text" name="r_messaggio" style="width: 275px" value="<?php echo $r['r_messaggio'];?>"></td> | |
| </tr> | |
|  | |
| <tr><td align="center" valign="top" colspan="4"> </td></tr> | |
| <tr><td width="750" align="right" colspan="4"><input type="submit" name="go" value="  Modifica farmacia  " class="button"></td></tr> | |
| <tr><td align="center" valign="top" colspan="4"> </td></tr> | |
|  | |
| </table> | |
| </form> | |
|  | |
|  | |
|  | |
| <?php | |
| }} | |
| ?>
 |