Location: PHPKode > projects > Mozart > Mozart-0.0.4/addcontact.php
<?
// called from: contact.php; index.php3
// description: inserts a new CONTACT and ADDRESS
//
include("connect.inc");
include("reqlogin.inc");
include("userprefs.inc");
include("getallusers.inc");
?>
<html>
<title>Mozart: Update Contact</title>
<body bgcolor=<? echo $bgcolor ?> text=<? txtcolor ?>>
<?
include("links.inc");

$ContactTypeSQL = "SELECT type_id, type_name FROM types WHERE type_source = 'Contact' ORDER BY type_name";
$AddressTypeSQL = "SELECT type_id, type_name FROM types WHERE type_source = 'Address' ORDER BY type_name";
$PhoneTypeSQL = "SELECT type_id, type_name FROM types WHERE type_source = 'Phone' ORDER BY type_name";

$ContactType = mysql_query($ContactTypeSQL);
$AddressType01 = mysql_query($AddressTypeSQL);
$AddressType02 = mysql_query($AddressTypeSQL);
$PhoneType01 = mysql_query($PhoneTypeSQL);
$PhoneType02 = mysql_query($PhoneTypeSQL);
?>
<form action="inscontact.php" method="post">
Add Contact for: <select name="ForUser">
<?
while ($ownerdata = mysql_fetch_array($OwnerData)) {
   if ($ownerdata["system_id"] == $SysID) {
	$selected = " selected";
   }
   else {
	$selected = "";
   }
   printf("<option value=%s %s>%s", $ownerdata["user_id"], $selected, $ownerdata["system_id"]);
}
?>
</select>
<br>
<select name="Sal">
<option>Mr.
<option>Mrs.
<option>Ms.
</select>
First:<input type="text" name="FirstName">
Middle:<input type="text" name="MiddleName">
Last:<input type="text" name="LastName">
<br>
DOB:<input type="text" name="BirthDate">
Email:<input type="text" name="Email">
URL:<input type="text" name="URL">
Type:<select name="CNTType">
<?
while ($myrow = mysql_fetch_array($ContactType)) {
   printf("<option value=%s>%s", $myrow["type_id"], $myrow["type_name"]);
}
?>
</select>
<br>
<table border=1 cellspacing=0 cellpadding=5>
<tr>
<td></td>
<td>
Address Type:<select name="AddrType01">
<option>None
<?
while ($myrow = mysql_fetch_array($AddressType01)) {
   printf("<option value=%s>%s", $myrow["type_id"], $myrow["type_name"]);
}
?>
</select>
</td>
<td>
Address Type:<select name="AddrType02">
<option>None
<?
while ($myrow = mysql_fetch_array($AddressType02)) {
   printf("<option value=%s>%s", $myrow["type_id"], $myrow["type_name"]);
}
?>
</select>
</td>
<td></td>
<td>Other Phone:<select name="Phone03">
<option>None
<?
while ($myrow = mysql_fetch_array($PhoneType01)) {
   printf("<option value=%s>%s", $myrow["type_id"], $myrow["type_name"]);
}
?>
</select>
</td>
<td>Other Phone:<select name="Phone04">
<option>None
<?
while ($myrow = mysql_fetch_array($PhoneType02)) {
   printf("<option value=%s>%s", $myrow["type_id"], $myrow["type_name"]);
}
?>
</select>
</td>
<tr>
<td>Street:</td><td><input type="text" name="Street01"></td>
<td><input type="text" name="Street02"></td>
<td>Number:</td><td><input type="text" name="PhoneNo03"></td>
<td><input type="text" name="PhoneNo04"></td>
<tr>
<td>Suite:</td><td><input type="text" name="Street01A"></td>
<td><input type="text" name="Street02A"></td>
<tr>
<td>City:</td><td><input type="text" name="City01"></td>
<td><input type="text" name="City02"></td>
<tr>
<td>State:</td><td><input type="text" name="State01"></td>
<td><input type="text" name="State02"></td>
<tr>
<td>Zip:</td><td><input type="text" name="Zip01"></td>
<td><input type="text" name="Zip02"></td>
<tr>
<td>Phone:</td><td><input type="text" name="Phone01"></td>
<td><input type="text" name="Phone02"></td>
</tr>
</table>
Notes:<br>
<textarea cols=50 rows=10 wrap="hard" name=Information></textarea>
<br>
<input type="submit" value="Add">
<input type="reset" value="Clear">
<input type="hidden" name=$SysID value=<? echo $SysID ?>>
</form>
<?
include("links.inc");
?>
</body>
</html>
Return current item: Mozart