Location: PHPKode > projects > GEStione SOci > member.php
<?
switch ($p_action) {
	case "member_new":
		$title = "Nuovo Socio";
		$action = "member_insert";
		$jsonload = "document.forms[0].p_name.focus();";
		$member_type_query_where = "where member_type_id = 'ADER'";
		$member_type_noblank = true;
		break;
	case "member_detail":
		$title = "Dettaglio Socio";
		$action = "member_update";
		$query = SQL_SELECT_MEMBER . " and a.member_id = '$p_member_id'";
		$result = mysql_query($query)
			or die("Query failed <pre>$query</pre>" . mysql_error());
		$line = mysql_fetch_array($result, MYSQL_ASSOC);
		$member_type_noblank = true;
		break;
	case "member_query":
		$title = "Ricerca Socio";
		$action = "member_query_result";
		$jsonload = "document.forms[0].p_name.focus();";
		$member_type_noblank = false;
		break;
}
?>
<link href="gesso.css" rel="stylesheet" type="text/css">
<table border="0" cellpadding="0" cellspacing="0" class="content"> 
	<tr> 
		<td class="content_top"><?= $title ?></td> 
	</tr> 
	<tr> 
		<td><br> 
			<?= (($p_action_message != "") ? ("<div class=\"action_message\">$p_action_message</div>") : ("")) ?> 
			<?
				if ($p_action_error != "") {
			  		print("<div class=\"action_error\">" . urldecode($p_action_error) . "</div>\n");
					$line[name] = $p_name;
					$line[surname] = $p_surname;
					$line[member_type_id] = $p_member_type_id;
					$line[email] = $p_email;
					$line[phone_mobile] = $p_phone_mobile;
					$line[phone_home] = $p_phone_home;
					$line[tax_code] = $p_tax_code;
					$line[birthplace] = $p_birthplace;
					$line[birthdate_f] = $p_birthdate;
					$line[address] = $p_address;
					$line[zip_code] = $p_zip_code;
					$line[city] = $p_city;
					$line[province_code] = $p_province_code;
					$line[flag_honorary] = $p_flag_honorary;
					$line[flag_activist] = $p_flag_activist;
					$line[amount] = $p_amount;
					$line[flag_unwanted] = $p_flag_unwanted;
					$line[print_application_date_f] = $p_print_application_date;
					$line[acceptance_date_f] = $p_acceptance_date;
					$line[membership_card_number] = $p_membership_card_number;
				}
			?> 
			<?= (($line[flag_unwanted] == "Y") ? ("<div class=\"alert_unwanted\">ATTEZIONE!!! Socio INDESIDERATO!!!</div>") : ("")) ?> 
			<form name="form1" method="post" action="index.php"> 
				<input type="hidden" name="p_action" value="<?= $action ?>"> 
				<table border="0" cellpadding="0" cellspacing="1" class="form_table"> 
					<tr> 
						<td nowrap class="form_label">Matricola</td> 
						<td class="form_value"><input type="text" class="form_input" size="30" name="p_member_id" value="<?= $line[member_id] ?>"></td> 
					</tr> 
					<tr> 
						<td nowrap class="form_label">Nome</td> 
						<td class="form_value"><input type="text" class="form_input" size="30" name="p_name" value="<?= $line[name] ?>"></td> 
					</tr> 
					<tr> 
						<td nowrap class="form_label">Cognome</td> 
						<td class="form_value"><input type="text" class="form_input" size="30" name="p_surname" value="<?= $line[surname] ?>"></td> 
					</tr> 
					<tr> 
						<td nowrap class="form_label">Numero Tessera </td> 
						<td class="form_value"><input type="text" class="form_input" size="30" name="p_membership_card_number" value="<?= $line[membership_card_number] ?>"></td> 
					</tr> 
					<tr> 
						<td nowrap class="form_label">E-Mail</td> 
						<td class="form_value"><input type="text" class="form_input" size="30" name="p_email" value="<?= $line[email] ?>"></td> 
					</tr> 
					<tr> 
						<td nowrap class="form_label">Tipo Socio </td> 
						<td class="form_value"><?= lov('p_member_type_id', "select member_type_id, description from tmember_type $member_type_query_where", $line[member_type_id], $member_type_noblank, 'class="form_input"') ?></td> 
					</tr> 
					<tr> 
						<td nowrap class="form_label">Cellulare</td> 
						<td class="form_value"><input type="text" class="form_input" size="30" name="p_phone_mobile" value="<?= $line[phone_mobile] ?>"></td> 
					</tr> 
					<tr> 
						<td nowrap class="form_label">Tel. Abitazione</td> 
						<td class="form_value"><input type="text" class="form_input" size="30" name="p_phone_home" value="<?= $line[phone_home] ?>"></td> 
					</tr> 
					<tr> 
						<td nowrap class="form_label">Codice Fiscale </td> 
						<td class="form_value"><input type="text" class="form_input" size="30" name="p_tax_code" value="<?= $line[tax_code] ?>"></td>
					</tr> 
					<tr> 
						<td nowrap class="form_label">Luogo Di Nascita</td> 
						<td class="form_value"><input type="text" class="form_input" size="30" name="p_birthplace" value="<?= $line[birthplace] ?>"></td> 
					</tr> 
					<tr> 
						<td nowrap class="form_label">Data Di Nascita  (dd-mm-yyyy)</td> 
						<td class="form_value"><input type="text" class="form_input" size="30" name="p_birthdate" value="<?= $line[birthdate_f] ?>"></td> 
					</tr> 
					<tr> 
						<td nowrap class="form_label">Via</td> 
						<td class="form_value"><input type="text" class="form_input" size="30" name="p_address" value="<?= $line[address] ?>"></td> 
					</tr> 
					<tr> 
						<td nowrap class="form_label">CAP</td> 
						<td class="form_value"><input type="text" class="form_input" size="30" name="p_zip_code" value="<?= $line[zip_code] ?>"></td> 
					</tr> 
					<tr> 
						<td nowrap class="form_label">Citt&agrave;</td> 
						<td class="form_value"><input type="text" class="form_input" size="30" name="p_city" value="<?= $line[city] ?>"></td> 
					</tr> 
					<tr> 
						<td nowrap class="form_label">Provincia</td> 
						<td class="form_value"><?= lov('p_province_code', 'select province_code, description from tprovince', $line[province_code], NULL, 'class="form_input"') ?></td> 
					</tr> 
					<tr> 
						<td nowrap class="form_label">Socio Onorario </td> 
						<td class="form_value"><input type="checkbox" name="p_flag_honorary" value="Y" <?= (($line[flag_honorary] == "Y") ? ("checked") : ("")) ?>></td> 
					</tr> 
					<tr> 
						<td nowrap class="form_label">Socio Attivista </td> 
						<td class="form_value"><input type="checkbox" name="p_flag_activist" value="Y"<?= (($line[flag_activist] == "Y") ? ("checked") : ("")) ?>></td> 
					</tr> 
					<tr> 
						<td nowrap class="form_label">Importo</td> 
						<td class="form_value"><input type="text" class="form_input" size="30" name="p_amount" value="<?= $line[amount] ?>"></td> 
					</tr> 
					<tr> 
						<td nowrap class="form_label">Indesiderato</td> 
						<td class="form_value"><input type="checkbox" name="p_flag_unwanted" value="Y"<?= (($line[flag_unwanted] == "Y") ? ("checked") : ("")) ?>></td> 
					</tr> 
					<tr> 
						<td nowrap class="form_label">Data Stampa Domanda </td> 
						<td class="form_value"><input type="text" class="form_input" size="30" name="p_print_application_date" value="<?= $line[print_application_date_f] ?>"></td> 
					</tr> 
					<tr> 
						<td nowrap class="form_label">Data Accettazione </td> 
						<td class="form_value"><input type="text" class="form_input" size="30" name="p_acceptance_date" value="<?= $line[acceptance_date_f] ?>"></td> 
					</tr> 
					<tr>
						<td nowrap class="form_label">Data Registrazione</td>
					   <td nowrap class="form_value"><input type="text" class="form_input" size="30" name="p_registration_date" value="<?= $line[registration_date_f] ?>"></td>
					</tr>
					<tr> 
						<td colspan="2" nowrap> <div align="left"> 
								<input name="" type="submit" value="Esegui"> 
								<input name="" type="reset" value="Ripristina"> 
								<?
								if ($p_action == "member_detail") {
								?> 
								<input name="" type="button" value="Elimina" onClick="if (confirm('Sicuro?')) { this.form.p_action.value = 'member_delete'; this.form.submit(); }"> 
								<?
								}
								?> 
								</div></td> 
					</tr>
				</table> 
			</form></td> 
	</tr> 
</table> 

<script><?= $jsonload ?></script>
Return current item: GEStione SOci