Changeset 1257

Show
Ignore:
Timestamp:
11/20/08 10:26:39 (2 months ago)
Author:
areski
Message:

more CDR optimization
Use table with prefix to store the destination,
remove text destination from CDR.

Files:

Legend:

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

    r1235 r1257  
    8181$FG_TABLE_COL [] = array (gettext ( "Dnid" ), "dnid", "7%", "center", "SORT", "30" ); 
    8282$FG_TABLE_COL [] = array (gettext ( "CalledNumber" ), "calledstation", "10%", "center", "SORT", "30", "", "", "", "", "", "remove_prefix" ); 
    83 $FG_TABLE_COL [] = array (gettext ( "Destination" ), "id_ratecard","10%", "center", "SORT", "15", "lie", "cc_ratecard", "destination", "id='%id'", "%1" ); 
     83$FG_TABLE_COL [] = array (gettext ( "Destination" ), "destination","10%", "center", "SORT", "15", "lie", "cc_prefix", "destination", "prefix='%id'", "%1" ); 
    8484$FG_TABLE_COL [] = array (gettext ( "Buy Rate" ), "buyrate", "5%", "center", "SORT", "30", "", "", "", "", "", "display_2bill" ); 
    8585$FG_TABLE_COL [] = array (gettext ( "Sell Rate" ), "rateinitial", "5%", "center", "SORT", "30", "", "", "", "", "", "display_2bill" ); 
    8686$FG_TABLE_COL [] = array (gettext ( "Duration" ), "sessiontime", "6%", "center", "SORT", "30", "", "", "", "", "", "display_minute" ); 
    87 $FG_TABLE_COL [] = array (gettext ( "AccountUsed" ), "card_id", "6%", "center", "sort", "", "lie", "cc_card", "username,id", "id='%id'", "%1", "", "A2B_entity_card.php" ); 
     87$FG_TABLE_COL [] = array (gettext ( "AccountUsed" ), "card_id", "6%", "center", "sort", "", "lie_link", "cc_card", "username,id", "id='%id'", "%1", "", "A2B_entity_card.php" ); 
    8888$FG_TABLE_COL [] = array (gettext ( "Trunk" ), "trunkcode", "6%", "center", "SORT", "30" ); 
    8989$FG_TABLE_COL [] = array ('<acronym title="' . gettext ( "Terminate Cause" ) . '">' . gettext ( "TC" ) . '</acronym>', "terminatecauseid", "7%", "center", "SORT", "", "list", $dialstatus_list ); 
     
    9999 
    100100// This Variable store the argument for the SQL query 
    101 $FG_COL_QUERY = 't1.starttime, t1.src, t1.dnid ,t1.calledstation, t1.id_ratecard, 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'; 
     101$FG_COL_QUERY = 't1.starttime, t1.src, t1.dnid ,t1.calledstation, t1.destination, 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'; 
    102102if (LINK_AUDIO_FILE) { 
    103103        $FG_COL_QUERY .= ', t1.uniqueid'; 
     
    957957?></center> 
    958958 
    959 <table width="<?php 
    960 echo $FG_HTML_TABLE_WIDTH?>" border="0" 
    961         align="center" cellpadding="0" cellspacing="0"> 
     959<table width="<?php echo $FG_HTML_TABLE_WIDTH?>" border="0" align="center" cellpadding="0" cellspacing="0"> 
    962960        <TR bgcolor="#ffffff"> 
    963                 <TD class="bgcolor_021" height=16 
    964                         style="PADDING-LEFT: 5px; PADDING-RIGHT: 3px"> 
     961                <TD class="bgcolor_021" height=16 style="PADDING-LEFT: 5px; PADDING-RIGHT: 3px"> 
    965962                <TABLE border=0 cellPadding=0 cellSpacing=0 width="100%"> 
    966963                        <TR> 
    967                                 <TD><SPAN class="fontstyle_003"><?php 
    968                                 echo $FG_HTML_TABLE_TITLE?></SPAN></TD> 
     964                                <TD><SPAN class="fontstyle_003"><?php echo $FG_HTML_TABLE_TITLE?></SPAN></TD> 
    969965                                <TD align=right><IMG alt="Back to Top" border=0 height=12 src="<?php echo Images_Path; ?>/btn_top_12x12.gif" width=12></TD> 
    970966                        </TR> 
     
    976972                <TABLE border=0 cellPadding=0 cellSpacing=0 width="100%"> 
    977973                        <TR class="bgcolor_008"> 
    978                                         <TD width="<?php 
    979                                         echo $FG_ACTION_SIZE_COLUMN?>" align=center 
    980                                                 class="tableBodyRight" 
    981                                                 style="PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px"></TD>                                       
     974                                <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>                                   
    982975                                   
    983976                  <?php 
     
    10201013</TR> 
    10211014<TR> 
    1022 <TD bgColor=#e1e1e1 colSpan=<?php 
    1023                                                         echo $FG_TOTAL_TABLE_COL?> 
    1024 height=1><IMG height=1 src="<?php 
    1025                                                         echo Images_Path; 
    1026                                                         ?>/clear.gif" 
    1027 width=1></TD> 
     1015<TD bgColor=#e1e1e1 colSpan=<?php echo $FG_TOTAL_TABLE_COL?> 
     1016height=1><IMG height=1 src="<?php echo Images_Path; ?>/clear.gif" width=1></TD> 
    10281017</TR> 
    10291018<?php 
     
    10351024                                                                ?> 
    10361025 
    1037  <TR 
    1038 bgcolor="<?php 
    1039                                                                 echo $FG_TABLE_ALTERNATE_ROW_COLOR [$ligne_number % 2]?>" 
    1040 onMouseOver="bgColor='#C4FFD7'" 
    1041 onMouseOut="bgColor='<?php echo $FG_TABLE_ALTERNATE_ROW_COLOR [$ligne_number % 2]?>'"> 
    1042 <TD vAlign=top align="<?php echo $FG_TABLE_COL [$i] [3]?>" 
    1043 class=tableBody><?php echo $ligne_number + $current_page * $FG_LIMITE_DISPLAY . ".&nbsp;"; ?></TD> 
     1026 <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]?>'"> 
     1027<TD vAlign=top align="<?php echo $FG_TABLE_COL [$i] [3]?>" class=tableBody><?php echo $ligne_number + $current_page * $FG_LIMITE_DISPLAY . ".&nbsp;"; ?></TD> 
    10441028  
    10451029<?php for($i = 0; $i < $FG_NB_TABLE_COL; $i ++) { ?> 
     
    10491033                                        $instance_sub_table = new Table ( $FG_TABLE_COL [$i] [7], $FG_TABLE_COL [$i] [8] ); 
    10501034                                        $sub_clause = str_replace ( "%id", $recordset [$i], $FG_TABLE_COL [$i] [9] ); 
    1051                                         $select_list = $instance_sub_table->Get_list ( $DBHandle, $sub_clause, null, null, null, null, null, null ); 
     1035                                        $select_list = $instance_sub_table->Get_list ( $DBHandle, $sub_clause, null, null, null, null, null, null, null, 10); 
    10521036                                         
    10531037                                        $field_list_sun = split ( ',', $FG_TABLE_COL [$i] [8] ); 
    10541038                                        $record_display = $FG_TABLE_COL [$i] [10]; 
    10551039                                         
    1056                                         for($l = 1; $l <= count ( $field_list_sun ); $l ++) { 
    1057                                                 $record_display = str_replace ( "%$l", $select_list [0] [$l - 1], $record_display ); 
    1058                                         } 
    1059                                  
     1040                                        if (is_array($select_list)) { 
     1041                                                for($l = 1; $l <= count ( $field_list_sun ); $l ++) { 
     1042                                                        $record_display = str_replace ( "%$l", $select_list [0] [$l - 1], $record_display ); 
     1043                                                } 
     1044                                        } else { 
     1045                                                $record_display = $recordset [$i]; 
     1046                                        } 
     1047                                } elseif($FG_TABLE_COL[$i][6]=="lie_link") { 
     1048                                        $instance_sub_table = new Table($FG_TABLE_COL[$i][7], $FG_TABLE_COL[$i][8]); 
     1049                                        $sub_clause = str_replace ( "%id", $recordset [$i], $FG_TABLE_COL [$i] [9] ); 
     1050                                        $select_list = $instance_sub_table -> Get_list ($DBHandle, $sub_clause, null, null, null, null, null, null, null, 10); 
     1051                                        if(is_array($select_list)){ 
     1052                                                $field_list_sun = split(',',$FG_TABLE_COL[$i][8]); 
     1053                                                $record_display = $FG_TABLE_COL[$i][10]; 
     1054                                                $link = $FG_TABLE_COL[$i][12]."?form_action=ask-edit&id=".$select_list[0][1]; 
     1055                                                for ($l=1;$l<=count($field_list_sun);$l++){ 
     1056                                                        $val = str_replace("%$l", $select_list[0][$l-1], $record_display); 
     1057                                                        $record_display = "<a href='$link'>$val</a>"; 
     1058                                                } 
     1059                                        }else{ 
     1060                                                $record_display=""; 
     1061                                        } 
    10601062                                } elseif ($FG_TABLE_COL [$i] [6] == "list") { 
    10611063                                        $select_list = $FG_TABLE_COL [$i] [7]; 
     
    10721074                                 
    10731075                                ?> 
    1074  <TD vAlign=top align="<?php echo $FG_TABLE_COL [$i] [3]?>" class=tableBody><?php 
     1076               <TD vAlign=top align="<?php echo $FG_TABLE_COL [$i] [3]?>" class=tableBody><?php 
    10751077                        if (isset ( $FG_TABLE_COL [$i] [11] ) && strlen ( $FG_TABLE_COL [$i] [11] ) > 1) { 
    10761078                                call_user_func ( $FG_TABLE_COL [$i] [11], $record_display ); 
     
    11131115        </tr> 
    11141116        <TR bgcolor="#ffffff"> 
    1115                 <TD class="bgcolor_005" height=16 
    1116                         style="PADDING-LEFT: 5px; PADDING-RIGHT: 3px"> 
    1117                 <TABLE border=0 cellPadding=0 cellSpacing=0 width="100%"> 
     1117                <TD class="bgcolor_005" height="16" style="PADDING-LEFT: 5px; PADDING-RIGHT: 3px"> 
     1118                        <TABLE border=0 cellPadding=0 cellSpacing=0 width="100%"> 
    11181119                                <TR> 
    11191120                                        <TD align="right"><SPAN class="fontstyle_003"> 
    1120                     <?php 
    1121                                                                                                                                                                 if ($current_page > 0) { 
    1122                                                                                                                                                                         ?> 
    1123                     <img src="<?php 
    1124                                                                                                                                                                         echo Images_Path; 
    1125                                                                                                                                                                         ?>/fleche-g.gif" 
    1126                                                 width="5" height="10"> <a 
    1127                                                 href="<?php 
    1128                                                                                                                                                                         echo $PHP_SELF?>?s=1&t=0&order=<?php 
    1129                                                                                                                                                                         echo $order?>&sens=<?php 
    1130                                                                                                                                                                         echo $sens?>&current_page=<?php 
    1131                                                                                                                                                                         echo ($current_page - 1)?><?php 
    1132  
    1133                                                                                                                                                                         if (! is_null ( $letter ) && ($letter != "")) { 
    1134                                                                                                                                                                                 echo "&letter=$letter"; 
    1135                                                                                                                                                                         } 
    1136                                                                                                                                                                         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"; 
    1137                                                                                                                                                                         ?>"> 
    1138                     <?php 
    1139                                                                                                                                                                         echo gettext ( "Previous" ); 
    1140                                                                                                                                                                         ?> </a> - 
    1141                     <?php 
    1142                                                                                                                                                                 } 
    1143                                                                                                                                                                 ?> 
    1144                     <?php 
    1145                                                                                                                                                                 echo ($current_page + 1); 
    1146                                                                                                                                                                 ?> / <?php 
    1147                                                                                                                                                                 echo $nb_record_max; 
    1148                                                                                                                                                                 ?> 
    1149                     <?php 
    1150                                                                                                                                                                 if ($current_page < $nb_record_max - 1) { 
    1151                                                                                                                                                                         ?> 
    1152                     - <a 
    1153                                                 href="<?php 
    1154                                                                                                                                                                         echo $PHP_SELF?>?s=1&t=0&order=<?php 
    1155                                                                                                                                                                         echo $order?>&sens=<?php 
    1156                                                                                                                                                                         echo $sens?>&current_page=<?php 
    1157                                                                                                                                                                         echo ($current_page + 1)?><?php 
    1158  
    1159                                                                                                                                                                         if (! is_null ( $letter ) && ($letter != "")) { 
    1160                                                                                                                                                                                 echo "&letter=$letter"; 
    1161                                                                                                                                                                         } 
    1162                                                                                                                                                                         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"; 
    1163                                                                                                                                                                         ?>"> 
    1164                     <?php 
    1165                                                                                                                                                                         echo gettext ( "Next" ); 
    1166                                                                                                                                                                         ?></a> <img 
    1167                                                 src="<?php 
    1168                                                                                                                                                                         echo Images_Path; 
    1169                                                                                                                                                                         ?>/fleche-d.gif" width="5" height="10"> 
    1170                                         </SPAN>  
    1171                     <?php 
    1172                                                                                                                                                                 } 
    1173                                                                                                                                                                 ?> 
     1121                    <?php if ($current_page > 0) { ?> 
     1122                                        <img src="<?php echo Images_Path; ?>/fleche-g.gif" 
     1123                                        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 
     1124                                                                        if (! is_null ( $letter ) && ($letter != "")) { 
     1125                                                                                echo "&letter=$letter"; 
     1126                                                                        } 
     1127                                                                        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"; 
     1128                                                                        ?>"> 
     1129                                        <?php echo gettext ( "Previous" ); ?> </a> - <?php } ?><?php echo ($current_page + 1); ?> / <?php echo $nb_record_max; ?> 
     1130                                        <?php if ($current_page < $nb_record_max - 1) { ?> 
     1131                                        - <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 
     1132                                                                        if (! is_null ( $letter ) && ($letter != "")) { 
     1133                                                                                echo "&letter=$letter"; 
     1134                                                                        } 
     1135                                                                        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"; 
     1136                                                                        ?>"> 
     1137                                        <?php echo gettext ( "Next" ); ?></a> <img src="<?php echo Images_Path; ?>/fleche-d.gif" width="5" height="10"> </SPAN>  
     1138                                        <?php } ?> 
    11741139                  </TD> 
    11751140                </TABLE> 
     
    11781143</table> 
    11791144 
    1180 <?php 
    1181 if (is_array ( $list ) && count ( $list ) > 0 && 3 == 4) { 
    1182         ?> 
    1183 <!-- ************** TOTAL SECTION ************* --> 
    1184 <br /> 
    1185 <div style="padding-right: 15px;"> 
    1186 <table cellpadding="1" bgcolor="#000000" cellspacing="1" 
    1187         width="<?php 
    1188         if ($_SESSION ["is_admin"] == 1) { 
    1189                 ?>450<?php 
    1190         } else { 
    1191                 ?>200<?php 
    1192         } 
    1193         ?>" 
    1194         align="right"> 
    1195         <tbody> 
    1196                 <tr class="form_head"> 
    1197                         <td width="33%" align="center" class="tableBodyRight" 
    1198                                 bgcolor="#600101" style="padding: 5px;"><strong><?php 
    1199         echo gettext ( "TOTAL COSTS" ); 
    1200         ?></strong></td> 
    1201                                    <?php 
    1202         if ($_SESSION ["is_admin"] == 1) { 
    1203                 ?><td width="33%" 
    1204                                 align="center" class="tableBodyRight" bgcolor="#600101" 
    1205                                 style="padding: 5px;"><strong><?php 
    1206                 echo gettext ( "TOTAL BUYCOSTS" ); 
    1207                 ?></strong></td><?php 
    1208         } 
    1209         ?> 
    1210                                    <?php 
    1211         if ($_SESSION ["is_admin"] == 1) { 
    1212                 ?><td width="33%" 
    1213                                 align="center" class="tableBodyRight" bgcolor="#600101" 
    1214                                 style="padding: 5px;"><strong><?php 
    1215                 echo gettext ( "DIFFERENCE" ); 
    1216                 ?></strong></td><?php 
    1217         } 
    1218         ?> 
    1219                 </tr> 
    1220                 <tr> 
    1221                         <td valign="top" align="center" class="tableBody" bgcolor="white"><b><?php 
    1222         echo $total_cost [0] [0]?></td> 
    1223                                   <?php 
    1224         if ($_SESSION ["is_admin"] == 1) { 
    1225                 ?><td valign="top" 
    1226                                 align="center" class="tableBody" bgcolor="#66FF66"><b><?php 
    1227                 echo $total_cost [0] [1]?></td><?php 
    1228         } 
    1229         ?> 
    1230                                   <?php 
    1231         if ($_SESSION ["is_admin"] == 1) { 
    1232                 ?><td valign="top" 
    1233                                 align="center" class="tableBody" bgcolor="#FF6666"><b><?php 
    1234                 echo $total_cost [0] [0] - $total_cost [0] [1]?></td><?php 
    1235         } 
    1236         ?> 
    1237  
    1238                                 </tr> 
    1239  
    1240 </table> 
    1241 </div> 
    1242 <br /> 
    1243 <br /> 
    1244  
    1245 <!-- ************** TOTAL SECTION ************* --> 
    1246 <?php 
    1247 } 
    1248 ?> 
    12491145 
    12501146<!-- ** ** ** ** ** Part to display the GRAPHIC ** ** ** ** ** --> 
  • trunk/admin/Public/form_data/FG_var_def_ratecard.inc

    r1237 r1257  
    8989 
    9090if ($popup_select) $HD_Form -> AddViewElement(gettext("ID"), "id", "5%", "center", "sort"); 
    91 $HD_Form -> AddViewElement(gettext("DESTINATION"), "destination", "17%", "center", "sort", ""); 
     91$HD_Form -> AddViewElement(gettext("DESTINATION"), "destination", "17%", "center", "sort", "15", "lie", "cc_prefix", "destination", "prefix='%id'", "%1"); 
    9292$HD_Form -> AddViewElement("<acronym title=\"DIALING PREFIX\">".gettext("PREFIX")."</acronym>", "dialprefix", "10%", "center", "sort", ""); 
    9393$HD_Form -> AddViewElement("<acronym title=\"BUYING RATE\">".gettext("BR")."</acronym>", "buyrate", "4%", "center", "sort"); 
     
    180180 
    181181 
    182 $HD_Form -> AddEditElement(gettext("Prefix_Destination"), 
    183    "id_cc_prefix", 
     182$HD_Form -> AddEditElement(gettext("Destination Prefix"), 
     183   "destination", 
    184184   '$value',     
    185185   "SELECT",     
     
    187187   "sql",                
    188188   "cc_prefix",  
    189    "destination, id, prefixe",                 
    190    "", "", "%3 (%1)", "", gettext("This will later replace the field Destination, select here the prefix Destination corresponding to your prefix rate.")); 
     189   "destination, prefix",              
     190   "", "", "%2 (%1)", "", gettext("Select here the prefix Destination corresponding to your prefix rate.")); 
    191191    
    192  
    193 $HD_Form -> AddEditElement(gettext("DESTINATION"), 
    194    "destination", 
    195    '$value', 
    196    "INPUT", 
    197    "size=30 maxlength=40", 
    198    "11", 
    199    gettext("Come on... Insert the destination name"), 
    200    "" , "", "", "", "", "", "", gettext("Name for this call destination, for example : UK, Belgium Landline, Spain Mobile Telefonica, ...") ); 
    201192 
    202193$HD_Form -> AddEditElement("BUYING RATE", 
     
    551542if (ADVANCED_MODE) { 
    552543        // This Variable store the argument for the SQL query 
    553         $HD_Form -> FieldEditElement ('idtariffplan, dialprefix, id_cc_prefix, destination, buyrate, buyrateinitblock, buyrateincrement, rateinitial, initblock, billingblock, connectcharge, disconnectcharge,disconnectcharge_after, minimal_cost, stepchargea, chargea, timechargea, billingblocka, stepchargeb, chargeb, timechargeb, billingblockb, stepchargec, chargec, timechargec, billingblockc,announce_time_correction, startdate, stopdate, starttime, endtime, rounding_calltime, rounding_threshold, additional_block_charge, additional_block_charge_time,additional_grace, id_trunk, id_outbound_cidgroup, tag, musiconhold'); 
     544        $HD_Form -> FieldEditElement ('idtariffplan, dialprefix, destination, buyrate, buyrateinitblock, buyrateincrement, rateinitial, initblock, billingblock, connectcharge, disconnectcharge,disconnectcharge_after, minimal_cost, stepchargea, chargea, timechargea, billingblocka, stepchargeb, chargeb, timechargeb, billingblockb, stepchargec, chargec, timechargec, billingblockc,announce_time_correction, startdate, stopdate, starttime, endtime, rounding_calltime, rounding_threshold, additional_block_charge, additional_block_charge_time,additional_grace, id_trunk, id_outbound_cidgroup, tag, musiconhold'); 
    554545}else{ 
    555546        // This Variable store the argument for the SQL query 
    556         $HD_Form -> FieldEditElement ('idtariffplan, dialprefix, id_cc_prefix, destination, buyrate, buyrateinitblock, buyrateincrement,rateinitial, initblock, billingblock, connectcharge, disconnectcharge,disconnectcharge_after, minimal_cost, startdate, stopdate, starttime, endtime, rounding_calltime, rounding_threshold, additional_block_charge, additional_block_charge_time,additional_grace, id_trunk, id_outbound_cidgroup, tag'); 
     547        $HD_Form -> FieldEditElement ('idtariffplan, dialprefix, destination, buyrate, buyrateinitblock, buyrateincrement,rateinitial, initblock, billingblock, connectcharge, disconnectcharge,disconnectcharge_after, minimal_cost, startdate, stopdate, starttime, endtime, rounding_calltime, rounding_threshold, additional_block_charge, additional_block_charge_time,additional_grace, id_trunk, id_outbound_cidgroup, tag'); 
    557548} 
    558549 
  • trunk/admin/Public/form_data/FG_var_prefix.inc

    r1084 r1257  
    11<?php 
    22 
    3 getpost_ifset(array('id', 'destination','dialprefix','popup_select','popup_formname','popup_fieldname' )); 
     3getpost_ifset(array('id', 'destination','prefix','popup_select','popup_formname','popup_fieldname' )); 
    44 
    55$HD_Form = new FormHandler("cc_prefix","prefix"); 
    66 
    77$HD_Form -> FG_DEBUG = 0; 
     8$HD_Form -> FG_TABLE_ID = "prefix"; 
    89$HD_Form -> FG_TABLE_DEFAULT_ORDER = "destination"; 
    910$HD_Form -> FG_TABLE_DEFAULT_SENS = "ASC"; 
    1011 
    1112 
    12  
    13 $HD_Form ->FG_LIST_ADDING_BUTTON1 = true; 
    14 $HD_Form ->FG_LIST_ADDING_BUTTON_LINK1 = "A2B_entity_prefix.php?form_action=ask-add&atmenu=prefixe&section=8"; 
    15 $HD_Form ->FG_LIST_ADDING_BUTTON_ALT1 = $HD_Form ->FG_LIST_ADDING_BUTTON_MSG1 = gettext("Add PREFIX"); 
    16 $HD_Form ->FG_LIST_ADDING_BUTTON_IMG1 = Images_Path ."/world_add.png" ; 
     13$HD_Form -> FG_LIST_ADDING_BUTTON1 = true; 
     14$HD_Form -> FG_LIST_ADDING_BUTTON_LINK1 = "A2B_entity_prefix.php?form_action=ask-add&atmenu=prefixe&section=8"; 
     15$HD_Form -> FG_LIST_ADDING_BUTTON_ALT1 = $HD_Form ->FG_LIST_ADDING_BUTTON_MSG1 = gettext("Add PREFIX"); 
     16$HD_Form -> FG_LIST_ADDING_BUTTON_IMG1 = Images_Path ."/world_add.png" ; 
    1717 
    1818 
    19 $HD_Form -> AddViewElement(gettext("Destination"), "destination", "40%", "left", "sort"); 
    20 $HD_Form -> AddViewElement(gettext("Prefix"), "prefixe", "10%", "center", "sort"); 
     19$HD_Form -> AddViewElement(gettext("Prefix"), "prefix", "10%", "center", "sort"); 
     20$HD_Form -> AddViewElement(gettext("Destination"), "destination", "40%", "center", "sort"); 
    2121 
    22 $HD_Form -> FieldViewElement ('destination, prefixe'); 
     22 
     23$HD_Form -> FieldViewElement ('prefix, destination'); 
    2324 
    2425 
     
    2829$HD_Form -> CV_TEXT_TITLE_ABOVE_TABLE = ''; 
    2930$HD_Form -> CV_DISPLAY_FILTER_ABOVE_TABLE = false; 
    30 if (!($popup_select==1)){ 
     31 
     32if (!($popup_select==1)) { 
    3133        $HD_Form -> FG_EDITION = true; 
    3234        $HD_Form -> FG_DELETION = true; 
    33 }else
     35} else
    3436        $HD_Form -> CV_FOLLOWPARAMETERS= "&popup_select=".$_GET['popup_select']."&popup_formname=".$_GET['popup_formname']."&popup_fieldname=".$_GET['popup_fieldname']; 
    3537        $HD_Form ->FG_LIMITE_DISPLAY=7; 
     
    3739        $HD_Form -> FG_OTHER_BUTTON1_ALT = '<font color="red">&lt;select&gt;</font>'; 
    3840        $HD_Form -> FG_OTHER_BUTTON1_IMG = ''; 
    39          
    40         //if ($popup_select==1){ 
    41         //      $HD_Form -> FG_OTHER_BUTTON1_LINK = "javascript:sendValue('|param|');"; 
    42         //}elseif ($popup_select==2){                                    
    43                 $HD_Form -> FG_OTHER_BUTTON1_LINK = "javascript:sendValue('|col1|');"; 
    44         //}      
    45          
     41                                         
     42        $HD_Form -> FG_OTHER_BUTTON1_LINK = "javascript:sendValue('|col1|');"; 
    4643} 
    4744 
    4845 
     46$HD_Form -> AddEditElement (gettext("PREFIX"), 
     47        "prefix", 
     48        '$value', 
     49        "INPUT", 
     50        "size=30 maxlength=300", 
     51        "$dialprefix", 
     52        gettext("Insert the Prefixe"), 
     53        "" , "", "", "", "" , "", "" ,""); 
     54         
    4955$HD_Form -> AddEditElement (gettext("DESTINATION"), 
    5056        "destination", 
     
    5662        "" , "", "", "", "" , "", "" ,""); 
    5763 
    58 $HD_Form -> AddEditElement (gettext("PREFIX"), 
    59         "prefixe", 
    60         '$value', 
    61         "INPUT", 
    62         "size=30 maxlength=300", 
    63         "$dialprefix", 
    64         gettext("Insert the Prefixe"), 
    65         "" , "", "", "", "" , "", "" ,""); 
    6664 
    67 $HD_Form -> FieldEditElement ('destination, prefixe'); 
     65$HD_Form -> FieldEditElement ('prefix, destination'); 
    6866 
     67$HD_Form -> FG_EDITION_CLAUSE = " prefix='%id'"; 
    6968 
    7069 
    7170$HD_Form -> FG_FILTER_APPLY = true; 
    72 $HD_Form -> FG_FILTERFIELD = 'destination'; 
    73 $HD_Form -> FG_FILTERFIELDNAME = 'destination'; 
     71$HD_Form -> FG_FILTERFIELD = 'prefix'; 
     72$HD_Form -> FG_FILTERFIELDNAME = 'prefix'; 
    7473$HD_Form -> FG_FILTER_FORM_ACTION = 'list'; 
    7574 
    76 if (isset($filterprefix)  &&  (strlen($filterprefix)>0))
     75if (isset($filterprefix)  &&  (strlen($filterprefix)>0))
    7776        if (strlen($HD_Form -> FG_TABLE_CLAUSE)>0) $HD_Form -> FG_TABLE_CLAUSE.=" AND "; 
    7877        $filterprefix = strtoupper(substr($filterprefix,0,1)).substr($filterprefix,1); 
    79         $HD_Form -> FG_TABLE_CLAUSE.="destination like '$filterprefix%'"; 
     78        $HD_Form -> FG_TABLE_CLAUSE .= "prefix like '$filterprefix%'"; 
    8079} 
    8180 
     
    10099 
    101100 
     101 
     102 
  • trunk/common/lib/Class.RateEngine.php

    r1237 r1257  
    172172                $QUERY = "SELECT 
    173173                tariffgroupname, lcrtype, idtariffgroup, cc_tariffgroup_plan.idtariffplan, tariffname,  
    174         id_cc_prefix, cc_ratecard.id, dialprefix, id_cc_prefix, buyrate, 
     174        destination, cc_ratecard.id, dialprefix, destination, buyrate, 
    175175        buyrateinitblock, buyrateincrement, rateinitial, initblock, billingblock, 
    176176                connectcharge, disconnectcharge, stepchargea, chargea, timechargea, 
     
    10551055                $QUERY_COLUMN = "uniqueid, sessionid, card_id, nasipaddress, starttime, sessiontime, real_sessiontime, calledstation, ". 
    10561056                        " terminatecauseid, stoptime, sessionbill, id_tariffgroup, id_tariffplan, id_ratecard, " . 
    1057                         " id_trunk, src, sipiax, buycost, id_card_package_offer, dnid, id_cc_prefix"; 
     1057                        " id_trunk, src, sipiax, buycost, id_card_package_offer, dnid, destination"; 
    10581058                $QUERY = "INSERT INTO cc_call ($QUERY_COLUMN) VALUES ('".$A2B->uniqueid."', '".$A2B->channel."', '". 
    10591059                        $A2B->id_card."', '".$A2B->hostname."', "; 
  • trunk/DataBase/mysql-5.x/UPDATE-a2billing-v1.3.4-to-v1.4.0-mysql.sql

    r1256 r1257  
    10861086ALTER TABLE cc_prefix ADD INDEX ( prefixe ); 
    10871087 
     1088 
    10881089-- optimization on CDR 
    10891090ALTER TABLE cc_call ADD COLUMN id_cc_prefix INT (11) DEFAULT 0; 
    10901091ALTER TABLE cc_ratecard ADD COLUMN id_cc_prefix INT (11) DEFAULT 0; 
     1092 
     1093 
    10911094 
    10921095-- ALTER TABLE cc_ratecard DROP destination;