$query = prepare("SELECT * \n FROM clientContact\n WHERE clientContact.clientID = %d AND clientContact.primaryContact = true", $clientID); $db->query($query); $cc = new clientContact(); $cc->read_db_record($db); $one = $client->format_address("postal"); $two = $client->format_address("street"); $thr = $cc->format_contact(); $fou = $project->format_client_old(); $temp = str_replace("<br>", "", $fou); $temp and $thr = $fou; $url = $TPL["url_alloc_client"] . "clientID=" . $clientID; if ($project->get_value("clientContactID")) { $cc = new clientContact(); $cc->set_id($project->get_value("clientContactID")); $cc->select(); $fiv = $cc->format_contact(); $temp = str_replace("<br>", "", $fiv); $temp and $thr = $fiv; } $TPL["clientDetails"] = "<table width=\"100%\">"; $TPL["clientDetails"] .= "<tr>"; $TPL["clientDetails"] .= "<td colspan=\"3\"><h2 style=\"margin-bottom:0px; display:inline;\"><a href=" . $url . ">" . $TPL["client_clientName"] . "</a></h2></td> "; $TPL["clientDetails"] .= "</tr>"; $TPL["clientDetails"] .= "<tr>"; $one and $TPL["clientDetails"] .= "<td class=\"nobr\"><u>Postal Address</u></td>"; $two and $TPL["clientDetails"] .= "<td class=\"nobr\"><u>Street Address</u></td>"; $thr and $TPL["clientDetails"] .= "<td><u>Contact</u></td>"; $TPL["clientDetails"] .= "</tr>"; $TPL["clientDetails"] .= "<tr>"; $one and $TPL["clientDetails"] .= "<td valign=\"top\">" . $one . "</td>"; $two and $TPL["clientDetails"] .= "<td valign=\"top\">" . $two . "</td>";