function ckEligible($last_name,$first_name,$maiden_name,$social_3,$liheap_type,$datetime){
// Set connection
GLOBAL $connection;
GLOBAL $output;
$count=0;
$output= "<table>";
// Verify Eligibility Against NEW Liheap Table
$query="SELECT * FROM prodcen_liheap WHERE last_name=\"{$last_name}\" AND social_3=\"{$social_3}\" AND liheap_type=\"{$liheap_type}\" AND datetime>\"{$datetime}\"";
$results=mysql_query($query,$connection);
while($row=mysql_fetch_array($results)){
$count++;
$output.= "<tr><td width=\"150\">";
$output.= $count.". ";
$output.= $row['last_name'];
$output.= ", ";
$output.= $row['first_name'];
$output.= "</td><td width=\"185\">";
$output.= $row['liheap_type']." assistance";
$output.= "</td><td width=\"150\">";
$output.= $row['datetime'];
$output.= "</td></tr>";
}
// Verify Eligiblity Againt OLD Liheap Table
if($count==0){
$query="SELECT * FROM prodcen_verify WHERE ";
if(!empty($last_name)){ $query.="last_name=\"".$last_name."\" AND "; }
if(!empty($first_name)){ $query.="first_name=\"".$first_name."\" AND "; }
if(!empty($maiden_name)){ $query.="maiden_name=\"".$maiden_name."\" AND "; }
$query.="liheap_type=\"{$liheap_type}\" AND datetime>\"{$datetime}\"";
$results=mysql_query($query,$connection);
while($row=mysql_fetch_array($results)){
$count++;
$output.= "<tr><td width=\"150\">";
$output.= $count.". ";
$output.= $row['last_name'];
$output.= ", ";
$output.= $row['first_name'];
$output.= "</td><td width=\"185\">";
$output.= $row['liheap_type']." assistance";
$output.= "</td><td width=\"150\">";
$output.= $row['datetime'];
$output.= "</td></tr>";
}
}
//Close Table & Return Counted Rows.
$output.= "</table>";
return $count;
}
|