| 1 |
<?php |
|---|
| 2 |
include_once(dirname(__FILE__) . "/lib/defines.php"); |
|---|
| 3 |
include_once(dirname(__FILE__) . "/lib/Class.Table.php"); |
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
getpost_ifset(array('posted', 'Period', 'frommonth', 'fromstatsmonth', 'tomonth', 'tostatsmonth', 'fromday', 'fromstatsday_sday', 'fromstatsmonth_sday', 'today', 'tostatsday_sday', 'tostatsmonth_sday', 'dsttype', 'sourcetype', 'clidtype', 'channel', 'resulttype', 'stitle', 'atmenu', 'current_page', 'order', 'sens', 'dst', 'src', 'clid', 'userfieldtype', 'userfield', 'accountcodetype', 'accountcode', 'duration1', 'duration1type', 'duration2', 'duration2type')); |
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
if (!isset ($current_page) || ($current_page == "")){ |
|---|
| 16 |
$current_page=0; |
|---|
| 17 |
} |
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
$FG_DEBUG = 0; |
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
$FG_TABLE_NAME=DB_TABLENAME; |
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
$FG_TABLE_HEAD_COLOR = "#D1D9E7"; |
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
$FG_TABLE_EXTERN_COLOR = "#7F99CC"; |
|---|
| 33 |
$FG_TABLE_INTERN_COLOR = "#EDF3FF"; |
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
// THIS VARIABLE DEFINE THE COLOR OF THE HEAD TABLE |
|---|
| 39 |
$FG_TABLE_ALTERNATE_ROW_COLOR[] = "#FFFFFF"; |
|---|
| 40 |
$FG_TABLE_ALTERNATE_ROW_COLOR[] = "#F2F8FF"; |
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
$DBHandle = DbConnect(); |
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
$FG_TABLE_COL = array(); |
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 |
|
|---|
| 57 |
|
|---|
| 58 |
|
|---|
| 59 |
|
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 |
|
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 72 |
|
|---|
| 73 |
|
|---|
| 74 |
|
|---|
| 75 |
|
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 |
|
|---|
| 79 |
|
|---|
| 80 |
|
|---|
| 81 |
|
|---|
| 82 |
|
|---|
| 83 |
|
|---|
| 84 |
|
|---|
| 85 |
|
|---|
| 86 |
$FG_TABLE_COL[]=array ("Calldate", "calldate", "18%", "center", "SORT", "19"); |
|---|
| 87 |
$FG_TABLE_COL[]=array ("Channel", "channel", "13%", "center", "", "30", "", "", "", "", "", "display_acronym"); |
|---|
| 88 |
$FG_TABLE_COL[]=array ("Source", "src", "14%", "center", "", "30"); |
|---|
| 89 |
$FG_TABLE_COL[]=array ("Clid", "clid", "26%", "center", "", "80"); |
|---|
| 90 |
|
|---|
| 91 |
$FG_TABLE_COL[]=array ("Dst", "dst", "14%", "center", "SORT", "30"); |
|---|
| 92 |
|
|---|
| 93 |
$FG_TABLE_COL[]=array ("Disposition", "disposition", "9%", "center", "", "30"); |
|---|
| 94 |
if ((!isset($resulttype)) || ($resulttype=="min")) $minute_function= "display_minute"; |
|---|
| 95 |
$FG_TABLE_COL[]=array ("Duration", "duration", "6%", "center", "SORT", "30", "", "", "", "", "", "$minute_function"); |
|---|
| 96 |
|
|---|
| 97 |
$FG_TABLE_DEFAULT_ORDER = "calldate"; |
|---|
| 98 |
$FG_TABLE_DEFAULT_SENS = "DESC"; |
|---|
| 99 |
|
|---|
| 100 |
|
|---|
| 101 |
|
|---|
| 102 |
|
|---|
| 103 |
$FG_COL_QUERY='calldate, channel, src, clid, dst, disposition, duration'; |
|---|
| 104 |
|
|---|
| 105 |
|
|---|
| 106 |
|
|---|
| 107 |
|
|---|
| 108 |
$FG_COL_QUERY_GRAPH='calldate, duration'; |
|---|
| 109 |
|
|---|
| 110 |
|
|---|
| 111 |
$FG_LIMITE_DISPLAY=25; |
|---|
| 112 |
|
|---|
| 113 |
|
|---|
| 114 |
$FG_NB_TABLE_COL=count($FG_TABLE_COL); |
|---|
| 115 |
|
|---|
| 116 |
|
|---|
| 117 |
$FG_EDITION=true; |
|---|
| 118 |
|
|---|
| 119 |
|
|---|
| 120 |
$FG_TOTAL_TABLE_COL = $FG_NB_TABLE_COL; |
|---|
| 121 |
if ($FG_DELETION || $FG_EDITION) $FG_TOTAL_TABLE_COL++; |
|---|
| 122 |
|
|---|
| 123 |
|
|---|
| 124 |
$FG_HTML_TABLE_TITLE=" - Call Logs - "; |
|---|
| 125 |
|
|---|
| 126 |
|
|---|
| 127 |
$FG_HTML_TABLE_WIDTH="100%"; |
|---|
| 128 |
|
|---|
| 129 |
|
|---|
| 130 |
|
|---|
| 131 |
|
|---|
| 132 |
if ($FG_DEBUG == 3) echo "<br>Table : $FG_TABLE_NAME - Col_query : $FG_COL_QUERY"; |
|---|
| 133 |
$instance_table = new Table($FG_TABLE_NAME, $FG_COL_QUERY); |
|---|
| 134 |
$instance_table_graph = new Table($FG_TABLE_NAME, $FG_COL_QUERY_GRAPH); |
|---|
| 135 |
|
|---|
| 136 |
|
|---|
| 137 |
if ( is_null ($order) || is_null($sens) ){ |
|---|
| 138 |
$order = $FG_TABLE_DEFAULT_ORDER; |
|---|
| 139 |
$sens = $FG_TABLE_DEFAULT_SENS; |
|---|
| 140 |
} |
|---|
| 141 |
|
|---|
| 142 |
if ($posted==1){ |
|---|
| 143 |
|
|---|
| 144 |
function do_field_duration($sql,$fld, $fldsql){ |
|---|
| 145 |
$fldtype = $fld.'type'; |
|---|
| 146 |
global $$fld; |
|---|
| 147 |
global $$fldtype; |
|---|
| 148 |
if (isset($$fld) && ($$fld!='')){ |
|---|
| 149 |
if (strpos($sql,'WHERE') > 0){ |
|---|
| 150 |
$sql = "$sql AND "; |
|---|
| 151 |
}else{ |
|---|
| 152 |
$sql = "$sql WHERE "; |
|---|
| 153 |
} |
|---|
| 154 |
$sql = "$sql $fldsql"; |
|---|
| 155 |
if (isset ($$fldtype)){ |
|---|
| 156 |
switch ($$fldtype) { |
|---|
| 157 |
case 1: $sql = "$sql ='".$$fld."'"; break; |
|---|
| 158 |
case 2: $sql = "$sql <= '".$$fld."'"; break; |
|---|
| 159 |
case 3: $sql = "$sql < '".$$fld."'"; break; |
|---|
| 160 |
case 4: $sql = "$sql > '".$$fld."'"; break; |
|---|
| 161 |
case 5: $sql = "$sql >= '".$$fld."'"; break; |
|---|
| 162 |
} |
|---|
| 163 |
}else{ $sql = "$sql = '".$$fld."'"; } |
|---|
| 164 |
} |
|---|
| 165 |
return $sql; |
|---|
| 166 |
} |
|---|
| 167 |
|
|---|
| 168 |
function do_field($sql,$fld){ |
|---|
| 169 |
$fldtype = $fld.'type'; |
|---|
| 170 |
global $$fld; |
|---|
| 171 |
global $$fldtype; |
|---|
| 172 |
if (isset($$fld) && ($$fld!='')){ |
|---|
| 173 |
if (strpos($sql,'WHERE') > 0){ |
|---|
| 174 |
$sql = "$sql AND "; |
|---|
| 175 |
}else{ |
|---|
| 176 |
$sql = "$sql WHERE "; |
|---|
| 177 |
} |
|---|
| 178 |
$sql = "$sql $fld"; |
|---|
| 179 |
if (isset ($$fldtype)){ |
|---|
| 180 |
switch ($$fldtype) { |
|---|
| 181 |
case 1: $sql = "$sql='".$$fld."'"; break; |
|---|
| 182 |
case 2: $sql = "$sql LIKE '".$$fld."%'"; break; |
|---|
| 183 |
case 3: $sql = "$sql LIKE '%".$$fld."%'"; break; |
|---|
| 184 |
case 4: $sql = "$sql LIKE '%".$$fld."'"; |
|---|
| 185 |
} |
|---|
| 186 |
}else{ $sql = "$sql LIKE '%".$$fld."%'"; } |
|---|
| 187 |
} |
|---|
| 188 |
return $sql; |
|---|
| 189 |
} |
|---|
| 190 |
$SQLcmd = ''; |
|---|
| 191 |
|
|---|
| 192 |
$SQLcmd = do_field($SQLcmd, 'clid'); |
|---|
| 193 |
$SQLcmd = do_field($SQLcmd, 'src'); |
|---|
| 194 |
$SQLcmd = do_field($SQLcmd, 'dst'); |
|---|
| 195 |
$SQLcmd = do_field($SQLcmd, 'userfield'); |
|---|
| 196 |
$SQLcmd = do_field($SQLcmd, 'accountcode'); |
|---|
| 197 |
$SQLcmd = do_field($SQLcmd, 'channel'); |
|---|
| 198 |
$SQLcmd = do_field_duration($SQLcmd, 'duration1', 'duration'); |
|---|
| 199 |
$SQLcmd = do_field_duration($SQLcmd, 'duration2', 'duration'); |
|---|
| 200 |
|
|---|
| 201 |
|
|---|
| 202 |
|
|---|
| 203 |
} |
|---|
| 204 |
|
|---|
| 205 |
|
|---|
| 206 |
$date_clause=''; |
|---|
| 207 |
|
|---|
| 208 |
if (DB_TYPE == "postgres"){ |
|---|
| 209 |
$UNIX_TIMESTAMP = ""; |
|---|
| 210 |
}else{ |
|---|
| 211 |
$UNIX_TIMESTAMP = "UNIX_TIMESTAMP"; |
|---|
| 212 |
} |
|---|
| 213 |
|
|---|
| 214 |
if ($Period=="Month"){ |
|---|
| 215 |
if ($frommonth && isset($fromstatsmonth)) $date_clause.=" AND $UNIX_TIMESTAMP(calldate) >= $UNIX_TIMESTAMP('$fromstatsmonth-01')"; |
|---|
| 216 |
if ($tomonth && isset($tostatsmonth)) $date_clause.=" AND $UNIX_TIMESTAMP(calldate) <= $UNIX_TIMESTAMP('$tostatsmonth-31 23:59:59')"; |
|---|
| 217 |
}else{ |
|---|
| 218 |
if ($fromday && isset($fromstatsday_sday) && isset($fromstatsmonth_sday)) $date_clause.=" AND $UNIX_TIMESTAMP(calldate) >= $UNIX_TIMESTAMP('$fromstatsmonth_sday-$fromstatsday_sday')"; |
|---|
| 219 |
if ($today && isset($tostatsday_sday) && isset($tostatsmonth_sday)) $date_clause.=" AND $UNIX_TIMESTAMP(calldate) <= $UNIX_TIMESTAMP('$tostatsmonth_sday-".sprintf("%02d",intval($tostatsday_sday))." 23:59:59')"; |
|---|
| 220 |
} |
|---|
| 221 |
|
|---|
| 222 |
|
|---|
| 223 |
|
|---|
| 224 |
|
|---|
| 225 |
|
|---|
| 226 |
|
|---|
| 227 |
|
|---|
| 228 |
|
|---|
| 229 |
|
|---|
| 230 |
|
|---|
| 231 |
|
|---|
| 232 |
|
|---|
| 233 |
|
|---|
| 234 |
|
|---|
| 235 |
|
|---|
| 236 |
if (strpos($SQLcmd, 'WHERE') > 0) { |
|---|
| 237 |
$FG_TABLE_CLAUSE = substr($SQLcmd,6).$date_clause; |
|---|
| 238 |
}elseif (strpos($date_clause, 'AND') > 0){ |
|---|
| 239 |
$FG_TABLE_CLAUSE = substr($date_clause,5); |
|---|
| 240 |
} |
|---|
| 241 |
|
|---|
| 242 |
|
|---|
| 243 |
|
|---|
| 244 |
if (!isset ($FG_TABLE_CLAUSE) || strlen($FG_TABLE_CLAUSE)==0){ |
|---|
| 245 |
|
|---|
| 246 |
$cc_yearmonth = sprintf("%04d-%02d",date("Y"),date("n")); |
|---|
| 247 |
$FG_TABLE_CLAUSE=" $UNIX_TIMESTAMP(calldate) >= $UNIX_TIMESTAMP('$cc_yearmonth-01')"; |
|---|
| 248 |
} |
|---|
| 249 |
|
|---|
| 250 |
|
|---|
| 251 |
|
|---|
| 252 |
|
|---|
| 253 |
session_start(); |
|---|
| 254 |
$AMP_CLAUSE = $HTTP_SESSION_VARS['AMP_SQL']; |
|---|
| 255 |
if (!isset($AMP_CLAUSE)) { |
|---|
| 256 |
$AMP_CLAUSE = " AND src = 'NeverReturnAnything'"; |
|---|
| 257 |
} |
|---|
| 258 |
$FG_TABLE_CLAUSE .= $AMP_CLAUSE; |
|---|
| 259 |
|
|---|
| 260 |
|
|---|
| 261 |
|
|---|
| 262 |
|
|---|
| 263 |
if ($posted==1){ |
|---|
| 264 |
|
|---|
| 265 |
|
|---|
| 266 |
//enforce restrictions for this AMP User |
|---|
| 267 |
$FG_TABLE_CLAUSE .= $AMP_CLAUSE; |
|---|
| 268 |
|
|---|
| 269 |
|
|---|
| 270 |
//> function Get_list ($clause=null, $order=null, $sens=null, $field_order_letter=null, $letters = null, $limite=null, $current_record = NULL) |
|---|
| 271 |
$list = $instance_table -> Get_list ($FG_TABLE_CLAUSE, $order, $sens, null, null, $FG_LIMITE_DISPLAY, $current_page*$FG_LIMITE_DISPLAY); |
|---|
| 272 |
|
|---|
| 273 |
$_SESSION["pr_sql_export"]="SELECT $FG_COL_QUERY FROM $FG_TABLE_NAME WHERE $FG_TABLE_CLAUSE"; |
|---|
| 274 |
|
|---|
| 275 |
|
|---|
| 276 |
$QUERY = "SELECT substring(calldate,1,10) AS day, sum(duration) AS calltime, count(*) as nbcall FROM cdr WHERE ".$FG_TABLE_CLAUSE." GROUP BY substring(calldate,1,10)"; |
|---|
| 277 |
//echo "$QUERY"; |
|---|
| 278 |
|
|---|
| 279 |
|
|---|
| 280 |
$res = $DBHandle -> query($QUERY); |
|---|
| 281 |
$num = $res -> numRows(); |
|---|
| 282 |
for($i=0;$i<$num;$i++) |
|---|
| 283 |
{ |
|---|
| 284 |
$list_total_day [] = $res -> fetchRow(); |
|---|
| 285 |
} |
|---|
| 286 |
|
|---|
| 287 |
if ($FG_DEBUG == 3) echo "<br>Clause : $FG_TABLE_CLAUSE"; |
|---|
| 288 |
$nb_record = $instance_table -> Table_count ($FG_TABLE_CLAUSE); |
|---|
| 289 |
|
|---|
| 290 |
} |
|---|
| 291 |
|
|---|
| 292 |
|
|---|
| 293 |
if ($FG_DEBUG >= 1) var_dump ($list); |
|---|
| 294 |
|
|---|
| 295 |
|
|---|
| 296 |
if ($nb_record<=$FG_LIMITE_DISPLAY){ |
|---|
| 297 |
$nb_record_max=1; |
|---|
| 298 |
}else{ |
|---|
| 299 |
if ($nb_record % $FG_LIMITE_DISPLAY == 0){ |
|---|
| 300 |
$nb_record_max=(intval($nb_record/$FG_LIMITE_DISPLAY)); |
|---|
| 301 |
}else{ |
|---|
| 302 |
$nb_record_max=(intval($nb_record/$FG_LIMITE_DISPLAY)+1); |
|---|
| 303 |
} |
|---|
| 304 |
} |
|---|
| 305 |
|
|---|
| 306 |
|
|---|
| 307 |
if ($FG_DEBUG == 3) echo "<br>Nb_record : $nb_record"; |
|---|
| 308 |
if ($FG_DEBUG == 3) echo "<br>Nb_record_max : $nb_record_max"; |
|---|
| 309 |
|
|---|
| 310 |
?> |
|---|
| 311 |
|
|---|
| 312 |
<script language="JavaScript" type="text/JavaScript"> |
|---|
| 313 |
<!-- |
|---|
| 314 |
function MM_openBrWindow(theURL,winName,features) { //v2.0 |
|---|
| 315 |
window.open(theURL,winName,features); |
|---|
| 316 |
} |
|---|
| 317 |
|
|---|
| 318 |
//--> |
|---|
| 319 |
</script> |
|---|
| 320 |
|
|---|
| 321 |
|
|---|
| 322 |
|
|---|
| 323 |
<!-- ** ** ** ** ** Part for the research ** ** ** ** ** --> |
|---|
| 324 |
<center> |
|---|
| 325 |
<FORM METHOD=POST ACTION="<?php echo $_SERVER['PHP_SELF']?>?s=<?php echo $s?>&t=<?php echo $t?>&order=<?php echo $order?>&sens=<?php echo $sens?>¤t_page=<?php echo $current_page?>"> |
|---|
| 326 |
<INPUT TYPE="hidden" NAME="posted" value=1> |
|---|
| 327 |
<INPUT TYPE="hidden" NAME="current_page" value=0> |
|---|
| 328 |
<table class="bar-status" width="75%" border="0" cellspacing="1" cellpadding="2" align="center"> |
|---|
| 329 |
<tbody><tr> |
|---|
| 330 |
<td class="bar-search" align="left" bgcolor="#555577"> |
|---|
| 331 |
|
|---|
| 332 |
<input type="radio" name="Period" value="Month" <?php if (($Period=="Month") || !isset($Period)){ ?>checked="checked" <?php } ?>> |
|---|
| 333 |
<font face="verdana" size="1" color="#ffffff"><b>Selection of the month</b></font> |
|---|
| 334 |
</td> |
|---|
| 335 |
<td class="bar-search" align="left" bgcolor="#cddeff"> |
|---|
| 336 |
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#cddeff"><tr><td> |
|---|
| 337 |
<input type="checkbox" name="frommonth" value="true" <?php if ($frommonth){ ?>checked<?php }?>> |
|---|
| 338 |
From : <select name="fromstatsmonth"> |
|---|
| 339 |
<?php $year_actual = date("Y"); |
|---|
| 340 |
for ($i=$year_actual;$i >= $year_actual-1;$i--) |
|---|
| 341 |
{ |
|---|
| 342 |
$monthname = array( "January", "February","March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); |
|---|
| 343 |
if ($year_actual==$i){ |
|---|
| 344 |
$monthnumber = date("n")-1; |
|---|
| 345 |
}else{ |
|---|
| 346 |
$monthnumber=11; |
|---|
| 347 |
} |
|---|
| 348 |
for ($j=$monthnumber;$j>=0;$j--){ |
|---|
| 349 |
$month_formated = sprintf("%02d",$j+1); |
|---|
| 350 |
if ($fromstatsmonth=="$i-$month_formated"){$selected="selected";}else{$selected="";} |
|---|
| 351 |
echo "<OPTION value=\"$i-$month_formated\" $selected> $monthname[$j]-$i </option>"; |
|---|
| 352 |
} |
|---|
| 353 |
} |
|---|
| 354 |
?> |
|---|
| 355 |
</select> |
|---|
| 356 |
</td><td> |
|---|
| 357 |
<input type="checkbox" name="tomonth" value="true" <?php if ($tomonth){ ?>checked<?php }?>> |
|---|
| 358 |
To : <select name="tostatsmonth"> |
|---|
| 359 |
<?php $year_actual = date("Y"); |
|---|
| 360 |
for ($i=$year_actual;$i >= $year_actual-1;$i--) |
|---|
| 361 |
{ |
|---|
| 362 |
$monthname = array( "January", "February","March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); |
|---|
| 363 |
if ($year_actual==$i){ |
|---|
| 364 |
$monthnumber = date("n")-1; |
|---|
| 365 |
}else{ |
|---|
| 366 |
$monthnumber=11; |
|---|
| 367 |
} |
|---|
| 368 |
for ($j=$monthnumber;$j>=0;$j--){ |
|---|
| 369 |
$month_formated = sprintf("%02d",$j+1); |
|---|
| 370 |
if ($tostatsmonth=="$i-$month_formated"){$selected="selected";}else{$selected="";} |
|---|
| 371 |
echo "<OPTION value=\"$i-$month_formated\" $selected> $monthname[$j]-$i </option>"; |
|---|
| 372 |
} |
|---|
| 373 |
} |
|---|
| 374 |
?> |
|---|
| 375 |
</select> |
|---|
| 376 |
</td></tr></table> |
|---|
| 377 |
</td> |
|---|
| 378 |
</tr> |
|---|
| 379 |
|
|---|
| 380 |
<tr> |
|---|
| 381 |
<td align="left" bgcolor="#000033"> |
|---|
| 382 |
<input type="radio" name="Period" value="Day" <?php if ($Period=="Day"){ ?>checked="checked" <?php } ?>> |
|---|
| 383 |
<font face="verdana" size="1" color="#ffffff"><b>Selection of the day</b></font> |
|---|
| 384 |
</td> |
|---|
| 385 |
<td align="left" bgcolor="#acbdee"> |
|---|
| 386 |
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#acbdee"><tr><td> |
|---|
| 387 |
<input type="checkbox" name="fromday" value="true" <?php if ($fromday){ ?>checked<?php }?>> From : |
|---|
| 388 |
<select name="fromstatsday_sday"> |
|---|
| 389 |
<?php |
|---|
| 390 |
for ($i=1;$i<=31;$i++){ |
|---|
| 391 |
if ($fromstatsday_sday==sprintf("%02d",$i)){$selected="selected";}else{$selected="";} |
|---|
| 392 |
echo '<option value="'.sprintf("%02d",$i)."\"$selected>".sprintf("%02d",$i).'</option>'; |
|---|
| 393 |
} |
|---|
| 394 |
?> |
|---|
| 395 |
</select> |
|---|
| 396 |
<select name="fromstatsmonth_sday"> |
|---|
| 397 |
<?php $year_actual = date("Y"); |
|---|
| 398 |
for ($i=$year_actual;$i >= $year_actual-1;$i--) |
|---|
| 399 |
{ |
|---|
| 400 |
$monthname = array( "January", "February","March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); |
|---|
| 401 |
if ($year_actual==$i){ |
|---|
| 402 |
$monthnumber = date("n")-1; |
|---|
| 403 |
}else{ |
|---|
| 404 |
$monthnumber=11; |
|---|
| 405 |
} |
|---|
| 406 |
for ($j=$monthnumber;$j>=0;$j--){ |
|---|
| 407 |
$month_formated = sprintf("%02d",$j+1); |
|---|
| 408 |
if ($fromstatsmonth_sday=="$i-$month_formated"){$selected="selected";}else{$selected="";} |
|---|
| 409 |
echo "<OPTION value=\"$i-$month_formated\" $selected> $monthname[$j]-$i </option>"; |
|---|
| 410 |
} |
|---|
| 411 |
} |
|---|
| 412 |
?> |
|---|
| 413 |
</select> |
|---|
| 414 |
</td><td> |
|---|
| 415 |
<input type="checkbox" name="today" value="true" <?php if ($today){ ?>checked<?php }?>> To : |
|---|
| 416 |
<select name="tostatsday_sday"> |
|---|
| 417 |
<?php |
|---|
| 418 |
for ($i=1;$i<=31;$i++){ |
|---|
| 419 |
if ($tostatsday_sday==sprintf("%02d",$i)){$selected="selected";}else{$selected="";} |
|---|
| 420 |
echo '<option value="'.sprintf("%02d",$i)."\"$selected>".sprintf("%02d",$i).'</option>'; |
|---|
| 421 |
} |
|---|
| 422 |
?> |
|---|
| 423 |
</select> |
|---|
| 424 |
<select name="tostatsmonth_sday"> |
|---|
| 425 |
<?php $year_actual = date("Y"); |
|---|
| 426 |
for ($i=$year_actual;$i >= $year_actual-1;$i--) |
|---|
| 427 |
{ |
|---|
| 428 |
$monthname = array( "January", "February","March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); |
|---|
| 429 |
if ($year_actual==$i){ |
|---|
| 430 |
$monthnumber = date("n")-1; |
|---|
| 431 |
}else{ |
|---|
| 432 |
$monthnumber=11; |
|---|
| 433 |
} |
|---|
| 434 |
for ($j=$monthnumber;$j>=0;$j--){ |
|---|
| 435 |
$month_formated = sprintf("%02d",$j+1); |
|---|
| 436 |
if ($tostatsmonth_sday=="$i-$month_formated"){$selected="selected";}else{$selected="";} |
|---|
| 437 |
echo "<OPTION value=\"$i-$month_formated\" $selected> $monthname[$j]-$i </option>"; |
|---|
| 438 |
} |
|---|
| 439 |
} |
|---|
| 440 |
?> |
|---|
| 441 |
</select> |
|---|
| 442 |
</td></tr></table> |
|---|
| 443 |
</td> |
|---|
| 444 |
</tr> |
|---|
| 445 |
<tr> |
|---|
| 446 |
<td class="bar-search" align="left" bgcolor="#555577"> |
|---|
| 447 |
<font face="verdana" size="1" color="#ffffff"><b> DESTINATION</b></font> |
|---|
| 448 |
</td> |
|---|
| 449 |
<td class="bar-search" align="left" bgcolor="#cddeff"> |
|---|
| 450 |
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td> <INPUT TYPE="text" NAME="dst" value="<?php echo $dst?>"></td> |
|---|
| 451 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="dsttype" value="1" <?php if((!isset($dsttype))||($dsttype==1)){?>checked<?php }?>>Exact</td> |
|---|
| 452 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="dsttype" value="2" <?php if($dsttype==2){?>checked<?php }?>>Begins with</td> |
|---|
| 453 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="dsttype" value="3" <?php if($dsttype==3){?>checked<?php }?>>Contains</td> |
|---|
| 454 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="dsttype" value="4" <?php if($dsttype==4){?>checked<?php }?>>Ends with</td> |
|---|
| 455 |
</tr></table></td> |
|---|
| 456 |
</tr> |
|---|
| 457 |
<tr> |
|---|
| 458 |
<td align="left" bgcolor="#000033"> |
|---|
| 459 |
<font face="verdana" size="1" color="#ffffff"><b> SOURCE</b></font> |
|---|
| 460 |
</td> |
|---|
| 461 |
<td class="bar-search" align="left" bgcolor="#acbdee"> |
|---|
| 462 |
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#acbdee"><tr><td> <INPUT TYPE="text" NAME="src" value="<?php echo "$src";?>"></td> |
|---|
| 463 |
<td class="bar-search" align="center" bgcolor="#acbdee"><input type="radio" NAME="sourcetype" value="1" <?php if((!isset($sourcetype))||($sourcetype==1)){?>checked<?php }?>>Exact</td> |
|---|
| 464 |
<td class="bar-search" align="center" bgcolor="#acbdee"><input type="radio" NAME="sourcetype" value="2" <?php if($sourcetype==2){?>checked<?php }?>>Begins with</td> |
|---|
| 465 |
<td class="bar-search" align="center" bgcolor="#acbdee"><input type="radio" NAME="sourcetype" value="3" <?php if($sourcetype==3){?>checked<?php }?>>Contains</td> |
|---|
| 466 |
<td class="bar-search" align="center" bgcolor="#acbdee"><input type="radio" NAME="sourcetype" value="4" <?php if($sourcetype==4){?>checked<?php }?>>Ends with</td> |
|---|
| 467 |
</tr></table></td> |
|---|
| 468 |
</tr> |
|---|
| 469 |
<!-- AMP <tr> |
|---|
| 470 |
<td class="bar-search" align="left" bgcolor="#555577"> |
|---|
| 471 |
<font face="verdana" size="1" color="#ffffff"><b> CLI</b></font> |
|---|
| 472 |
</td> |
|---|
| 473 |
<td class="bar-search" align="left" bgcolor="#cddeff"> |
|---|
| 474 |
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td> <INPUT TYPE="text" NAME="clid" value="<?php echo $clid?>"></td> |
|---|
| 475 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="clidtype" value="1" <?php if((!isset($clidtype))||($clidtype==1)){?>checked<?php }?>>Exact</td> |
|---|
| 476 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="clidtype" value="2" <?php if($clidtype==2){?>checked<?php }?>>Begins with</td> |
|---|
| 477 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="clidtype" value="3" <?php if($clidtype==3){?>checked<?php }?>>Contains</td> |
|---|
| 478 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="clidtype" value="4" <?php if($clidtype==4){?>checked<?php }?>>Ends with</td> |
|---|
| 479 |
</tr></table></td> |
|---|
| 480 |
</tr> |
|---|
| 481 |
<tr> |
|---|
| 482 |
<td align="left" bgcolor="#000033"> |
|---|
| 483 |
<font face="verdana" size="1" color="#ffffff"><b> USERFIELD</b></font> |
|---|
| 484 |
</td> |
|---|
| 485 |
<td class="bar-search" align="left" bgcolor="#acbdee"> |
|---|
| 486 |
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#acbdee"><tr><td> <INPUT TYPE="text" NAME="userfield" value="<?php echo "$userfield";?>"></td> |
|---|
| 487 |
<td class="bar-search" align="center" bgcolor="#acbdee"><input type="radio" NAME="userfieldtype" value="1" <?php if((!isset($userfieldtype))||($userfieldtype==1)){?>checked<?php }?>>Exact</td> |
|---|
| 488 |
<td class="bar-search" align="center" bgcolor="#acbdee"><input type="radio" NAME="userfieldtype" value="2" <?php if($userfieldtype==2){?>checked<?php }?>>Begins with</td> |
|---|
| 489 |
<td class="bar-search" align="center" bgcolor="#acbdee"><input type="radio" NAME="userfieldtype" value="3" <?php if($userfieldtype==3){?>checked<?php }?>>Contains</td> |
|---|
| 490 |
<td class="bar-search" align="center" bgcolor="#acbdee"><input type="radio" NAME="userfieldtype" value="4" <?php if($userfieldtype==4){?>checked<?php }?>>Ends with</td> |
|---|
| 491 |
</tr></table></td> |
|---|
| 492 |
</tr> |
|---|
| 493 |
<tr> |
|---|
| 494 |
<td class="bar-search" align="left" bgcolor="#555577"> |
|---|
| 495 |
<font face="verdana" size="1" color="#ffffff"><b> ACCOUNTCODE</b></font> |
|---|
| 496 |
</td> |
|---|
| 497 |
<td class="bar-search" align="left" bgcolor="#cddeff"> |
|---|
| 498 |
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td> <INPUT TYPE="text" NAME="accountcode" value="<?php echo $accountcode?>"></td> |
|---|
| 499 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="accountcodetype" value="1" <?php if((!isset($accountcodetype))||($accountcodetype==1)){?>checked<?php }?>>Exact</td> |
|---|
| 500 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="accountcodetype" value="2" <?php if($accountcodetype==2){?>checked<?php }?>>Begins with</td> |
|---|
| 501 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="accountcodetype" value="3" <?php if($accountcodetype==3){?>checked<?php }?>>Contains</td> |
|---|
| 502 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="accountcodetype" value="4" <?php if($accountcodetype==4){?>checked<?php }?>>Ends with</td> |
|---|
| 503 |
</tr></table></td> |
|---|
| 504 |
</tr> |
|---|
| 505 |
--> |
|---|
| 506 |
<tr> |
|---|
| 507 |
<td align="left" bgcolor="#000033"> |
|---|
| 508 |
<font face="verdana" size="1" color="#ffffff"><b> CHANNEL</b></font> |
|---|
| 509 |
</td> |
|---|
| 510 |
<td class="bar-search" align="left" bgcolor="#acbdee"> |
|---|
| 511 |
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td> <INPUT TYPE="text" NAME="channel" value="<?php echo $channel?>"></td> |
|---|
| 512 |
</tr></table></td> |
|---|
| 513 |
</tr> |
|---|
| 514 |
|
|---|
| 515 |
<tr> |
|---|
| 516 |
<td class="bar-search" align="left" bgcolor="#555577"> |
|---|
| 517 |
<font face="verdana" size="1" color="#ffffff"><b> DURATION</b></font> |
|---|
| 518 |
</td> |
|---|
| 519 |
<td class="bar-search" align="left" bgcolor="#cddeff"> |
|---|
| 520 |
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr> |
|---|
| 521 |
<td> <INPUT TYPE="text" NAME="duration1" size="4" value="<?php echo $duration1?>"></td> |
|---|
| 522 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="duration1type" value="4" <?php if($duration1type==4){?>checked<?php }?>>></td> |
|---|
| 523 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="duration1type" value="5" <?php if($duration1type==5){?>checked<?php }?>>> egal</td> |
|---|
| 524 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="duration1type" value="1" <?php if((!isset($duration1type))||($duration1type==1)){?>checked<?php }?>>Egal</td> |
|---|
| 525 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="duration1type" value="2" <?php if($duration1type==2){?>checked<?php }?>>< egal</td> |
|---|
| 526 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="duration1type" value="3" <?php if($duration1type==3){?>checked<?php }?>><</td> |
|---|
| 527 |
<td width="5%" class="bar-search" align="center" bgcolor="#cddeff"></td> |
|---|
| 528 |
|
|---|
| 529 |
<td> <INPUT TYPE="text" NAME="duration2" size="4" value="<?php echo $duration2?>"></td> |
|---|
| 530 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="duration2type" value="4" <?php if($duration2type==4){?>checked<?php }?>>></td> |
|---|
| 531 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="duration2type" value="5" <?php if($duration2type==5){?>checked<?php }?>>> egal</td> |
|---|
| 532 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="duration2type" value="2" <?php if($duration2type==1){?>checked<?php }?>>< egal</td> |
|---|
| 533 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="duration2type" value="3" <?php if($duration2type==3){?>checked<?php }?>><</td> |
|---|
| 534 |
</tr></table> |
|---|
| 535 |
</td> |
|---|
| 536 |
</tr> |
|---|
| 537 |
|
|---|
| 538 |
|
|---|
| 539 |
<tr> |
|---|
| 540 |
<td class="bar-search" align="left" bgcolor="#000033"> </td> |
|---|
| 541 |
|
|---|
| 542 |
<td class="bar-search" align="center" bgcolor="#acbdee"> |
|---|
| 543 |
<input type="image" name="image16" align="top" border="0" src="images/button-search.gif" /> |
|---|
| 544 |
|
|---|
| 545 |
Result : Minutes<input type="radio" NAME="resulttype" value="min" <?php if((!isset($resulttype))||($resulttype=="min")){?>checked<?php }?>> - Seconds <input type="radio" NAME="resulttype" value="sec" <?php if($resulttype=="sec"){?>checked<?php }?>> |
|---|
| 546 |
</td> |
|---|
| 547 |
</tr> |
|---|
| 548 |
</tbody></table> |
|---|
| 549 |
</FORM> |
|---|
| 550 |
</center> |
|---|
| 551 |
|
|---|
| 552 |
|
|---|
| 553 |
<br><br> |
|---|
| 554 |
|
|---|
| 555 |
<!-- ** ** ** ** ** Part to display the CDR ** ** ** ** ** --> |
|---|
| 556 |
|
|---|
| 557 |
<center>Number of calls : <?php if (is_array($list) && count($list)>0){ echo $nb_record; }else{echo "0";}?></center> |
|---|
| 558 |
<table width="<?php echo $FG_HTML_TABLE_WIDTH?>" border="0" align="center" cellpadding="0" cellspacing="0"> |
|---|
| 559 |
<TR bgcolor="#ffffff"> |
|---|
| 560 |
<TD bgColor=#7f99cc height=16 style="PADDING-LEFT: 5px; PADDING-RIGHT: 3px"> |
|---|
| 561 |
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%"> |
|---|
| 562 |
<TBODY> |
|---|
| 563 |
<TR> |
|---|
| 564 |
<TD><SPAN style="COLOR: #ffffff; FONT-SIZE: 11px"><B><?php echo $FG_HTML_TABLE_TITLE?></B></SPAN></TD> |
|---|
| 565 |
<TD align=right> <IMG alt="Back to Top" border=0 height=12 src="images/btn_top_12x12.gif" width=12> |
|---|
| 566 |
</TD> |
|---|
| 567 |
</TR> |
|---|
| 568 |
</TBODY> |
|---|
| 569 |
</TABLE></TD> |
|---|
| 570 |
</TR> |
|---|
| 571 |
<TR> |
|---|
| 572 |
<TD> <TABLE border=0 cellPadding=0 cellSpacing=0 width="100%"> |
|---|
| 573 |
<TBODY> |
|---|
| 574 |
<TR bgColor=#F0F0F0> |
|---|
| 575 |
<TD width="<?php echo $FG_ACTION_SIZE_COLUMN?>" align=center class="tableBodyRight" style="PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px"></TD> |
|---|
| 576 |
|
|---|
| 577 |
<?php |
|---|
| 578 |
if (is_array($list) && count($list)>0){ |
|---|
| 579 |
|
|---|
| 580 |
for($i=0;$i<$FG_NB_TABLE_COL;$i++){ |
|---|
| 581 |
|
|---|
| 582 |
//$FG_TABLE_COL[]=array ("Name", "name", "20%"); |
|---|
| 583 |
?> |
|---|
| 584 |
|
|---|
| 585 |
|
|---|
| 586 |
<TD width="<?php echo $FG_TABLE_COL[$i][2]?>" align=middle class="tableBody" style="PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px"> |
|---|
| 587 |
<center><strong> |
|---|
| 588 |
<?php if (strtoupper($FG_TABLE_COL[$i][4])=="SORT"){?> |
|---|
| 589 |
<a href="<?php echo $_SERVER['PHP_SELF']."?s=1&t=$t&stitle=$stitle&atmenu=$atmenu¤t_page=$current_page&order=".$FG_TABLE_COL[$i][1]."&sens="; if ($sens=="ASC"){echo"DESC";}else{echo"ASC";} |
|---|
| 590 |
echo "&posted=$posted&Period=$Period&frommonth=$frommonth&fromstatsmonth=$fromstatsmonth&tomonth=$tomonth&tostatsmonth=$tostatsmonth&fromday=$fromday&fromstatsday_sday=$fromstatsday_sday&fromstatsmonth_sday=$fromstatsmonth_sday&today=$today&tostatsday_sday=$tostatsday_sday&tostatsmonth_sday=$tostatsmonth_sday&dsttype=$dsttype&sourcetype=$sourcetype&clidtype=$clidtype&channel=$channel&resulttype=$resulttype&dst=$dst&src=$src&clid=$clid";?>"> |
|---|
| 591 |
<span class="liens"><?php } ?> |
|---|
| 592 |
<?php echo $FG_TABLE_COL[$i][0]?> |
|---|
| 593 |
<?php if ($order==$FG_TABLE_COL[$i][1] && $sens=="ASC"){?> |
|---|
| 594 |
<img src="images/icon_up_12x12.GIF" width="12" height="12" border="0"> |
|---|
| 595 |
<?php }elseif ($order==$FG_TABLE_COL[$i][1] && $sens=="DESC"){?> |
|---|
| 596 |
<img src="images/icon_down_12x12.GIF" width="12" height="12" border="0"> |
|---|
| 597 |
<?php }?> |
|---|
| 598 |
<?php if (strtoupper($FG_TABLE_COL[$i][4])=="SORT"){?> |
|---|
| 599 |
</span></a> |
|---|
| 600 |
<?php }?> |
|---|
| 601 |
</strong></center></TD> |
|---|
| 602 |
<?php } ?> |
|---|
| 603 |
|
|---|
| 604 |
</TR> |
|---|
| 605 |
<TR> |
|---|
| 606 |
<TD bgColor=#e1e1e1 colSpan=<?php echo $FG_TOTAL_TABLE_COL?> height=1><IMG |
|---|
| 607 |
height=1 |
|---|
| 608 |
src="images/clear.gif" |
|---|
| 609 |
width=1></TD> |
|---|
| 610 |
</TR> |
|---|
| 611 |
<?php |
|---|
| 612 |
|
|---|
| 613 |
|
|---|
| 614 |
|
|---|
| 615 |
$ligne_number=0; |
|---|
| 616 |
|
|---|
| 617 |
foreach ($list as $recordset){ |
|---|
| 618 |
$ligne_number++; |
|---|
| 619 |
?> |
|---|
| 620 |
|
|---|
| 621 |
<TR bgcolor="<?php echo $FG_TABLE_ALTERNATE_ROW_COLOR[$ligne_number%2]?>" onMouseOver="bgColor='#C4FFD7'" onMouseOut="bgColor='<?php echo $FG_TABLE_ALTERNATE_ROW_COLOR[$ligne_number%2]?>'"> |
|---|
| 622 |
<TD vAlign=top align="<?php echo $FG_TABLE_COL[$i][3]?>" class=tableBody><?php echo $ligne_number+$current_page*$FG_LIMITE_DISPLAY.". "; ?></TD> |
|---|
| 623 |
|
|---|
| 624 |
<?php for($i=0;$i<$FG_NB_TABLE_COL;$i++){ ?> |
|---|
| 625 |
|
|---|
| 626 |
|
|---|
| 627 |
<?php |
|---|
| 628 |
//$FG_TABLE_COL[]=array ("Name", "name", "20%"); |
|---|
| 629 |
|
|---|
| 630 |
|
|---|
| 631 |
if ($FG_TABLE_COL[$i][6]=="lie"){ |
|---|
| 632 |
|
|---|
| 633 |
|
|---|
| 634 |
$instance_sub_table = new Table($FG_TABLE_COL[$i][7], $FG_TABLE_COL[$i][8]); |
|---|
| 635 |
$sub_clause = str_replace("%id", $recordset[$i], $FG_TABLE_COL[$i][9]); |
|---|
| 636 |
$select_list = $instance_sub_table -> Get_list ($sub_clause, null, null, null, null, null, null); |
|---|
| 637 |
|
|---|
| 638 |
|
|---|
| 639 |
$field_list_sun = split(',',$FG_TABLE_COL[$i][8]); |
|---|
| 640 |
$record_display = $FG_TABLE_COL[$i][10]; |
|---|
| 641 |
|
|---|
| 642 |
|
|---|
| 643 |
for ($l=1;$l<=count($field_list_sun);$l++){ |
|---|
| 644 |
$record_display = str_replace("%$l", $select_list[0][$l-1], $record_display); |
|---|
| 645 |
} |
|---|
| 646 |
|
|---|
| 647 |
}elseif ($FG_TABLE_COL[$i][6]=="list"){ |
|---|
| 648 |
$select_list = $FG_TABLE_COL[$i][7]; |
|---|
| 649 |
$record_display = $select_list[$recordset[$i]][0]; |
|---|
| 650 |
|
|---|
| 651 |
}else{ |
|---|
| 652 |
$record_display = $recordset[$i]; |
|---|
| 653 |
} |
|---|
| 654 |
|
|---|
| 655 |
|
|---|
| 656 |
if ( is_numeric($FG_TABLE_COL[$i][5]) && (strlen($record_display) > $FG_TABLE_COL[$i][5]) ){ |
|---|
| 657 |
$record_display = substr($record_display, 0, $FG_TABLE_COL[$i][5]-3).""; |
|---|
| 658 |
|
|---|
| 659 |
} |
|---|
| 660 |
|
|---|
| 661 |
|
|---|
| 662 |
?> |
|---|
| 663 |
<TD vAlign=top align="<?php echo $FG_TABLE_COL[$i][3]?>" class=tableBody><?php |
|---|
| 664 |
if (isset ($FG_TABLE_COL[$i][11]) && strlen($FG_TABLE_COL[$i][11])>1){ |
|---|
| 665 |
call_user_func($FG_TABLE_COL[$i][11], $record_display); |
|---|
| 666 |
}else{ |
|---|
| 667 |
echo stripslashes($record_display); |
|---|
| 668 |
} |
|---|
| 669 |
?></TD> |
|---|
| 670 |
<?php } ?> |
|---|
| 671 |
|
|---|
| 672 |
</TR> |
|---|
| 673 |
<?php |
|---|
| 674 |
} |
|---|
| 675 |
while ($ligne_number < $FG_LIMITE_DISPLAY){ |
|---|
| 676 |
$ligne_number++; |
|---|
| 677 |
?> |
|---|
| 678 |
<TR bgcolor="<?php echo $FG_TABLE_ALTERNATE_ROW_COLOR[$ligne_number%2]?>"> |
|---|
| 679 |
<?php for($i=0;$i<$FG_NB_TABLE_COL;$i++){ |
|---|
| 680 |
|
|---|
| 681 |
//$FG_TABLE_COL[]=array ("Name", "name", "20%"); |
|---|
| 682 |
?> |
|---|
| 683 |
<TD vAlign=top class=tableBody> </TD> |
|---|
| 684 |
<?php } ?> |
|---|
| 685 |
<TD align="center" vAlign=top class=tableBodyRight> </TD> |
|---|
| 686 |
</TR> |
|---|
| 687 |
|
|---|
| 688 |
<?php |
|---|
| 689 |
} |
|---|
| 690 |
|
|---|
| 691 |
}else{ |
|---|
| 692 |
echo "No data found !!!"; |
|---|
| 693 |
} |
|---|
| 694 |
?> |
|---|
| 695 |
<TR> |
|---|
| 696 |
<TD class=tableDivider colSpan=<?php echo $FG_TOTAL_TABLE_COL?>><IMG height=1 |
|---|
| 697 |
src="images/clear.gif" |
|---|
| 698 |
width=1></TD> |
|---|
| 699 |
</TR> |
|---|
| 700 |
<TR> |
|---|
| 701 |
<TD class=tableDivider colSpan=<?php echo $FG_TOTAL_TABLE_COL?>><IMG height=1 |
|---|
| 702 |
src="images/clear.gif" |
|---|
| 703 |
width=1></TD> |
|---|
| 704 |
</TR> |
|---|
| 705 |
</TBODY> |
|---|
| 706 |
</TABLE></td> |
|---|
| 707 |
</tr> |
|---|
| 708 |
<TR bgcolor="#ffffff"> |
|---|
| 709 |
<TD bgColor=#ADBEDE height=16 style="PADDING-LEFT: 5px; PADDING-RIGHT: 3px"> |
|---|
| 710 |
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%"> |
|---|
| 711 |
<TBODY> |
|---|
| 712 |
<TR> |
|---|
| 713 |
<TD align="right"><SPAN style="COLOR: #ffffff; FONT-SIZE: 11px"><B> |
|---|
| 714 |
<?php if ($current_page>0){?> |
|---|
| 715 |
<img src="images/fleche-g.gif" width="5" height="10"> <a href="<?php echo $_SERVER['PHP_SELF']?>?s=1&t=<?php echo $t?>&order=<?php echo $order?>&sens=<?php echo $sens?>¤t_page=<?php echo ($current_page-1)?><?php if (!is_null($letter) && ($letter!="")){ echo "&letter=$letter";} |
|---|
| 716 |
echo "&posted=$posted&Period=$Period&frommonth=$frommonth&fromstatsmonth=$fromstatsmonth&tomonth=$tomonth&tostatsmonth=$tostatsmonth&fromday=$fromday&fromstatsday_sday=$fromstatsday_sday&fromstatsmonth_sday=$fromstatsmonth_sday&today=$today&tostatsday_sday=$tostatsday_sday&tostatsmonth_sday=$tostatsmonth_sday&dsttype=$dsttype&sourcetype=$sourcetype&clidtype=$clidtype&channel=$channel&resulttype=$resulttype&dst=$dst&src=$src&clid=$clid&channel=$channel&resulttype=$resulttype&dst=$dst&src=$src&clid=$clid&userfieldtype=$userfieldtype&userfield=$userfield&accountcodetype=$accountcodetype&accountcode=$accountcode&duration1=$duration1&duration1type=$duration1type&duration2=$duration2&duration2type=$duration2type";?>"> |
|---|
| 717 |
Previous </a> - |
|---|
| 718 |
<?php }?> |
|---|
| 719 |
<?php echo ($current_page+1);?> / <?php echo $nb_record_max;?> |
|---|
| 720 |
<?php if ($current_page<$nb_record_max-1){?> |
|---|
| 721 |
- <a href="<?php echo $_SERVER['PHP_SELF']?>?s=1&t=<?php echo $t?>&order=<?php echo $order?>&sens=<?php echo $sens?>¤t_page=<?php echo ($current_page+1)?><?php if (!is_null($letter) && ($letter!="")){ echo "&letter=$letter";} |
|---|
| 722 |
echo "&posted=$posted&Period=$Period&frommonth=$frommonth&fromstatsmonth=$fromstatsmonth&tomonth=$tomonth&tostatsmonth=$tostatsmonth&fromday=$fromday&fromstatsday_sday=$fromstatsday_sday&fromstatsmonth_sday=$fromstatsmonth_sday&today=$today&tostatsday_sday=$tostatsday_sday&tostatsmonth_sday=$tostatsmonth_sday&dsttype=$dsttype&sourcetype=$sourcetype&clidtype=$clidtype&channel=$channel&resulttype=$resulttype&dst=$dst&src=$src&clid=$clid&channel=$channel&resulttype=$resulttype&dst=$dst&src=$src&clid=$clid&userfieldtype=$userfieldtype&userfield=$userfield&accountcodetype=$accountcodetype&accountcode=$accountcode&duration1=$duration1&duration1type=$duration1type&duration2=$duration2&duration2type=$duration2type";?>"> |
|---|
| 723 |
Next </a> <img src="images/fleche-d.gif" width="5" height="10"> |
|---|
| 724 |
</B></SPAN> |
|---|
| 725 |
<?php }?> |
|---|
| 726 |
</TD> |
|---|
| 727 |
</TBODY> |
|---|
| 728 |
</TABLE></TD> |
|---|
| 729 |
</TR> |
|---|
| 730 |
</table> |
|---|
| 731 |
|
|---|
| 732 |
<!-- ** ** ** ** ** Part to display the GRAPHIC ** ** ** ** ** --> |
|---|
| 733 |
<br><br> |
|---|
| 734 |
|
|---|
| 735 |
<?php |
|---|
| 736 |
|
|---|
| 737 |
if (is_array($list_total_day) && count($list_total_day)>0){ |
|---|
| 738 |
|
|---|
| 739 |
|
|---|
| 740 |
|
|---|
| 741 |
|
|---|
| 742 |
|
|---|
| 743 |
|
|---|
| 744 |
|
|---|
| 745 |
|
|---|
| 746 |
|
|---|
| 747 |
|
|---|
| 748 |
|
|---|
| 749 |
|
|---|
| 750 |
|
|---|
| 751 |
|
|---|
| 752 |
|
|---|
| 753 |
|
|---|
| 754 |
|
|---|
| 755 |
|
|---|
| 756 |
|
|---|
| 757 |
|
|---|
| 758 |
$mmax=0; |
|---|
| 759 |
$totalcall==0; |
|---|
| 760 |
$totalminutes=0; |
|---|
| 761 |
foreach ($list_total_day as $data){ |
|---|
| 762 |
if ($mmax < $data[1]) $mmax=$data[1]; |
|---|
| 763 |
$totalcall+=$data[2]; |
|---|
| 764 |
$totalminutes+=$data[1]; |
|---|
| 765 |
} |
|---|
| 766 |
|
|---|
| 767 |
|
|---|
| 768 |
|
|---|
| 769 |
|
|---|
| 770 |
|
|---|
| 771 |
|
|---|
| 772 |
|
|---|
| 773 |
|
|---|
| 774 |
|
|---|
| 775 |
|
|---|
| 776 |
?> |
|---|
| 777 |
|
|---|
| 778 |
|
|---|
| 779 |
<!-- TITLE GLOBAL --> |
|---|
| 780 |
<center> |
|---|
| 781 |
<table border="0" cellspacing="0" cellpadding="0" width="80%"><tbody><tr><td align="left" height="30"> |
|---|
| 782 |
<table cellspacing="0" cellpadding="1" bgcolor="#000000" width="50%"><tbody><tr><td> |
|---|
| 783 |
<table cellspacing="0" cellpadding="0" width="100%"><tbody> |
|---|
| 784 |
<tr><td bgcolor="#600101" align="left"><font face="verdana" size="1" color="white"><b>TOTAL</b></font></td></tr> |
|---|
| 785 |
</tbody></table> |
|---|
| 786 |
</td></tr></tbody></table> |
|---|
| 787 |
</td></tr></tbody></table> |
|---|
| 788 |
|
|---|
| 789 |
<!-- FIN TITLE GLOBAL MINUTES //--> |
|---|
| 790 |
|
|---|
| 791 |
<table border="0" cellspacing="0" cellpadding="0" width="80%"> |
|---|
| 792 |
<tbody><tr><td bgcolor="#000000"> |
|---|
| 793 |
<table border="0" cellspacing="1" cellpadding="2" width="100%"><tbody> |
|---|
| 794 |
<tr> |
|---|
| 795 |
<td align="center" bgcolor="#600101"></td> |
|---|
| 796 |
<td bgcolor="#b72222" align="center" colspan="4"><font face="verdana" size="1" color="#ffffff"><b>ASTERISK MINUTES</b></font></td> |
|---|
| 797 |
</tr> |
|---|
| 798 |
<tr bgcolor="#600101"> |
|---|
| 799 |
<td align="right" bgcolor="#b72222"><font face="verdana" size="1" color="#ffffff"><b>DATE</b></font></td> |
|---|
| 800 |
<td align="center"><font face="verdana" size="1" color="#ffffff"><b>DURATION</b></font></td> |
|---|
| 801 |
<td align="center"><font face="verdana" size="1" color="#ffffff"><b>GRAPHIC</b></font></td> |
|---|
| 802 |
<td align="center"><font face="verdana" size="1" color="#ffffff"><b>CALLS</b></font></td> |
|---|
| 803 |
<td align="center"><font face="verdana" size="1" color="#ffffff"><b> <acronym title="Average Connection Time">ACT</acronym> </b></font></td> |
|---|
| 804 |
|
|---|
| 805 |
<!-- LOOP --> |
|---|
| 806 |
<?php |
|---|
| 807 |
$i=0; |
|---|
| 808 |
|
|---|
| 809 |
foreach ($list_total_day as $data){ |
|---|
| 810 |
$i=($i+1)%2; |
|---|
| 811 |
$tmc = $data[1]/$data[2]; |
|---|
| 812 |
|
|---|
| 813 |
if ((!isset($resulttype)) || ($resulttype=="min")){ |
|---|
| 814 |
$tmc = sprintf("%02d",intval($tmc/60)).":".sprintf("%02d",intval($tmc%60)); |
|---|
| 815 |
}else{ |
|---|
| 816 |
|
|---|
| 817 |
$tmc =intval($tmc); |
|---|
| 818 |
} |
|---|
| 819 |
|
|---|
| 820 |
if ((!isset($resulttype)) || ($resulttype=="min")){ |
|---|
| 821 |
$minutes = sprintf("%02d",intval($data[1]/60)).":".sprintf("%02d",intval($data[1]%60)); |
|---|
| 822 |
}else{ |
|---|
| 823 |
$minutes = $data[1]; |
|---|
| 824 |
} |
|---|
| 825 |
$widthbar= intval(($data[1]/$mmax)*200); |
|---|
| 826 |
|
|---|
| 827 |
|
|---|
| 828 |
?> |
|---|
| 829 |
</tr><tr> |
|---|
| 830 |
<td align="right" class="sidenav" nowrap="nowrap"><font face="verdana" size="1" color="#ffffff"><?php echo $data[0]?></font></td> |
|---|
| 831 |
<td bgcolor="<?php echo $FG_TABLE_ALTERNATE_ROW_COLOR[$i]?>" align="right" nowrap="nowrap"><font face="verdana" color="#000000" size="1"><?php echo $minutes?> </font></td> |
|---|
| 832 |
<td bgcolor="<?php echo $FG_TABLE_ALTERNATE_ROW_COLOR[$i]?>" align="left" nowrap="nowrap" width="<?php echo $widthbar+60?>"> |
|---|
| 833 |
<table cellspacing="0" cellpadding="0"><tbody><tr> |
|---|
| 834 |
<td bgcolor="#e22424"><img src="images/spacer.gif" width="<?php echo $widthbar?>" height="6"></td> |
|---|
| 835 |
</tr></tbody></table></td> |
|---|
| 836 |
<td bgcolor="<?php echo $FG_TABLE_ALTERNATE_ROW_COLOR[$i]?>" align="right" nowrap="nowrap"><font face="verdana" color="#000000" size="1"><?php echo $data[2]?></font></td> |
|---|
| 837 |
<td bgcolor="<?php echo $FG_TABLE_ALTERNATE_ROW_COLOR[$i]?>" align="right" nowrap="nowrap"><font face="verdana" color="#000000" size="1"><?php echo $tmc?> </font></td> |
|---|
| 838 |
<?php } |
|---|
| 839 |
|
|---|
| 840 |
if ((!isset($resulttype)) || ($resulttype=="min")){ |
|---|
| 841 |
$total_tmc = sprintf("%02d",intval(($totalminutes/$totalcall)/60)).":".sprintf("%02d",intval(($totalminutes/$totalcall)%60)); |
|---|
| 842 |
$totalminutes = sprintf("%02d",intval($totalminutes/60)).":".sprintf("%02d",intval($totalminutes%60)); |
|---|
| 843 |
}else{ |
|---|
| 844 |
$total_tmc = intval($totalminutes/$totalcall); |
|---|
| 845 |
} |
|---|
| 846 |
|
|---|
| 847 |
?> |
|---|
| 848 |
</tr> |
|---|
| 849 |
<!-- FIN DETAIL --> |
|---|
| 850 |
|
|---|
| 851 |
|
|---|
| 852 |
<!-- FIN BOUCLE --> |
|---|
| 853 |
|
|---|
| 854 |
<!-- TOTAL --> |
|---|
| 855 |
<tr bgcolor="#600101"> |
|---|
| 856 |
<td align="right" nowrap="nowrap"><font face="verdana" size="1" color="#ffffff"><b>TOTAL</b></font></td> |
|---|
| 857 |
<td align="center" nowrap="nowrap" colspan="2"><font face="verdana" size="1" color="#ffffff"><b><?php echo $totalminutes?> </b></font></td> |
|---|
| 858 |
<td align="center" nowrap="nowrap"><font face="verdana" size="1" color="#ffffff"><b><?php echo $totalcall?></b></font></td> |
|---|
| 859 |
<td align="center" nowrap="nowrap"><font face="verdana" size="1" color="#ffffff"><b><?php echo $total_tmc?></b></font></td> |
|---|
| 860 |
</tr> |
|---|
| 861 |
<!-- FIN TOTAL --> |
|---|
| 862 |
|
|---|
| 863 |
</tbody></table> |
|---|
| 864 |
<!-- Fin Tableau Global //--> |
|---|
| 865 |
|
|---|
| 866 |
</td></tr></tbody></table> |
|---|
| 867 |
|
|---|
| 868 |
<br/> |
|---|
| 869 |
<table width="60%"><tr><td> |
|---|
| 870 |
<a href="export_pdf.php" target="_blank"><img src="./images/pdf.gif " border="0"/></a> <a href="export_pdf.php" target="_blank">Export PDF file</a> |
|---|
| 871 |
</td> |
|---|
| 872 |
<td> |
|---|
| 873 |
<a href="export_csv.php" target="_blank" ><img src="./images/excel.gif" border="0"/></a> <a href="export_csv.php" target="_blank">Export CSV file</a> |
|---|
| 874 |
</td></tr></table> |
|---|
| 875 |
|
|---|
| 876 |
|
|---|
| 877 |
<?php }else{ ?> |
|---|
| 878 |
<center><h3>No calls in your selection.</h3></center> |
|---|
| 879 |
<?php } ?> |
|---|
| 880 |
</center> |
|---|
| 881 |
|
|---|