2012-06-04 16:58:40 +02:00
|
|
|
<?php
|
|
|
|
|
/*
|
|
|
|
|
FusionPBX
|
|
|
|
|
Version: MPL 1.1
|
|
|
|
|
|
|
|
|
|
The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
|
1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
http://www.mozilla.org/MPL/
|
|
|
|
|
|
|
|
|
|
Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
|
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
|
for the specific language governing rights and limitations under the
|
|
|
|
|
License.
|
|
|
|
|
|
|
|
|
|
The Original Code is FusionPBX
|
|
|
|
|
|
|
|
|
|
The Initial Developer of the Original Code is
|
|
|
|
|
Mark J Crane <markjcrane@fusionpbx.com>
|
2014-04-27 01:37:41 +02:00
|
|
|
Copyright (C) 2008-2012
|
2012-06-04 16:58:40 +02:00
|
|
|
All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
Contributor(s):
|
|
|
|
|
Mark J Crane <markjcrane@fusionpbx.com>
|
|
|
|
|
*/
|
|
|
|
|
include "root.php";
|
2013-07-06 08:03:27 +02:00
|
|
|
require_once "resources/require.php";
|
2013-07-06 07:50:55 +02:00
|
|
|
require_once "resources/check_auth.php";
|
2014-06-17 00:08:30 +02:00
|
|
|
if (permission_exists('xml_cdr_search_advanced')) {
|
2012-06-04 16:58:40 +02:00
|
|
|
//access granted
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo "access denied";
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2014-07-17 21:04:20 +02:00
|
|
|
//add multi-lingual support
|
|
|
|
|
require_once "app_languages.php";
|
|
|
|
|
foreach($text as $key => $value) {
|
|
|
|
|
$text[$key] = $value[$_SESSION['domain']['language']['code']];
|
|
|
|
|
}
|
2012-06-04 16:58:40 +02:00
|
|
|
|
2014-07-17 21:04:20 +02:00
|
|
|
require_once "resources/header.php";
|
2012-06-04 16:58:40 +02:00
|
|
|
|
2014-08-03 06:03:44 +02:00
|
|
|
//javascript to toggle input/select boxes
|
|
|
|
|
echo "<script type='text/javascript'>";
|
|
|
|
|
echo " function toggle(field) {";
|
|
|
|
|
echo " if (field == 'source') {";
|
|
|
|
|
echo " document.getElementById('caller_extension_uuid').selectedIndex = 0;";
|
|
|
|
|
echo " document.getElementById('caller_id_number').value = '';";
|
|
|
|
|
echo " $('#caller_extension_uuid').toggle();";
|
|
|
|
|
echo " $('#caller_id_number').toggle();";
|
|
|
|
|
echo " if ($('#caller_id_number').is(':visible')) { $('#caller_id_number').focus(); } else { $('#caller_extension_uuid').focus(); }";
|
|
|
|
|
echo " }";
|
|
|
|
|
echo " }";
|
|
|
|
|
echo "</script>";
|
|
|
|
|
|
|
|
|
|
echo "<div align='center'>";
|
2014-07-17 21:04:20 +02:00
|
|
|
echo "<form method='post' action='xml_cdr.php'>\n";
|
2014-08-03 06:03:44 +02:00
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo " <tr class='border'>\n";
|
|
|
|
|
echo " <td align=\"left\">\n";
|
|
|
|
|
|
2014-07-17 21:04:20 +02:00
|
|
|
echo "<table width='100%' cellpadding='6' cellspacing='0'>\n";
|
2014-08-03 06:03:44 +02:00
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td width='30%' nowrap valign='top'><b>Advanced Search</b></td>\n";
|
|
|
|
|
echo " <td width='70%' align='right' valign='top'>";
|
|
|
|
|
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='xml_cdr.php'\" value='Back'>";
|
|
|
|
|
echo " <input type='submit' name='submit' class='btn' value='Search'>";
|
|
|
|
|
echo " <br /><br />";
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
echo "</table>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
|
2014-08-03 06:03:44 +02:00
|
|
|
echo "<table cellpadding='0' cellspacing='0' border='0' width='100%'>\n";
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td width='50%' style='vertical-align: top;'>\n";
|
2014-07-17 21:04:20 +02:00
|
|
|
|
2014-08-03 06:03:44 +02:00
|
|
|
echo "<table width='100%' cellpadding='6' cellspacing='0'>\n";
|
2014-07-17 21:04:20 +02:00
|
|
|
echo " <tr>\n";
|
2014-08-03 06:03:44 +02:00
|
|
|
echo " <td width='30%' class='vncell' valign='top' nowrap='nowrap'>\n";
|
2014-07-17 21:04:20 +02:00
|
|
|
echo " ".$text['label-direction']."\n";
|
|
|
|
|
echo " </td>\n";
|
2014-08-03 06:03:44 +02:00
|
|
|
echo " <td width='70%' class='vtable' align='left'>\n";
|
2014-07-17 21:04:20 +02:00
|
|
|
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";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " <option value='inbound'>".$text['label-inbound']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
if ($direction == "outbound") {
|
|
|
|
|
echo " <option value='outbound' selected='selected'>".$text['label-outbound']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " <option value='outbound'>".$text['label-outbound']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
if ($direction == "local") {
|
|
|
|
|
echo " <option value='local' selected='selected'>".$text['label-local']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " <option value='local'>".$text['label-local']."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
echo " </select>\n";
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
echo " <tr>";
|
|
|
|
|
echo " <td class='vncell'>".$text['label-caller_id_name']."</td>"; //source name
|
|
|
|
|
echo " <td class='vtable'><input type='text' class='formfld' name='caller_id_name' value='$caller_id_name'></td>";
|
|
|
|
|
echo " </tr>";
|
|
|
|
|
echo " <tr>";
|
|
|
|
|
echo " <td class='vncell'>".$text['label-caller_id_number']."</td>"; //source number
|
2014-08-03 06:03:44 +02:00
|
|
|
echo " <td class='vtable'>";
|
|
|
|
|
echo " <select class='formfld' name='caller_extension_uuid' id='caller_extension_uuid'>\n";
|
|
|
|
|
echo " <option value=''></option>";
|
|
|
|
|
$sql = "select extension_uuid, extension, number_alias from v_extensions ";
|
|
|
|
|
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
|
|
|
|
$sql .= "order by ";
|
|
|
|
|
$sql .= "extension asc ";
|
|
|
|
|
$sql .= ", number_alias asc ";
|
|
|
|
|
$prep_statement = $db->prepare(check_sql($sql));
|
|
|
|
|
$prep_statement -> execute();
|
|
|
|
|
$result_e = $prep_statement -> fetchAll(PDO::FETCH_NAMED);
|
|
|
|
|
foreach ($result_e as &$row) {
|
|
|
|
|
$selected = ($row['extension_uuid'] == $caller_extension_uuid) ? "selected" : null;
|
|
|
|
|
echo " <option value='".$row['extension_uuid']."' ".$selected.">".((is_numeric($row['extension'])) ? $row['extension'] : $row['number_alias']." (".$row['extension'].")")."</option>";
|
|
|
|
|
}
|
|
|
|
|
unset ($prep_statement);
|
|
|
|
|
echo " </select>\n";
|
|
|
|
|
echo " <input type='text' class='formfld' style='display: none;' name='caller_id_number' id='caller_id_number' value='".$caller_id_number."'>\n";
|
2014-08-03 07:23:44 +02:00
|
|
|
echo " <input type='button' id='btn_toggle_source' class='btn' name='' alt='".$text['button-back']."' value='⨞' onclick=\"toggle('source');\">\n";
|
2014-08-03 06:03:44 +02:00
|
|
|
echo " </td>";
|
2014-07-17 21:04:20 +02:00
|
|
|
echo " </tr>";
|
|
|
|
|
echo " <tr>";
|
|
|
|
|
echo " <td class='vncell'>".$text['label-destination']."</td>";
|
|
|
|
|
echo " <td class='vtable'><input type='text' class='formfld' name='destination_number' value='$destination_number'></td>";
|
|
|
|
|
echo " </tr>";
|
|
|
|
|
echo " <tr>";
|
|
|
|
|
echo " <td class='vncell'>".$text['label-context']."</td>";
|
|
|
|
|
echo " <td class='vtable'><input type='text' class='formfld' name='context' value='$context'></td>";
|
|
|
|
|
echo " </tr>";
|
|
|
|
|
echo " <tr>";
|
2014-08-02 12:57:02 +02:00
|
|
|
echo " <td class='vncell'>".$text['label-start_range']."</td>";
|
|
|
|
|
echo " <td class='vtable'>";
|
2014-08-03 07:23:44 +02:00
|
|
|
echo " <input type='text' class='formfld' style='min-width: 115px; width: 115px;' name='start_stamp_begin' data-calendar=\"{format: '%Y-%m-%d %H:%M', listYears: true, hideOnPick: false, fxName: null, showButtons: true}\" placeholder='".$text['label-from']."' value='$start_stamp_begin'>";
|
|
|
|
|
echo " <input type='text' class='formfld' style='min-width: 115px; width: 115px;' name='start_stamp_end' data-calendar=\"{format: '%Y-%m-%d %H:%M', listYears: true, hideOnPick: false, fxName: null, showButtons: true}\" placeholder='".$text['label-to']."' value='$start_stamp_end'>";
|
2014-08-02 12:57:02 +02:00
|
|
|
echo " </td>";
|
2014-07-17 21:04:20 +02:00
|
|
|
echo " </tr>";
|
|
|
|
|
echo " <tr>";
|
2014-08-02 12:57:02 +02:00
|
|
|
echo " <td class='vncell'>".$text['label-answer_range']."</td>";
|
|
|
|
|
echo " <td class='vtable'>";
|
2014-08-03 07:23:44 +02:00
|
|
|
echo " <input type='text' class='formfld' style='min-width: 115px; width: 115px;' name='answer_stamp_begin' data-calendar=\"{format: '%Y-%m-%d %H:%M', listYears: true, hideOnPick: false, fxName: null, showButtons: true}\" placeholder='".$text['label-from']."' value='$answer_stamp_begin'>";
|
|
|
|
|
echo " <input type='text' class='formfld' style='min-width: 115px; width: 115px;' name='answer_stamp_end' data-calendar=\"{format: '%Y-%m-%d %H:%M', listYears: true, hideOnPick: false, fxName: null, showButtons: true}\" placeholder='".$text['label-to']."' value='$answer_stamp_end'>";
|
2014-08-02 12:57:02 +02:00
|
|
|
echo " </td>";
|
2014-07-17 21:04:20 +02:00
|
|
|
echo " </tr>";
|
|
|
|
|
echo " <tr>";
|
2014-08-02 12:57:02 +02:00
|
|
|
echo " <td class='vncell'>".$text['label-end_range']."</td>";
|
|
|
|
|
echo " <td class='vtable'>";
|
2014-08-03 07:23:44 +02:00
|
|
|
echo " <input type='text' class='formfld' style='min-width: 115px; width: 115px;' name='end_stamp_begin' data-calendar=\"{format: '%Y-%m-%d %H:%M', listYears: true, hideOnPick: false, fxName: null, showButtons: true}\" placeholder='".$text['label-from']."' value='$end_stamp_begin'>";
|
|
|
|
|
echo " <input type='text' class='formfld' style='min-width: 115px; width: 115px;' name='end_stamp_end' data-calendar=\"{format: '%Y-%m-%d %H:%M', listYears: true, hideOnPick: false, fxName: null, showButtons: true}\" placeholder='".$text['label-to']."' value='$end_stamp_end'>";
|
2014-08-02 12:57:02 +02:00
|
|
|
echo " </td>";
|
2014-07-17 21:04:20 +02:00
|
|
|
echo " </tr>";
|
|
|
|
|
echo " <tr>";
|
|
|
|
|
echo " <td class='vncell'>".$text['label-duration']."</td>";
|
|
|
|
|
echo " <td class='vtable'><input type='text' class='formfld' name='duration' value='$duration'></td>";
|
|
|
|
|
echo " </tr>";
|
2014-08-03 06:03:44 +02:00
|
|
|
echo "</table>";
|
|
|
|
|
|
|
|
|
|
echo " </td>";
|
|
|
|
|
echo " <td width='50%' style='vertical-align: top;'>\n";
|
|
|
|
|
|
|
|
|
|
echo "<table width='100%' cellpadding='6' cellspacing='0'>\n";
|
2014-07-17 21:04:20 +02:00
|
|
|
echo " <tr>";
|
2014-08-03 06:03:44 +02:00
|
|
|
echo " <td width='30%' class='vncell'>".$text['label-billsec']."</td>";
|
|
|
|
|
echo " <td width='70%' class='vtable'><input type='text' class='formfld' name='billsec' value='$billsec'></td>";
|
2014-07-17 21:04:20 +02:00
|
|
|
echo " </tr>";
|
|
|
|
|
echo " <tr>";
|
|
|
|
|
echo " <td class='vncell'>".$text['label-hangup_cause']."</td>";
|
|
|
|
|
echo " <td class='vtable'><input type='text' class='formfld' name='hangup_cause' value='$hangup_cause'></td>";
|
|
|
|
|
echo " </tr>";
|
|
|
|
|
echo " <tr>";
|
|
|
|
|
echo " <td class='vncell'>".$text['label-uuid']."</td>";
|
|
|
|
|
echo " <td class='vtable'><input type='text' class='formfld' name='uuid' value='$uuid'></td>";
|
|
|
|
|
echo " </tr>";
|
|
|
|
|
echo " <tr>";
|
|
|
|
|
echo " <td class='vncell'>".$text['label-bridge_uuid']."</td>";
|
|
|
|
|
echo " <td class='vtable'><input type='text' class='formfld' name='bleg_uuid' value='$bridge_uuid'></td>";
|
|
|
|
|
echo " </tr>";
|
|
|
|
|
echo " <tr>";
|
|
|
|
|
echo " <td class='vncell'>".$text['label-accountcode']."</td>";
|
|
|
|
|
echo " <td class='vtable'><input type='text' class='formfld' name='accountcode' value='$accountcode'></td>";
|
|
|
|
|
echo " </tr>";
|
|
|
|
|
echo " <tr>";
|
|
|
|
|
echo " <td class='vncell'>".$text['label-read_codec']."</td>";
|
|
|
|
|
echo " <td class='vtable'><input type='text' class='formfld' name='read_codec' value='$read_codec'></td>";
|
|
|
|
|
echo " </tr>";
|
|
|
|
|
echo " <tr>";
|
|
|
|
|
echo " <td class='vncell'>".$text['label-write_codec']."</td>";
|
|
|
|
|
echo " <td class='vtable'><input type='text' class='formfld' name='write_codec' value='$write_codec'></td>";
|
|
|
|
|
echo " </tr>";
|
|
|
|
|
echo " <tr>";
|
|
|
|
|
echo " <td class='vncell'>".$text['label-remote_media_ip']."</td>";
|
|
|
|
|
echo " <td class='vtable'><input type='text' class='formfld' name='remote_media_ip' value='$remote_media_ip'></td>";
|
|
|
|
|
echo " </tr>";
|
|
|
|
|
echo " <tr>";
|
|
|
|
|
echo " <td class='vncell'>".$text['label-network_addr']."</td>";
|
|
|
|
|
echo " <td class='vtable'><input type='text' class='formfld' name='network_addr' value='$network_addr'></td>";
|
|
|
|
|
echo " </tr>";
|
|
|
|
|
echo " <tr>";
|
|
|
|
|
echo " <td colspan='2' align='right'><input type='submit' name='submit' class='btn' value='".$text['button-search']."'></td>";
|
|
|
|
|
echo " </tr>";
|
|
|
|
|
echo "</table>";
|
2012-06-04 16:58:40 +02:00
|
|
|
|
2014-08-03 06:03:44 +02:00
|
|
|
echo " </td>";
|
|
|
|
|
echo " </tr>";
|
|
|
|
|
echo "</table>";
|
|
|
|
|
|
|
|
|
|
echo " </td>";
|
2014-07-17 21:04:20 +02:00
|
|
|
echo " </tr>";
|
|
|
|
|
echo "</table>";
|
2014-08-03 06:03:44 +02:00
|
|
|
echo "</form>";
|
2014-07-17 21:04:20 +02:00
|
|
|
echo "</div>";
|
2012-06-04 16:58:40 +02:00
|
|
|
|
2014-07-17 21:04:20 +02:00
|
|
|
require_once "resources/footer.php";
|
2012-06-04 16:58:40 +02:00
|
|
|
|
2014-07-17 21:04:20 +02:00
|
|
|
?>
|