| 1 |
<?php |
|---|
| 2 |
include_once(dirname(__FILE__) . "/lib/defines.php"); |
|---|
| 3 |
include_once(dirname(__FILE__) . "/lib/Class.Table.php"); |
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
getpost_ifset(array('current_page', 'fromstatsday_sday', 'fromstatsmonth_sday', 'days_compare', 'min_call', 'posted', 'dsttype', 'sourcetype', 'clidtype', 'channel', 'resulttype', 'stitle', 'atmenu', 'current_page', 'order', 'sens', 'dst', 'src', 'clid', 'userfieldtype', 'userfield', 'accountcodetype', 'accountcode')); |
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
if (!isset ($current_page) || ($current_page == "")){ |
|---|
| 11 |
$current_page=0; |
|---|
| 12 |
} |
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
$FG_DEBUG = 0; |
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
$FG_TABLE_NAME=DB_TABLENAME; |
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
$FG_TABLE_HEAD_COLOR = "#D1D9E7"; |
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
$FG_TABLE_EXTERN_COLOR = "#7F99CC"; |
|---|
| 27 |
$FG_TABLE_INTERN_COLOR = "#EDF3FF"; |
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
// THIS VARIABLE DEFINE THE COLOR OF THE HEAD TABLE |
|---|
| 33 |
$FG_TABLE_ALTERNATE_ROW_COLOR[] = "#FFFFFF"; |
|---|
| 34 |
$FG_TABLE_ALTERNATE_ROW_COLOR[] = "#F2F8FF"; |
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
$DBHandle = DbConnect(); |
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
$FG_TABLE_COL = array(); |
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
$FG_TABLE_COL[]=array ("Calldate", "calldate", "18%", "center", "SORT", "19"); |
|---|
| 51 |
$FG_TABLE_COL[]=array ("Channel", "channel", "13%", "center", "", "30"); |
|---|
| 52 |
$FG_TABLE_COL[]=array ("Source", "src", "10%", "center", "", "30"); |
|---|
| 53 |
$FG_TABLE_COL[]=array ("Clid", "clid", "12%", "center", "", "30"); |
|---|
| 54 |
$FG_TABLE_COL[]=array ("Lastapp", "lastapp", "8%", "center", "", "30"); |
|---|
| 55 |
|
|---|
| 56 |
$FG_TABLE_COL[]=array ("Lastdata", "lastdata", "12%", "center", "", "30"); |
|---|
| 57 |
$FG_TABLE_COL[]=array ("Dst", "dst", "9%", "center", "SORT", "30"); |
|---|
| 58 |
|
|---|
| 59 |
$FG_TABLE_COL[]=array ("Disposition", "disposition", "9%", "center", "", "30"); |
|---|
| 60 |
$FG_TABLE_COL[]=array ("Duration", "duration", "6%", "center", "SORT", "30"); |
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 |
$FG_TABLE_DEFAULT_ORDER = "calldate"; |
|---|
| 64 |
$FG_TABLE_DEFAULT_SENS = "DESC"; |
|---|
| 65 |
|
|---|
| 66 |
|
|---|
| 67 |
$FG_COL_QUERY='calldate, channel, src, clid, lastapp, lastdata, dst, disposition, duration'; |
|---|
| 68 |
|
|---|
| 69 |
$FG_COL_QUERY_GRAPH='calldate, duration'; |
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 72 |
$FG_LIMITE_DISPLAY=25; |
|---|
| 73 |
|
|---|
| 74 |
|
|---|
| 75 |
$FG_NB_TABLE_COL=count($FG_TABLE_COL); |
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 |
$FG_EDITION=true; |
|---|
| 79 |
|
|---|
| 80 |
|
|---|
| 81 |
$FG_TOTAL_TABLE_COL = $FG_NB_TABLE_COL; |
|---|
| 82 |
if ($FG_DELETION || $FG_EDITION) $FG_TOTAL_TABLE_COL++; |
|---|
| 83 |
|
|---|
| 84 |
|
|---|
| 85 |
$FG_HTML_TABLE_TITLE=" - Call Logs - "; |
|---|
| 86 |
|
|---|
| 87 |
|
|---|
| 88 |
$FG_HTML_TABLE_WIDTH="90%"; |
|---|
| 89 |
|
|---|
| 90 |
|
|---|
| 91 |
if ($FG_DEBUG == 3) echo "<br>Table : $FG_TABLE_NAME - Col_query : $FG_COL_QUERY"; |
|---|
| 92 |
$instance_table = new Table($FG_TABLE_NAME, $FG_COL_QUERY); |
|---|
| 93 |
$instance_table_graph = new Table($FG_TABLE_NAME, $FG_COL_QUERY_GRAPH); |
|---|
| 94 |
|
|---|
| 95 |
|
|---|
| 96 |
if ( is_null ($order) || is_null($sens) ){ |
|---|
| 97 |
$order = $FG_TABLE_DEFAULT_ORDER; |
|---|
| 98 |
$sens = $FG_TABLE_DEFAULT_SENS; |
|---|
| 99 |
} |
|---|
| 100 |
|
|---|
| 101 |
|
|---|
| 102 |
if ($posted==1){ |
|---|
| 103 |
|
|---|
| 104 |
function do_field($sql,$fld){ |
|---|
| 105 |
$fldtype = $fld.'type'; |
|---|
| 106 |
global $$fld; |
|---|
| 107 |
global $$fldtype; |
|---|
| 108 |
if (isset($$fld) && ($$fld!='')){ |
|---|
| 109 |
if (strpos($sql,'WHERE') > 0){ |
|---|
| 110 |
$sql = "$sql AND "; |
|---|
| 111 |
}else{ |
|---|
| 112 |
$sql = "$sql WHERE "; |
|---|
| 113 |
} |
|---|
| 114 |
$sql = "$sql $fld"; |
|---|
| 115 |
if (isset ($$fldtype)){ |
|---|
| 116 |
switch ($$fldtype) { |
|---|
| 117 |
case 1: $sql = "$sql='".$$fld."'"; break; |
|---|
| 118 |
case 2: $sql = "$sql LIKE '".$$fld."%'"; break; |
|---|
| 119 |
case 3: $sql = "$sql LIKE '%".$$fld."%'"; break; |
|---|
| 120 |
case 4: $sql = "$sql LIKE '%".$$fld."'"; |
|---|
| 121 |
} |
|---|
| 122 |
}else{ $sql = "$sql LIKE '%".$$fld."%'"; } |
|---|
| 123 |
} |
|---|
| 124 |
return $sql; |
|---|
| 125 |
} |
|---|
| 126 |
$SQLcmd = ''; |
|---|
| 127 |
|
|---|
| 128 |
if ($_POST['before']) { |
|---|
| 129 |
if (strpos($SQLcmd, 'WHERE') > 0) { $SQLcmd = "$SQLcmd AND "; |
|---|
| 130 |
}else{ $SQLcmd = "$SQLcmd WHERE "; } |
|---|
| 131 |
$SQLcmd = "$SQLcmd calldate<'".mysql_real_escape_string($_POST['before'])."'"; |
|---|
| 132 |
} |
|---|
| 133 |
if ($_POST['after']) { if (strpos($SQLcmd, 'WHERE') > 0) { $SQLcmd = "$SQLcmd AND "; |
|---|
| 134 |
} else { $SQLcmd = "$SQLcmd WHERE "; } |
|---|
| 135 |
$SQLcmd = "$SQLcmd calldate>'".mysql_real_escape_string($_POST['after'])."'"; |
|---|
| 136 |
} |
|---|
| 137 |
$SQLcmd = do_field($SQLcmd, 'clid'); |
|---|
| 138 |
$SQLcmd = do_field($SQLcmd, 'src'); |
|---|
| 139 |
$SQLcmd = do_field($SQLcmd, 'dst'); |
|---|
| 140 |
$SQLcmd = do_field($SQLcmd, 'channel'); |
|---|
| 141 |
|
|---|
| 142 |
$SQLcmd = do_field($SQLcmd, 'userfield'); |
|---|
| 143 |
$SQLcmd = do_field($SQLcmd, 'accountcode'); |
|---|
| 144 |
|
|---|
| 145 |
|
|---|
| 146 |
} |
|---|
| 147 |
|
|---|
| 148 |
|
|---|
| 149 |
$date_clause=''; |
|---|
| 150 |
|
|---|
| 151 |
|
|---|
| 152 |
|
|---|
| 153 |
if (!isset($fromstatsday_sday)){ |
|---|
| 154 |
$fromstatsday_sday = date("d"); |
|---|
| 155 |
$fromstatsmonth_sday = date("Y-m"); |
|---|
| 156 |
} |
|---|
| 157 |
|
|---|
| 158 |
|
|---|
| 159 |
|
|---|
| 160 |
|
|---|
| 161 |
|
|---|
| 162 |
if (DB_TYPE == "postgres"){ |
|---|
| 163 |
if (isset($fromstatsday_sday) && isset($fromstatsmonth_sday)) $date_clause.=" AND calldate < date'$fromstatsmonth_sday-$fromstatsday_sday'+ INTERVAL '1 DAY' AND calldate >= date'$fromstatsmonth_sday-$fromstatsday_sday'"; |
|---|
| 164 |
}else{ |
|---|
| 165 |
if (isset($fromstatsday_sday) && isset($fromstatsmonth_sday)) $date_clause.=" AND calldate < ADDDATE('$fromstatsmonth_sday-$fromstatsday_sday',INTERVAL 1 DAY) AND calldate >= '$fromstatsmonth_sday-$fromstatsday_sday'"; |
|---|
| 166 |
} |
|---|
| 167 |
|
|---|
| 168 |
if ($FG_DEBUG == 3) echo "<br>$date_clause<br>"; |
|---|
| 169 |
|
|---|
| 170 |
if (strpos($SQLcmd, 'WHERE') > 0) { |
|---|
| 171 |
$FG_TABLE_CLAUSE = substr($SQLcmd,6).$date_clause; |
|---|
| 172 |
}elseif (strpos($date_clause, 'AND') > 0){ |
|---|
| 173 |
$FG_TABLE_CLAUSE = substr($date_clause,5); |
|---|
| 174 |
} |
|---|
| 175 |
|
|---|
| 176 |
|
|---|
| 177 |
|
|---|
| 178 |
session_start(); |
|---|
| 179 |
$AMP_CLAUSE = $HTTP_SESSION_VARS['AMP_SQL']; |
|---|
| 180 |
if (!isset($AMP_CLAUSE)) { |
|---|
| 181 |
$AMP_CLAUSE = " AND src = 'NeverReturnAnything'"; |
|---|
| 182 |
} |
|---|
| 183 |
$FG_TABLE_CLAUSE .= $AMP_CLAUSE; |
|---|
| 184 |
|
|---|
| 185 |
|
|---|
| 186 |
|
|---|
| 187 |
|
|---|
| 188 |
if ($_POST['posted']==1){ |
|---|
| 189 |
|
|---|
| 190 |
$list = $instance_table -> Get_list ($FG_TABLE_CLAUSE, $order, $sens, null, null, $FG_LIMITE_DISPLAY, $current_page*$FG_LIMITE_DISPLAY); |
|---|
| 191 |
|
|---|
| 192 |
$list_total = $instance_table_graph -> Get_list ($FG_TABLE_CLAUSE, null, null, null, null, null, null); |
|---|
| 193 |
} |
|---|
| 194 |
|
|---|
| 195 |
|
|---|
| 196 |
if ($FG_DEBUG == 3) echo "<br>Clause : $FG_TABLE_CLAUSE"; |
|---|
| 197 |
|
|---|
| 198 |
$nb_record = count($list_total); |
|---|
| 199 |
if ($FG_DEBUG >= 1) var_dump ($list); |
|---|
| 200 |
|
|---|
| 201 |
|
|---|
| 202 |
|
|---|
| 203 |
if ($nb_record<=$FG_LIMITE_DISPLAY){ |
|---|
| 204 |
$nb_record_max=1; |
|---|
| 205 |
}else{ |
|---|
| 206 |
$nb_record_max=(intval($nb_record/$FG_LIMITE_DISPLAY)+1); |
|---|
| 207 |
} |
|---|
| 208 |
|
|---|
| 209 |
if ($FG_DEBUG == 3) echo "<br>Nb_record : $nb_record"; |
|---|
| 210 |
if ($FG_DEBUG == 3) echo "<br>Nb_record_max : $nb_record_max"; |
|---|
| 211 |
|
|---|
| 212 |
?> |
|---|
| 213 |
|
|---|
| 214 |
<script language="JavaScript" type="text/JavaScript"> |
|---|
| 215 |
<!-- |
|---|
| 216 |
function MM_openBrWindow(theURL,winName,features) { //v2.0 |
|---|
| 217 |
window.open(theURL,winName,features); |
|---|
| 218 |
} |
|---|
| 219 |
|
|---|
| 220 |
//--> |
|---|
| 221 |
</script> |
|---|
| 222 |
|
|---|
| 223 |
|
|---|
| 224 |
|
|---|
| 225 |
<!-- ** ** ** ** ** Part for the research ** ** ** ** ** --> |
|---|
| 226 |
<center> |
|---|
| 227 |
<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?>"> |
|---|
| 228 |
<INPUT TYPE="hidden" NAME="posted" value=1> |
|---|
| 229 |
<table class="bar-status" width="75%" border="0" cellspacing="1" cellpadding="2" align="center"> |
|---|
| 230 |
<tbody> |
|---|
| 231 |
|
|---|
| 232 |
<tr> |
|---|
| 233 |
<td align="left" bgcolor="#000033"> |
|---|
| 234 |
<font face="verdana" size="1" color="#ffffff"><b>Select the day</b></font> |
|---|
| 235 |
</td> |
|---|
| 236 |
<td align="left" bgcolor="#acbdee"> |
|---|
| 237 |
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#acbdee"><tr><td> |
|---|
| 238 |
<b>From : </b><select name="fromstatsday_sday"> |
|---|
| 239 |
<?php |
|---|
| 240 |
for ($i=1;$i<=31;$i++){ |
|---|
| 241 |
if ($fromstatsday_sday==sprintf("%02d",$i)){$selected="selected";}else{$selected="";} |
|---|
| 242 |
echo '<option value="'.sprintf("%02d",$i)."\"$selected>".sprintf("%02d",$i).'</option>'; |
|---|
| 243 |
} |
|---|
| 244 |
?> |
|---|
| 245 |
</select> |
|---|
| 246 |
<select name="fromstatsmonth_sday"> |
|---|
| 247 |
<?php $year_actual = date("Y"); |
|---|
| 248 |
for ($i=$year_actual;$i >= $year_actual-1;$i--) |
|---|
| 249 |
{ |
|---|
| 250 |
$monthname = array( "January", "February","March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); |
|---|
| 251 |
if ($year_actual==$i){ |
|---|
| 252 |
$monthnumber = date("n")-1; |
|---|
| 253 |
}else{ |
|---|
| 254 |
$monthnumber=11; |
|---|
| 255 |
} |
|---|
| 256 |
for ($j=$monthnumber;$j>=0;$j--){ |
|---|
| 257 |
$month_formated = sprintf("%02d",$j+1); |
|---|
| 258 |
if ($fromstatsmonth_sday=="$i-$month_formated"){$selected="selected";}else{$selected="";} |
|---|
| 259 |
echo "<OPTION value=\"$i-$month_formated\" $selected> $monthname[$j]-$i </option>"; |
|---|
| 260 |
} |
|---|
| 261 |
} |
|---|
| 262 |
?> |
|---|
| 263 |
</select> |
|---|
| 264 |
</td></tr></table> |
|---|
| 265 |
</td> |
|---|
| 266 |
</tr> |
|---|
| 267 |
|
|---|
| 268 |
<tr> |
|---|
| 269 |
<td class="bar-search" align="left" bgcolor="#555577"> |
|---|
| 270 |
<font face="verdana" size="1" color="#ffffff"><b> DESTINATION</b></font> |
|---|
| 271 |
</td> |
|---|
| 272 |
<td class="bar-search" align="left" bgcolor="#cddeff"> |
|---|
| 273 |
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td> <INPUT TYPE="text" NAME="dst" value="<?php echo $dst?>"></td> |
|---|
| 274 |
<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> |
|---|
| 275 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="dsttype" value="2" <?php if($dsttype==2){?>checked<?php }?>>Begins with</td> |
|---|
| 276 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="dsttype" value="3" <?php if($dsttype==3){?>checked<?php }?>>Contains</td> |
|---|
| 277 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="dsttype" value="4" <?php if($dsttype==4){?>checked<?php }?>>Ends with</td> |
|---|
| 278 |
</tr></table></td> |
|---|
| 279 |
</tr> |
|---|
| 280 |
<tr> |
|---|
| 281 |
<td align="left" bgcolor="#000033"> |
|---|
| 282 |
<font face="verdana" size="1" color="#ffffff"><b> SOURCE</b></font> |
|---|
| 283 |
</td> |
|---|
| 284 |
<td class="bar-search" align="left" bgcolor="#acbdee"> |
|---|
| 285 |
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#acbdee"><tr><td> <INPUT TYPE="text" NAME="src" value="<?php echo "$src";?>"></td> |
|---|
| 286 |
<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> |
|---|
| 287 |
<td class="bar-search" align="center" bgcolor="#acbdee"><input type="radio" NAME="sourcetype" value="2" <?php if($sourcetype==2){?>checked<?php }?>>Begins with</td> |
|---|
| 288 |
<td class="bar-search" align="center" bgcolor="#acbdee"><input type="radio" NAME="sourcetype" value="3" <?php if($sourcetype==3){?>checked<?php }?>>Contains</td> |
|---|
| 289 |
<td class="bar-search" align="center" bgcolor="#acbdee"><input type="radio" NAME="sourcetype" value="4" <?php if($sourcetype==4){?>checked<?php }?>>Ends with</td> |
|---|
| 290 |
</tr></table></td> |
|---|
| 291 |
</tr> |
|---|
| 292 |
<!-- AMP |
|---|
| 293 |
<tr> |
|---|
| 294 |
<td class="bar-search" align="left" bgcolor="#555577"> |
|---|
| 295 |
<font face="verdana" size="1" color="#ffffff"><b> CLI</b></font> |
|---|
| 296 |
</td> |
|---|
| 297 |
<td class="bar-search" align="left" bgcolor="#cddeff"> |
|---|
| 298 |
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td> <INPUT TYPE="text" NAME="clid" value="<?php echo $clid?>"></td> |
|---|
| 299 |
<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> |
|---|
| 300 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="clidtype" value="2" <?php if($clidtype==2){?>checked<?php }?>>Begins with</td> |
|---|
| 301 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="clidtype" value="3" <?php if($clidtype==3){?>checked<?php }?>>Contains</td> |
|---|
| 302 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="clidtype" value="4" <?php if($clidtype==4){?>checked<?php }?>>Ends with</td> |
|---|
| 303 |
</tr></table></td> |
|---|
| 304 |
</tr> |
|---|
| 305 |
<tr> |
|---|
| 306 |
<td align="left" bgcolor="#000033"> |
|---|
| 307 |
<font face="verdana" size="1" color="#ffffff"><b> USERFIELD</b></font> |
|---|
| 308 |
</td> |
|---|
| 309 |
<td class="bar-search" align="left" bgcolor="#acbdee"> |
|---|
| 310 |
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#acbdee"><tr><td> <INPUT TYPE="text" NAME="userfield" value="<?php echo "$userfield";?>"></td> |
|---|
| 311 |
<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> |
|---|
| 312 |
<td class="bar-search" align="center" bgcolor="#acbdee"><input type="radio" NAME="userfieldtype" value="2" <?php if($userfieldtype==2){?>checked<?php }?>>Begins with</td> |
|---|
| 313 |
<td class="bar-search" align="center" bgcolor="#acbdee"><input type="radio" NAME="userfieldtype" value="3" <?php if($userfieldtype==3){?>checked<?php }?>>Contains</td> |
|---|
| 314 |
<td class="bar-search" align="center" bgcolor="#acbdee"><input type="radio" NAME="userfieldtype" value="4" <?php if($userfieldtype==4){?>checked<?php }?>>Ends with</td> |
|---|
| 315 |
</tr></table></td> |
|---|
| 316 |
</tr> |
|---|
| 317 |
<tr> |
|---|
| 318 |
<td class="bar-search" align="left" bgcolor="#555577"> |
|---|
| 319 |
<font face="verdana" size="1" color="#ffffff"><b> ACCOUNTCODE</b></font> |
|---|
| 320 |
</td> |
|---|
| 321 |
<td class="bar-search" align="left" bgcolor="#cddeff"> |
|---|
| 322 |
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td> <INPUT TYPE="text" NAME="accountcode" value="<?php echo $accountcode?>"></td> |
|---|
| 323 |
<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> |
|---|
| 324 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="accountcodetype" value="2" <?php if($accountcodetype==2){?>checked<?php }?>>Begins with</td> |
|---|
| 325 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="accountcodetype" value="3" <?php if($accountcodetype==3){?>checked<?php }?>>Contains</td> |
|---|
| 326 |
<td class="bar-search" align="center" bgcolor="#cddeff"><input type="radio" NAME="accountcodetype" value="4" <?php if($accountcodetype==4){?>checked<?php }?>>Ends with</td> |
|---|
| 327 |
</tr></table></td> |
|---|
| 328 |
</tr> |
|---|
| 329 |
--> |
|---|
| 330 |
<tr> |
|---|
| 331 |
<td align="left" bgcolor="#000033"> |
|---|
| 332 |
<font face="verdana" size="1" color="#ffffff"><b> CHANNEL</b></font> |
|---|
| 333 |
</td> |
|---|
| 334 |
<td class="bar-search" align="left" bgcolor="#acbdee"> |
|---|
| 335 |
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td> <INPUT TYPE="text" NAME="channel" value="<?php echo $channel?>"></td> |
|---|
| 336 |
</tr></table></td> |
|---|
| 337 |
</tr> |
|---|
| 338 |
|
|---|
| 339 |
<tr> |
|---|
| 340 |
<td class="bar-search" align="left" bgcolor="#555577"> </td> |
|---|
| 341 |
|
|---|
| 342 |
<td class="bar-search" align="center" bgcolor="#cddeff"> |
|---|
| 343 |
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#cddeff"> |
|---|
| 344 |
<tr> |
|---|
| 345 |
<td align="right"> |
|---|
| 346 |
<input type="image" name="image16" align="top" border="0" src="images/button-search.gif" /> |
|---|
| 347 |
|
|---|
| 348 |
</td></tr></table> |
|---|
| 349 |
</td> |
|---|
| 350 |
</tr> |
|---|
| 351 |
</tbody></table> |
|---|
| 352 |
</FORM> |
|---|
| 353 |
</center> |
|---|
| 354 |
|
|---|
| 355 |
|
|---|
| 356 |
|
|---|
| 357 |
|
|---|
| 358 |
|
|---|
| 359 |
<!-- ** ** ** ** ** Part to display the GRAPHIC ** ** ** ** ** --> |
|---|
| 360 |
<br><br> |
|---|
| 361 |
|
|---|
| 362 |
<?php |
|---|
| 363 |
if (is_array($list) && count($list)>0){ |
|---|
| 364 |
|
|---|
| 365 |
$table_graph=array(); |
|---|
| 366 |
$table_graph_hours=array(); |
|---|
| 367 |
$numm=0; |
|---|
| 368 |
foreach ($list_total as $recordset){ |
|---|
| 369 |
$numm++; |
|---|
| 370 |
$mydate= substr($recordset[0],0,10); |
|---|
| 371 |
$mydate_hours= substr($recordset[0],0,13); |
|---|
| 372 |
|
|---|
| 373 |
if (is_array($table_graph_hours[$mydate_hours])){ |
|---|
| 374 |
$table_graph_hours[$mydate_hours][0]++; |
|---|
| 375 |
$table_graph_hours[$mydate_hours][1]=$table_graph_hours[$mydate_hours][1]+$recordset[1]; |
|---|
| 376 |
}else{ |
|---|
| 377 |
$table_graph_hours[$mydate_hours][0]=1; |
|---|
| 378 |
$table_graph_hours[$mydate_hours][1]=$recordset[1]; |
|---|
| 379 |
} |
|---|
| 380 |
|
|---|
| 381 |
|
|---|
| 382 |
if (is_array($table_graph[$mydate])){ |
|---|
| 383 |
$table_graph[$mydate][0]++; |
|---|
| 384 |
$table_graph[$mydate][1]=$table_graph[$mydate][1]+$recordset[1]; |
|---|
| 385 |
}else{ |
|---|
| 386 |
$table_graph[$mydate][0]=1; |
|---|
| 387 |
$table_graph[$mydate][1]=$recordset[1]; |
|---|
| 388 |
} |
|---|
| 389 |
|
|---|
| 390 |
} |
|---|
| 391 |
|
|---|
| 392 |
$mmax=0; |
|---|
| 393 |
$totalcall==0; |
|---|
| 394 |
$totalminutes=0; |
|---|
| 395 |
foreach ($table_graph as $tkey => $data){ |
|---|
| 396 |
if ($mmax < $data[1]) $mmax=$data[1]; |
|---|
| 397 |
$totalcall+=$data[0]; |
|---|
| 398 |
$totalminutes+=$data[1]; |
|---|
| 399 |
} |
|---|
| 400 |
|
|---|
| 401 |
?> |
|---|
| 402 |
|
|---|
| 403 |
|
|---|
| 404 |
<!-- TITLE GLOBAL --> |
|---|
| 405 |
<center> |
|---|
| 406 |
<table border="0" cellspacing="0" cellpadding="0" width="80%"><tbody><tr><td align="left" height="30"> |
|---|
| 407 |
<table cellspacing="0" cellpadding="1" bgcolor="#000000" width="50%"><tbody><tr><td> |
|---|
| 408 |
<table cellspacing="0" cellpadding="0" width="100%"><tbody> |
|---|
| 409 |
<tr><td bgcolor="#600101" align="left"><font face="verdana" size="1" color="white"><b>TOTAL</b></font></td></tr> |
|---|
| 410 |
</tbody></table> |
|---|
| 411 |
</td></tr></tbody></table> |
|---|
| 412 |
</td></tr></tbody></table> |
|---|
| 413 |
|
|---|
| 414 |
<!-- FIN TITLE GLOBAL MINUTES //--> |
|---|
| 415 |
|
|---|
| 416 |
<table border="0" cellspacing="0" cellpadding="0" width="80%"> |
|---|
| 417 |
<tbody><tr><td bgcolor="#000000"> |
|---|
| 418 |
<table border="0" cellspacing="1" cellpadding="2" width="100%"><tbody> |
|---|
| 419 |
<tr> |
|---|
| 420 |
<td align="center" bgcolor="#600101"></td> |
|---|
| 421 |
<td bgcolor="#b72222" align="center" colspan="4"><font face="verdana" size="1" color="#ffffff"><b>ASTERISK MINUTES</b></font></td> |
|---|
| 422 |
</tr> |
|---|
| 423 |
<tr bgcolor="#600101"> |
|---|
| 424 |
<td align="right" bgcolor="#b72222"><font face="verdana" size="1" color="#ffffff"><b>DATE</b></font></td> |
|---|
| 425 |
<td align="center"><font face="verdana" size="1" color="#ffffff"><b>DURATION</b></font></td> |
|---|
| 426 |
<td align="center"><font face="verdana" size="1" color="#ffffff"><b>GRAPHIC</b></font></td> |
|---|
| 427 |
<td align="center"><font face="verdana" size="1" color="#ffffff"><b>CALLS</b></font></td> |
|---|
| 428 |
<td align="center"><font face="verdana" size="1" color="#ffffff"><b> <acronym title="Average Connection Time">ACT</acronym> </b></font></td> |
|---|
| 429 |
|
|---|
| 430 |
<!-- LOOP --> |
|---|
| 431 |
<?php |
|---|
| 432 |
$i=0; |
|---|
| 433 |
|
|---|
| 434 |
foreach ($table_graph as $tkey => $data){ |
|---|
| 435 |
$i=($i+1)%2; |
|---|
| 436 |
$tmc = $data[1]/$data[0]; |
|---|
| 437 |
|
|---|
| 438 |
$tmc_60 = sprintf("%02d",intval($tmc/60)).":".sprintf("%02d",intval($tmc%60)); |
|---|
| 439 |
|
|---|
| 440 |
$minutes_60 = sprintf("%02d",intval($data[1]/60)).":".sprintf("%02d",intval($data[1]%60)); |
|---|
| 441 |
$widthbar= intval(($data[1]/$mmax)*200); |
|---|
| 442 |
|
|---|
| 443 |
|
|---|
| 444 |
?> |
|---|
| 445 |
</tr><tr> |
|---|
| 446 |
<td align="right" class="sidenav" nowrap="nowrap"><font face="verdana" size="1" color="#ffffff"><?php echo $tkey?></font></td> |
|---|
| 447 |
<td bgcolor="<?php echo $FG_TABLE_ALTERNATE_ROW_COLOR[$i]?>" align="right" nowrap="nowrap"><font face="verdana" color="#000000" size="1"><?php echo $minutes_60?> </font></td> |
|---|
| 448 |
<td bgcolor="<?php echo $FG_TABLE_ALTERNATE_ROW_COLOR[$i]?>" align="left" nowrap="nowrap" width="<?php echo $widthbar+60?>"> |
|---|
| 449 |
<table cellspacing="0" cellpadding="0"><tbody><tr> |
|---|
| 450 |
<td bgcolor="#e22424"><img src="images/spacer.gif" width="<?php echo $widthbar?>" height="6"></td> |
|---|
| 451 |
</tr></tbody></table></td> |
|---|
| 452 |
<td bgcolor="<?php echo $FG_TABLE_ALTERNATE_ROW_COLOR[$i]?>" align="right" nowrap="nowrap"><font face="verdana" color="#000000" size="1"><?php echo $data[0]?></font></td> |
|---|
| 453 |
<td bgcolor="<?php echo $FG_TABLE_ALTERNATE_ROW_COLOR[$i]?>" align="right" nowrap="nowrap"><font face="verdana" color="#000000" size="1"><?php echo $tmc_60?> </font></td> |
|---|
| 454 |
<?php } |
|---|
| 455 |
$total_tmc_60 = sprintf("%02d",intval(($totalminutes/$totalcall)/60)).":".sprintf("%02d",intval(($totalminutes/$totalcall)%60)); |
|---|
| 456 |
$total_minutes_60 = sprintf("%02d",intval($totalminutes/60)).":".sprintf("%02d",intval($totalminutes%60)); |
|---|
| 457 |
|
|---|
| 458 |
?> |
|---|
| 459 |
</tr> |
|---|
| 460 |
<!-- FIN DETAIL --> |
|---|
| 461 |
|
|---|
| 462 |
|
|---|
| 463 |
<!-- FIN BOUCLE --> |
|---|
| 464 |
|
|---|
| 465 |
<!-- TOTAL --> |
|---|
| 466 |
<tr bgcolor="#600101"> |
|---|
| 467 |
<td align="right" nowrap="nowrap"><font face="verdana" size="1" color="#ffffff"><b>TOTAL</b></font></td> |
|---|
| 468 |
<td align="center" nowrap="nowrap" colspan="2"><font face="verdana" size="1" color="#ffffff"><b><?php echo $total_minutes_60?> </b></font></td> |
|---|
| 469 |
<td align="center" nowrap="nowrap"><font face="verdana" size="1" color="#ffffff"><b><?php echo $totalcall?></b></font></td> |
|---|
| 470 |
<td align="center" nowrap="nowrap"><font face="verdana" size="1" color="#ffffff"><b><?php echo $total_tmc_60?></b></font></td> |
|---|
| 471 |
</tr> |
|---|
| 472 |
<!-- FIN TOTAL --> |
|---|
| 473 |
|
|---|
| 474 |
</tbody></table> |
|---|
| 475 |
<!-- Fin Tableau Global //--> |
|---|
| 476 |
|
|---|
| 477 |
</td></tr></tbody></table> |
|---|
| 478 |
<br> |
|---|
| 479 |
<IMG SRC="graph_statbar.php?min_call=<?php echo $min_call?>&fromstatsday_sday=<?php echo $fromstatsday_sday?>&days_compare=<?php echo $days_compare?>&fromstatsmonth_sday=<?php echo $fromstatsmonth_sday?>&dsttype=<?php echo $dsttype?>&sourcetype=<?php echo $sourcetype?>&clidtype=<?php echo $clidtype?>&channel=<?php echo $channel?>&resulttype=<?php echo $resulttype?>&dst=<?php echo $dst?>&src=<?php echo $src?>&clid=<?php echo $clid?>&userfieldtype=<?php echo $userfieldtype?>&userfield=<?php echo $userfield?>&accountcodetype=<?php echo $accountcodetype?>&accountcode=<?php echo $accountcode?>" ALT="Stat Graph"> |
|---|
| 480 |
|
|---|
| 481 |
|
|---|
| 482 |
|
|---|
| 483 |
<!-- ** ** ** ** ** HOURLY LOAD ** ** ** ** ** --> |
|---|
| 484 |
|
|---|
| 485 |
<br/> |
|---|
| 486 |
<center>Select the hour interval to see the details |
|---|
| 487 |
<FORM METHOD=POST ACTION="graph_hourdetail.php?posted=<?php echo $posted?>&min_call=<?php echo $min_call?>&fromstatsday_sday=<?php echo $fromstatsday_sday?>&days_compare=<?php echo $days_compare?>&fromstatsmonth_sday=<?php echo $fromstatsmonth_sday?>&dsttype=<?php echo $dsttype?>&sourcetype=<?php echo $sourcetype?>&clidtype=<?php echo $clidtype?>&channel=<?php echo $channel?>&resulttype=<?php echo $resulttype?>&dst=<?php echo $dst?>&src=<?php echo $src?>&clid=<?php echo $clid?>&userfieldtype=<?php echo $userfieldtype?>&userfield=<?php echo $userfield?>&accountcodetype=<?php echo $accountcodetype?>&accountcode=<?php echo $accountcode?>" target="superframe"> |
|---|
| 488 |
<!-- ** ** ** ** ** HOURLY LOAD ** ** ** ** ** --> |
|---|
| 489 |
<table class="bar-status" width="60%" border="0" cellspacing="1" cellpadding="2" align="center"> |
|---|
| 490 |
<tbody> |
|---|
| 491 |
<tr> |
|---|
| 492 |
<td align="left" bgcolor="#000033"> |
|---|
| 493 |
<font face="verdana" size="1" color="#ffffff"><b> HOUR INTERVAL :</b></font> |
|---|
| 494 |
</td> |
|---|
| 495 |
<td class="bar-search" align="center" bgcolor="#acbdee"> |
|---|
| 496 |
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td> |
|---|
| 497 |
<select name="hourinterval"> |
|---|
| 498 |
<?php |
|---|
| 499 |
for ($i=0;$i<=23;$i++){ |
|---|
| 500 |
echo '<option value="'.sprintf("%02d",$i)."\"> Interval [".sprintf("%02d",$i).'h to '.sprintf("%02d",$i+1).'h] </option>'; |
|---|
| 501 |
} |
|---|
| 502 |
?> |
|---|
| 503 |
</select> |
|---|
| 504 |
|
|---|
| 505 |
</td> |
|---|
| 506 |
</tr></table></td> |
|---|
| 507 |
</tr> |
|---|
| 508 |
|
|---|
| 509 |
<tr> |
|---|
| 510 |
<td align="left" bgcolor="#555577"> |
|---|
| 511 |
<font face="verdana" size="1" color="#ffffff"><b> TYPE GRAPH :</b></font> |
|---|
| 512 |
</td> |
|---|
| 513 |
<td class="bar-search" align="center" bgcolor="#cddeff"> |
|---|
| 514 |
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td> |
|---|
| 515 |
<select name="typegraph"> |
|---|
| 516 |
<option value="fluctuation"> FLUCTUATION GRAPH</option> <option value="watch-call" selected> WATCH CALLS GRAPH</option> |
|---|
| 517 |
</select> |
|---|
| 518 |
|
|---|
| 519 |
</td> |
|---|
| 520 |
</tr></table></td> |
|---|
| 521 |
</tr> |
|---|
| 522 |
|
|---|
| 523 |
<tr> |
|---|
| 524 |
<td class="bar-search" align="left" bgcolor="#000033"> </td> |
|---|
| 525 |
|
|---|
| 526 |
<td class="bar-search" align="center" bgcolor="#acbdee"> |
|---|
| 527 |
<input type="image" name="image16" align="top" border="0" src="images/button-search.gif" /> |
|---|
| 528 |
|
|---|
| 529 |
</td> |
|---|
| 530 |
</tr> |
|---|
| 531 |
</tbody></table> |
|---|
| 532 |
</FORM> |
|---|
| 533 |
</center> |
|---|
| 534 |
<br> |
|---|
| 535 |
<center> |
|---|
| 536 |
<iframe name="superframe" src="graph_hourdetail.php?posted=<?php echo $posted?>&min_call=<?php echo $min_call?>&fromstatsday_sday=<?php echo $fromstatsday_sday?>&days_compare=<?php echo $days_compare?>&fromstatsmonth_sday=<?php echo $fromstatsmonth_sday?>&dsttype=<?php echo $dsttype?>&sourcetype=<?php echo $sourcetype?>&clidtype=<?php echo $clidtype?>&channel=<?php echo $channel?>&resulttype=<?php echo $resulttype?>&dst=<?php echo $dst?>&src=<?php echo $src?>&clid=<?php echo $clid?>&userfieldtype=<?php echo $userfieldtype?>&userfield=<?php echo $userfield?>&accountcodetype=<?php echo $accountcodetype?>&accountcode=<?php echo $accountcode?>" BGCOLOR=white width=770 height=800 marginWidth=0 marginHeight=0 frameBorder=0 scrolling=yes> |
|---|
| 537 |
|
|---|
| 538 |
</iframe> |
|---|
| 539 |
</center> |
|---|
| 540 |
|
|---|
| 541 |
|
|---|
| 542 |
</center> |
|---|
| 543 |
|
|---|
| 544 |
<?php }else{ ?> |
|---|
| 545 |
<center><h3>No calls in your selection.</h3></center> |
|---|
| 546 |
<?php } ?> |
|---|
| 547 |
|
|---|