Changeset 10726
- Timestamp:
- 12/24/10 06:05:27 (2 years ago)
- Files:
-
- freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/call-comp.php (modified) (2 diffs)
- freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/call-daily-load.php (modified) (1 diff)
- freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/call-last-month.php (modified) (2 diffs)
- freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/call-log.php (modified) (2 diffs)
- freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/cdr.php (modified) (5 diffs)
- freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/common/graph_hourdetail.php (modified) (1 diff)
- freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/common/graph_pie.php (modified) (1 diff)
- freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/common/graph_stat.php (modified) (1 diff)
- freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/common/graph_statbar.php (modified) (1 diff)
- freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/export_csv.php (modified) (1 diff)
- freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/export_pdf.php (modified) (1 diff)
- freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/lib/Class.Table.php (modified) (13 diffs)
- freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/lib/defines.php (modified) (1 diff)
- freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/lib/fpdf.php (modified) (1 diff)
- freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/lib/iam_csvdump.php (modified) (2 diffs)
- freepbx/branches/bootstrap/amp_conf/htdocs/admin/reports.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/call-comp.php
r10717 r10726 38 38 39 39 //$link = DbConnect(); 40 $DBHandle = D BHandle();40 $DBHandle = DbConnect(); 41 41 42 42 // The variable Var_col would define the col that we want show in your table … … 48 48 Calldate Clid Src Dst Dcontext Channel Dstchannel Lastapp Lastdata Duration Billsec Disposition Amaflags Accountcode Uniqueid Serverid 49 49 *******/ 50 if (! @include($amp_conf['ASTETCDIR'].'/call-comp-table.php')) {50 if (!file_exists($amp_conf['ASTETCDIR'].'/call-log-table.php') || !@include($amp_conf['ASTETCDIR'].'/call-log-table.php')) { 51 51 52 52 $FG_TABLE_COL[]=array ("Calldate", "calldate", "18%", "center", "SORT", "19"); freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/call-daily-load.php
r10717 r10726 38 38 39 39 //$link = DbConnect(); 40 $DBHandle = D BHandle();40 $DBHandle = DbConnect(); 41 41 42 42 $FG_TABLE_COL = array(); 43 43 44 if (! @include($amp_conf['ASTETCDIR'].'/call-daily-load-table.php')) {44 if (!file_exists($amp_conf['ASTETCDIR'].'/call-log-table.php') || !@include($amp_conf['ASTETCDIR'].'/call-log-table.php')) { 45 45 // The variable Var_col would define the col that we want show in your table 46 46 // First Name of the column in the html page, second name of the field freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/call-last-month.php
r10717 r10726 38 38 39 39 //$link = DbConnect(); 40 $DBHandle = D BHandle();40 $DBHandle = DbConnect(); 41 41 42 42 // The variable Var_col would define the col that we want show in your table … … 48 48 *******/ 49 49 50 if (! @include($amp_conf['ASTETCDIR'].'/call-last-month-table.php')) {50 if (!file_exists($amp_conf['ASTETCDIR'].'/call-log-table.php') || !@include($amp_conf['ASTETCDIR'].'/call-log-table.php')) { 51 51 52 52 $FG_TABLE_COL[]=array ("Calldate", "calldate", "18%", "center", "SORT", "19"); freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/call-log.php
r10717 r10726 83 83 84 84 /* --AMP Begin-- */ 85 if (! @include($amp_conf['ASTETCDIR'].'/call-log-table.php')) {85 if (!file_exists($amp_conf['ASTETCDIR'].'/call-log-table.php') || !@include($amp_conf['ASTETCDIR'].'/call-log-table.php')) { 86 86 87 87 $FG_TABLE_COL[]=array ("Calldate", "calldate", "18%", "center", "SORT", "19"); … … 266 266 /* --AMP BEGIN-- */ 267 267 //enforce restrictions for this AMP User 268 @session_start(); 268 if(!isset($_SESSION)) { 269 @session_start(); 270 } 271 269 272 $AMP_CLAUSE = $_SESSION['AMP_SQL']; 270 273 if (!isset($AMP_CLAUSE)) { freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/cdr.php
r10717 r10726 4 4 5 5 /* -- AMP Begin -- */ 6 /* 6 7 $low = $_SESSION["AMP_user"]->_extension_low; 8 $high = $_SESSION["AMP_user"]->_extension_high; 9 if ((!empty($low)) && (!empty($high))) { 10 $channelfilter="OR (FIELD( SUBSTRING_INDEX( channel, '/', 1 ) , 'SIP', 'IAX2' ) > 0 AND SUBSTRING_INDEX(SUBSTRING(channel,2+LENGTH(SUBSTRING_INDEX( channel, '/', 1 ))),'-',1) BETWEEN $low and $high)"; 11 $channelfilter.="OR (dstchannel<>'' AND FIELD( SUBSTRING_INDEX( dstchannel, '/', 1 ) , 'SIP', 'IAX2' ) > 0 AND SUBSTRING_INDEX(SUBSTRING(dstchannel,2+LENGTH(SUBSTRING_INDEX( dstchannel, '/', 1 ))),'-',1) BETWEEN $low and $high)"; 12 13 $_SESSION["AMP_SQL"] = " AND ((src+0 BETWEEN $low AND $high) OR (dst+0 BETWEEN $low AND $high) OR (dst+0 BETWEEN 8$low AND 8$high) $channelfilter)"; 14 } else { 15 $_SESSION["AMP_SQL"] = ""; 16 } 17 7 18 $AMP_CLAUSE = $_SESSION['AMP_SQL']; 8 19 if (!isset($AMP_CLAUSE)) { … … 10 21 echo "<font color=red>YOU MUST ACCESS THE CDR THROUGH THE ASTERISK MANAGEMENT PORTAL!</font>"; 11 22 } 12 */ 23 13 24 //echo 'AMP_CLAUSE='.$AMP_CLAUSE.'<hr>'; 14 25 /* -- AMP End -- */ … … 30 41 } 31 42 32 33 34 43 cdrpage_getpost_ifset(array('s', 't')); 35 44 45 $get_vars = array( 46 'accountcode', 47 'accountcodetype', 48 'after', 49 'atmenu', 50 'before', 51 'channel', 52 'clid', 53 'clidtype', 54 'duration1', 55 'duration1type', 56 'duration2', 57 'duration2type', 58 'dst', 59 'dsttype', 60 'fromday', 61 'frommonth', 62 'fromstatsday_sday', 63 'fromstatsmonth', 64 'fromstatsmonth_sday', 65 'letter', 66 'list', 67 'list_total', 68 'list_total_day', 69 'min_call', 70 'name', 71 'nb_record', 72 'order', 73 'posted', 74 'resulttype', 75 's', 76 'sens', 77 'sql_limit', 78 'src', 79 'srctype', 80 'stitle', 81 't', 82 'today', 83 'tomonth', 84 'tostatsday_sday', 85 'tostatsmonth_sday', 86 'tostatsmonth', 87 'totalcall', 88 'userfield', 89 'userfieldtype', 90 'AMP_SQL', 91 'FG_ACTION_SIZE_COLUMN', 92 'FG_DELETION', 93 'Period', 94 'SQLcmd', 95 ); 36 96 97 foreach ($get_vars as $gv) { 98 if (!isset($$gv) || !$$gv) { 99 $$gv = isset($_REQUEST[$gv]) ? $_REQUEST[$gv] : ''; 100 } 101 } 37 102 $array = array ("INTRO", "CDR REPORT", "CALLS COMPARE", "MONTHLY TRAFFIC","DAILY LOAD", "CONTACT"); 38 103 $s = $s ? $s : 1; … … 68 133 <?php if ($section=="section0"){?> 69 134 70 <h1>71 <center>ASTERISK : CDR ANALYSER</center>72 </h1>73 <h3>Call data collection</h3>74 <p>Regardless of their size, most telephone PBX (public branch exchange) and PMS (property management systems)75 output <b>Call Detail Records (CDR)</b>. Generally, these get created at the end of a call but on some phone systems76 the data is available during the call. This data is output from the phone system by a serial link known as the77 Station Message Detail Recording port (SMDR). <b>Some of the details included in call records are: Time, Date, Call78 Duration, Number dialed, Caller ID information, Extension, Line/trunk location, Cost, Call completion status.</b><br>79 <br>80 Call detail records, both local and long distance, can be used for usage verification, billing reconciliation,81 network management and to monitor telephone usage to determine volume of phone usage, as well as abuse of the system.82 CDR's aid in the planning for future telecommunications needs. <br>83 <br>84 Control with CDR analysis:85 <ul>86 87 <li>review all CDR's for accuracy88 <li>verify usage89 <li>resolve discrepancies with vendors90 <li>disconnect unused service91 <li>terminate leases on unused equipment92 <li>deter or detect fraud93 <li>etc ...94 </ul>95 96 135 <?php }elseif ($section=="section1"){?> 97 136 98 137 <?php require("call-log.php");?> 99 138 100 101 139 <?php }elseif ($section=="section2"){?> 102 140 103 141 <?php require("call-comp.php");?> 104 105 142 106 143 <?php }elseif ($section=="section3"){?> … … 111 148 112 149 <?php require("call-daily-load.php");?> 113 114 115 <?php }elseif ($section=="section5"){?>116 <h1>Contact</h1>117 <table width="90%">118 119 <tr>120 <td>121 <h3>Arezqui Belaïd <br> <i>Barcelona - Belgium</i></h3>122 <br>123 <a href='javascript:bite("3721 945 4728 2762 3565 3554 2008 1380 654 3721 3554 4468 3007 3877 4828 654",5123,2981)'>Click to email me</a>124 <br><br><i>Feel free to send me your suggestions to improve the application ;)</i>125 </td>126 </tr>127 128 </table>129 <br><br><em><strong>Last update:</strong></em> <?php echo $update?><br>130 131 150 132 151 <?php }else{?> freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/common/graph_hourdetail.php
r10243 r10726 1 1 <?php /* $Id: graph_hourdetail.php 6816 2008-09-19 18:33:18Z p_lindheimer $ */ 2 if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); } 2 3 include_once(dirname(__FILE__) . "/../lib/defines.php"); 3 4 include_once(dirname(__FILE__) . "/../lib/Class.Table.php"); freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/common/graph_pie.php
r10243 r10726 1 1 <?php /* $Id: graph_pie.php 6816 2008-09-19 18:33:18Z p_lindheimer $ */ 2 if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); } 2 3 include_once(dirname(__FILE__) . "/../lib/defines.php"); 3 4 include_once(dirname(__FILE__) . "/../lib/Class.Table.php"); freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/common/graph_stat.php
r10243 r10726 1 1 <?php 2 if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); } 2 3 include_once(dirname(__FILE__) . "/../lib/defines.php"); 3 4 include_once(dirname(__FILE__) . "/../lib/Class.Table.php"); freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/common/graph_statbar.php
r10243 r10726 1 1 <?php /* $Id: graph_statbar.php 6816 2008-09-19 18:33:18Z p_lindheimer $ */ 2 if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); } 2 3 include_once(dirname(__FILE__) . "/../lib/defines.php"); 3 4 include_once(dirname(__FILE__) . "/../lib/Class.Table.php"); freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/export_csv.php
r173 r10726 1 1 <?php 2 if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); } 2 3 include_once(dirname(__FILE__) . "/lib/defines.php"); 3 4 include_once(dirname(__FILE__) . "/lib/Class.Table.php"); freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/export_pdf.php
r188 r10726 1 1 <?php 2 if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); } 2 3 include_once(dirname(__FILE__) . "/lib/defines.php"); 3 4 include_once(dirname(__FILE__) . "/lib/Class.Table.php"); freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/lib/Class.Table.php
r6002 r10726 1 1 <?php 2 2 if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); } 3 3 class Table { 4 4 … … 16 16 $this -> table = $table; 17 17 $this -> fields = $liste_fields; 18 $this->db = DbConnect(); 18 19 19 20 } … … 39 40 40 41 function Get_list ($clause=null, $order=null, $sens=null, $field_order_letter=null, $letters = null, $limite=null, $current_record=NULL) { 41 //global $link;42 global $DBHandle;43 44 45 42 $sql = 'SELECT '.$this -> fields.' FROM '.trim($this -> table); 46 43 … … 78 75 $QUERY = $sql.$sql_clause.$sql_orderby.$sql_limit; 79 76 if ($this -> debug_st) echo "<br>QUERY:".$QUERY; 80 81 //$res=DbExec($link, $QUERY); 82 $res = $DBHandle -> query($QUERY); 77 78 $res = $this->db->query($QUERY); 83 79 if(DB::isError($res)) 84 80 { … … 108 104 109 105 function Table_count ($clause=null) { 110 //global $link;111 global $DBHandle;112 113 114 106 $sql = 'SELECT count(*) FROM '.trim($this -> table); 115 107 … … 124 116 //echo $sql; 125 117 126 if ($this -> debug_st) echo "<br>QUERY:".$QUERY; 127 //$res=DbExec($link, $QUERY); 128 $res = $DBHandle -> query($QUERY); 118 if ($this -> debug_st) echo "<br>QUERY:".$QUERY; 119 $res = $this->db->query($QUERY); 129 120 130 121 /////$num=DbCount($res); … … 143 134 144 135 function Add_table ($value, $func_fields = null, $func_table = null, $id_name = null) { 145 //global $link;146 global $DBHandle;147 148 136 if ($func_fields!=""){ 149 137 $this -> fields = $func_fields; … … 158 146 if ($this -> debug_st) echo "<br>QUERY:".$QUERY; 159 147 160 $res = $DBHandle ->query($QUERY);148 $res = dbquery($QUERY); 161 149 162 150 if (DB::isError($res)){ 163 151 //if (! $res=DbExec($link, $QUERY)) { 164 152 //$this -> errstr = "Could not create a new instance in the table '".$this -> table."'"; 165 $this -> errstr = $ DBHandle ->getMessage();153 $this -> errstr = $this->db->getMessage(); 166 154 167 155 … … 177 165 $sql = 'SELECT "'.$id_name.'" FROM "'.$this -> table.'" WHERE oid=\''.$oid.'\''; 178 166 179 if (! $res = $ DBHandle ->query($sql)) return (false);167 if (! $res = $this->db->query($sql)) return (false); 180 168 181 169 $row [] =$res -> fetchRow(); … … 189 177 190 178 function Update_table ($param_update, $clause, $func_table = null) { 191 //global $link;192 global $DBHandle;193 194 179 if ($param_update=="" || $clause==""){ 195 180 echo "<br>Update parameters wasn't correctly defined.<br>Check the function call 'Update_table'."; … … 206 191 207 192 208 if (! $res = $ DBHandle ->query($QUERY)){193 if (! $res = $this->db->query($QUERY)){ 209 194 //if (! $res=DbExec($link, $QUERY)) { 210 195 $this -> errstr = "Could not update the instances of the table '".$this -> table."'"; … … 218 203 219 204 function Delete_table ($clause, $func_table = null) { 220 //global $link;221 global $DBHandle;222 223 205 if ($clause==""){ 224 206 echo "<br>Delete parameters wasn't correctly defined.<br>Check the function call 'Update_table'."; … … 234 216 if ($this -> debug_st) echo "<br>QUERY:".$QUERY; 235 217 236 if (! $res = $ DBHandle ->query($QUERY)){218 if (! $res = $this->db->query($QUERY)){ 237 219 //if (! $res=DbExec($link, $QUERY)) { 238 220 $this -> errstr = "Could not delete the instances of the table '".$this -> table."'"; freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/lib/defines.php
r10717 r10726 1 1 <?php /* $Id$ */ 2 2 if (!@include_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.conf')) { 3 include_once('/etc/asterisk/freepbx.conf'); 4 } 5 if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); } 3 6 require_once('DB.php'); // PEAR 4 7 freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/lib/fpdf.php
r173 r10726 9 9 * Vous pouvez utiliser et modifier ce logiciel comme vous le souhaitez. * 10 10 *******************************************************************************/ 11 11 if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); } 12 12 if(!class_exists('FPDF')) 13 13 { freepbx/branches/bootstrap/amp_conf/htdocs/admin/cdr/lib/iam_csvdump.php
r173 r10726 1 1 <?php 2 2 if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); } 3 3 /** 4 4 * IAM_CSVDump A class form performing a query dump and sending it to the browser or setting it or download. … … 8 8 /** 9 9 * IAM_CSVDump A class form performing a query dump and sending it to the browser or setting it or download. 10 * @author Iv án Ariel Melgrati <phpclasses@imelgrat.mailshell.com>10 * @author Iván Ariel Melgrati <phpclasses@imelgrat.mailshell.com> 11 11 * @package iam_csvdump 12 12 * @version 1.0 freepbx/branches/bootstrap/amp_conf/htdocs/admin/reports.php
r10671 r10726 12 12 //GNU General Public License for more details. 13 13 $restrict_mods = true; 14 require_once('bootstrap.php'); 14 if (!@include_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.conf')) { 15 include_once('/etc/asterisk/freepbx.conf'); 16 } 15 17 if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); } 16 18 $quietmode = isset($_REQUEST['quietmode'])?$_REQUEST['quietmode']:'';
