\n";
+
+ //set the table header
+ $table_header = "\n";
+ $table_header .= th_order_by('created_epoch', $text['label-created_epoch'], $order_by, $order);
+ $table_header .= th_order_by('caller_id_name', $text['label-caller_id_name'], $order_by, $order);
+ $table_header .= th_order_by('caller_id_number', $text['label-caller_id_number'], $order_by, $order);
+ $table_header .= "| ".$text['label-tools']." | \n";
+ $table_header .= th_order_by('message_length', $text['label-message_length'], $order_by, $order, null, "style='text-align: right;'");
+ $table_header .= "".$text['label-message_size']." | \n";
+ $table_header .= " | ";
+ $table_header .= "
\n";
+
$previous_voicemail_id = '';
foreach($voicemails as $field) {
if ($previous_voicemail_id != $field['voicemail_id']) {
- echo "\n";
- echo " \n";
- echo " ";
if ($previous_voicemail_id != '') {
- echo "
\n";
+ echo " |
|
\n";
}
+ echo "\n";
+ echo " \n";
echo " ".$text['label-mailbox'].": ".$field['voicemail_id']." \n";
echo " | \n";
echo " \n";
if (permission_exists('voicemail_greeting_view')) {
echo " \n";
}
- if (permission_exists('voicemail_view')) {
+ if (permission_exists('voicemail_edit')) {
echo " \n";
}
echo "
| \n";
echo " | \n";
echo "
\n";
- echo $table_header;
+ if (count($field['messages']) > 0) {
+ echo $table_header;
+ }
}
- foreach($field['messages'] as &$row) {
- if ($row['message_status'] == '') { $style = "font-weight: bold;"; } else { $style = ''; }
- echo "";
- echo " ".$row['created_date'];
- echo " | \n";
- echo " ".$row['caller_id_name']." | \n";
- echo " ".$row['caller_id_number']." | \n";
- echo " ";
- $recording_file_path = $file;
- $recording_file_name = strtolower(pathinfo($recording_file_path, PATHINFO_BASENAME));
- $recording_file_ext = pathinfo($recording_file_name, PATHINFO_EXTENSION);
- switch ($recording_file_ext) {
- case "wav" : $recording_type = "audio/wav"; break;
- case "mp3" : $recording_type = "audio/mpeg"; break;
- case "ogg" : $recording_type = "audio/ogg"; break;
+ if (count($field['messages']) > 0) {
+ foreach($field['messages'] as &$row) {
+ if ($row['message_status'] == '') { $style = "font-weight: bold;"; } else { $style = ''; }
+ echo " | \n";
+ echo " | ".$row['created_date']." | \n";
+ echo " ".$row['caller_id_name']." | \n";
+ echo " ".$row['caller_id_number']." | \n";
+ echo " ";
+ $recording_file_path = $file;
+ $recording_file_name = strtolower(pathinfo($recording_file_path, PATHINFO_BASENAME));
+ $recording_file_ext = pathinfo($recording_file_name, PATHINFO_EXTENSION);
+ switch ($recording_file_ext) {
+ case "wav" : $recording_type = "audio/wav"; break;
+ case "mp3" : $recording_type = "audio/mpeg"; break;
+ case "ogg" : $recording_type = "audio/ogg"; break;
+ }
+ echo "";
+ echo "".$v_link_label_play."";
+ echo "".$v_link_label_download."";
+ echo " | \n";
+ echo " ".$row['message_length_label']." | \n";
+ echo " ".$row['file_size_label']." | \n";
+ echo " ";
+ if (permission_exists('voicemail_message_delete')) {
+ echo "$v_link_label_delete";
}
- echo "";
- echo "".$v_link_label_play."";
- echo "".$v_link_label_download."";
- echo " | \n";
- echo " ".$row['message_length_label']." | \n";
- echo " ".$row['file_size_label']." | \n";
- echo " \n";
- if (permission_exists('voicemail_message_delete')) {
- echo " $v_link_label_delete\n";
+ echo " | \n";
+ echo "
\n";
+ $c = ($c) ? 0 : 1;
}
- echo " \n";
- echo "\n";
- if ($c==0) { $c=1; } else { $c=0; }
- } //end foreach
+ }
+ else {
+ echo "".$text['message-messages_not_found']."
|
";
+ }//end foreach
unset($row);
$previous_voicemail_id = $field['voicemail_id'];
unset($sql, $result, $result_count);
+
}
- } //end if results
- echo "\n";
- echo "\n";
- echo " \n";
- echo " \n";
- echo " | | \n";
- echo " | \n";
- echo " \n";
- echo " \n";
- echo " | \n";
- echo " \n";
- echo " \n";
- echo " | \n";
- echo "
\n";
+ echo "
";
+ echo "