Location: PHPKode > projects > A2z - Web-based address book > a2z-1.0.2/programs/master.functions.inc.php
<?
/* This file contains all the variables to exploit the database
 * and set the main configuration issues. You may modify them if
 * you have previously read the documentation and know what you
 * are doing.
 */

# DATABASE ACCESS ######################################################

include ('dbkey.inc.php');

$user = "Your_Name";
$reply_email = "hide@address.com";

# QUERIES ##############################################################

$select_contacts = "SELECT ContactID,
                           LastName,
                           FirstName,
                           SubGroup
                    FROM Person
                    ORDER BY SubGroup,
                             LastName,
                             FirstName";

$select_contact = "SELECT ContactID,
                           LastName,
                           FirstName,
                           SubGroup
                    FROM Person
		    WHERE ContactID=$ContactID";

$select_email = "SELECT Address, Serial, Location
		 FROM Email
		 WHERE ContactID=$ContactID";

$select_phonenumber = "SELECT Serial,
			      intlPrefix,
			      RegionalCode,
			      PartOne,
			      PartTwo,
			      Ext,
			      Location
		       FROM PhoneNumber
		       WHERE ContactID=$ContactID";

$select_address = "SELECT Serial,
			  ContactID,
			  Location,
			  Street,
			  City,
			  State,
			  Country,
			  PostalCode
		   FROM Address
		   WHERE ContactID=$ContactID";

# FUNCTIONS ############################################################

# EDIT PERSON ##########################################################

