Response message updates.
This commit is contained in:
@@ -91,10 +91,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
if ($action == "update") {
|
||||
//$call_block_uuid = check_str($_POST["call_block_uuid"]);
|
||||
}
|
||||
|
||||
|
||||
//check for all required data
|
||||
if (strlen($call_block_name) == 0) { $msg .= $text['label-provide-name']."<br>\n"; }
|
||||
if ($action == "add") {
|
||||
if ($action == "add") {
|
||||
if (strlen($call_block_number) == 0) { $msg .= $text['label-provide-number']."<br>\n"; }
|
||||
}
|
||||
if (strlen($call_block_enabled) == 0) { $msg .= $text['label-provide-enabled']."<br>\n"; }
|
||||
@@ -139,12 +139,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
$db->exec(check_sql($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";
|
||||
$_SESSION["message"] = $text['label-add-complete'];
|
||||
header("Location: call_block.php");
|
||||
return;
|
||||
} //if ($action == "add")
|
||||
|
||||
@@ -159,15 +155,11 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
$db->exec(check_sql($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-update-complete']."\n";
|
||||
echo "</div>\n";
|
||||
require_once "resources/footer.php";
|
||||
$_SESSION["message"] = $text['label-update-complete'];
|
||||
header("Location: call_block.php");
|
||||
return;
|
||||
} //if ($action == "update")
|
||||
} //if ($_POST["persistformvar"] != "true")
|
||||
} //if ($_POST["persistformvar"] != "true")
|
||||
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
|
||||
|
||||
//pre-populate the form
|
||||
@@ -197,63 +189,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo "<div align='center'>";
|
||||
// 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 "<tr class='border'>\n";
|
||||
echo " <td align=\"left\">\n";
|
||||
@@ -343,11 +278,11 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <select class='formfld' name='call_block_enabled'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
if ($call_block_enabled == "true") {
|
||||
if ($call_block_enabled == "true") {
|
||||
echo " <option value='true' SELECTED >".$text['label-true']."</option>\n";
|
||||
echo " <option value='false'>".$text['label-false']."</option>\n";
|
||||
}
|
||||
if ($call_block_enabled == "false") {
|
||||
if ($call_block_enabled == "false") {
|
||||
echo " <option value='false' SELECTED >".$text['label-false']."</option>\n";
|
||||
echo " <option value='true'>".$text['label-true']."</option>\n";
|
||||
}
|
||||
@@ -372,7 +307,70 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo " </td>";
|
||||
echo " </tr>";
|
||||
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
|
||||
require_once "resources/footer.php";
|
||||
|
||||
Reference in New Issue
Block a user