Location: PHPKode > projects > NCD Toolkit > ncdtoolkit1.2/ncd/add_private_step_1.inc.php
	if ($c > 0 && $persons != "n")
		echo "<p>Using this wizard, you will add a new private collector plus one or more private collections. Please first verify that the collector has not been entered yet. If the person is listed below please select his or her name to continue. ";
			if ($d > 0)
				echo "You are not allowed to add collections to one or more persons because you don't have the appropriate permissions. Please contact the NCD toolkit administrator if the private collector you need to add a collection to is listed below. ";
		echo "<br><br></p>\n<p>";
		echo $private_collectors;
		echo "<p><br>Else create a new private collector using the form below. Please first check the popup menu if the person has already been entered into the NCD toolkit. If not, enter the data in the text fields.<br><br></p>\n";
		echo "<p>The first step is to enter the details of the person owning the private collection. Please first check the popup menu if the person has already been entered into the NCD toolkit. If not, enter the data in the text fields.<br><br></p>\n";

	$persons_in_popup = 0;
	if ($personid == "")
		$person_popup = "<select name=\"personid\"><option value=\"\">Select a name...</option>";
		$person_popup = "<select name=\"personid\"><option value=\"\">Do not select a name</option>";

	$query = "SELECT Title, Prefix, GivenNames, OtherNames, FamilyName, Suffix, ID, CreatorID FROM Persons ORDER BY FamilyName, OtherNames, GivenNames";
	$result = mysql_query($query);
	while($row = mysql_fetch_array($result))
		$popup_personid = $row["ID"];
		$popup_creatorid = $row["CreatorID"];
		$popup_fullname = fullname($row[0], $row[1], $row[2], $row[3], $row[4], $row[5]);	

		if (!in_array($popup_personid, $private_collector_ids) && in_array($popup_creatorid, $permission_group))
			if ($popup_personid == $personid)
				$selected = " selected";			
			$person_popup .= "<option value=\"$popup_personid\" $selected>$popup_fullname</option>\n";
			$selected = "";
	$person_popup .= "</select>";

	if ($personid != "")
		$title = $prefix = $givenname = $additionalnames = $familyname = $suffix = "";

	echo "<form method=\"post\" action=\"add_private_collection.php\"><table>";
	if ($persons_in_popup > 0)
		echo "<tr><td align=\"right\" width=\"150\">&nbsp;</td><td height=\"30\" valign=\"top\" class=\"title\">Select an existing person...</td></tr>\n";
		echo "<tr><td align=\"right\"></td><td>$person_popup".help("SelectPerson")."</td>";
		echo "<tr><td align=\"right\"></td><td height=\"20\">";
		$label = "... or add a new person (only if not present in the list above!)";
		$label = "Add a new person";
	echo "<tr><td align=\"right\">&nbsp;</td><td height=\"30\" valign=\"top\" class=\"title\">$label</td></tr>\n";
	echo "<tr><td class=\"label\"><b>Title</b></td><td><input type=\"text\" name=\"title\" value=\"$title\" size=\"50\"></td></tr>\n";
	echo "<tr><td class=\"label\"><b>Prefix</b></td><td><input type=\"text\" name=\"prefix\" value=\"$prefix\" size=\"50\"></td></tr>\n";
	echo "<tr><td class=\"label\"><b>Given names</b></td><td>";

	if ($step == 2 && $personid == "" && $givenname == "")
		$extra1 = "class=\"missing\"";
	echo "<input type=\"text\" name=\"givenname\" size=\"50\" value=\"$givenname\" $extra1><span class=\"asteriks\">*</span></td></tr>\n";
	echo "<tr><td class=\"label\"><b>Other names</b></td><td><input type=\"text\" name=\"additionalnames\" value=\"$additionalnames\" size=\"50\"></td></tr>\n";
	echo "<tr><td class=\"label\"><b>Family name</b></td><td>";

	if ($step == 2 && $personid == "" && $familyname == "")
		$extra2 = "class=\"missing\"";
	echo "<input type=\"text\" name=\"familyname\" size=\"50\" value=\"$familyname\" $extra2><span class=\"asteriks\">*</span></td></tr>\n";
	if ($additionalnames != "" && $personid != "")
		$additionalnames = "";
	echo "<tr><td class=\"label\"><b>Suffix</b></td><td><input type=\"text\" name=\"suffix\" value=\"$suffix\" size=\"50\"></td></tr>\n";

	echo "<tr><td></td><td height=\"40\" class=\"title\">Address</td></tr>\n";
	if ($step == 2 && $personstreet == "" && $personpostbox == "")
		$extra5 = "class=\"missing\"";
	echo "<tr><td class=\"label\"><b>Street</b></td><td><input type=\"text\" name=\"personstreet\" value=\"$personstreet\" size=\"50\" $extra5><span class=\"asteriks\">*</span></td></tr>\n";
	echo "<tr><td class=\"label\"><b>Address extension</b></td><td><input type=\"text\" name=\"personaddressext\" value=\"$personaddressext\" size=\"50\"></td></tr>\n";

	if ($step == 2 && $personzip == "")
		$extra6 = "class=\"missing\"";
	echo "<tr><td class=\"label\"><b>Postal code</b></td><td><input type=\"text\" name=\"personzip\" value=\"$personzip\" size=\"50\" $extra6><span class=\"asteriks\">*</span></td></tr>\n";

	if ($step == 2 && $persontown == "")
		$extra7 = "class=\"missing\"";
	echo "<tr><td class=\"label\"><b>City</b></td><td><input type=\"text\" name=\"persontown\" value=\"$persontown\" size=\"50\" $extra7><span class=\"asteriks\">*</span></td></tr>\n";
	echo "<tr><td class=\"label\"><b>State/region</b></td><td><input type=\"text\" name=\"personregion\" value=\"$personregion\" size=\"50\"></td></tr>\n";

	if ($step == 2 && $country_id == "")
		$extra8 = "<span class=\"error\">Required field!</span>";
	echo "<tr><td class=\"label\"><b>Country</b></td><td>$country_popup $extra8<span class=\"asteriks\">*</span></td></tr>\n";

	echo "<tr><td></td><td height=\"40\" class=\"title\">Contact details</td></tr>\n";
	echo "<tr><td class=\"label\"><b>Telephone</b></td><td><input type=\"text\" name=\"persontelephone\" value=\"$persontelephone\" size=\"50\"></td></tr>\n";
	echo "<tr><td class=\"label\"><b>Fax</b></td><td><input type=\"text\" name=\"personfax\" value=\"$personfax\" size=\"50\"></td></tr>\n";

	if ($step == 2 && $personemail == "")
		$extra8 = "class=\"missing\"";
	echo "<tr><td class=\"label\"><b>Email</b></td><td><input type=\"text\" name=\"personemail\" value=\"$personemail\" size=\"50\" $extra8><span class=\"asteriks\">*</span></td></tr>\n";
	echo "<tr><td class=\"label\">Web site</td><td><input type=\"text\" name=\"personwebsiteurl\" value=\"$personwebsiteurl\" size=\"50\">";

	if ($personwebsiteurl != "" && $personwebsiteurl != "http://")
		echo " <a href=\"$personwebsiteurl\" target=\"_blank\">Show website</a>";

	echo "</td></tr>\n";
	echo "<tr><td align=\"right\"></td><td height=\"50\" class=\"bottom\">";
	echo "<input name=\"step\" type=\"hidden\" value=\"2\">";
	echo "<input name=\"persons\" type=\"hidden\" value=\"n\">";
	echo "<input type=\"submit\" value=\"Submit\">";
	echo "</td></tr>\n</table>\n</form>";
Return current item: NCD Toolkit