X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fbrowse%2Frate.cgi;h=b20c45c0c606792cf3d8b8bbf53cca941d3ec5a9;hb=8a00b4c10743a314f4a298879141b60d6096eb3b;hp=c31260166645a4beaecf44eebc3854fb69599c29;hpb=673b9a458d9138523026963df6fa3b4683e09bae;p=freeside.git
diff --git a/httemplate/browse/rate.cgi b/httemplate/browse/rate.cgi
index c31260166..b20c45c0c 100644
--- a/httemplate/browse/rate.cgi
+++ b/httemplate/browse/rate.cgi
@@ -1,34 +1,67 @@
-
-<%= header("Rate plan listing", menubar( 'Main Menu' => "$p#sysadmin" )) %>
-Rate plans, regions and prefixes for VoIP and call billing.
-Add a rate plan
-| Add a region
-
-
-
-<%= table() %>
-
- Rate plan |
-
-
-<% foreach my $rate ( sort {
- $a->getfield('ratenum') <=> $b->getfield('ratenum')
- } qsearch('rate',{}) ) {
+<% include( 'elements/browse.html',
+ 'title' => 'Rate plans',
+ 'menubar' => [ 'Regions and Prefixes' =>
+ $p.'browse/rate_region.html',
+ ],
+ 'html_init' => $html_init,
+ 'name' => 'rate plans',
+ 'query' => { 'table' => 'rate',
+ 'hashref' => {},
+ 'extra_sql' => 'ORDER BY ratenum',
+ },
+ 'count_query' => $count_query,
+ 'header' => [ '#', 'Rate plan', 'Rates' ],
+ 'fields' => [ 'ratenum', 'ratename', $rates_sub ],
+ 'links' => [ $link, $link, '' ],
+ )
%>
-
- <%= $rate->ratenum %> |
- <%= $rate->ratename %> |
-
+<%once>
-<% } %>
+my $sth = dbh->prepare("SELECT DISTINCT(countrycode) FROM rate_prefix")
+ or die dbh->errstr;
+$sth->execute or die $sth->errstr;
+my @all_countrycodes = map $_->[0], @{ $sth->fetchall_arrayref };
+my $all_countrycodes = join("\n", map qq(