Changeset 1005

Show
Ignore:
Timestamp:
09/14/08 00:01:09 (2 years ago)
Author:
areski
Message:

Optimization on terminatecause

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/agent/Public/call-comp.php

    r778 r1005  
    55 
    66 
    7 if (! has_rights (ACX_CALL_REPORT)){  
     7if (! has_rights (ACX_CALL_REPORT)) {  
    88        Header ("HTTP/1.0 401 Unauthorized"); 
    99        Header ("Location: PP_error.php?c=accessdenied");           
     
    7070 
    7171$FG_TABLE_COL[]=array (gettext("CardUsed"), "username", "11%", "center", "SORT", "", "30", "", "", "", "", "linktocustomer"); 
    72 $FG_TABLE_COL[]=array (gettext("terminatecause"), "terminatecause", "10%", "center", "SORT", "30"); 
     72$FG_TABLE_COL[]=array (gettext("terminatecauseid"), "terminatecauseid", "10%", "center", "SORT", "30"); 
    7373$FG_TABLE_COL[]=array (gettext("IAX/SIP"), "sipiax", "6%", "center", "SORT",  "", "list", $yesno); 
    7474//$FG_TABLE_COL[]=array ("DestID", "destID", "12%", "center", "SORT", "30"); 
     
    9191// This Variable store the argument for the SQL query 
    9292 
    93 $FG_COL_QUERY='t1.starttime, t1.calledstation, t1.destination, t1.sessiontime, t1.username, t1.terminatecause, t1.sipiax, t1.calledrate, t1.sessionbill'; 
     93$FG_COL_QUERY='t1.starttime, t1.calledstation, t1.destination, t1.sessiontime, t1.username, t1.terminatecauseid, t1.sipiax, t1.calledrate, t1.sessionbill'; 
    9494// t1.stoptime, 
    9595 
  • trunk/agent/Public/call-count-reporting.php

    r778 r1005  
    44include ("../lib/agent.smarty.php"); 
    55 
    6 if (! has_rights (ACX_CALL_REPORT)){  
     6if (! has_rights (ACX_CALL_REPORT)) {  
    77        Header ("HTTP/1.0 401 Unauthorized"); 
    88        Header ("Location: PP_error.php?c=accessdenied");           
     
    1010} 
    1111 
    12 getpost_ifset(array('inputtopvar','topsearch', 'posted', 'Period', 'frommonth', 'fromstatsmonth', 'tomonth', 'tostatsmonth', 'fromday', 'fromstatsday_sday', 'fromstatsmonth_sday', 'today', 'tostatsday_sday', 'tostatsmonth_sday', 'resulttype', 'stitle', 'atmenu', 'current_page', 'order', 'sens', 'choose_currency', 'terminatecause', 'nodisplay','grouped')); 
     12getpost_ifset(array('inputtopvar','topsearch', 'posted', 'Period', 'frommonth', 'fromstatsmonth', 'tomonth', 'tostatsmonth', 'fromday', 'fromstatsday_sday', 'fromstatsmonth_sday', 'today', 'tostatsday_sday', 'tostatsmonth_sday', 'resulttype', 'stitle', 'atmenu', 'current_page', 'order', 'sens', 'choose_currency', 'terminatecauseid', 'nodisplay','grouped')); 
    1313 
    1414//var $field=array(); 
     
    7171$FG_TABLE_COL[]=array (gettext("Sell"), "cost", "25%", "center","sort","","","","","","","display_2bill"); 
    7272if ($grouped) $FG_TABLE_COL[]=array (gettext("Calldate"), "day", "10%", "center", "SORT", "19", "", "", "", "", "", "display_dateformat"); 
    73 $FG_TABLE_COL[]=array (gettext("terminatecause"), "terminatecause", "10%", "center", "SORT", "30"); 
     73$FG_TABLE_COL[]=array (gettext("terminatecauseid"), "terminatecauseid", "10%", "center", "SORT", "30"); 
    7474 
    7575if ((isset($inputtopvar)) && ($inputtopvar!="") && (isset($topsearch)) && ($topsearch!="")){ 
     
    7878 
    7979if ($grouped){ 
    80         $FG_COL_QUERY=$field[1].', sum(sessiontime) AS calltime, sum(sessionbill) as cost, sum(buycost) as buy,substring(starttime,1,10) AS day,terminatecause, count(*) as nbcall'; 
    81         $SQL_GROUP="GROUP BY ".$field[1].",day,terminatecause "; 
     80        $FG_COL_QUERY=$field[1].', sum(sessiontime) AS calltime, sum(sessionbill) as cost, sum(buycost) as buy,substring(starttime,1,10) AS day,terminatecauseid, count(*) as nbcall'; 
     81        $SQL_GROUP="GROUP BY ".$field[1].",day,terminatecauseid "; 
    8282}else{ 
    83         $FG_COL_QUERY=$field[1].', sum(sessiontime) AS calltime, sum(sessionbill) as cost, sum(buycost) as buy,terminatecause, count(*) as nbcall'; 
    84         $SQL_GROUP="GROUP BY ".$field[1].",terminatecause "; 
     83        $FG_COL_QUERY=$field[1].', sum(sessiontime) AS calltime, sum(sessionbill) as cost, sum(buycost) as buy,terminatecauseid, count(*) as nbcall'; 
     84        $SQL_GROUP="GROUP BY ".$field[1].",terminatecauseid "; 
    8585} 
    8686 
     
    144144 
    145145 
    146 //To select just terminatecause=ANSWER 
    147 if (!isset($terminatecause)){ 
    148         $terminatecause="ANSWER"; 
    149 } 
    150 if ($terminatecause=="ANSWER") { 
     146//To select just terminatecauseid=ANSWER 
     147if (!isset($terminatecauseid)){ 
     148        $terminatecauseid="ANSWER"; 
     149} 
     150if ($terminatecauseid=="ANSWER") { 
    151151        if (strlen($FG_TABLE_CLAUSE)>0) $FG_TABLE_CLAUSE.=" AND "; 
    152         $FG_TABLE_CLAUSE.=" (terminatecause='ANSWER' OR terminatecause='ANSWERED') "; 
     152        $FG_TABLE_CLAUSE.=" (terminatecauseid=1) "; 
    153153} 
    154154 
     
    161161if ((isset($inputtopvar)) && ($inputtopvar!="") && (isset($topsearch)) && ($topsearch!="")){ 
    162162        if ($grouped){ 
    163                 $FG_COL_QUERY1=$field[1].', sum(sessiontime) AS sessiontime, sum(sessionbill) as sessionbill, sum(buycost) as buycost,substring(starttime,1,10) AS starttime,terminatecause, count(*) as nbcall'; 
    164                 $SQL_GROUP1=" GROUP BY $field[1],starttime,terminatecause"; 
     163                $FG_COL_QUERY1=$field[1].', sum(sessiontime) AS sessiontime, sum(sessionbill) as sessionbill, sum(buycost) as buycost,substring(starttime,1,10) AS starttime,terminatecauseid, count(*) as nbcall'; 
     164                $SQL_GROUP1=" GROUP BY $field[1],starttime,terminatecauseid"; 
    165165        }else{ 
    166                 $FG_COL_QUERY1=$field[1].', sum(sessiontime) AS sessiontime, sum(sessionbill) as sessionbill, sum(buycost) as buycost,terminatecause, count(*) as nbcall,starttime'; 
    167                 $SQL_GROUP1=" GROUP BY $field[1],terminatecause,starttime"; 
     166                $FG_COL_QUERY1=$field[1].', sum(sessiontime) AS sessiontime, sum(sessionbill) as sessionbill, sum(buycost) as buycost,terminatecauseid, count(*) as nbcall,starttime'; 
     167                $SQL_GROUP1=" GROUP BY $field[1],terminatecauseid,starttime"; 
    168168        } 
    169169        $QUERY = "CREATE TEMPORARY TABLE temp_result AS (SELECT $FG_COL_QUERY1 FROM $FG_TABLE_NAME WHERE $FG_TABLE_CLAUSE  $SQL_GROUP1 ORDER BY nbcall DESC LIMIT $inputtopvar)"; 
     
    172172                $FG_TABLE_NAME="temp_result"; 
    173173                if ($grouped){ 
    174                         $FG_COL_QUERY=$field[1].', sum(sessiontime) AS calltime, sum(sessionbill) as cost, sum(buycost) as buy,substring(starttime,1,10) AS day,terminatecause, nbcall'; 
    175                         $SQL_GROUP=" GROUP BY ".$field[1].",day,terminatecause,nbcall "; 
     174                        $FG_COL_QUERY=$field[1].', sum(sessiontime) AS calltime, sum(sessionbill) as cost, sum(buycost) as buy,substring(starttime,1,10) AS day,terminatecauseid, nbcall'; 
     175                        $SQL_GROUP=" GROUP BY ".$field[1].",day,terminatecauseid,nbcall "; 
    176176                        $QUERY_TOTAL = "SELECT sum(sessiontime) AS calltime, sum(sessionbill) as cost, sum(buycost) as buy, sum(nbcall) as nbcall,substring(starttime,1,10) AS day FROM $FG_TABLE_NAME GROUP BY day"; 
    177177                }else{ 
    178                         $FG_COL_QUERY=$field[1].', sum(sessiontime) AS calltime, sum(sessionbill) as cost, sum(buycost) as buy,terminatecause, nbcall'; 
    179                         $SQL_GROUP=" GROUP BY ".$field[1].",terminatecause,nbcall "; 
     178                        $FG_COL_QUERY=$field[1].', sum(sessiontime) AS calltime, sum(sessionbill) as cost, sum(buycost) as buy,terminatecauseid, nbcall'; 
     179                        $SQL_GROUP=" GROUP BY ".$field[1].",terminatecauseid,nbcall "; 
    180180                        $QUERY_TOTAL = "SELECT sum(sessiontime) AS calltime, sum(sessionbill) as cost, sum(buycost) as buy, sum(nbcall) as nbcall FROM $FG_TABLE_NAME"; 
    181181                } 
     
    410410                                   <td width="80%"  class="fontstyle_searchoptions">                                             
    411411                                  <?php echo gettext("Answered Calls")?> 
    412                                   <input name="terminatecause" type="radio" value="ANSWER" <?php if((!isset($terminatecause))||($terminatecause=="ANSWER")){?>checked<?php }?> />  
     412                                  <input name="terminatecauseid" type="radio" value="ANSWER" <?php if((!isset($terminatecauseid))||($terminatecauseid=="ANSWER")){?>checked<?php }?> />  
    413413                                  <?php echo gettext("All Calls")?>      
    414                                    <input name="terminatecause" type="radio" value="ALL" <?php if($terminatecause=="ALL"){?>checked<?php }?>/> 
     414                                   <input name="terminatecauseid" type="radio" value="ALL" <?php if($terminatecauseid=="ALL"){?>checked<?php }?>/> 
    415415                                        </td> 
    416416                                </tr> 
     
    518518                    <?php  if (strtoupper($FG_TABLE_COL[$i][4])=="SORT"){?> 
    519519                    <a href="<?php  echo $PHP_SELF."?s=1&t=0&stitle=$stitle&atmenu=$atmenu&current_page=$current_page&order=".$FG_TABLE_COL[$i][1]."&sens="; if ($sens=="ASC"){echo"DESC";}else{echo"ASC";}  
    520                                         echo "&topsearch=$topsearch&inputtopvar=$inputtopvar&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&resulttype=$resulttype&terminatecause=$terminatecause&grouped=$grouped";?>">  
     520                                        echo "&topsearch=$topsearch&inputtopvar=$inputtopvar&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&resulttype=$resulttype&terminatecauseid=$terminatecauseid&grouped=$grouped";?>">  
    521521                    <span class="liens"><?php  } ?> 
    522522                    <?php echo $FG_TABLE_COL[$i][0]?>  
     
    610610                    <?php if ($current_page>0){?> 
    611611                    <img src="<?php echo Images_Path;?>/fleche-g.gif" width="5" height="10"> <a href="<?php echo $PHP_SELF?>?s=1&t=0&order=<?php echo $order?>&sens=<?php echo $sens?>&current_page=<?php  echo ($current_page-1)?><?php  if (!is_null($letter) && ($letter!="")){ echo "&letter=$letter";}  
    612                                         echo "&topsearch=$topsearch&inputtopvar=$inputtopvar&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&resulttype=$resulttype&terminatecause=$terminatecause&grouped=$grouped";?>"> 
     612                                        echo "&topsearch=$topsearch&inputtopvar=$inputtopvar&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&resulttype=$resulttype&terminatecauseid=$terminatecauseid&grouped=$grouped";?>"> 
    613613                    <?php echo gettext("Previous");?> </a> - 
    614614                    <?php }?> 
     
    616616                    <?php if ($current_page<$nb_record_max-1){?> 
    617617                    - <a href="<?php echo $PHP_SELF?>?s=1&t=0&order=<?php echo $order?>&sens=<?php echo $sens?>&current_page=<?php  echo ($current_page+1)?><?php  if (!is_null($letter) && ($letter!="")){ echo "&letter=$letter";} 
    618                                         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&clidtype=$clidtype&resulttype=$resulttype&clid=$clid&terminatecause=$terminatecause&topsearch=$topsearch&inputtopvar=$inputtopvar&grouped=$grouped";?>"> 
     618                                        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&clidtype=$clidtype&resulttype=$resulttype&clid=$clid&terminatecauseid=$terminatecauseid&topsearch=$topsearch&inputtopvar=$inputtopvar&grouped=$grouped";?>"> 
    619619                    <?php echo gettext("Next");?></a> <img src="<?php echo Images_Path;?>/fleche-d.gif" width="5" height="10"> 
    620620                    </B></TD></SPAN>  
  • trunk/agent/Public/call-daily-load.php

    r778 r1005  
    7272 
    7373$FG_TABLE_COL[]=array (gettext("CardUsed"), "username", "11%", "center", "SORT", "", "30", "", "", "", "", "linktocustomer"); 
    74 $FG_TABLE_COL[]=array (gettext("terminatecause"), "terminatecause", "10%", "center", "SORT", "30"); 
     74$FG_TABLE_COL[]=array (gettext("terminatecauseid"), "terminatecauseid", "10%", "center", "SORT", "30"); 
    7575$FG_TABLE_COL[]=array (gettext("IAX/SIP"), "sipiax", "6%", "center", "SORT",  "", "list", $yesno); 
    7676//$FG_TABLE_COL[]=array ("DestID", "destID", "12%", "center", "SORT", "30"); 
     
    9393// This Variable store the argument for the SQL query 
    9494 
    95 $FG_COL_QUERY='t1.starttime, t1.calledstation, t1.destination, t1.sessiontime, t1.username, t1.terminatecause, t1.sipiax, t1.calledrate, t1.sessionbill'; 
     95$FG_COL_QUERY='t1.starttime, t1.calledstation, t1.destination, t1.sessiontime, t1.username, t1.terminatecauseid, t1.sipiax, t1.calledrate, t1.sessionbill'; 
    9696// t1.stoptime, 
    9797 
  • trunk/agent/Public/call-last-month.php

    r857 r1005  
    44include ("../lib/agent.smarty.php"); 
    55 
    6 if (! has_rights (ACX_CALL_REPORT)){  
     6if (! has_rights (ACX_CALL_REPORT)) {  
    77        Header ("HTTP/1.0 401 Unauthorized"); 
    88        Header ("Location: PP_error.php?c=accessdenied");           
     
    1515// graphtype = 1, 2, 3 , 4  
    1616// 1 : traffic - 2 : Profit - 3 : Sells -  4 : Buys 
    17 if (!isset ($current_page) || ($current_page == "")){  
     17if (!isset ($current_page) || ($current_page == "")) {         
    1818        $current_page=0; 
    1919} 
     
    4545$FG_TABLE_COL[]=array (gettext("Duration"), "sessiontime", "7%", "center", "SORT", "30", "", "", "", "", "", "display_minute"); 
    4646$FG_TABLE_COL[]=array (gettext("CardUsed"), "username", "11%", "center", "SORT", "", "30", "", "", "", "", "linktocustomer"); 
    47 $FG_TABLE_COL[]=array (gettext("terminatecause"), "terminatecause", "10%", "center", "SORT", "30"); 
     47$FG_TABLE_COL[]=array (gettext("terminatecauseid"), "terminatecauseid", "10%", "center", "SORT", "30"); 
    4848$FG_TABLE_COL[]=array (gettext("IAX/SIP"), "sipiax", "6%", "center", "SORT",  "", "list", $yesno); 
    4949$FG_TABLE_COL[]=array (gettext("InitialRate"), "calledrate", "10%", "center", "SORT", "30", "", "", "", "", "", "display_2dec"); 
     
    5353$FG_TABLE_DEFAULT_SENS = "DESC"; 
    5454         
    55 $FG_COL_QUERY='t1.starttime, t1.calledstation, t1.destination, t1.sessiontime, t1.username, t1.terminatecause, t1.sipiax, t1.calledrate, t1.sessionbill'; 
     55$FG_COL_QUERY='t1.starttime, t1.calledstation, t1.destination, t1.sessiontime, t1.username, t1.terminatecauseid, t1.sipiax, t1.calledrate, t1.sessionbill'; 
    5656 
    5757$FG_COL_QUERY_GRAPH='t1.starttime, t1.sessiontime'; 
  • trunk/agent/Public/call-log-customers.php

    r822 r1005  
    1111} 
    1212 
    13 getpost_ifset(array('customer', 'entercustomer', 'enterprovider', 'entertariffgroup', 'entertrunk', 'enterratecard', 'posted', 'Period', 'frommonth', 'fromstatsmonth', 'tomonth', 'tostatsmonth', 'fromday', 'fromstatsday_sday', 'fromstatsmonth_sday', 'today', 'tostatsday_sday', 'tostatsmonth_sday', 'dsttype', 'srctype', 'clidtype', 'channel', 'resulttype', 'stitle', 'atmenu', 'current_page', 'order', 'sens', 'dst', 'src', 'clid', 'choose_currency', 'terminatecause', 'choose_calltype')); 
     13getpost_ifset(array('customer', 'entercustomer', 'enterprovider', 'entertariffgroup', 'entertrunk', 'enterratecard', 'posted', 'Period', 'frommonth', 'fromstatsmonth', 'tomonth', 'tostatsmonth', 'fromday', 'fromstatsday_sday', 'fromstatsmonth_sday', 'today', 'tostatsday_sday', 'tostatsmonth_sday', 'dsttype', 'srctype', 'clidtype', 'channel', 'resulttype', 'stitle', 'atmenu', 'current_page', 'order', 'sens', 'dst', 'src', 'clid', 'choose_currency', 'terminatecauseid', 'choose_calltype')); 
    1414 
    1515 
     
    7878$FG_TABLE_COL[]=array (gettext("CardUsed"), "username", "6%", "center", "SORT", "", "30", "", "", "", "", "linktocustomer"); 
    7979$FG_TABLE_COL[]=array (gettext("Trunk"), "trunkcode", "6%", "center", "SORT", "30"); 
    80 $FG_TABLE_COL[]=array ('<acronym title="'.gettext("Terminate Cause").'">'.gettext("TC").'</acronym>', "terminatecause", "7%", "center", "SORT", "30"); 
     80$FG_TABLE_COL[]=array ('<acronym title="'.gettext("Terminate Cause").'">'.gettext("TC").'</acronym>', "terminatecauseid", "7%", "center", "SORT", "30"); 
    8181$FG_TABLE_COL[]=array (gettext("Calltype"), "sipiax", "6%", "center", "SORT",  "", "list", $list_calltype); 
    8282$FG_TABLE_COL[]=array (gettext("Buy"), "buycost", "8%", "center", "SORT", "30", "", "", "", "", "", "display_2bill"); 
     
    9393         
    9494// This Variable store the argument for the SQL query 
    95 $FG_COL_QUERY='t1.starttime, t1.src, t1.calledstation, t1.destination, t1.sessiontime, t1.username, t3.trunkcode, t1.terminatecause, t1.sipiax, t1.buycost, t1.sessionbill, case when t1.sessionbill!=0 then ((t1.sessionbill-t1.buycost)/t1.sessionbill)*100 else NULL end as margin,case when t1.buycost!=0 then ((t1.sessionbill-t1.buycost)/t1.buycost)*100 else NULL end as markup'; 
     95$FG_COL_QUERY='t1.starttime, t1.src, t1.calledstation, t1.destination, t1.sessiontime, t1.username, t3.trunkcode, t1.terminatecauseid, t1.sipiax, t1.buycost, t1.sessionbill, case when t1.sessionbill!=0 then ((t1.sessionbill-t1.buycost)/t1.sessionbill)*100 else NULL end as margin,case when t1.buycost!=0 then ((t1.sessionbill-t1.buycost)/t1.buycost)*100 else NULL end as markup'; 
    9696if (LINK_AUDIO_FILE) { 
    9797        $FG_COL_QUERY .= ', t1.uniqueid'; 
     
    207207 
    208208$FG_ASR_CIC_CLAUSE = $FG_TABLE_CLAUSE; 
    209 //To select just terminatecause=ANSWER 
    210 if (!isset($terminatecause)) { 
    211         $terminatecause="ANSWER"; 
    212 } 
    213 if ($terminatecause=="ANSWER") { 
     209//To select just terminatecauseid=ANSWER 
     210if (!isset($terminatecauseid)) { 
     211        $terminatecauseid="ANSWER"; 
     212} 
     213if ($terminatecauseid=="ANSWER") { 
    214214        if (strlen($FG_TABLE_CLAUSE)>0) $FG_TABLE_CLAUSE.=" AND "; 
    215         $FG_TABLE_CLAUSE .= " (t1.terminatecause='ANSWER' OR t1.terminatecause='ANSWERED') "; 
     215        $FG_TABLE_CLAUSE .= " (t1.terminatecauseid=1) "; 
    216216} 
    217217 
     
    245245 
    246246 
    247 //************************************************************/ 
    248 // calculate nbr of success calls,nbr fail calls, max nbr of fail calls successfally / 
    249 //************************************************************/ 
    250  
    251 $QUERY="CREATE TEMPORARY TABLE ASR_CIC_TEMP AS (SELECT substring(t1.starttime,1,10) AS day,case when t1.terminatecause='ANSWER' then 1 else 0 end as success,case when t1.terminatecause ='ANSWER'  OR t1.terminatecause='ANSWERED' then 0 else 1 end as fail,0 as maxfail FROM $FG_TABLE_NAME WHERE ".$FG_TABLE_CLAUSE." ORDER BY day)"; 
    252 $max_fail=0; 
    253 $max=0; 
    254 $total_fail_succ=0; 
    255 $total_max_succ=0; 
    256 $update=array(); 
    257 if (!$nodisplay){ 
    258         $num = 0; 
    259         $res = $DBHandle -> Execute($QUERY); 
    260         $QUERY="SELECT * FROM ASR_CIC_TEMP order by day"; 
    261         $res = $DBHandle -> Execute($QUERY); 
    262         if ($res) 
    263                 $num = $res -> RecordCount(); 
    264         $pos=0; 
    265         for($i=0;$i<$num;$i++) 
    266         {        
    267                 $asr_cic_list [] =$res -> fetchRow(); 
    268                 if ($i>0) 
    269                 {        
    270                         if ($asr_cic_list[$i][0] == $asr_cic_list[$i-1][0] && $i<$num-1 && $asr_cic_list[$i][2]==1) { 
    271                                 $max++; 
    272                         }else { 
    273                                 if (($i==$num-1) && ($asr_cic_list[$i][2]==1)) $max++; 
    274                                 if ($max > $max_fail) { 
    275                                         $max_fail=$max; 
    276                                         $asr_cic_list1[$pos][3]=$max_fail; 
    277                                         $max=0; 
    278                                 } 
    279                                 if($asr_cic_list[$i][0] != $asr_cic_list[$i-1][0]){ 
    280                                         $pos++; 
    281                                         $success=0; 
    282                                         $fail=0; 
    283                                         $max_fail=0; 
    284                                 } 
    285                         } 
    286                          
    287                 }elseif($asr_cic_list[$i][2]==1){ 
    288                         $max++; 
    289                 } 
    290                 $success+=$asr_cic_list[$i][1]; 
    291                 $fail+=$asr_cic_list[$i][2]; 
    292                 $asr_cic_list1[$pos][0] = $asr_cic_list[$i][0]; 
    293                 $asr_cic_list1[$pos][1] = $success;  
    294                 $asr_cic_list1[$pos][2] = $fail; 
    295                  
    296                 if ($asr_cic_list[$i][2]==1){ 
    297                         $total_fail_succ++;      
    298                 }elseif($total_fail_succ > $total_max_succ){ 
    299                         $total_max_succ=$total_fail_succ; 
    300                         $total_fail_succ=0; 
    301                 } 
    302         } 
    303 } 
    304247 
    305248/************************/ 
     
    578521                           <td width="80%"  class="fontstyle_searchoptions"> 
    579522                                        <?php echo gettext("Answered Calls");?>   
    580                                         <input name="terminatecause" type="radio" value="ANSWER" <?php if((!isset($terminatecause))||($terminatecause=="ANSWER")){?>checked<?php }?> />  
     523                                        <input name="terminatecauseid" type="radio" value="ANSWER" <?php if((!isset($terminatecauseid))||($terminatecauseid=="ANSWER")){?>checked<?php }?> />  
    581524                                        <?php echo gettext("All Calls");?>   
    582                                         <input name="terminatecause" type="radio" value="ALL" <?php if($terminatecause=="ALL"){?>checked<?php }?>/> 
     525                                        <input name="terminatecauseid" type="radio" value="ALL" <?php if($terminatecauseid=="ALL"){?>checked<?php }?>/> 
    583526                                </td> 
    584527                        </tr> 
     
    657600                    <?php  if (strtoupper($FG_TABLE_COL[$i][4])=="SORT"){?> 
    658601                    <a href="<?php  echo $PHP_SELF."?customer=$customer&s=1&t=0&stitle=$stitle&atmenu=$atmenu&current_page=$current_page&order=".$FG_TABLE_COL[$i][1]."&sens="; if ($sens=="ASC"){echo"DESC";}else{echo"ASC";}  
    659                                         echo "&entercustomer=$entercustomer&enterprovider=$enterprovider&entertrunk=$entertrunk&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&srctype=$srctype&clidtype=$clidtype&channel=$channel&resulttype=$resulttype&dst=$dst&src=$src&clid=$clid&terminatecause=$terminatecause&choose_calltype=$choose_calltype";?>">  
     602                                        echo "&entercustomer=$entercustomer&enterprovider=$enterprovider&entertrunk=$entertrunk&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&srctype=$srctype&clidtype=$clidtype&channel=$channel&resulttype=$resulttype&dst=$dst&src=$src&clid=$clid&terminatecauseid=$terminatecauseid&choose_calltype=$choose_calltype";?>">  
    660603                    <span class="liens"><?php  } ?> 
    661604                    <?php echo $FG_TABLE_COL[$i][0]?>  
     
    778721                    <?php if ($current_page>0){?> 
    779722                    <img src="<?php echo Images_Path;?>/fleche-g.gif" width="5" height="10"> <a href="<?php echo $PHP_SELF?>?s=1&t=0&order=<?php echo $order?>&sens=<?php echo $sens?>&current_page=<?php  echo ($current_page-1)?><?php  if (!is_null($letter) && ($letter!="")){ echo "&letter=$letter";}  
    780                                         echo "&customer=$customer&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&srctype=$srctype&clidtype=$clidtype&channel=$channel&resulttype=$resulttype&dst=$dst&src=$src&clid=$clid&terminatecause=$terminatecause&choose_calltype=$choose_calltype&entercustomer=$entercustomer&enterprovider=$enterprovider&entertrunk=$entertrunk";?>"> 
     723                                        echo "&customer=$customer&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&srctype=$srctype&clidtype=$clidtype&channel=$channel&resulttype=$resulttype&dst=$dst&src=$src&clid=$clid&terminatecauseid=$terminatecauseid&choose_calltype=$choose_calltype&entercustomer=$entercustomer&enterprovider=$enterprovider&entertrunk=$entertrunk";?>"> 
    781724                    <?php echo gettext("Previous");?> </a> - 
    782725                    <?php }?> 
     
    784727                    <?php if ($current_page<$nb_record_max-1){?> 
    785728                    - <a href="<?php echo $PHP_SELF?>?s=1&t=0&order=<?php echo $order?>&sens=<?php echo $sens?>&current_page=<?php  echo ($current_page+1)?><?php  if (!is_null($letter) && ($letter!="")){ echo "&letter=$letter";} 
    786                                         echo "&customer=$customer&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&srctype=$srctype&clidtype=$clidtype&channel=$channel&resulttype=$resulttype&dst=$dst&src=$src&clid=$clid&terminatecause=$terminatecause&choose_calltype=$choose_calltype&entercustomer=$entercustomer&enterprovider=$enterprovider&entertrunk=$entertrunk";?>"> 
     729                                        echo "&customer=$customer&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&srctype=$srctype&clidtype=$clidtype&channel=$channel&resulttype=$resulttype&dst=$dst&src=$src&clid=$clid&terminatecauseid=$terminatecauseid&choose_calltype=$choose_calltype&entercustomer=$entercustomer&enterprovider=$enterprovider&entertrunk=$entertrunk";?>"> 
    787730                    <?php echo gettext("Next");?></a> <img src="<?php echo Images_Path;?>/fleche-d.gif" width="5" height="10"> 
    788731                    </SPAN>  
  • trunk/agent/Public/card-history.php

    r822 r1005  
    44include ("../lib/agent.smarty.php"); 
    55 
    6 if (! has_rights (ACX_CALL_REPORT)){  
     6 
     7if (! has_rights (ACX_CALL_REPORT)) {  
    78        Header ("HTTP/1.0 401 Unauthorized"); 
    89        Header ("Location: PP_error.php?c=accessdenied");           
    910        die(); 
    1011} 
    11  
    12  
    1312 
    1413 
     
    158157<!-- ** ** ** ** ** Part for the research ** ** ** ** ** --> 
    159158        <center> 
    160         <FORM METHOD=POST ACTION="<?php echo $PHP_SELF?>?s=1&t=0&order=<?php echo $order?>&sens=<?php echo $sens?>&current_page=<?php echo $current_page?>&terminatecause=<?php echo $terminatecause?>"> 
     159        <FORM METHOD=POST ACTION="<?php echo $PHP_SELF?>?s=1&t=0&order=<?php echo $order?>&sens=<?php echo $sens?>&current_page=<?php echo $current_page?>&terminatecauseid=<?php echo $terminatecauseid?>"> 
    161160                <INPUT TYPE="hidden" NAME="posted" value=1> 
    162161                <INPUT TYPE="hidden" NAME="current_page" value=0> 
  • trunk/agent/Public/graph_statbar.php

    r778 r1005  
    5252 
    5353$FG_TABLE_COL[]=array (gettext("CardUsed"), "username", "11%", "center", "SORT", "30"); 
    54 $FG_TABLE_COL[]=array (gettext("terminatecause"), "terminatecause", "10%", "center", "SORT", "30"); 
     54$FG_TABLE_COL[]=array (gettext("terminatecauseid"), "terminatecauseid", "10%", "center", "SORT", "30"); 
    5555$FG_TABLE_COL[]=array (gettext("IAX/SIP"), "sipiax", "6%", "center", "SORT",  "", "list", $yesno); 
    5656//$FG_TABLE_COL[]=array ("DestID", "destID", "12%", "center", "SORT", "30"); 
  • trunk/agent/Public/graph_stat.php

    r778 r1005  
    66 
    77 
    8 if (! has_rights (ACX_CALL_REPORT)){  
     8if (! has_rights (ACX_CALL_REPORT)) {  
    99           Header ("HTTP/1.0 401 Unauthorized"); 
    1010           Header ("Location: PP_error.php?c=accessdenied");        
     
    5353 
    5454$FG_TABLE_COL[]=array (gettext("CardUsed"), "username", "11%", "center", "SORT", "30"); 
    55 $FG_TABLE_COL[]=array (gettext("terminatecause"), "terminatecause", "10%", "center", "SORT", "30"); 
     55$FG_TABLE_COL[]=array (gettext("terminatecauseid"), "terminatecauseid", "10%", "center", "SORT", "30"); 
    5656$FG_TABLE_COL[]=array (gettext("IAX/SIP"), "sipiax", "6%", "center", "SORT",  "", "list", $yesno); 
    5757//$FG_TABLE_COL[]=array ("DestID", "destID", "12%", "center", "SORT", "30"); 
     
    7474// This Variable store the argument for the SQL query 
    7575 
    76 $FG_COL_QUERY='t1.starttime, t1.calledstation, t1.destination, t1.sessiontime, t1.username, t1.terminatecause, t1.sipiax, t1.calledrate, t1.sessionbill'; 
     76$FG_COL_QUERY='t1.starttime, t1.calledstation, t1.destination, t1.sessiontime, t1.username, t1.terminatecauseid, t1.sipiax, t1.calledrate, t1.sessionbill'; 
    7777// t1.stoptime, 
    7878$FG_COL_QUERY_GRAPH='t1.starttime, t1.sessiontime, t1.sessionbill-t1.buycost as profit, t1.sessionbill, t1.buycost'; 
     
    9393 
    9494 
    95 if ( is_null ($order) || is_null($sens) )
     95if ( is_null ($order) || is_null($sens) )
    9696        $order = $FG_TABLE_DEFAULT_ORDER; 
    9797        $sens  = $FG_TABLE_DEFAULT_SENS; 



Google