Response message updates.

This commit is contained in:
Nate Jones 2014-02-21 02:03:22 +00:00
parent 79c7ecadf7
commit 107efa90c9
6 changed files with 100 additions and 119 deletions

View File

@ -107,6 +107,11 @@
$text['label-edit-add']['pt-pt'] = "Adicionar Bloqueio de Chamadas"; $text['label-edit-add']['pt-pt'] = "Adicionar Bloqueio de Chamadas";
$text['label-edit-add']['fr-fr'] = "Ajouter bloquage d'appel"; $text['label-edit-add']['fr-fr'] = "Ajouter bloquage d'appel";
$text['label-edit-add-recent']['en-us'] = "Recent Calls";
$text['label-edit-add-recent']['es-cl'] = "Llamadas Recientes";
$text['label-edit-add-recent']['pt-pt'] = "Chamadas Recentes";
$text['label-edit-add-recent']['fr-fr'] = "Appels Récents";
$text['label-edit-edit']['en-us'] = "Call Block Edit"; $text['label-edit-edit']['en-us'] = "Call Block Edit";
$text['label-edit-edit']['es-cl'] = "Editar bloqueo de llamada"; $text['label-edit-edit']['es-cl'] = "Editar bloqueo de llamada";
$text['label-edit-edit']['pt-pt'] = "Editar Bloqueio de Chamadas"; $text['label-edit-edit']['pt-pt'] = "Editar Bloqueio de Chamadas";

View File

