Database class integration.

This commit is contained in:
Nate
2019-07-27 09:03:55 -06:00
parent 6ee98f351d
commit 8bb000e32b
7 changed files with 230 additions and 318 deletions
+11 -12
View File
@@ -48,15 +48,14 @@
//get the contact list
$sql = "select * from v_contact_notes ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
$sql .= "and contact_uuid = '$contact_uuid' ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and contact_uuid = :contact_uuid ";
$sql .= "order by last_mod_date desc ";
$prep_statement = $db->prepare(check_sql($sql));
if ($prep_statement) {
$prep_statement->execute();
$contact_notes = $prep_statement->fetchAll(PDO::FETCH_NAMED);
unset ($prep_statement, $sql);
}
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['contact_uuid'] = $contact_uuid;
$database = new database;
$contact_notes = $database->select($sql, $parameters, 'all');
unset($sql, $parameters);
//set the row style array
$c = 0;
@@ -79,7 +78,7 @@
echo "<div id='contact_notes' style='width: 100%; overflow: auto; direction: rtl; text-align: right; margin-bottom: 23px;'>";
echo "<table class='tr_hover' style='width: 100%; direction: ltr; padding-left: 1px' border='0' cellpadding='0' cellspacing='0'>\n";
if (is_array($contact_notes)) {
if (is_array($contact_notes) && @sizeof($contact_notes) != 0) {
foreach($contact_notes as $row) {
$contact_note = $row['contact_note'];
$contact_note = escape($contact_note);
@@ -102,9 +101,9 @@
echo " </td>\n";
echo "</tr>\n";
$c = ($c) ? 0 : 1;
} //end foreach
unset($sql, $contact_notes);
} //end if results
}
}
unset($contact_notes, $row);
echo "</table>";
echo "</div>\n";