The code for the drop down box:
- Code: Select all
$sql_interred_cert = "SELECT $interred.ID AS InterredID,
PlotID, $interred.FirstName, $interred.LastName, $interred.ServiceDate,
SectionNumber, LotNumber, LotLocation
FROM $interred
LEFT JOIN $plots ON $plots.ID = $interred.PlotID
WHERE $interred.ID=last_insert_id($interred.ID) ORDER BY last_insert_id($interred.ID) DESC ";
/************* Display Result from Query**********/
/*************************************************/
$result_interred_cert = mysql_query($sql_interred_cert,$connection) or die(mysql_errno() . ": " . mysql_error());
while ($row = mysql_fetch_array($result_interred_cert)) {
$ID = $row['InterredID'];
$PlotID = $row['PlotID'];
$FirstName = $row['FirstName'];
$LastName = $row['LastName'];
$ServiceDate = $row['ServiceDate'];
$SectionNumber = $row['SectionNumber'];
$LotNumber = $row['LotNumber'];
$LotLocation = $row['LotLocation'];
$option_block .= "<option value='$ID'> $ServiceDate, $LastName, $FirstName, $SectionNumber $LotNumber $LotLocation</option>";
}
/* Check results of $result array
echo print_r($result_interred_cert);
*/
$display_block = "
<FORM METHOD='post' ACTION='intercert.php'>
<select class='blue' name='ID'>
$option_block
</select><br>
<strong><span class='black'>(Service Date, Last Name, First Name, Section Lot Space)</span></strong>
<br>
<INPUT class='input' TYPE='SUBMIT' NAME='submit' VALUE='Select This Interred Person'></P>
</form>
";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>Print Interment Certificate</title>
<link href="cemetery.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="600" height="150" border="1" align="center" cellpadding="0" cellspacing="0" bgcolor="#edecfe">
<tr>
<td width="587" height="136" align="center">
<h2 align="center"><strong>Choose Interred Person to Print Certificate</strong></h2>
<h4 align="center">Select Interred Person to print certificate from the
list below.</h4>
<h4 align="center"><?php echo "$display_block"; ?> </h4>
........blah blah
The code for putting the data into the page:
- Code: Select all
$ID= $_POST['ID'];
$thePlotID= $_POST['thePlotID'];
if (!$ID) {
header("Location: the_page_from_the_code_above.php");
exit;
}
.....Connection Made here...
$db = @mysql_select_db($db_name, $connection) or die("Could not select database.");
$uf= new UserFriendlyToolKit($connection);
$sql_interred_cert = "SELECT $interred.ID AS InterredID, PlotID, $interred.FirstName, $interred.LastName, ServiceDate, DOB, DOD, SectionNumber, LotNumber, LotLocation, $fundir.StreetAddress
FROM $interred
LEFT JOIN $plots ON $plots.ID = $interred.PlotID
LEFT JOIN $fundir ON $interred.FunDirID=$fundir.ID
WHERE $plots.ID = $interred.PlotID ORDER BY LastName, FirstName";
//echo $sql_interred_cert."<BR><BR>\n";
$result_interred_cert = mysql_query($sql_interred_cert,$connection) or die(mysql_errno() . ": " . mysql_error());
while ($row = mysql_fetch_array($result_interred_cert)) {
$ID = $row['InterredID'];
$PlotID = $row['PlotID'];
$FirstName = $row['FirstName'];
$LastName = $row['LastName'];
$ServiceDate = $row['ServiceDate'];
$DOB = $row['DOB'];
$DOD = $row['DOD'];
$FunDirID = $row['FunDirID'];
$StreetAddress = $row['StreetAddress'];
$SectionNumber = $row['SectionNumber'];
$LotNumber = $row['LotNumber'];
$LotLocation = $row['LotLocation'];
}
//echo $result_interred_cert."<br><br>\n";
if(is_array($result_interred_cert)) {
print_r($result_interred_cert);
}else{
echo $result_interred_cert . " Is Not A Valid Array";
}
mysql_free_result($result_interred_cert);
$sql_name= "SELECT * FROM $own WHERE OwnerID = '$OwnerID' ";
$owner = @mysql_query($sql_name,$connection) or die(mysql_errno() . ": " . mysql_error());
while ($the_owner = mysql_fetch_array($owner)) {
$ownID = $row['ID']; // not the same thing as OwnerID
if($ownID > 0) // Exclude "No Owner"
{
$LastName = $the_owner['LastName'];
$FirstName = $the_owner['FirstName'];
}
}
//echo $sql_name."<br><br>\n";
?>
.....HTML CODE Follows and there are echo statements to show the results.....
I hope someone can help me.