@ -142,7 +142,7 @@ else {
echo " <a href='call_block_edit.php?id=".$row['call_block_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n"; echo " <a href='call_block_edit.php?id=".$row['call_block_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
} }
if (permission_exists('call_block_delete')) { if (permission_exists('call_block_delete')) {
echo " <a href='call_block_delete.php?id=".$row['call_block_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm(".$text['confirm-delete'].")\">$v_link_label_delete</a>\n"; echo " <a href='call_block_delete.php?id=".$row['call_block_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
}; };
echo "</tr>\n"; echo "</tr>\n";
if ($c==0) { $c=1; } else { $c=0; } if ($c==0) { $c=1; } else { $c=0; }

View File

@ -87,12 +87,7 @@ else {
$db->exec(check_sql($sql)); $db->exec(check_sql($sql));
unset($sql); unset($sql);
require_once "resources/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=call_block.php\">\n";
echo "<div align='center'>\n";
echo $text['label-add-complete']."\n";
echo "</div>\n";
require_once "resources/footer.php";
return;
$_SESSION["message"] = $text['label-add-complete'];
header("Location: call_block.php");
?> ?>

View File

@ -57,22 +57,9 @@ else {
unset($prep_statement, $sql); unset($prep_statement, $sql);
} }
//redirect the user
require_once "resources/header.php"; $_SESSION["message"] = $text['label-delete-complete'];
echo "<meta http-equiv=\"refresh\" content=\"2;url=call_block.php\">\n"; header("Location: call_block.php");
echo "<br />\n";
echo "<div align='center'>\n";
echo " <table width='40%'>\n";
echo " <tr>\n";
echo " <th align='left'>".$text['label-message']."</th>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td class='row_style1'><strong>".$text['label-delete-complete']."</strong></td>\n";
echo " </tr>\n";
echo " </table>\n";
echo " <br />\n";
echo "</div>\n";
require_once "resources/footer.php";
return; return;
?> ?>

View File

@ -139,12 +139,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$db->exec(check_sql($sql)); $db->exec(check_sql($sql));
unset($sql); unset($sql);
require_once "resources/header.php"; $_SESSION["message"] = $text['label-add-complete'];
echo "<meta http-equiv=\"refresh\" content=\"2;url=call_block.php\">\n"; header("Location: call_block.php");
echo "<div align='center'>\n";
echo $text['label-add-complete']."\n";
echo "</div>\n";
require_once "resources/footer.php";
return; return;
} //if ($action == "add") } //if ($action == "add")
@ -159,12 +155,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$db->exec(check_sql($sql)); $db->exec(check_sql($sql));
unset($sql); unset($sql);
require_once "resources/header.php"; $_SESSION["message"] = $text['label-update-complete'];
echo "<meta http-equiv=\"refresh\" content=\"2;url=call_block.php\">\n"; header("Location: call_block.php");
echo "<div align='center'>\n";
echo $text['label-update-complete']."\n";
echo "</div>\n";
require_once "resources/footer.php";
return; return;
} //if ($action == "update") } //if ($action == "update")
} //if ($_POST["persistformvar"] != "true") } //if ($_POST["persistformvar"] != "true")
@ -197,63 +189,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<div align='center'>"; echo "<div align='center'>";
// Show last 5-10 calls first, with add button // Show last 5-10 calls first, with add button
//get the results from the db
$sql = "select caller_id_number, caller_id_name, start_epoch, uuid from v_xml_cdr ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
$sql .= "and direction != 'outbound' ";
$sql .= "order by start_stamp DESC ";
$sql .= "limit 20 ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll();
$result_count = count($result);
unset ($prep_statement);
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo th_order_by('caller_id_name', $text['label-name'], $order_by, $order);
echo th_order_by('caller_id_number', $text['label-number'], $order_by, $order);
echo th_order_by('start_stamp', $text['label-called-on'], $order_by, $order);
$c = 0;
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
if ($result_count > 0) {
foreach($result as $row) {
if (strlen($row['caller_id_number']) >= 7) {
if (defined('TIME_24HR') && TIME_24HR == 1) {
$tmp_start_epoch = date("j M Y H:i:s", $row['start_epoch']);
} else {
$tmp_start_epoch = date("j M Y h:i:sa", $row['start_epoch']);
}
echo "<tr >\n";
echo " <td valign='top' class='".$row_style[$c]."'>";
echo $row['caller_id_name'].' ';
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>";
if (is_numeric($row['caller_id_number'])) {
echo format_phone($row['caller_id_number']).' ';
}
else {
echo $row['caller_id_number'].' ';
}
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$tmp_start_epoch."</td>\n";
echo " <td valign='top' align='right'>\n";
echo " <a href='call_block_cdr_add.php?cdr_id=".$row['uuid']."' alt='add'>$v_link_label_add</a>\n";
echo "</tr>\n";
if ($c==0) { $c=1; } else { $c=0; }
}
} //end foreach
unset($sql, $result, $row_count);
} //end if results
echo "<tr>\n";
echo "</tr>\n";
echo "</table>";
// end of Display Last 5-10 Calls
echo "<table width='100%' border='0' cellpadding='0' cellspacing=''>\n"; echo "<table width='100%' border='0' cellpadding='0' cellspacing=''>\n";
echo "<tr class='border'>\n"; echo "<tr class='border'>\n";
echo " <td align=\"left\">\n"; echo " <td align=\"left\">\n";
@ -372,7 +307,70 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " </td>"; echo " </td>";
echo " </tr>"; echo " </tr>";
echo "</table>"; echo "</table>";
echo "</div>"; echo "</div><br><br>";
//get recent calls from the db (if not editing an existing call block record)
if (!isset($_REQUEST["id"])) {
$sql = "select caller_id_number, caller_id_name, start_epoch, uuid from v_xml_cdr ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
$sql .= "and direction != 'outbound' ";
$sql .= "order by start_stamp DESC ";
$sql .= "limit 20 ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll();
$result_count = count($result);
unset ($prep_statement);
echo "<b>".$text['label-edit-add-recent']."</b>";
echo "<br><br>";
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo th_order_by('caller_id_name', $text['label-name'], $order_by, $order);
echo th_order_by('caller_id_number', $text['label-number'], $order_by, $order);
echo th_order_by('start_stamp', $text['label-called-on'], $order_by, $order);
$c = 0;
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
if ($result_count > 0) {
foreach($result as $row) {
if (strlen($row['caller_id_number']) >= 7) {
if (defined('TIME_24HR') && TIME_24HR == 1) {
$tmp_start_epoch = date("j M Y H:i:s", $row['start_epoch']);
} else {
$tmp_start_epoch = date("j M Y h:i:sa", $row['start_epoch']);
}
echo "<tr >\n";
echo " <td valign='top' class='".$row_style[$c]."'>";
echo $row['caller_id_name'].' ';
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>";
if (is_numeric($row['caller_id_number'])) {
echo format_phone($row['caller_id_number']).' ';
}
else {
echo $row['caller_id_number'].' ';
}
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$tmp_start_epoch."</td>\n";
echo " <td valign='top' align='right'>\n";
echo " <a href='call_block_cdr_add.php?cdr_id=".$row['uuid']."' alt='add'>$v_link_label_add</a>\n";
echo "</tr>\n";
if ($c==0) { $c=1; } else { $c=0; }
}
} //end foreach
unset($sql, $result, $row_count);
} //end if results
echo "<tr>\n";
echo "</tr>\n";
echo "</table>";
}
// end of Display Last 5-10 Calls
//include the footer //include the footer
require_once "resources/footer.php"; require_once "resources/footer.php";

View File

@ -348,12 +348,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
} }
//redirect the user //redirect the user
require_once "resources/header.php"; $_SESSION["message"] = $text['confirm-update'];
echo "<meta http-equiv=\"refresh\" content=\"3;url=".PROJECT_PATH."/core/user_settings/user_dashboard.php\">\n"; header("Location: ".PROJECT_PATH."/core/user_settings/user_dashboard.php");
echo "<div align='center'>\n";
echo "".$text['confirm-update']."<br />\n";
echo "</div>\n";
require_once "resources/footer.php";
return; return;
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) } //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)