Voicemail messages show the table header and links when there is no voicemails.

This commit is contained in:
Mark Crane 2013-01-02 19:31:49 +00:00
parent cad3b941af
commit 590a92c99a
2 changed files with 15 additions and 3 deletions

View File

@ -103,7 +103,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$sql .= "domain_uuid, ";
$sql .= "voicemail_message_uuid, ";
$sql .= "voicemail_uuid, ";
$sql .= "voicemail_uuid, ";
$sql .= "created_epoch, ";
$sql .= "read_epoch, ";
$sql .= "caller_id_name, ";
@ -117,7 +116,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$sql .= "'$domain_uuid', ";
$sql .= "'".uuid()."', ";
$sql .= "'$voicemail_uuid', ";
$sql .= "'$voicemail_uuid', ";
$sql .= "'$created_epoch', ";
$sql .= "'$read_epoch', ";
$sql .= "'$caller_id_name', ";

View File

@ -51,6 +51,7 @@ else {
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
foreach ($result as &$row) {
$voicemail_id = $row["voicemail_id"];
$voicemail_uuid = $row["voicemail_uuid"];
}
unset ($prep_statement);
}
@ -123,7 +124,20 @@ else {
$result_count = count($result);
//loop throug the voicemail messages
if ($result_count > 0) {
if ($result_count == 0) {
echo "<tr><td colspan='5' align='left'>\n";
echo " <br /><br />\n";
echo " <b>".$text['label-mailbox'].": ".$voicemail_id."</b>&nbsp;\n";
echo " \n";
echo "</td>\n";
echo "<td valign='bottom' align='right'>\n";
echo " <input type='button' class='btn' name='' alt='greetings' onclick=\"window.location='".PROJECT_PATH."/app/voicemail_greetings/voicemail_greetings.php?id=".$voicemail_id."'\" value='".$text['button-greetings']."'>\n";
echo " <input type='button' class='btn' name='' alt='settings' onclick=\"window.location='".PROJECT_PATH."/app/voicemails/voicemail_edit.php?id=".$voicemail_uuid."'\" value='".$text['button-settings']."'>\n";
echo "</td>\n";
echo "</tr>\n";
echo $table_header;
}
else {
$previous_voicemail_id = '';
foreach($result as $row) {
if ($previous_voicemail_id != $row['voicemail_id']) {