function edit_contact_form($ecf_action, $FirstName, $LastName, $SubGroup, $ContactID) {

    if ($ecf_action == "edit") {
	include ('dbkey.inc.php');
	$link_ecf = mysql_connect($dbhost,$dbuser,$dbpass)
		or die("Cannot connect to db");
	mysql_select_db($dbname,$link_ecf)
		or die("Could not find db");
	$result_ecf = mysql_query("SELECT ContactID,
					  LastName,
					  FirstName,
					  SubGroup
				   FROM Person
				   WHERE ContactID = $ContactID");
	while ( $a_row = mysql_fetch_array( $result_ecf ))
	 {
	  include ('html_head.inc.php');
	  print "<FORM ACTION=\"edit.php\"
		       METHOD=\"POST\">
		 <TABLE>";
	  print "<TR><TD>First Name:</TD>
		     <TD><input type=\"text\"
				name=\"FirstName\"
				value=\"$a_row[FirstName]\"></TD>
		 </TR>
		 <TR><TD>Last Name:</TD>
		     <TD><input type=\"text\"
				name=\"LastName\"
				value=\"$a_row[LastName]\"></TD>
		 </TR>
		 <TR><TD>Group:</TD>
		     <TD><input type=\"text\"
				name=\"SubGroup\"
				value=\"$a_row[SubGroup]\"></TD>
			 <input type=\"hidden\"
				name=\"ecf_action\"
				value=\"update\">
			 <input type=\"hidden\"
				name=\"ContactID\"
				value=\"$ContactID\">
			 <input type=\"hidden\"
				name=\"edit\"
				value=\"Person\">
			 <BR>
		 </TR>
		 <TR><TD></TD>
		     <TD><input type=\"submit\"
				name=\"submit\"
				value=\"Submit\">
			 <A HREF=\"edit.php?edit=Delete&database=Person&ContactID=$ContactID\"
			    onClick=\"return confirm('Delete this address?')\">
			 <IMG SRC = \"../images/button_delete.gif\"
			      ALT = \"Delete this entry...\"
			      BORDER = \"0\">
			 </A>
		     </TD>
		 </TR>";
	  print "</TABLE></FORM>";
	  include ('html_footer.inc.php');
	 }
	mysql_close( $link_ecf );
    } elseif ($ecf_action == "insert") {
	include ('dbkey.inc.php');
	$link_ecf_ins = mysql_connect($dbhost,$dbuser,$dbpass)
		or die("Cannot connect to db");
	mysql_select_db( "$dbname", $link_ecf_ins )
		or die("Could not find db for INSERT");
	$result_ecf = mysql_query("INSERT INTO Person
				   (LastName,
				    FirstName,
				    SubGroup)
				   VALUES
				   ('$LastName',
				    '$FirstName',
				    '$SubGroup')");
	 check_result($result_ecf, "list", "");
	mysql_close( $link_ecf_ins );
    } elseif ($ecf_action == "update") {
	include ('dbkey.inc.php');
	$link_ecf = mysql_connect($dbhost,$dbuser,$dbpass)
		or die("Cannot connect to db");
	mysql_select_db($dbname,$link_ecf)
		or die("Could not find db");
	$result_ecf = mysql_query("UPDATE Person
				   SET LastName='$LastName',
				       FirstName='$FirstName',
				       SubGroup='$SubGroup'
				   WHERE ContactID='$ContactID'");
	 check_result($result_ecf, "list");
	mysql_close( $link_ecf );
    } else {
	include ('dbkey.inc.php');
	  include ('html_head.inc.php');
	 print "<FORM ACTION=\"edit.php\"
		       METHOD=\"POST\">
		 <TABLE>";
	 print "<TR><TD>First Name:</TD>
		     <TD><input type=\"text\"
				name=\"FirstName\"
				value=\"$a_row[FirstName]\"></TD>
		 </TR>
		 <TR><TD>Last Name:</TD>
		     <TD><input type=\"text\"
				name=\"LastName\"
				value=\"$a_row[LastName]\"></TD>
		 </TR>
		 <TR><TD>Group:</TD>
		     <TD><input type=\"text\"
				name=\"SubGroup\"
				value=\"$a_row[SubGroup]\">
			 <input type=\"hidden\"
				name=\"ecf_action\"
				value=\"insert\">
			 <input type=\"hidden\"
				name=\"edit\"
				value=\"Person\">
		     </TD>
		 </TR>
		 <TR><TD></TD>
		     <TD><input type=\"submit\"
				name=\"submit\"
				value=\"Submit\">
		     </TD>
		 </TR>";
	  print "</TABLE></FORM>";
	  include ('html_footer.inc.php');
    }
}

# EDIT EMAIL ###########################################################

function edit_email_form($eef_action, $ContactID, $Address, $Location, $Serial) {

    if ($eef_action == "edit") {
	include ('dbkey.inc.php');
	# print "$Serial";
	$link_eef = mysql_connect($dbhost,$dbuser,$dbpass)
		or die("Cannot connect to db");
	mysql_select_db($dbname,$link_eef)
		or die("Could not find db");
	$result_eef = mysql_query("SELECT ContactID,
					  Address,
					  Location
				   FROM Email
				   WHERE Serial = $Serial");
	while ( $a_row = mysql_fetch_array( $result_eef ))
	 {
	  include ('html_head.inc.php');
	  print "<FORM ACTION=\"edit.php\"
		       METHOD=\"POST\">
		 <TABLE>";
	  print "<TR><TD>First Name:</TD>
		     <TD><input type=\"text\"
				name=\"Address\"
				value=\"$a_row[Address]\"></TD>
		 </TR>
		 <TR><TD>Location:</TD>
		     <TD><input type=\"text\"
				name=\"Location\"
				value=\"$a_row[Location]\"></TD>
			 <input type=\"hidden\"
				name=\"eef_action\"
				value=\"update\">
			 <input type=\"hidden\"
				name=\"Serial\"
				value=\"$Serial\">
			 <input type=\"hidden\"
				name=\"edit\"
				value=\"Email\">
			 <input type=\"hidden\"
				name=\"ContactID\"
				value=\"$a_row[ContactID]\">
			 <BR>
		 </TR>
		 <TR><TD></TD>
		     <TD><input type=\"submit\"
				name=\"submit\"
				value=\"Submit\">
			 <A HREF=\"edit.php?edit=Delete&database=Email&Serial=$Serial&ContactID=$a_row[ContactID]\"
			    onClick=\"return confirm('Delete this address?')\">
			 <IMG SRC = \"../images/button_delete.gif\"
			      ALT = \"Delete this entry...\"
			      BORDER = \"0\">
			 </A>
		     </TD>
		 </TR>";
	  print "</TABLE></FORM>";
	  include ('html_footer.inc.php');
	 }
	mysql_close( $link_eef );
    } elseif ($eef_action == "insert") {
	include ('dbkey.inc.php');
	$link_eef_ins = mysql_connect($dbhost,$dbuser,$dbpass)
		or die("Cannot connect to db");
	mysql_select_db( "$dbname", $link_eef_ins )
		or die("Could not find db for INSERT");
	$result_eef = mysql_query("INSERT INTO Email
				   (Address,
				    Location,
				    ContactID)
				   VALUES
				   ('$Address',
				    '$Location',
				    '$ContactID')");
	 check_result($result_eef, "self", $ContactID);
	mysql_close( $link_eef_ins );
    } elseif ($eef_action == "update") {
	include ('dbkey.inc.php');
	$link_eef = mysql_connect($dbhost,$dbuser,$dbpass)
		or die("Cannot connect to db");
	mysql_select_db($dbname,$link_eef)
		or die("Could not find db");
	$result_eef = mysql_query("UPDATE Email
				   SET Address='$Address',
				       Location='$Location'
				   WHERE Serial='$Serial'");
	 check_result($result_eef, "self", $ContactID);
	if ( $result_eef = 1 ) {
		print "Thank You";
	} else {
		print "Oh No!";
	}
	mysql_close( $link_eef );
    } else {
	include ('dbkey.inc.php');
	  include ('html_head.inc.php');
	 print "<FORM ACTION=\"edit.php\"
		       METHOD=\"POST\">
		 <TABLE>";
	 print "<TR><TD>Address:</TD>
		     <TD><input type=\"text\"
				name=\"Address\"
				value=\"$a_row[Address]\"></TD>
		</TR>
		<TR><TD>Location:</TD>
		     <TD><input type=\"text\"
				name=\"Location\"
				value=\"$a_row[Location]\"></TD>
			 <input type=\"hidden\"
				name=\"eef_action\"
				value=\"insert\">
			 <input type=\"hidden\"
				name=\"ContactID\"
				value=\"$ContactID\">
			 <input type=\"hidden\"
				name=\"edit\"
				value=\"Email\">
		     </TD>
		 </TR>
		 <TR><TD></TD>
		     <TD><input type=\"submit\"
				name=\"submit\"
				value=\"Submit\">
		     </TD>
		 </TR>";
	  print "</TABLE></FORM>";
	  include ('html_footer.inc.php');
    }
}

# EDIT PHONE NUMBER ####################################################

function edit_phonenumber_form($epf_action, $ContactID, $intlPrefix, $RegionalCode, $PartOne, $PartTwo, $Location, $Ext, $Serial) {

 # Set the default international
 # And regional code HERE:

	$intlcode = "+1";
	$regionalcode = "418";

    if ($epf_action == "edit") {
	include ('dbkey.inc.php');
	# print "$Serial";
	$link_epf = mysql_connect($dbhost,$dbuser,$dbpass)
		or die("Cannot connect to db");
	mysql_select_db($dbname,$link_epf)
		or die("Could not find db");
	$result_epf = mysql_query("SELECT ContactID,
					  intlPrefix,
					  RegionalCode,
					  PartOne,
					  PartTwo,
					  Ext,
					  Location
				   FROM PhoneNumber
				   WHERE Serial = $Serial");
	while ( $a_row = mysql_fetch_array( $result_epf ))
	 {
	  include ('html_head.inc.php');
	  print "<FORM ACTION=\"edit.php\"
		       METHOD=\"POST\">
		 <TABLE>";
	  print "<TR><TD>Telephone Number:</TD>
		     <TD><input type=\"text\"
				name=\"intlPrefix\"
				value=\"$a_row[intlPrefix]\"
				size=\"2\"
				maxlength=\"2\">
		         <input type=\"text\"
				name=\"RegionalCode\"
				value=\"$a_row[RegionalCode]\"
				size=\"3\"
				maxlength=\"3\">
		         <input type=\"text\"
				name=\"PartOne\"
				value=\"$a_row[PartOne]\"
				size=\"3\"
				maxlength=\"3\">
		         <input type=\"text\"
				name=\"PartTwo\"
				value=\"$a_row[PartTwo]\"
				size=\"4\"
				maxlength=\"4\">
			 Ext:
		         <input type=\"text\"
				name=\"Ext\"
				value=\"$a_row[Ext]\"
				size=\"5\"
				maxlength=\"5\">
			 <input type=\"hidden\"
				name=\"epf_action\"
				value=\"update\">
			 <input type=\"hidden\"
				name=\"Serial\"
				value=\"$Serial\">
			 <input type=\"hidden\"
				name=\"ContactID\"
				value=\"$a_row[ContactID]\">
			 <input type=\"hidden\"
				name=\"edit\"
				value=\"PhoneNumber\">
		     </TD>
		 </TR>
		 <TR><TD>Location:</TD>
		     <TD><input type=\"text\"
				name=\"Location\"
				value=\"$a_row[Location]\">
		     </TD>
		 </TR>
		 <TR><TD></TD>
		     <TD><input type=\"submit\"
				name=\"submit\"
				value=\"Submit\">
			 <A HREF=\"edit.php?edit=Delete&database=PhoneNumber&Serial=$Serial&ContactID=$a_row[ContactID]\"
			    onClick=\"return confirm('Delete this address?')\">
			 <IMG SRC = \"../images/button_delete.gif\"
			      ALT = \"Delete this entry...\"
			      BORDER = \"0\">
			 </A>
		     </TD>
		 </TR>";
	  print "</TABLE></FORM>";
	  include ('html_footer.inc.php');
	 }
	mysql_close( $link_epf );
    } elseif ($epf_action == "insert") {
	include ('dbkey.inc.php');
	$link_epf_ins = mysql_connect($dbhost,$dbuser,$dbpass)
		or die("Cannot connect to db");
	mysql_select_db( "$dbname", $link_epf_ins )
		or die("Could not find db for INSERT");
	$result_epf = mysql_query("INSERT INTO PhoneNumber
				   (ContactID,
				    intlPrefix,
				    RegionalCode,
				    PartOne,
				    PartTwo,
				    Ext,
				    Location)
				   VALUES
				   ('$ContactID',
				    '$intlPrefix',
				    '$RegionalCode',
				    '$PartOne',
				    '$PartTwo',
				    '$Ext',
				    '$Location')");
	 check_result($result_epf, "self", $ContactID);
	mysql_close( $link_epf_ins );
    } elseif ($epf_action == "update") {
	include ('dbkey.inc.php');
	$link_epf = mysql_connect($dbhost,$dbuser,$dbpass)
		or die("Cannot connect to db");
	mysql_select_db($dbname,$link_epf)
		or die("Could not find db");
	$result_epf = mysql_query("UPDATE PhoneNumber
				   SET intlPrefix='$intlPrefix',
				       RegionalCode='$RegionalCode',
				       PartOne='$PartOne',
				       PartTwo='$PartTwo',
				       Ext='$Ext',
				       Location='$Location'
				   WHERE Serial='$Serial'");
	 check_result($result_epf, "self", $ContactID);
	mysql_close( $link_epf );
    } else {
	include ('dbkey.inc.php');
	  include ('html_head.inc.php');
	 print "<FORM ACTION=\"edit.php\"
		       METHOD=\"POST\">
		 <TABLE>";
	 print "<TR><TD>Telephone Number:</TD>
		     <TD><input type=\"text\"
				name=\"intlPrefix\"
				value=\"$intlcode\"
				size=\"2\"
				maxlength=\"2\">
		         <input type=\"text\"
				name=\"RegionalCode\"
				value=\"$regionalcode\"
				size=\"3\"
				maxlength=\"3\">
		         <input type=\"text\"
				name=\"PartOne\"
				value=\"$a_row[PartOne]\"
				size=\"3\"
				maxlength=\"3\">
		         <input type=\"text\"
				name=\"PartTwo\"
				value=\"$a_row[PartTwo]\"
				size=\"4\"
				maxlength=\"4\">
			 Ext:
		         <input type=\"text\"
				name=\"Ext\"
				value=\"$a_row[Ext]\"
				size=\"5\"
				maxlength=\"5\">
			 <input type=\"hidden\"
				name=\"epf_action\"
				value=\"insert\">
			 <input type=\"hidden\"
				name=\"ContactID\"
				value=\"$ContactID\">
			 <input type=\"hidden\"
				name=\"Serial\"
				value=\"$Serial\">
			 <input type=\"hidden\"
				name=\"edit\"
				value=\"PhoneNumber\">
		     </TD>
		 </TR>
		 <TR><TD>Location:</TD>
		     <TD><input type=\"text\"
				name=\"Location\"
				value=\"$a_row[Location]\">
		     </TD>
		 </TR>
		 <TR><TD></TD>
		     <TD><input type=\"submit\"
				name=\"submit\"
				value=\"Submit\">
		     </TD>
		 </TR>";
	  print "</TABLE></FORM>";
	  include ('html_footer.inc.php');
    }
}

# EDIT STREET ADDRESS ##################################################

function edit_address_form($eaf_action, $ContactID, $Location, $Street, $City, $State, $Country, $PostalCode, $Serial) {

    if ($eaf_action == "edit") {
	include ('dbkey.inc.php');
	# print "$Serial";
	$link_eaf = mysql_connect($dbhost,$dbuser,$dbpass)
		or die("Cannot connect to db");
	mysql_select_db($dbname,$link_eaf)
		or die("Could not find db");
	$result_eaf = mysql_query("SELECT ContactID,
					  Location,
					  Street,
					  City,
					  State,
					  Country,
					  PostalCode
				   FROM Address
				   WHERE Serial = $Serial");
	while ( $a_row = mysql_fetch_array( $result_eaf ))
	 {
	  include ('html_head.inc.php');
	  print "<FORM ACTION=\"edit.php\"
		       METHOD=\"POST\">
		 <TABLE>";
	  print "<TR><TD>Street:</TD>
		     <TD><input type=\"text\"
				name=\"Street\"
				value=\"$a_row[Street]\">
		     </TD>
		 </TR>
		 <TR><TD>City:</TD>
		     <TD><input type=\"text\"
				name=\"City\"
				value=\"$a_row[City]\">
		     </TD>
		 </TR>
		 <TR><TD>State:</TD>
		     <TD><input type=\"text\"
				name=\"State\"
				value=\"$a_row[State]\">
		     </TD>
		 </TR>
		 <TR><TD>Country:</TD>
		     <TD><input type=\"text\"
				name=\"Country\"
				value=\"$a_row[Country]\">
		     </TD>
		 </TR>
		 <TR><TD>PostalCode:</TD>
		     <TD><input type=\"text\"
				name=\"PostalCode\"
				value=\"$a_row[PostalCode]\">
		     </TD>
		 </TR>
		 <TR><TD>Location:</TD>
		     <TD><input type=\"text\"
				name=\"Location\"
				value=\"$a_row[Location]\">
		     </TD>
		 </TR>
		 <TR><TD></TD>
		     <TD><input type=\"hidden\"
				name=\"eaf_action\"
				value=\"update\">
			 <input type=\"hidden\"
				name=\"Serial\"
				value=\"$Serial\">
			 <input type=\"hidden\"
				name=\"ContactID\"
				value=\"$a_row[ContactID]\">
			 <input type=\"hidden\"
				name=\"edit\"
				value=\"Address\">
			 <input type=\"submit\"
				name=\"submit\"
				value=\"Submit\">
			 <A HREF=\"edit.php?edit=Delete&database=Address&Serial=$Serial&ContactID=$a_row[ContactID]\"
			    onClick=\"return confirm('Delete this address?')\">
			 <IMG SRC = \"../images/button_delete.gif\"
			      ALT = \"Delete this entry...\"
			      BORDER = \"0\">
			 </A>
		     </TD>
		 </TR>";
	  print "</TABLE></FORM>";
	  include ('html_footer.inc.php');
	 }
	mysql_close( $link_eaf );
    } elseif ($eaf_action == "insert") {
	include ('dbkey.inc.php');
	  include ('html_head.inc.php');
	$link_eaf_ins = mysql_connect($dbhost,$dbuser,$dbpass)
		or die("Cannot connect to db");
	mysql_select_db( "$dbname", $link_eaf_ins )
		or die("Could not find db for INSERT");
	$result_eaf = mysql_query("INSERT INTO Address
				   (ContactID,
				    Street,
				    City,
				    State,
				    Country,
				    PostalCode,
				    Location)
				   VALUES
				   ('$ContactID',
				    '$Street',
				    '$City',
				    '$State',
				    '$Country',
				    '$PostalCode',
				    '$Location')");
	 check_result($result_eaf, "self", $ContactID);
	mysql_close( $link_eaf_ins );
    } elseif ($eaf_action == "update") {
	include ('dbkey.inc.php');
	$link_eaf = mysql_connect($dbhost,$dbuser,$dbpass)
		or die("Cannot connect to db");
	mysql_select_db($dbname,$link_eaf)
		or die("Could not find db");
	$result_eaf = mysql_query("UPDATE Address
				   SET Street='$Street',
				       City='$City',
				       State='$State',
				       Country='$Country',
				       PostalCode='$PostalCode',
				       Location='$Location'
				   WHERE Serial='$Serial'");
	 check_result($result_eaf, "self", $ContactID);
	mysql_close( $link_eaf );
    } else {
	include ('dbkey.inc.php');
	 print "<FORM ACTION=\"edit.php\"
		       METHOD=\"POST\">
		 <TABLE>";
	  print "<TR><TD>Street:</TD>
		     <TD><input type=\"text\"
				name=\"Street\"
				value=\"$a_row[Street]\">
		     </TD>
		 </TR>
		 <TR><TD>City:</TD>
		     <TD><input type=\"text\"
				name=\"City\"
				value=\"$a_row[City]\">
		     </TD>
		 </TR>
		 <TR><TD>State:</TD>
		     <TD><input type=\"text\"
				name=\"State\"
				value=\"$a_row[State]\">
		     </TD>
		 </TR>
		 <TR><TD>Country:</TD>
		     <TD><input type=\"text\"
				name=\"Country\"
				value=\"$a_row[Country]\">
		     </TD>
		 </TR>
		 <TR><TD>PostalCode:</TD>
		     <TD><input type=\"text\"
				name=\"PostalCode\"
				value=\"$a_row[PostalCode]\">
		     </TD>
		 </TR>
		 <TR><TD>Location:</TD>
		     <TD><input type=\"text\"
				name=\"Location\"
				value=\"$a_row[Location]\">
		     </TD>
		 </TR>
		 <TR><TD></TD>
		     <TD><input type=\"hidden\"
				name=\"eaf_action\"
				value=\"insert\">
			 <input type=\"hidden\"
				name=\"Serial\"
				value=\"$Serial\">
			 <input type=\"hidden\"
				name=\"ContactID\"
				value=\"$ContactID\">
			 <input type=\"hidden\"
				name=\"edit\"
				value=\"Address\">
			 <input type=\"submit\"
				name=\"submit\"
				value=\"Submit\">
		     </TD>
		 </TR>";
	  print "</TABLE></FORM>";
	  include ('html_footer.inc.php');
    }
}

# DELETE ENTRY #########################################################

function edit_delete_contact($database, $Serial, $ContactID) {

	include ('dbkey.inc.php');
$link_delete = mysql_connect($dbhost, $dbuser, $dbpass)
	or die("Could not connect to the Database");
 mysql_select_db($dbname, $link_delete)
	or die("Could nor select the databse");
if ($database == "Person") {
$result_delete = mysql_query("DELETE FROM $database
				     WHERE ContactID=$ContactID");
 $reload = "list";
} else {
$result_delete = mysql_query("DELETE FROM $database
				     WHERE Serial=$Serial
				     AND ContactID=$ContactID");
 $reload = "self";
}
 check_result($result_delete, $reload, $ContactID);
}

# CHECK RESULT #########################################################

function check_result($result, $reload, $ContactID) {

	if ($result != 1) {
		print "<HTML><BODY>
			There seem to be a problem with your sumission
		       </BODY></HTML>";
	} else {
		if ($reload == "list") {
		    reload_list();
		} elseif ($reload == "self") {
		    reload_self($ContactID);
		} else {
		    print "Select self or list function";
		}
	}
}

# RELOAD LIST ##########################################################

function reload_list() {

	print "<HTML>";
       include ('html_subhead.inc.php');
	print "<BODY onLoad=\"parent.frames[1].location.href = 'list.php'; return true;\">
		<TABLE WIDTH = \"100%\" HEIGHT = \"100%\"
                       BORDER = \"0\"
		       CELLSPACING = \"0\" CELLPADDING = \"0\">
		<TR><TD ALIGN = \"CENTER\">
			<TABLE WIDTH = \"240\" BORDER = \"1\"
			       CELLSPACING = \"0\" CELLPADDING = \"0\">
			<TR><TD ALIGN=\"CENTER\"><h3>Operation successful</h3></TD>
			    <TD><IMG SRC = \"../images/logo_medium.gif\"
				     ALT = \"A2Z!\"></TD></TR>
			</TABLE>
		</TD></TR></TABLE>
		</BODY>
	       </HTML>";
}

# RELOAD SELF ##########################################################

function reload_self($ContactID) {

	print "<HTML><HEAD>
		<META HTTP-EQUIV=\"refresh\"
		      CONTENT=\"0;URL=display.php?ContactID=$ContactID\">
		</HEAD>
	       </HTML>";
}


?>
Return current item: A2z - Web-based address book