Changeset 1257
- Timestamp:
- 11/20/08 10:26:39 (2 months ago)
- Files:
-
- trunk/admin/Public/call-log-customers.php (modified) (10 diffs)
- trunk/admin/Public/form_data/FG_var_def_ratecard.inc (modified) (4 diffs)
- trunk/admin/Public/form_data/FG_var_prefix.inc (modified) (5 diffs)
- trunk/common/lib/Class.RateEngine.php (modified) (2 diffs)
- trunk/DataBase/mysql-5.x/UPDATE-a2billing-v1.3.4-to-v1.4.0-mysql-prefix-table.sql (added)
- trunk/DataBase/mysql-5.x/UPDATE-a2billing-v1.3.4-to-v1.4.0-mysql.sql (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/admin/Public/call-log-customers.php
r1235 r1257 81 81 $FG_TABLE_COL [] = array (gettext ( "Dnid" ), "dnid", "7%", "center", "SORT", "30" ); 82 82 $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" ); 84 84 $FG_TABLE_COL [] = array (gettext ( "Buy Rate" ), "buyrate", "5%", "center", "SORT", "30", "", "", "", "", "", "display_2bill" ); 85 85 $FG_TABLE_COL [] = array (gettext ( "Sell Rate" ), "rateinitial", "5%", "center", "SORT", "30", "", "", "", "", "", "display_2bill" ); 86 86 $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" ); 88 88 $FG_TABLE_COL [] = array (gettext ( "Trunk" ), "trunkcode", "6%", "center", "SORT", "30" ); 89 89 $FG_TABLE_COL [] = array ('<acronym title="' . gettext ( "Terminate Cause" ) . '">' . gettext ( "TC" ) . '</acronym>', "terminatecauseid", "7%", "center", "SORT", "", "list", $dialstatus_list ); … … 99 99 100 100 // 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'; 102 102 if (LINK_AUDIO_FILE) { 103 103 $FG_COL_QUERY .= ', t1.uniqueid'; … … 957 957 ?></center> 958 958 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"> 962 960 <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"> 965 962 <TABLE border=0 cellPadding=0 cellSpacing=0 width="100%"> 966 963 <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> 969 965 <TD align=right><IMG alt="Back to Top" border=0 height=12 src="<?php echo Images_Path; ?>/btn_top_12x12.gif" width=12></TD> 970 966 </TR> … … 976 972 <TABLE border=0 cellPadding=0 cellSpacing=0 width="100%"> 977 973 <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> 982 975 983 976 <?php … … 1020 1013 </TR> 1021 1014 <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?> 1016 height=1><IMG height=1 src="<?php echo Images_Path; ?>/clear.gif" width=1></TD> 1028 1017 </TR> 1029 1018 <?php … … 1035 1024 ?> 1036 1025 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 . ". "; ?></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 . ". "; ?></TD> 1044 1028 1045 1029 <?php for($i = 0; $i < $FG_NB_TABLE_COL; $i ++) { ?> … … 1049 1033 $instance_sub_table = new Table ( $FG_TABLE_COL [$i] [7], $FG_TABLE_COL [$i] [8] ); 1050 1034 $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); 1052 1036 1053 1037 $field_list_sun = split ( ',', $FG_TABLE_COL [$i] [8] ); 1054 1038 $record_display = $FG_TABLE_COL [$i] [10]; 1055 1039 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 } 1060 1062 } elseif ($FG_TABLE_COL [$i] [6] == "list") { 1061 1063 $select_list = $FG_TABLE_COL [$i] [7]; … … 1072 1074 1073 1075 ?> 1074 <TD vAlign=top align="<?php echo $FG_TABLE_COL [$i] [3]?>" class=tableBody><?php1076 <TD vAlign=top align="<?php echo $FG_TABLE_COL [$i] [3]?>" class=tableBody><?php 1075 1077 if (isset ( $FG_TABLE_COL [$i] [11] ) && strlen ( $FG_TABLE_COL [$i] [11] ) > 1) { 1076 1078 call_user_func ( $FG_TABLE_COL [$i] [11], $record_display ); … … 1113 1115 </tr> 1114 1116 <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%"> 1118 1119 <TR> 1119 1120 <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?>¤t_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?>¤t_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?>¤t_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?>¤t_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 } ?> 1174 1139 </TD> 1175 1140 </TABLE> … … 1178 1143 </table> 1179 1144 1180 <?php1181 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="<?php1188 if ($_SESSION ["is_admin"] == 1) {1189 ?>450<?php1190 } else {1191 ?>200<?php1192 }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><?php1199 echo gettext ( "TOTAL COSTS" );1200 ?></strong></td>1201 <?php1202 if ($_SESSION ["is_admin"] == 1) {1203 ?><td width="33%"1204 align="center" class="tableBodyRight" bgcolor="#600101"1205 style="padding: 5px;"><strong><?php1206 echo gettext ( "TOTAL BUYCOSTS" );1207 ?></strong></td><?php1208 }1209 ?>1210 <?php1211 if ($_SESSION ["is_admin"] == 1) {1212 ?><td width="33%"1213 align="center" class="tableBodyRight" bgcolor="#600101"1214 style="padding: 5px;"><strong><?php1215 echo gettext ( "DIFFERENCE" );1216 ?></strong></td><?php1217 }1218 ?>1219 </tr>1220 <tr>1221 <td valign="top" align="center" class="tableBody" bgcolor="white"><b><?php1222 echo $total_cost [0] [0]?></td>1223 <?php1224 if ($_SESSION ["is_admin"] == 1) {1225 ?><td valign="top"1226 align="center" class="tableBody" bgcolor="#66FF66"><b><?php1227 echo $total_cost [0] [1]?></td><?php1228 }1229 ?>1230 <?php1231 if ($_SESSION ["is_admin"] == 1) {1232 ?><td valign="top"1233 align="center" class="tableBody" bgcolor="#FF6666"><b><?php1234 echo $total_cost [0] [0] - $total_cost [0] [1]?></td><?php1235 }1236 ?>1237 1238 </tr>1239 1240 </table>1241 </div>1242 <br />1243 <br />1244 1245 <!-- ************** TOTAL SECTION ************* -->1246 <?php1247 }1248 ?>1249 1145 1250 1146 <!-- ** ** ** ** ** Part to display the GRAPHIC ** ** ** ** ** --> trunk/admin/Public/form_data/FG_var_def_ratecard.inc
r1237 r1257 89 89 90 90 if ($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"); 92 92 $HD_Form -> AddViewElement("<acronym title=\"DIALING PREFIX\">".gettext("PREFIX")."</acronym>", "dialprefix", "10%", "center", "sort", ""); 93 93 $HD_Form -> AddViewElement("<acronym title=\"BUYING RATE\">".gettext("BR")."</acronym>", "buyrate", "4%", "center", "sort"); … … 180 180 181 181 182 $HD_Form -> AddEditElement(gettext(" Prefix_Destination"),183 " id_cc_prefix",182 $HD_Form -> AddEditElement(gettext("Destination Prefix"), 183 "destination", 184 184 '$value', 185 185 "SELECT", … … 187 187 "sql", 188 188 "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.")); 191 191 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, ...") );201 192 202 193 $HD_Form -> AddEditElement("BUYING RATE", … … 551 542 if (ADVANCED_MODE) { 552 543 // 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'); 554 545 }else{ 555 546 // 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'); 557 548 } 558 549 trunk/admin/Public/form_data/FG_var_prefix.inc
r1084 r1257 1 1 <?php 2 2 3 getpost_ifset(array('id', 'destination',' dialprefix','popup_select','popup_formname','popup_fieldname' ));3 getpost_ifset(array('id', 'destination','prefix','popup_select','popup_formname','popup_fieldname' )); 4 4 5 5 $HD_Form = new FormHandler("cc_prefix","prefix"); 6 6 7 7 $HD_Form -> FG_DEBUG = 0; 8 $HD_Form -> FG_TABLE_ID = "prefix"; 8 9 $HD_Form -> FG_TABLE_DEFAULT_ORDER = "destination"; 9 10 $HD_Form -> FG_TABLE_DEFAULT_SENS = "ASC"; 10 11 11 12 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§ion=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§ion=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" ; 17 17 18 18 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"); 21 21 22 $HD_Form -> FieldViewElement ('destination, prefixe'); 22 23 $HD_Form -> FieldViewElement ('prefix, destination'); 23 24 24 25 … … 28 29 $HD_Form -> CV_TEXT_TITLE_ABOVE_TABLE = ''; 29 30 $HD_Form -> CV_DISPLAY_FILTER_ABOVE_TABLE = false; 30 if (!($popup_select==1)){ 31 32 if (!($popup_select==1)) { 31 33 $HD_Form -> FG_EDITION = true; 32 34 $HD_Form -> FG_DELETION = true; 33 } else{35 } else { 34 36 $HD_Form -> CV_FOLLOWPARAMETERS= "&popup_select=".$_GET['popup_select']."&popup_formname=".$_GET['popup_formname']."&popup_fieldname=".$_GET['popup_fieldname']; 35 37 $HD_Form ->FG_LIMITE_DISPLAY=7; … … 37 39 $HD_Form -> FG_OTHER_BUTTON1_ALT = '<font color="red"><select></font>'; 38 40 $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|');"; 46 43 } 47 44 48 45 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 49 55 $HD_Form -> AddEditElement (gettext("DESTINATION"), 50 56 "destination", … … 56 62 "" , "", "", "", "" , "", "" ,""); 57 63 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 "" , "", "", "", "" , "", "" ,"");66 64 67 $HD_Form -> FieldEditElement (' destination, prefixe');65 $HD_Form -> FieldEditElement ('prefix, destination'); 68 66 67 $HD_Form -> FG_EDITION_CLAUSE = " prefix='%id'"; 69 68 70 69 71 70 $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'; 74 73 $HD_Form -> FG_FILTER_FORM_ACTION = 'list'; 75 74 76 if (isset($filterprefix) && (strlen($filterprefix)>0)) {75 if (isset($filterprefix) && (strlen($filterprefix)>0)) { 77 76 if (strlen($HD_Form -> FG_TABLE_CLAUSE)>0) $HD_Form -> FG_TABLE_CLAUSE.=" AND "; 78 77 $filterprefix = strtoupper(substr($filterprefix,0,1)).substr($filterprefix,1); 79 $HD_Form -> FG_TABLE_CLAUSE .="destinationlike '$filterprefix%'";78 $HD_Form -> FG_TABLE_CLAUSE .= "prefix like '$filterprefix%'"; 80 79 } 81 80 … … 100 99 101 100 101 102 trunk/common/lib/Class.RateEngine.php
r1237 r1257 172 172 $QUERY = "SELECT 173 173 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, 175 175 buyrateinitblock, buyrateincrement, rateinitial, initblock, billingblock, 176 176 connectcharge, disconnectcharge, stepchargea, chargea, timechargea, … … 1055 1055 $QUERY_COLUMN = "uniqueid, sessionid, card_id, nasipaddress, starttime, sessiontime, real_sessiontime, calledstation, ". 1056 1056 " 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"; 1058 1058 $QUERY = "INSERT INTO cc_call ($QUERY_COLUMN) VALUES ('".$A2B->uniqueid."', '".$A2B->channel."', '". 1059 1059 $A2B->id_card."', '".$A2B->hostname."', "; trunk/DataBase/mysql-5.x/UPDATE-a2billing-v1.3.4-to-v1.4.0-mysql.sql
r1256 r1257 1086 1086 ALTER TABLE cc_prefix ADD INDEX ( prefixe ); 1087 1087 1088 1088 1089 -- optimization on CDR 1089 1090 ALTER TABLE cc_call ADD COLUMN id_cc_prefix INT (11) DEFAULT 0; 1090 1091 ALTER TABLE cc_ratecard ADD COLUMN id_cc_prefix INT (11) DEFAULT 0; 1092 1093 1091 1094 1092 1095 -- ALTER TABLE cc_ratecard DROP destination;
