CDR basic search query, style and language mods, misc minor style mods.

This commit is contained in:
Nate Jones
2014-06-16 18:12:21 +00:00
parent 69bf98f6f7
commit e5a23aabaf
8 changed files with 198 additions and 245 deletions

View File

@@ -42,28 +42,6 @@ else {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
if (!function_exists('th_order_by')) {
//html table header order by
function th_order_by($field_name, $columntitle, $order_by, $order) {
$html .= "<th nowrap>&nbsp; &nbsp; ";
if (strlen($order_by)==0) {
$html .= "<a href='?order_by=$field_name&order=desc' title='ascending'>$columntitle</a>";
}
else {
if ($order=="asc") {
$html .= "<a href='?order_by=$field_name&order=desc' title='ascending'>$columntitle</a>";
}
else {
$html .= "<a href='?order_by=$field_name&order=asc' title='descending'>$columntitle</a>";
}
}
$html .= "&nbsp; &nbsp; </th>";
return $html;
}
}
require_once "resources/header.php";
echo "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"\" href=\"rss.php\" />\n";

View File

@@ -46,25 +46,6 @@ else {
$dialplan_context = check_str($_GET["dialplan_context"]);
$app_uuid = check_str($_GET["app_uuid"]);
//custom table header order by to accomodate the app_uuid
function th_order_by($field_name, $columntitle, $order_by, $order, $app_uuid) {
if (strlen($app_uuid) > 0) { $app_uuid = "app_uuid=".$app_uuid; }
$html = "<th nowrap>&nbsp; &nbsp; ";
if (strlen($order_by)==0) {
$html .= "<a href='?order_by=$field_name&order=desc&$app_uuid' title='ascending'>$columntitle</a>";
}
else {
if ($order=="asc") {
$html .= "<a href='?order_by=$field_name&order=desc&$app_uuid' title='ascending'>$columntitle</a>";
}
else {
$html .= "<a href='?order_by=$field_name&order=asc&$app_uuid' title='descending'>$columntitle</a>";
}
}
$html .= "&nbsp; &nbsp; </th>";
return $html;
}
//includes
require_once "resources/header.php";
require_once "resources/paging.php";
@@ -274,11 +255,11 @@ else {
unset ($prep_statement);
}
echo "<tr >\n";
echo " <td valign='top' class='".$row_style[$c]."'>&nbsp;&nbsp;".$row['dialplan_name']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>&nbsp;&nbsp;".$row['dialplan_number']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>&nbsp;&nbsp;".$row['dialplan_context']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>&nbsp;&nbsp;".$row['dialplan_order']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>&nbsp;&nbsp;".$row['dialplan_enabled']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['dialplan_name']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['dialplan_number']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['dialplan_context']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['dialplan_order']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['dialplan_enabled']."</td>\n";
echo " <td valign='top' class='row_stylebg' width='30%'>".$row['dialplan_description']."&nbsp;</td>\n";
echo " <td class='list_control_icons'>\n";
if ($app_uuid == "c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4") {

View File

@@ -1,4 +1,4 @@
<?php
<?php
$text['title']['en-us'] = "Call Detail Records";
$text['title']['es-cl'] = "Registro de Detalle de Llamadas";
@@ -25,30 +25,30 @@
$text['description-4']['pt-pt'] = "Veja as chamadas na lista ou descarregue-as como arquivo, separadas por vírgulas, usando o botão 'csv'.";
$text['description-4']['fr-fr'] = "Ensuite visualisez les informations dans la liste ci-dessous, ou téléchargez les sous forme d'un fichier CSV.";
$text['label-description']['en-us'] = "Description";
$text['label-description']['es-cl'] = "Descripción";
$text['label-description']['pt-pt'] = "Descrição";
$text['label-description']['fr-fr'] = "Description";
$text['label-direction']['en-us'] = "Direction";
$text['label-direction']['es-cl'] = "Dirección";
$text['label-direction']['pt-pt'] = "Direção";
$text['label-direction']['fr-fr'] = "Direction";
$text['label-cid-name']['en-us'] = "CID Name";
$text['label-cid-name']['es-cl'] = "Nombre CID";
$text['label-cid-name']['pt-pt'] = "Nome CID";
$text['label-cid-name']['fr-fr'] = "Nom de l'Appelant";
$text['label-inbound']['en-us'] = "inbound";
$text['label-inbound']['es-cl'] = "entrada";
$text['label-inbound']['pt-pt'] = "entrada";
$text['label-inbound']['fr-fr'] = "entrant";
$text['label-inbound']['en-us'] = "Inbound";
$text['label-inbound']['es-cl'] = "Entrada";
$text['label-inbound']['pt-pt'] = "Entrada";
$text['label-inbound']['fr-fr'] = "Entrant";
$text['label-outbound']['en-us'] = "outbound";
$text['label-outbound']['es-cl'] = "salida";
$text['label-outbound']['pt-pt'] = "saída";
$text['label-outbound']['fr-fr'] = "sortant";
$text['label-outbound']['en-us'] = "Outbound";
$text['label-outbound']['es-cl'] = "Salida";
$text['label-outbound']['pt-pt'] = "Saída";
$text['label-outbound']['fr-fr'] = "Sortant";
$text['label-local']['en-us'] = "local";
$text['label-local']['es-cl'] = "local";
$text['label-local']['pt-pt'] = "local";
$text['label-local']['fr-fr'] = "local";
$text['label-local']['en-us'] = "Local";
$text['label-local']['es-cl'] = "Local";
$text['label-local']['pt-pt'] = "Local";
$text['label-local']['fr-fr'] = "Local";
$text['label-source']['en-us'] = "Source";
$text['label-source']['es-cl'] = "Origen";
@@ -80,10 +80,10 @@
$text['label-number']['pt-pt'] = "Número";
$text['label-number']['fr-fr'] = "Numéro";
$text['label-length']['en-us'] = "Length";
$text['label-length']['es-cl'] = "Duración";
$text['label-length']['pt-pt'] = "Duração";
$text['label-length']['fr-fr'] = "Durée";
$text['label-duration']['en-us'] = "Duration";
$text['label-duration']['es-cl'] = "Duración";
$text['label-duration']['pt-pt'] = "Duração";
$text['label-duration']['fr-fr'] = "Durée";
$text['label-tools']['en-us'] = "Tools";
$text['label-tools']['es-cl'] = "Herramientas";
@@ -114,6 +114,21 @@
$text['button-missed']['pt-pt'] = "Chamadas Perdidas";
$text['button-missed']['fr-fr'] = "Appels Perdus";
$text['button-reset']['en-us'] = "Reset";
$text['button-reset']['es-cl'] = "Reajustar";
$text['button-reset']['pt-pt'] = "Restabelecer";
$text['button-reset']['fr-fr'] = "Remettre";
$text['button-search']['en-us'] = "Search";
$text['button-search']['es-cl'] = "Búsqueda";
$text['button-search']['pt-pt'] = "Pesquisa";
$text['button-search']['fr-fr'] = "Recherche";
$text['button-advanced_search']['en-us'] = "Advanced Search";
$text['button-advanced_search']['es-cl'] = "Búsqueda Avanzada";
$text['button-advanced_search']['pt-pt'] = "Pesquisa Avançada";
$text['button-advanced_search']['fr-fr'] = "Recherche Avancée";
//xml_cdr_details
$text['title2']['en-us'] = "Call Details";
$text['title2']['es-cl'] = "Detalles dw Llamadas";

View File

@@ -71,11 +71,14 @@ else {
echo "<div align='center'>";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td align='left' width='50%' nowrap='nowrap'><b>".$text['title']."</b></td>\n";
echo "<td align='right' width='100%'>\n";
echo "<td align='left' width='50%' nowrap='nowrap' style='vertical-align: top;'><b>".$text['title']."</b><br><br><br></td>\n";
echo "<td align='right' width='100%' style='vertical-align: top;'>\n";
echo "<table>\n";
echo "<tr>\n";
echo "<td>\n";
if (if_group("admin") || if_group("superadmin") || permission_exists('xml_cdr_domain')) {
echo " <input type='button' class='btn' value='".$text['button-advanced_search']."' onclick=\"window.location='xml_cdr_search.php';\">\n";
}
echo " <input type='button' class='btn' value='".$text['button-missed']."' onclick=\"document.location.href='xml_cdr.php?missed=true';\">\n";
echo " <input type='button' class='btn' value='".$text['button-statistics']."' onclick=\"document.location.href='xml_cdr_statistics.php';\">\n";
echo "</td>\n";
@@ -124,16 +127,24 @@ else {
//search the call detail records
if (if_group("admin") || if_group("superadmin") || permission_exists('xml_cdr_domain')) {
echo "<fieldset>";
echo "<legend>Basic Search</legend>";
echo "<form method='post' action=''>\n";
echo "<table width='95%' cellpadding='3' border='0'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td width='33.3%'>\n";
echo "<table width='100%' border='0'>\n";
echo "<td width='44%' style='vertical-align: top;'>\n";
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
echo " <tr>\n";
echo " <td align='left' width='25%'>".$text['label-description'].":</td>\n";
echo " <td align='left' width='75%'>\n";
echo " <select name='direction' style='width:100%' class='formfld'>\n";
echo " <option value=''> </option>\n";
echo " <td class='vncell' valign='top' nowrap='nowrap' width='30%'>\n";
echo " ".$text['label-direction']."\n";
echo " </td>\n";
echo " <td class='vtable' width='70%' align='left'>\n";
echo " <select name='direction' class='formfld'>\n";
echo " <option value=''></option>\n";
if ($direction == "inbound") {
echo " <option value='inbound' selected='selected'>".$text['label-inbound']."</option>\n";
}
@@ -157,160 +168,118 @@ else {
echo " </tr>\n";
echo " <tr>\n";
echo " <td align=\"left\">".$text['label-cid-name'].":</td>\n";
echo " <td align=\"left\"><input type='text' class='formfld' name='caller_id_name' style='width:100%' value='$caller_id_name'></td>\n";
echo " </tr>\n";
echo "</table>\n";
echo "</td>\n";
echo "<td width='33.3%'>\n";
echo "<table width='100%'>\n";
echo " <tr>\n";
echo " <td align='left' width='25%'>".$text['label-source'].":</td>\n";
echo " <td align='left' width='75%'><input type='text' class='formfld' name='caller_id_number' style='width:100%' value='$caller_id_number'></td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td align='left' width='25%'>".$text['label-destination'].":</td>\n";
echo " <td align='left' width='75%'><input type='text' class='formfld' name='destination_number' style='width:100%' value='$destination_number'></td>\n";
echo " </tr>\n";
echo "</table>\n";
echo "</td>\n";
echo "<td width='33.3%'>\n";
echo "<table width='100%'>\n";
//echo " <tr>";
//echo " <td>Context:</td>";
//echo " <td><input type='text' class='formfld' name='context' style='width:100%' value='$context'></td>";
//echo " </tr>";
//echo " <tr>";
//echo " <td>Answer:</td>";
//echo " <td><input type='text' class='formfld' name='answer_stamp' style='width:100%' value='$answer_stamp'></td>";
//echo " </tr>";
//echo " <tr>";
//echo " <td>End:</td>";
//echo " <td><input type='text' class='formfld' name='end_stamp' style='width:100%' value='$end_stamp'></td>";
//echo " </tr>";
echo " <tr>\n";
echo " <td align='left' width='25%'>".$text['label-start'].":</td>\n";
echo " <td align='left' width='75%'><input type='text' class='formfld' name='start_stamp' style='width:100%' value='$start_stamp'></td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td align='left' width='25%'>".$text['label-status'].":</td>\n";
echo " <td align='left' width='75%'>\n";
echo " <select name=\"hangup_cause\" style='width:100%' class='formfld'>\n";
echo " <option value='".$hangup_cause."' selected='selected'>".$hangup_cause."</option>\n";
echo " <td class='vncell' valign='top' nowrap='nowrap' width='30%'>\n";
echo " ".$text['label-status']."\n";
echo " </td>\n";
echo " <td class='vtable' width='70%' align='left'>\n";
echo " <select name=\"hangup_cause\" class='formfld'>\n";
echo " <option value='".$hangup_cause."' selected='selected'>".$hangup_cause."</option>\n";
if (strlen($hangup_cause) > 0) {
echo " <option value=''></option>\n";
}
echo " <option value='NORMAL_CLEARING'>NORMAL_CLEARING</option>\n";
echo " <option value='ORIGINATOR_CANCEL'>ORIGINATOR_CANCEL</option>\n";
echo " <option value='BLIND_TRANSFER'>BLIND_TRANSFER</option>\n";
echo " <option value='LOSE_RACE'>LOSE_RACE</option>\n";
echo " <option value='NO_ANSWER'>NO_ANSWER</option>\n";
echo " <option value='NORMAL_UNSPECIFIED'>NORMAL_UNSPECIFIED</option>\n";
echo " <option value='NO_USER_RESPONSE'>NO_USER_RESPONSE</option>\n";
echo " <option value='NO_ROUTE_DESTINATION'>NO_ROUTE_DESTINATION</option>\n";
echo " <option value='SUBSCRIBER_ABSENT'>SUBSCRIBER_ABSENT</option>\n";
echo " <option value='NORMAL_TEMPORARY_FAILURE'>NORMAL_TEMPORARY_FAILURE</option>\n";
echo " <option value='ATTENDED_TRANSFER'>ATTENDED_TRANSFER</option>\n";
echo " <option value='PICKED_OFF'>PICKED_OFF</option>\n";
echo " <option value='USER_BUSY'>USER_BUSY</option>\n";
echo " <option value='CALL_REJECTED'>CALL_REJECTED</option>\n";
echo " <option value='INVALID_NUMBER_FORMAT'>INVALID_NUMBER_FORMAT</option>\n";
echo " <option value='NETWORK_OUT_OF_ORDER'>NETWORK_OUT_OF_ORDER</option>\n";
echo " <option value='DESTINATION_OUT_OF_ORDER'>DESTINATION_OUT_OF_ORDER</option>\n";
echo " <option value='RECOVERY_ON_TIMER_EXPIRE'>RECOVERY_ON_TIMER_EXPIRE</option>\n";
echo " <option value='MANAGER_REQUEST'>MANAGER_REQUEST</option>\n";
echo " <option value='MEDIA_TIMEOUT'>MEDIA_TIMEOUT</option>\n";
echo " <option value='UNALLOCATED_NUMBER'>UNALLOCATED_NUMBER</option>\n";
echo " <option value='NONE'>NONE</option>\n";
echo " <option value='EXCHANGE_ROUTING_ERROR'>EXCHANGE_ROUTING_ERROR</option>\n";
echo " <option value='ALLOTTED_TIMEOUT'>ALLOTTED_TIMEOUT</option>\n";
echo " <option value='CHAN_NOT_IMPLEMENTED'>CHAN_NOT_IMPLEMENTED</option>\n";
echo " <option value='INCOMPATIBLE_DESTINATION'>INCOMPATIBLE_DESTINATION</option>\n";
echo " <option value='USER_NOT_REGISTERED'>USER_NOT_REGISTERED</option>\n";
echo " <option value='SYSTEM_SHUTDOWN'>SYSTEM_SHUTDOWN</option>\n";
echo " <option value='MANDATORY_IE_MISSING'>MANDATORY_IE_MISSING</option>\n";
/*
$sql = "";
$sql .= "select distinct(hangup_cause) from v_xml_cdr ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
foreach ($result as &$row) {
if ($row["hangup_cause"] == $hangup_cause) {
echo " <option value='".$row["hangup_cause"]."' selected='selected'>".$row["hangup_cause"]."</option>\n";
}
else {
echo " <option value='".$row["hangup_cause"]."'>".$row["hangup_cause"]."</option>\n";
}
$cdr_status_options = array(
'NORMAL_CLEARING',
'ORIGINATOR_CANCEL',
'BLIND_TRANSFER',
'LOSE_RACE',
'NO_ANSWER',
'NORMAL_UNSPECIFIED',
'NO_USER_RESPONSE',
'NO_ROUTE_DESTINATION',
'SUBSCRIBER_ABSENT',
'NORMAL_TEMPORARY_FAILURE',
'ATTENDED_TRANSFER',
'PICKED_OFF',
'USER_BUSY',
'CALL_REJECTED',
'INVALID_NUMBER_FORMAT',
'NETWORK_OUT_OF_ORDER',
'DESTINATION_OUT_OF_ORDER',
'RECOVERY_ON_TIMER_EXPIRE',
'MANAGER_REQUEST',
'MEDIA_TIMEOUT',
'UNALLOCATED_NUMBER',
'NONE',
'EXCHANGE_ROUTING_ERROR',
'ALLOTTED_TIMEOUT',
'CHAN_NOT_IMPLEMENTED',
'INCOMPATIBLE_DESTINATION',
'USER_NOT_REGISTERED',
'SYSTEM_SHUTDOWN',
'MANDATORY_IE_MISSING'
);
sort($cdr_status_options);
foreach ($cdr_status_options as $cdr_status) {
$cdr_status_label = ucwords(strtolower(str_replace("_", " ", $cdr_status)));
echo " <option value='".$cdr_status."'>".$cdr_status_label."</option>";
}
unset ($prep_statement);
*/
echo " </select>\n";
echo " </td>\n";
echo " </tr>\n";
echo "</table>\n";
//echo " <tr>";
//echo " <td align='left' width='25%'>Duration:</td>";
//echo " <td align='left' width='75%'><input type='text' class='txt' name='duration' value='$duration'></td>";
//echo " </tr>";
//echo " <tr>";
//echo " <td align='left' width='25%'>Bill:</td>";
//echo " <td align='left' width='75%'><input type='text' class='txt' name='billsec' value='$billsec'></td>";
//echo " </tr>";
//echo " <tr>";
//echo " <td>UUID:</td>";
//echo " <td><input type='text' class='txt' name='uuid' value='$uuid'></td>";
//echo " </tr>";
//echo " <tr>";
//echo " <td>Bridge UUID:</td>";
//echo " <td><input type='text' class='txt' name='bridge_uuid' value='$bridge_uuid'></td>";
//echo " </tr>";
//echo " <tr>";
//echo " <td>Account Code:</td>";
//echo " <td><input type='text' class='txt' name='accountcode' value='$accountcode'></td>";
//echo " </tr>";
//echo " <tr>";
//echo " <td>Read Codec:</td>";
//echo " <td><input type='text' class='txt' name='read_codec' value='$read_codec'></td>";
//echo " </tr>";
//echo " <tr>";
//echo " <td>Write Codec:</td>";
//echo " <td><input type='text' class='txt' name='write_codec' value='$write_codec'></td>";
//echo " </tr>";
//echo " <tr>";
//echo " <td>Remote Media IP:</td>";
//echo " <td><input type='text' class='txt' name='remote_media_ip' value='$remote_media_ip'></td>";
//echo " </tr>";
//echo " <tr>";
//echo " <td>Network Address:</td>";
//echo " <td><input type='text' class='txt' name='network_addr' value='$network_addr'></td>";
//echo " </tr>";
//echo " <tr>";
echo "</td>";
echo "<td width='28%' style='vertical-align: top;'>\n";
echo " </tr>";
echo "</table>";
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
echo " <tr>\n";
echo " <td class='vncell' valign='top' nowrap='nowrap' width='30%'>\n";
echo " ".$text['label-source']."\n";
echo " </td>\n";
echo " <td class='vtable' width='70%' align='left'>\n";
echo " <input type='text' class='formfld' name='caller_id_number' style='width:100%' value='$caller_id_number'>\n";
echo " </td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td class='vncell' valign='top' nowrap='nowrap' width='30%'>\n";
echo " ".$text['label-destination']."\n";
echo " </td>\n";
echo " <td class='vtable' width='70%' align='left'>\n";
echo " <input type='text' class='formfld' name='destination_number' style='width:100%' value='$destination_number'>\n";
echo " </td>\n";
echo " </tr>\n";
echo "</table>\n";
echo "</td>";
echo "<td width='28%' style='vertical-align: top;'>\n";
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
echo " <tr>\n";
echo " <td class='vncell' valign='top' nowrap='nowrap' width='30%'>\n";
echo " ".$text['label-cid-name']."\n";
echo " </td>\n";
echo " <td class='vtable' width='70%' align='left'>\n";
echo " <input type='text' class='formfld' name='caller_id_name' style='width:100%' value='$caller_id_name'>\n";
echo " </td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td class='vncell' valign='top' nowrap='nowrap' width='30%'>\n";
echo " ".$text['label-start']."\n";
echo " </td>\n";
echo " <td class='vtable' width='70%' align='left'>\n";
echo " <input type='text' class='formfld' name='start_stamp' style='width:100%' value='$start_stamp'>\n";
echo " </td>\n";
echo " </tr>\n";
echo "</table>\n";
echo "</td>";
echo "</tr>";
echo "<tr>\n";
echo "<td colspan='2' align='right'>\n";
//echo " <input type='button' class='btn' name='' alt='view' onclick=\"window.location='cdr_search.php'\" value='advanced'>\n";
echo "</td>\n";
echo "<td colspan='1' align='right'>\n";
echo " <input type='button' class='btn' name='' alt='view' onclick=\"window.location='xml_cdr_search.php'\" value='advanced'>&nbsp;\n";
echo " <input type='submit' class='btn' name='submit' value='filter'>\n";
echo "</td>\n";
echo "<tr>";
echo "<td colspan='3' style='padding-top: 8px;' align='right'>";
echo "<input type='button' class='btn' value='".$text['button-reset']."' onclick=\"document.location.href='xml_cdr.php';\">\n";
echo "<input type='submit' class='btn' name='submit' value='".$text['button-search']."'>\n";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</form>";
echo "</fieldset>";
echo "<br /><br />";
}
//show the results
@@ -320,13 +289,13 @@ else {
//echo th_order_by('default_language', 'Language', $order_by, $order);
//echo th_order_by('context', 'Context', $order_by, $order);
//echo th_order_by('leg', 'Leg', $order_by, $order);
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('caller_id_name', $text['label-cid-name'], $order_by, $order);
echo th_order_by('caller_id_number', $text['label-source'], $order_by, $order);
echo th_order_by('destination_number', $text['label-destination'], $order_by, $order);
echo "<th>".$text['label-tools']."</th>\n";
echo th_order_by('start_stamp', $text['label-start'], $order_by, $order);
//echo th_order_by('end_stamp', 'End', $order_by, $order);
echo th_order_by('duration', $text['label-length'], $order_by, $order);
echo th_order_by('duration', $text['label-duration'], $order_by, $order);
if (if_group("admin") || if_group("superadmin")) {
echo th_order_by('pdd_ms', 'PDD', $order_by, $order);
}
@@ -379,7 +348,7 @@ else {
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>";
echo " &nbsp; <a href=\"javascript:void(0)\" onclick=\"send_cmd('".PROJECT_PATH."/app/click_to_call/click_to_call.php?src_cid_name=".urlencode($row['caller_id_name'])."&src_cid_number=".urlencode($row['caller_id_number'])."&dest_cid_name=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_name'])."&dest_cid_number=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_number'])."&src=".urlencode($_SESSION['user']['extension'][0]['user'])."&dest=".urlencode($row['caller_id_number'])."&rec=false&ringback=us-ring&auto_answer=true');\">\n";
echo " <a href=\"javascript:void(0)\" onclick=\"send_cmd('".PROJECT_PATH."/app/click_to_call/click_to_call.php?src_cid_name=".urlencode($row['caller_id_name'])."&src_cid_number=".urlencode($row['caller_id_number'])."&dest_cid_name=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_name'])."&dest_cid_number=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_number'])."&src=".urlencode($_SESSION['user']['extension'][0]['user'])."&dest=".urlencode($row['caller_id_number'])."&rec=false&ringback=us-ring&auto_answer=true');\">\n";
if (is_numeric($row['caller_id_number'])) {
echo " ".format_phone($row['caller_id_number']).' ';
}

View File

@@ -186,7 +186,7 @@ else {
echo "<th>".$text['label-destination']."</th>\n";
echo "<th>".$text['label-start']."</th>\n";
echo "<th>".$text['table-end']."</th>\n";
echo "<th>".$text['label-length']."</th>\n";
echo "<th>".$text['label-duration']."</th>\n";
echo "<th>".$text['label-status']."</th>\n";
echo "</tr>\n";

View File

@@ -75,22 +75,14 @@ else {
if ($missed == true) {
$sql_where .= "and billsec = '0' ";
}
if (strlen($start_epoch) > 0 && strlen($stop_epoch) > 0) {
if (strlen($start_epoch) > 0 && strlen($stop_epoch) > 0) {
$sql_where .= "and start_epoch BETWEEN ".$start_epoch." AND ".$stop_epoch." ";
}
if (strlen($cdr_id) > 0) { $sql_where .= "and cdr_id like '%$cdr_id%' "; }
if (strlen($direction) > 0) { $sql_where .= "and direction = '$direction' "; }
if (strlen($caller_id_name) > 0) { $sql_where .= "and caller_id_name like '$caller_id_name' "; }
if (strlen($caller_id_number) > 0 && strlen($destination_number) > 0) {
$sql_where .= "and (";
$sql_where .= "caller_id_number = '$caller_id_number' ";
$sql_where .= "or destination_number = '$destination_number'";
$sql_where .= ") ";
}
else {
if (strlen($caller_id_number) > 0) { $sql_where .= "and caller_id_number like '$caller_id_number' "; }
if (strlen($destination_number) > 0) { $sql_where .= "and destination_number like '$destination_number' "; }
}
if (strlen($caller_id_name) > 0) { $sql_where .= "and caller_id_name like '%".$caller_id_name."%' "; }
if (strlen($caller_id_number) > 0) { $sql_where .= "and caller_id_number like '%".$caller_id_number."%' "; }
if (strlen($destination_number) > 0) { $sql_where .= "and destination_number like '%".$destination_number."%' "; }
if (strlen($context) > 0) { $sql_where .= "and context like '%$context%' "; }
if ($db_type == "sqlite") {
if (strlen($start_stamp) > 0) { $sql_where .= "and start_stamp like '%$start_stamp%' "; }
@@ -113,7 +105,7 @@ else {
if (strlen($network_addr) > 0) { $sql_where .= "and network_addr like '%$network_addr%' "; }
//example sql
// select caller_id_number, destination_number from v_xml_cdr where domain_uuid = ''
// select caller_id_number, destination_number from v_xml_cdr where domain_uuid = ''
// and (caller_id_number = '1001' or destination_number = '1001' or destination_number = '*991001')
if (!if_group("admin") && !if_group("superadmin") && !permission_exists('xml_cdr_domain')) {
$sql_where = "where domain_uuid = '$domain_uuid' ";
@@ -182,7 +174,7 @@ else {
//page results if rows_per_page is greater than zero
if ($rows_per_page > 0) {
//get the number of rows in the v_xml_cdr
//get the number of rows in the v_xml_cdr
$sql = "select count(*) as num_rows from v_xml_cdr ";
$sql .= $sql_where;
$prep_statement = $db->prepare(check_sql($sql));
@@ -201,8 +193,8 @@ else {
//prepare to page the results
//$rows_per_page = 150; //set on the page that includes this page
$page = $_GET['page'];
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
$offset = $rows_per_page * $page;
}

View File

@@ -62,6 +62,7 @@
if (!function_exists('check_sql')) {
function check_sql($string) {
$string = str_replace("''", "null", $string);
return trim($string); //remove white space
}
}
@@ -358,21 +359,21 @@
if (!function_exists('th_order_by')) {
//html table header order by
function th_order_by($field_name, $columntitle, $order_by, $order) {
$html = "<th nowrap>&nbsp; &nbsp; ";
function th_order_by($field_name, $columntitle, $order_by, $order, $app_uuid = '') {
if (strlen($app_uuid) > 0) { $app_uuid = "&app_uuid=".$app_uuid; } // accomodate need to pass app_uuid where necessary (inbound/outbound routes lists)
$html = "<th nowrap>";
if (strlen($order_by)==0) {
$html .= "<a href='?order_by=$field_name&order=desc' title='ascending'>$columntitle</a>";
$html .= "<a href='?order_by=$field_name&order=desc".$app_uuid."' title='ascending'>$columntitle</a>";
}
else {
if ($order=="asc") {
$html .= "<a href='?order_by=$field_name&order=desc' title='ascending'>$columntitle</a>";
$html .= "<a href='?order_by=$field_name&order=desc".$app_uuid."' title='ascending'>$columntitle</a>";
}
else {
$html .= "<a href='?order_by=$field_name&order=asc' title='descending'>$columntitle</a>";
$html .= "<a href='?order_by=$field_name&order=asc".$app_uuid."' title='descending'>$columntitle</a>";
}
}
$html .= "&nbsp; &nbsp; </th>";
$html .= "</th>";
return $html;
}
}

View File

@@ -86,7 +86,6 @@ b {
}
th {
/*border-top: 1px solid #444444;*/
border-bottom: 1px solid #a4aebf;
text-align: left;
color: #3164AD;
@@ -377,6 +376,24 @@ table tr:nth-last-child(-5) td:first-of-type {
border-bottom-top-radius:7px;
}
fieldset {
padding: 8px;
text-align: left;
border: 1px solid #aeb7c6;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
margin: 0px;
}
legend {
font-size: 13px;
font-family: arial;
font-weight: bold;
color: #3164ad;
padding-bottom: 8px;
padding-right: 2px;
}
/* begin the menu css*/
@@ -984,7 +1001,7 @@ table tr:nth-last-child(-5) td:first-of-type {
<tr>
<td class='' colspan='2' width='100%' height='7px'><img src='<!--{project_path}-->/themes/enhanced/images/blank.gif'></td>
</tr>
<?php
<?php
}
?>
<tr>