call-last-month.php
来自「asterisk用 的voip记费软件」· PHP 代码 · 共 539 行 · 第 1/2 页
PHP
539 行
<script language="JavaScript" type="text/JavaScript"><!--function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features);}//--></script><!-- ** ** ** ** ** Part for the research ** ** ** ** ** --> <center> <FORM METHOD=POST name="myForm" ACTION="<?php echo $PHP_SELF?>?s=<?php echo $s?>&t=<?php echo $t?>&order=<?php echo $order?>&sens=<?php echo $sens?>¤t_page=<?php echo $current_page?>"> <INPUT TYPE="hidden" NAME="posted" value=1> <table class="bar-status" width="80%" border="0" cellspacing="1" cellpadding="2" align="center"> <tbody> <tr> <td align="left" valign="top" class="bgcolor_004"> <font class="fontstyle_003"> <?php echo gettext("CUSTOMERS");?></font> </td> <td class="bgcolor_005" align="left"> <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr> <td class="fontstyle_searchoptions"> <?php echo gettext("Enter the cardnumber");?>: <INPUT TYPE="text" NAME="entercustomer" value="<?php echo $entercustomer?>" class="form_input_text"> <a href="#" onclick="window.open('../A2B_entity_card.php?popup_select=2&popup_formname=myForm&popup_fieldname=entercustomer' , 'CardNumberSelection','width=550,height=330,top=20,left=100,scrollbars=1');"><img src="<?php echo Images_Path;?>/icon_arrow_orange.gif"></a> </td> <td align="right" class="fontstyle_searchoptions""> <?php echo gettext("Provider");?>: <INPUT TYPE="text" NAME="enterprovider" value="<?php echo $enterprovider?>" size="4" class="form_input_text"> <a href="#" onclick="window.open('../A2B_entity_provider.php?popup_select=2&popup_formname=myForm&popup_fieldname=enterprovider' , 'ProviderSelection','width=550,height=330,top=20,left=100,scrollbars=1,scrollbars=1');"><img src="<?php echo Images_Path;?>/icon_arrow_orange.gif"></a> <?php echo gettext("Trunk");?>: <INPUT TYPE="text" NAME="entertrunk" value="<?php echo $entertrunk?>" size="4" class="form_input_text"> <a href="#" onclick="window.open('../A2B_entity_trunk.php?popup_select=2&popup_formname=myForm&popup_fieldname=entertrunk' , 'TrunkSelection','width=550,height=330,top=20,left=100,scrollbars=1');"><img src="<?php echo Images_Path;?>/icon_arrow_orange.gif"></a> </td> </tr></table></td> </tr> <tr> <td align="left" class="bgcolor_002"> <font class="fontstyle_003"> <?php echo gettext("SELECT MONTH");?></font> </td> <td align="left" class="bgcolor_003"> <table width="100%" border="0" cellspacing="0" cellpadding="0" > <tr><td class="fontstyle_searchoptions"> <?php echo gettext("From");?> : <select name="fromstatsmonth_sday" class="form_input_select"> <?php $monthname = array( gettext("January"), gettext("February"),gettext("March"), gettext("April"), gettext("May"), gettext("June"), gettext("July"), gettext("August"), gettext("September"), gettext("October"), gettext("November"), gettext("December")); $year_actual = date("Y"); for ($i=$year_actual;$i >= $year_actual-1;$i--) { if ($year_actual==$i){ $monthnumber = date("n")-1; // Month number without lead 0. }else{ $monthnumber=11; } for ($j=$monthnumber;$j>=0;$j--){ $month_formated = sprintf("%02d",$j+1); if ($fromstatsmonth_sday=="$i-$month_formated") $selected="selected"; else $selected=""; echo "<OPTION value=\"$i-$month_formated\" $selected> $monthname[$j]-$i </option>"; } } ?> </select> </td><td class="fontstyle_searchoptions"> <?php echo gettext("Number of months to compare");?> : <select name="months_compare" class="form_input_select"> <option value="6" <?php if ($months_compare=="6"){ echo "selected";}?>>- 6 <?php echo gettext("months");?></option> <option value="5" <?php if ($months_compare=="5"){ echo "selected";}?>>- 5 <?php echo gettext("months");?></option> <option value="4" <?php if ($months_compare=="4"){ echo "selected";}?>>- 4 <?php echo gettext("months");?></option> <option value="3" <?php if ($months_compare=="3"){ echo "selected";}?>>- 3 <?php echo gettext("months");?></option> <option value="2" <?php if (($months_compare=="2")|| !isset($months_compare)){ echo "selected";}?>>- 2 <?php echo gettext("months");?></option> <option value="1" <?php if ($months_compare=="1"){ echo "selected";}?>>- 1 <?php echo gettext("months");?></option> </select> </td></tr></table> </td> </tr> <tr> <td class="bgcolor_004" align="left" > <font class="fontstyle_003" > <?php echo gettext("DESTINATION");?></font> </td> <td class="bgcolor_005" align="left" > <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr><td class="fontstyle_searchoptions"> <INPUT TYPE="text" NAME="dst" value="<?php echo $dst?>" class="form_input_select"></td> <td align="center" class="fontstyle_searchoptions"><input type="radio" NAME="dsttype" value="1" <?php if((!isset($dsttype))||($dsttype==1)){?>checked<?php }?>><?php echo gettext("Exact");?></td> <td align="center" class="fontstyle_searchoptions"><input type="radio" NAME="dsttype" value="2" <?php if($dsttype==2){?>checked<?php }?>><?php echo gettext("Begins with");?></td> <td align="center" class="fontstyle_searchoptions"><input type="radio" NAME="dsttype" value="3" <?php if($dsttype==3){?>checked<?php }?>><?php echo gettext("Contains");?></td> <td align="center" class="fontstyle_searchoptions"><input type="radio" NAME="dsttype" value="4" <?php if($dsttype==4){?>checked<?php }?>><?php echo gettext("Ends with");?></td> </tr></table></td> </tr> <tr> <td class="bgcolor_002" align="left" > </td> <td class="bgcolor_003" align="center"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="bgcolor_003"> <tr> <td align="center"> <input type="image" name="image16" align="top" border="0" src="<?php echo Images_Path;?>/button-search.gif" /> </td></tr></table> </td> </tr> </tbody></table> </FORM></center><!-- ** ** ** ** ** Part to display the GRAPHIC ** ** ** ** ** --><br><br><?php if ($FG_DEBUG == 3) print_r($list);if (is_array($list) && count($list)>0){$table_graph=array();$table_graph_hours=array();$numm=0;foreach ($list_total as $recordset){ $numm++; $mydate= substr($recordset[0],0,10); $mydate_hours= substr($recordset[0],0,13); //echo "$mydate<br>"; if (is_array($table_graph_hours[$mydate_hours])){ $table_graph_hours[$mydate_hours][0]++; $table_graph_hours[$mydate_hours][1]=$table_graph_hours[$mydate_hours][1]+$recordset[1]; }else{ $table_graph_hours[$mydate_hours][0]=1; $table_graph_hours[$mydate_hours][1]=$recordset[1]; } if (is_array($table_graph[$mydate])){ $table_graph[$mydate][0]++; $table_graph[$mydate][1]=$table_graph[$mydate][1]+$recordset[1]; }else{ $table_graph[$mydate][0]=1; $table_graph[$mydate][1]=$recordset[1]; } }$mmax=0;$totalcall==0;$totalminutes=0;foreach ($table_graph as $tkey => $data){ if ($mmax < $data[1]) $mmax=$data[1]; $totalcall+=$data[0]; $totalminutes+=$data[1];}?><!-- TITLE GLOBAL --><center> <table border="0" cellspacing="0" cellpadding="0" width="80%"><tbody><tr><td align="left" height="30"> <table cellspacing="0" cellpadding="1" bgcolor="#000000" width="50%"><tbody><tr><td> <table cellspacing="0" cellpadding="0" width="100%"><tbody> <tr><td class="bgcolor_019" align="left"><font class="fontstyle_003"><?php echo gettext("TOTAL");?></font></td></tr> </tbody></table> </td></tr></tbody></table> </td></tr></tbody></table> <!-- FIN TITLE GLOBAL MINUTES //--> <table border="0" cellspacing="0" cellpadding="0" width="80%"><tbody><tr><td bgcolor="#000000"> <table border="0" cellspacing="1" cellpadding="2" width="100%"><tbody> <tr> <td align="center" class="bgcolor_019"></td> <td class="bgcolor_020" align="center" colspan="4"><font class="fontstyle_003"><?php echo gettext("ASTERISK MINUTES");?></font></td> </tr> <tr class="bgcolor_019"> <td align="right" class="bgcolor_020"><font class="fontstyle_003"><?php echo gettext("DATE");?></font></td> <td align="center"><font class="fontstyle_003"><?php echo gettext("DURATION");?></font></td> <td align="center"><font class="fontstyle_003"><?php echo gettext("GRAPHIC");?></font></td> <td align="center"><font class="fontstyle_003"><?php echo gettext("CALLS");?></font></td> <td align="center"><font class="fontstyle_003"> <acronym title="<?php echo gettext("AVERAGE LENGTH OF CALL");?>"><?php echo gettext("ALOC");?></acronym></font></td> <!-- LOOP --> <?php $i=0; // #ffffff #cccccc foreach ($table_graph as $tkey => $data){ $i=($i+1)%2; $tmc = $data[1]/$data[0]; $tmc_60 = sprintf("%02d",intval($tmc/60)).":".sprintf("%02d",intval($tmc%60)); $minutes_60 = sprintf("%02d",intval($data[1]/60)).":".sprintf("%02d",intval($data[1]%60)); $widthbar= intval(($data[1]/$mmax)*200); //bgcolor="#336699" ?> </tr><tr> <td align="right" class="sidenav" nowrap="nowrap"><font class="fontstyle_006"><?php echo $tkey?></font></td> <td bgcolor="<?php echo $FG_TABLE_ALTERNATE_ROW_COLOR[$i]?>" align="right" nowrap="nowrap"><font class="fontstyle_006"><?php echo $minutes_60?> </font></td> <td bgcolor="<?php echo $FG_TABLE_ALTERNATE_ROW_COLOR[$i]?>" align="left" nowrap="nowrap" width="<?php echo $widthbar+60?>"> <table cellspacing="0" cellpadding="0"><tbody><tr> <td bgcolor="#e22424"><img src="images/spacer.gif" width="<?php echo $widthbar?>" height="6"></td> </tr></tbody></table></td> <td bgcolor="<?php echo $FG_TABLE_ALTERNATE_ROW_COLOR[$i]?>" align="right" nowrap="nowrap"><font class="fontstyle_006"><?php echo $data[0]?></font></td> <td bgcolor="<?php echo $FG_TABLE_ALTERNATE_ROW_COLOR[$i]?>" align="right" nowrap="nowrap"><font class="fontstyle_006"><?php echo $tmc_60?> </font></td> <?php } $total_tmc_60 = sprintf("%02d",intval(($totalminutes/$totalcall)/60)).":".sprintf("%02d",intval(($totalminutes/$totalcall)%60)); $total_minutes_60 = sprintf("%02d",intval($totalminutes/60)).":".sprintf("%02d",intval($totalminutes%60)); ?> </tr> <!-- FIN DETAIL --> <!-- FIN BOUCLE --> <!-- TOTAL --> <tr class="bgcolor_019"> <td align="right" nowrap="nowrap"><font class="fontstyle_003><?php echo gettext("TOTAL");?></font></td> <td align="center" nowrap="nowrap" colspan="2"><fontclass="fontstyle_003"><?php echo $total_minutes_60?> </font></td> <td align="center" nowrap="nowrap"><font class="fontstyle_003"><?php echo $totalcall?></font></td> <td align="center" nowrap="nowrap"><font class="fontstyle_003"><?php echo $total_tmc_60?></font></td> </tr> <!-- FIN TOTAL --> </tbody></table> <!-- Fin Tableau Global //--></td></tr></tbody></table> <br> <?php }else{ ?> <?php } ?><?php if ($posted==1){ ?> <center> <?php echo gettext("TRAFFIC")?><br> <IMG SRC="graph_pie.php?graphtype=1&min_call=<?php echo $min_call?>&fromstatsday_sday=<?php echo $fromstatsday_sday?>&months_compare=<?php echo $months_compare?>&fromstatsmonth_sday=<?php echo $fromstatsmonth_sday?>&dsttype=<?php echo $dsttype?>&srctype=<?php echo $srctype?>&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?>&customer=<?php echo $customer?>&entercustomer=<?php echo $entercustomer?>&enterprovider=<?php echo $enterprovider?>&entertrunk=<?php echo $entertrunk?>" ALT="<?php echo gettext("Stat Graph");?>"> </center> <br> <center> <?php echo gettext("PROFIT")?> <br> <IMG SRC="graph_pie.php?graphtype=2&min_call=<?php echo $min_call?>&fromstatsday_sday=<?php echo $fromstatsday_sday?>&months_compare=<?php echo $months_compare?>&fromstatsmonth_sday=<?php echo $fromstatsmonth_sday?>&dsttype=<?php echo $dsttype?>&srctype=<?php echo $srctype?>&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?>&customer=<?php echo $customer?>&entercustomer=<?php echo $entercustomer?>&enterprovider=<?php echo $enterprovider?>&entertrunk=<?php echo $entertrunk?>" ALT="<?php echo gettext("Stat Graph");?>"> </center> <br> <center> <?php echo gettext("SELL")?> <br> <IMG SRC="graph_pie.php?graphtype=3&min_call=<?php echo $min_call?>&fromstatsday_sday=<?php echo $fromstatsday_sday?>&months_compare=<?php echo $months_compare?>&fromstatsmonth_sday=<?php echo $fromstatsmonth_sday?>&dsttype=<?php echo $dsttype?>&srctype=<?php echo $srctype?>&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?>&customer=<?php echo $customer?>&entercustomer=<?php echo $entercustomer?>&enterprovider=<?php echo $enterprovider?>&entertrunk=<?php echo $entertrunk?>" ALT="<?php echo gettext("Stat Graph");?>"> </center> <?php } ?></center><br><br><?php $smarty->display('footer.tpl');?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?