From c371f6e225cfffa667815a51571203b034e4f75c Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 10 Jan 2008 21:53:49 +0000 Subject: new rate editor --- httemplate/browse/rate.cgi | 76 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 53 insertions(+), 23 deletions(-) (limited to 'httemplate/browse') diff --git a/httemplate/browse/rate.cgi b/httemplate/browse/rate.cgi index 584891a..b20c45c 100644 --- a/httemplate/browse/rate.cgi +++ b/httemplate/browse/rate.cgi @@ -1,34 +1,64 @@ <% include( 'elements/browse.html', - 'title' => 'Rate plans', - 'menubar' => [ 'Main menu' => $p, ], - 'html_init' => $html_init, - 'name' => 'rate plans', - 'query' => { 'table' => 'rate', - 'hashref' => {}, - 'extra_sql' => 'ORDER BY ratenum', - }, - 'count_query' => $count_query, - 'header' => [ '#', 'Rate plan', ], - 'fields' => [ 'ratenum', 'ratename' ], - 'links' => [ $link, $link ], - ) + '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, '' ], + ) %> +<%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(