X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fold477%2F477partV.html;fp=httemplate%2Fsearch%2Fold477%2F477partV.html;h=80201f9d7886b88c2abff31fdfa1169f1acfbf66;hb=8fdc0ea36474cfb3d1389f41691c14598559cbe7;hp=0000000000000000000000000000000000000000;hpb=08db5f6900bb754efb597a2967adde4dbd12e731;p=freeside.git diff --git a/httemplate/search/old477/477partV.html b/httemplate/search/old477/477partV.html new file mode 100755 index 000000000..80201f9d7 --- /dev/null +++ b/httemplate/search/old477/477partV.html @@ -0,0 +1,54 @@ +% if ( $cgi->param('_type') =~ /^xml$/ ) { + +% } +<& /search/elements/search.html, + 'html_init' => $html_init, + 'name' => 'zip code', + 'query' => $sql_query, + 'count_query' => $count_query, + 'nohtmlheader' => 1, + 'disable_total' => 1, + 'header' => [ 'zip code' ], + 'xml_elements' => [ 'zip codes' ], + 'no_field_elements' => 1, + 'fields' => [ 'zip' ], + 'url' => $opt{url} || '', + 'really_disable_download' => 1, + + +&> +% if ( $cgi->param('_type') =~ /^xml$/ ) { + +% } +<%init> + +my $curuser = $FS::CurrentUser::CurrentUser; + +die "access denied" + unless $curuser->access_right('List packages'); + +my %opt = @_; +my $html_init = '

Part V

'; +my %search_hash = (); +my @sql_query = (); +my @count_query = (); + +for ( qw(agentnum state) ) { + $search_hash{$_} = $cgi->param($_) if $cgi->param($_); +} +$search_hash{'country'} = 'US'; +$search_hash{'classnum'} = [ $cgi->param('classnum') ]; +$search_hash{report_option} = $cgi->param('part5_report_option') + if $cgi->param('part5_report_option'); +$search_hash{'active'} = [ $opt{date}, $opt{date} ]; + +my $sql_query = FS::cust_pkg->search( { %search_hash, + 'fcc_line' => 1, + 'select_zip5' => 1, + } + ); +my $count_query = delete($sql_query->{'count_query'}); +$count_query =~ s/COUNT\(\*\)/count(DISTINCT substr(zip,1,5))/; +$count_query =~ s/ORDER BY [.\w]+//; + +