Current Path : /web/htdocs/www.entinoprofit.org/home/database/cofapi/
Upload File :
Current File : /web/htdocs/www.entinoprofit.org/home/database/cofapi/Anagrafica.php

<?php
include("dblib.inc");
include("clublib.inc");
checkUser();
$message = "";
if (isset($_POST['actionflag']) && $_POST['actionflag']=="Update")
	{
	
	if (empty($_POST["Ragione_Sociale"] ) ||
		empty($_POST["Cognome"]) ||
		empty($_POST["Nome"]) ||
		empty($_POST["PI"]) ||
		empty($_POST["CF"]) ||
		empty($_POST["Indirizzo"]) ||
		empty($_POST["Citta"]) ||
		empty($_POST["CAP"]) ||
		empty($_POST["Civico"]) ||
		empty($_POST["Provincia"]) ||
		empty($_POST["Telefono"]) ||
		empty($_POST["Fax"]) ||
		empty($_POST["Cell"]) ||
		empty($_POST["E_Mail"]) ||
		empty($_POST["Password"]) ||
		empty($_POST["Web"]))
		$message .= "I campi sono tutti obbligatori ! <br>";
	if (!(strlen($_POST["Password"]) == '8'))
		$message .= "La password deve essere di 8 caratteri<br>";
		
	if ( $message == "") // nessun errore	
		{
		$result = updateUser ( $_POST["Ragione_Sociale"], $_POST["Cognome"], $_POST["Nome"], $_POST["PI"], $_POST["CF"], $_POST["Indirizzo"], $_POST["Citta"], $_POST["CAP"], $_POST["Civico"], $_POST["Provincia"], $_POST["Telefono"], $_POST["Fax"], $_POST["Cell"], $_POST["Password"], $_POST["Web"], $_POST["E_Mail"]);
// $_POST = getRow ( "pws_clienti", "E_Mail", $_SESSION["Login"]);
		//print $_SESSION["Login"];
		print $result;
		}
}		
$_POST = getRow ( "pws_clienti", "E_Mail", $_SESSION["E_Mail"]);
$_POST["E_Mail"]=$_SESSION["E_Mail"];
?>
<html>
<head>
<title>Registrazione</title>
<link rel="stylesheet" type="text/css" href="Themes/Facet/Style.css">
</head>
<body bgcolor="#FFFFFF" link="#504C43" alink="#000000" vlink="#504C43" text="#000000">
<?php 
include("Header.php"); 
include("publicnav.php");
?>
<!-- BEGIN Record pws_clienti -->
<form method="post" action="<?php print $_SERVER['PHP_SELF'];?>" name="pws_clienti">
<!-- flag di invio del modulo -->
<input type="Hidden" name="actionflag" value="Update">
<div align="center"><font class="FacetFormHeaderFont">Dati Anagrafici</font></div>
<table border="0" cellpadding="3" cellspacing="1" class="FacetFormTABLE" align="center">
  <!-- BEGIN Error -->
  <tr>
    <td colspan="2" class="FacetDataTD">
	<?php
	if (! $message == "")
	{
	print "$message";
	}
	?>
	</td>
  </tr>
  <!-- END Error -->
  <tr>
    <td class="FacetFieldCaptionTD">Ragione Sociale&nbsp;</td>
    <td class="FacetDataTD"><input type="text" name="Ragione_Sociale" value="<?php print $_POST["Ragione_Sociale"] ?>" maxlength="100" size="50" class="FacetInput">&nbsp;</td>
  </tr>
  <tr>
    <td class="FacetFieldCaptionTD">Cognome&nbsp;</td>
    <td class="FacetDataTD"><input type="text" name="Cognome" value="<?php print $_POST["Cognome"] ?>" maxlength="30" size="30" class="FacetInput">&nbsp;</td>
  </tr>
  <tr>
    <td class="FacetFieldCaptionTD">Nome&nbsp;</td>
    <td class="FacetDataTD"><input type="text" name="Nome" value="<?php print $_POST["Nome"] ?>" maxlength="30" size="30" class="FacetInput">&nbsp;</td>
  </tr>
  <tr>
    <td class="FacetFieldCaptionTD">PI&nbsp;</td>
    <td class="FacetDataTD"><input type="text" name="PI" value="<?php print $_POST["PI"] ?>" maxlength="12" size="12" class="FacetInput">&nbsp;</td>
  </tr>
  <tr>
    <td class="FacetFieldCaptionTD">CF&nbsp;</td>
    <td class="FacetDataTD"><input type="text" name="CF" value="<?php print $_POST["CF"] ?>" maxlength="16" size="16" class="FacetInput">&nbsp;</td>
  </tr>
  <tr>
    <td class="FacetFieldCaptionTD">Indirizzo&nbsp;</td>
    <td class="FacetDataTD"><input type="text" name="Indirizzo" value="<?php print $_POST["Indirizzo"] ?>" maxlength="60" size="50" class="FacetInput">&nbsp;</td>
  </tr>
   <tr>
    <td class="FacetFieldCaptionTD">Civico&nbsp;</td>
    <td class="FacetDataTD"><input type="text" name="Civico" value="<?php print $_POST["Civico"] ?>" maxlength="10" size="10" class="FacetInput">&nbsp;</td>
  </tr>
  <tr>
    <td class="FacetFieldCaptionTD">Citta&nbsp;</td>
    <td class="FacetDataTD"><input type="text" name="Citta" value="<?php print $_POST["Citta"] ?>" maxlength="60" size="50" class="FacetInput">&nbsp;</td>
  </tr>
  <tr>
    <td class="FacetFieldCaptionTD">CAP&nbsp;</td>
    <td class="FacetDataTD"><input type="text" name="CAP" value="<?php print $_POST["CAP"] ?>" maxlength="5" size="5" class="FacetInput">&nbsp;</td>
  </tr>
   <tr>
    <td class="FacetFieldCaptionTD">Provincia&nbsp;</td>
    <td class="FacetDataTD"><input type="text" name="Provincia" value="<?php print $_POST["Provincia"] ?>" maxlength="2" size="2" class="FacetInput">&nbsp;</td>
  </tr>
  <tr>
    <td class="FacetFieldCaptionTD">Telefono&nbsp;</td>
    <td class="FacetDataTD"><input type="text" name="Telefono" value="<?php print $_POST["Telefono"] ?>" maxlength="20" size="20" class="FacetInput">&nbsp;</td>
  </tr>
  <tr>
    <td class="FacetFieldCaptionTD">Fax&nbsp;</td>
    <td class="FacetDataTD"><input type="text" name="Fax" value="<?php print $_POST["Fax"] ?>" maxlength="20" size="20" class="FacetInput">&nbsp;</td>
  </tr>
  <tr>
    <td class="FacetFieldCaptionTD">Cell&nbsp;</td>
    <td class="FacetDataTD"><input type="text" name="Cell" value="<?php print $_POST["Cell"] ?>" maxlength="20" size="20" class="FacetInput">&nbsp;</td>
  </tr>
  <tr>
    <td class="FacetFieldCaptionTD">E Mail&nbsp;</td>
    <td class="FacetDataTD"><input type="text" name="E_Mail" disabled value="<?php print $_POST["E_Mail"] ?>" maxlength="100" size="50" class="FacetInput">&nbsp;</td>
  </tr>
  <input type="hidden" name="E_Mail" value="<?php print $_POST["E_Mail"] ?>">
   <tr>
    <td class="FacetFieldCaptionTD">Password&nbsp;</td>
    <td class="FacetDataTD"><input type="text" name="Password" value="<?php print $_POST["Password"] ?>" maxlength="10" size="10" class="FacetInput">&nbsp;</td>
  </tr>
  <tr>
    <td class="FacetFieldCaptionTD">Web&nbsp;</td>
    <td class="FacetDataTD"><input type="text" name="Web" value="<?php print $_POST["Web"] ?>" maxlength="50" size="50" class="FacetInput">&nbsp;</td>
  </tr>
  
    <td colspan="2" align="right" nowrap class="FacetFooterTD">
      <!-- BEGIN Button Insert --><input name="Insert" type="submit" value="Update" class="FacetButton"><!-- END Button Insert -->

    </td>
  </tr></table>
</form>
<!-- END Record pws_clienti -->
</body>
</html>