Changeset 1090

Show
Ignore:
Timestamp:
10/03/08 03:40:21 (2 months ago)
Author:
areski
Message:

fix CDR view on Customer

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/admin/Public/call-log-customers.php

    r1081 r1090  
    6868$list_calltype ["4"] = array ("CALLBACK", "4" ); 
    6969$list_calltype ["5"] = array ("PREDICT", "5" ); 
     70 
     71$FG_TABLE_DEFAULT_ORDER = "t1.starttime"; 
     72$FG_TABLE_DEFAULT_SENS = "DESC"; 
     73 
    7074 
    7175$DBHandle = DbConnect (); 
     
    9397} 
    9498 
    95 $FG_TABLE_DEFAULT_ORDER = "t1.starttime"; 
    96 $FG_TABLE_DEFAULT_SENS = "DESC"; 
    97  
    9899// This Variable store the argument for the SQL query 
    99100$FG_COL_QUERY = 't1.starttime, t1.src, t1.dnid ,t1.calledstation, t1.id_cc_prefix, t4.buyrate ,t4.rateinitial ,t1.sessiontime, t1.card_id, 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'; 
     
    101102        $FG_COL_QUERY .= ', t1.uniqueid'; 
    102103} 
    103  
    104104$FG_COL_QUERY_GRAPH = 't1.callstart, t1.duration'; 
    105105 
    106 // The variable LIMITE_DISPLAY define the limit of record to display by page 
    107106$FG_LIMITE_DISPLAY = 25; 
    108  
    109 // Number of column in the html table 
    110107$FG_NB_TABLE_COL = count ( $FG_TABLE_COL ); 
    111  
    112 // The variable $FG_EDITION define if you want process to the edition of the database record 
    113108$FG_EDITION = true; 
    114  
    115 //This variable will store the total number of column 
    116109$FG_TOTAL_TABLE_COL = $FG_NB_TABLE_COL; 
    117110if ($FG_DELETION || $FG_EDITION) 
    118111        $FG_TOTAL_TABLE_COL ++; 
    119          
    120 //This variable define the Title of the HTML table 
     112 
    121113$FG_HTML_TABLE_TITLE = gettext ( " - Call Logs - " ); 
    122  
    123 //This variable define the width of the HTML table 
    124114$FG_HTML_TABLE_WIDTH = '98%'; 
    125115 
    126 if ($FG_DEBUG == 3) 
    127         echo "<br>Table : $FG_TABLE_NAME        -       Col_query : $FG_COL_QUERY"; 
     116 
    128117$instance_table = new Table ( $FG_TABLE_NAME, $FG_COL_QUERY ); 
    129118$instance_table_graph = new Table ( $FG_TABLE_NAME, $FG_COL_QUERY_GRAPH ); 
  • trunk/admin/Public/form_data/FG_var_card.inc

    r1082 r1090  
    7676 
    7777$cardstatus_list = Constants::getCardStatus_List(); 
    78  
    7978$cardstatus_list_r = Constants::getCardStatus_Revert_List(); 
    80  
    8179$cardstatus_list_acronym = Constants::getCardStatus_Acronym_List(); 
    82  
    8380$typepaid_list = Constants::getPaidTypeList(); 
    8481 
  • trunk/common/lib/interface/constants.php

    r1083 r1090  
    2424                $yesno["0"] = array( gettext("No"), "0"); 
    2525                return $yesno; 
    26         } 
    27  
    28  
    29          
    30          
     26        }        
    3127 
    3228        public static function getPeriodsList(){ 
     
    223219                $cardstatus_list_acronym = array(); 
    224220                $cardstatus_list_acronym["0"]  = array( gettext("<acronym title=\"CANCELLED\">".gettext("CANCEL")."</acronym>"), "0"); 
    225                 $cardstatus_list_acronym["1"]  = array( gettext("<acronym title=\"ACTIVE\">".gettext("ACTIVE")."</acronym>"), "1"); 
     221                $cardstatus_list_acronym["1"]  = array( gettext("<acronym title=\"ACTIVED\">".gettext("ACTIVED")."</acronym>"), "1"); 
    226222                $cardstatus_list_acronym["2"]  = array( gettext("<acronym title=\"NEW\">".gettext("NEW")."</acronym>"), "2"); 
    227                 $cardstatus_list_acronym["3"]  = array( gettext("<acronym title=\"WAITING-MAILCONFIRMATION\">".gettext("WAIT")."</acronym>"), "3"); 
     223                $cardstatus_list_acronym["3"]  = array( gettext("<acronym title=\"WAITING-MAILCONFIRMATION\">".gettext("WAITING")."</acronym>"), "3"); 
    228224                $cardstatus_list_acronym["4"]  = array( gettext("<acronym title=\"RESERVED\">".gettext("RESERV")."</acronym>"), "4"); 
    229                 $cardstatus_list_acronym["5"]  = array( gettext("<acronym title=\"EXPIRED\">".gettext("EXPIR")."</acronym>"), "5"); 
    230                 $cardstatus_list_acronym["6"]  = array( gettext("<acronym title=\"SUSPENDED FOR UNDERPAYMENT\">".gettext("UNDERPAY")."</acronym>"), "6"); 
    231                 $cardstatus_list_acronym["7"]  = array( gettext("<acronym title=\"SUSPENDED FOR LITIGATION\">".gettext("LITIG")."</acronym>"), "7"); 
     225                $cardstatus_list_acronym["5"]  = array( gettext("<acronym title=\"EXPIRED\">".gettext("EXPIRED")."</acronym>"), "5"); 
     226                $cardstatus_list_acronym["6"]  = array( gettext("<acronym title=\"SUSPENDED FOR UNDERPAYMENT\">".gettext("SUS-PAY")."</acronym>"), "6"); 
     227                $cardstatus_list_acronym["7"]  = array( gettext("<acronym title=\"SUSPENDED FOR LITIGATION\">".gettext("SUS-LIT")."</acronym>"), "7"); 
     228                return $cardstatus_list_acronym; 
    232229        } 
    233230         
  • trunk/customer/call-history.php

    r1014 r1090  
    6060$DBHandle  = DbConnect(); 
    6161 
    62 // The variable Var_col would define the col that we want show in your table 
    63 // First Name of the column in the html page, second name of the field 
     62$FG_TABLE_DEFAULT_ORDER = "t1.starttime"; 
     63$FG_TABLE_DEFAULT_SENS = "DESC"; 
     64 
    6465$FG_TABLE_COL = array(); 
    65  
    66  
    6766$FG_TABLE_COL[]=array (gettext("Calldate"), "starttime", "14%", "center", "SORT", "19", "", "", "", "", "", "display_dateformat"); 
    6867$FG_TABLE_COL[]=array (gettext("Source"), "source", "12%", "center", "SORT", "30"); 
    6968$FG_TABLE_COL[]=array (gettext("PhoneNumber"), "calledstation", "12%", "center", "SORT", "30", "", "", "", "", "", "remove_prefix"); 
    70 $FG_TABLE_COL[]=array (gettext("Destination"), "id_cc_prefix", "12%", "center", "SORT", "30", "", "", "", "", "", "remove_prefix"); 
     69$FG_TABLE_COL [] = array (gettext ( "Destination" ), "id_cc_prefix", "10%", "center", "SORT", "15", "lie", "cc_prefix", "destination", "id='%id'", "%1" ); 
    7170$FG_TABLE_COL[]=array (gettext("Duration"), "sessiontime", "7%", "center", "SORT", "30", "", "", "", "", "", "display_minute"); 
    7271$FG_TABLE_COL[]=array ('<acronym title="'.gettext("Terminate Cause").'">'.gettext("TC").'</acronym>', "terminatecauseid", "7%", "center", "SORT", "", "list", $dialstatus_list); 
     
    7574$FG_TABLE_COL[]=array (gettext("Cost"), "sessionbill", "10%", "center", "SORT", "30", "", "", "", "", "", "display_2bill"); 
    7675 
    77  
    78 $FG_TABLE_DEFAULT_ORDER = "t1.starttime"; 
    79 $FG_TABLE_DEFAULT_SENS = "DESC"; 
    80          
    81 // This Variable store the argument for the SQL query 
    82 $FG_COL_QUERY='t1.starttime, t1.src, t1.calledstation, t1.destination, t1.sessiontime, t1.terminatecauseid, t1.sipiax, t1.calledrate, t1.sessionbill'; 
    83 // t1.stoptime, 
    84  
     76$FG_COL_QUERY='t1.starttime, t1.src, t1.calledstation, t1.id_cc_prefix, t1.sessiontime, t1.terminatecauseid, t1.sipiax, t1.calledrate, t1.sessionbill'; 
    8577$FG_COL_QUERY_GRAPH='t1.callstart, t1.duration'; 
    8678 
    87 // The variable LIMITE_DISPLAY define the limit of record to display by page 
    8879$FG_LIMITE_DISPLAY=25; 
    89  
    90 // Number of column in the html table 
    9180$FG_NB_TABLE_COL=count($FG_TABLE_COL); 
    92  
    93 // The variable $FG_EDITION define if you want process to the edition of the database record 
    9481$FG_EDITION=true; 
    95  
    96 //This variable will store the total number of column 
    9782$FG_TOTAL_TABLE_COL = $FG_NB_TABLE_COL; 
    9883if ($FG_DELETION || $FG_EDITION) $FG_TOTAL_TABLE_COL++; 
    99  
    100 //This variable define the Title of the HTML table 
    10184$FG_HTML_TABLE_TITLE=" - ".gettext("Call Logs")." - "; 
    102  
    103 //This variable define the width of the HTML table 
    10485$FG_HTML_TABLE_WIDTH="98%"; 
    10586 
    106        if ($FG_DEBUG == 3) echo "<br>Table : $FG_TABLE_NAME   -       Col_query : $FG_COL_QUERY"; 
    107        $instance_table = new Table($FG_TABLE_NAME, $FG_COL_QUERY); 
    108        $instance_table_graph = new Table($FG_TABLE_NAME, $FG_COL_QUERY_GRAPH); 
     87if ($FG_DEBUG == 3) echo "<br>Table : $FG_TABLE_NAME          -       Col_query : $FG_COL_QUERY"; 
     88$instance_table = new Table($FG_TABLE_NAME, $FG_COL_QUERY); 
     89$instance_table_graph = new Table($FG_TABLE_NAME, $FG_COL_QUERY_GRAPH); 
    10990 
    11091 
     
    11495} 
    11596 
    116 if ($posted==1){ 
    117    
    118   $SQLcmd = ''; 
    119    
    120   $SQLcmd = do_field($SQLcmd, 'src', 'source'); 
    121   $SQLcmd = do_field($SQLcmd, 'dst', 'calledstation'); 
    122          
    123    
    124 
    125  
    126  
    127 $date_clause=''; 
    128 // Period (Month-Day) 
     97if ($posted==1) { 
     98        $SQLcmd = ''; 
     99        $SQLcmd = do_field($SQLcmd, 'src', 'source'); 
     100        $SQLcmd = do_field($SQLcmd, 'dst', 'calledstation'); 
     101
     102 
     103 
     104$date_clause = ''; 
    129105if (DB_TYPE == "postgres"){              
    130106                $UNIX_TIMESTAMP = ""; 
     
    141117} 
    142118 
    143 //echo "<br>$date_clause<br>"; 
    144 /* 
    145 Month 
    146 fromday today 
    147 frommonth tomonth (true) 
    148 fromstatsmonth tostatsmonth 
    149  
    150 fromstatsday_sday 
    151 fromstatsmonth_sday 
    152 tostatsday_sday 
    153 tostatsmonth_sday 
    154 */ 
    155  
    156  
    157119   
    158120if (strpos($SQLcmd, 'WHERE') > 0) {  
     
    199161 
    200162if (!$nodisplay){ 
    201                 $res = $DBHandle -> Execute($QUERY); 
    202                 if ($res){ 
    203                         $num = $res -> RecordCount(); 
    204                         for($i=0;$i<$num;$i++) 
    205                         {                                
    206                                 $list_total_day [] =$res -> fetchRow(); 
    207                         } 
    208                 }                
    209  
    210 if ($FG_DEBUG == 3) echo "<br>Clause : $FG_TABLE_CLAUSE"; 
    211 $nb_record = $instance_table -> Table_count ($DBHandle, $FG_TABLE_CLAUSE); 
    212 if ($FG_DEBUG >= 1) var_dump ($list); 
    213  
    214 }//end IF nodisplay 
    215  
    216 if ($nb_record<=$FG_LIMITE_DISPLAY){  
     163        $res = $DBHandle -> Execute($QUERY); 
     164        if ($res){ 
     165                $num = $res -> RecordCount(); 
     166                for($i=0;$i<$num;$i++) 
     167                {                                
     168                        $list_total_day [] =$res -> fetchRow(); 
     169                } 
     170        } 
     171         
     172        if ($FG_DEBUG == 3) echo "<br>Clause : $FG_TABLE_CLAUSE"; 
     173        $nb_record = $instance_table -> Table_count ($DBHandle, $FG_TABLE_CLAUSE); 
     174        if ($FG_DEBUG >= 1) var_dump ($list); 
     175
     176 
     177if ($nb_record<=$FG_LIMITE_DISPLAY) {  
    217178        $nb_record_max=1; 
    218 }else{  
    219         if ($nb_record % $FG_LIMITE_DISPLAY == 0)
     179} else {  
     180        if ($nb_record % $FG_LIMITE_DISPLAY == 0)
    220181                $nb_record_max=(intval($nb_record/$FG_LIMITE_DISPLAY)); 
    221         }else
     182        } else
    222183                $nb_record_max=(intval($nb_record/$FG_LIMITE_DISPLAY)+1); 
    223184        }        
    224185} 
    225  
    226  
    227 if ($FG_DEBUG == 3) echo "<br>Nb_record : $nb_record"; 
    228 if ($FG_DEBUG == 3) echo "<br>Nb_record_max : $nb_record_max"; 
    229  
    230186 
    231187/*************************************************************/ 
     
    243199 
    244200<?php 
    245         $smarty->display( 'main.tpl'); 
    246          
    247  
    248          
     201 
     202$smarty->display( 'main.tpl'); 
     203 
    249204// #### HELP SECTION 
    250205echo $CC_help_balance_customer; 


Google