1 % if ( $type eq 'xml' ) {
2 <?xml version="1.0" encoding="ISO-8859-1"?>
3 <Form_477_submission xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://specialreports.fcc.gov/wcb/Form477/XMLSchema-instance/form_477_upload_Schema.xsd" >
5 <& /elements/header.html, "FCC Form 477 Results - $state" &>
6 %# XXX when we stop supporting IE8, add this to freeside.css using :nth-child
7 %# selectors, and remove it from everywhere else
8 <STYLE TYPE="text/css">
9 .grid TH { background-color: #cccccc; padding: 0px 3px 2px; text-align: right }
10 .row0 TD { background-color: #eeeeee; padding: 0px 3px 2px; text-align: right }
11 .row1 TD { background-color: #ffffff; padding: 0px 3px 2px; text-align: right }
17 <TD ALIGN="right" CLASS="noprint">
18 Download full results<BR>
19 % $cgi->param('_type', 'xml');
20 as <A HREF="<% $cgi->self_url %>">XML file</A><BR>
22 % $cgi->param('_type', 'html-print');
23 as <A HREF="<% $cgi->self_url %>">printable copy</A>
26 % $cgi->param('_type', $type );
30 % foreach my $part ( @parts ) {
31 % if ( $part{$part} ) {
33 % if ( $part eq 'V' ) {
34 % next unless ( $part{'IIA'} || $part{'IIB'} );
37 % if ( $part eq 'VI_census' ) {
38 % next unless $part{'IA'};
42 % if ( $part eq 'IA' ) {
43 % for ( my $tech = 0; $tech < scalar(@technology_option); $tech++ ) {
44 % next unless $technology_option[$tech];
45 % my $url = &{$url_mangler}($part);
46 % if ( $type eq 'xml' ) {
47 <<% 'Part_IA_'. chr(65 + $tech) %>>
49 <& "477part${part}.html",
54 % if ( $type eq 'xml' ) {
55 </<% 'Part_IA_'. chr(65 + $tech) %>>
59 % if ( $type eq 'xml' ) {
60 <<% 'Part_'. $part %>>
62 % my $url = &{$url_mangler}($part);
63 <& "477part${part}.html", 'url' => $url &>
64 % if ( $type eq 'xml' ) {
65 </<% 'Part_'. $part %>>
71 % if ( $type eq 'xml' ) {
72 </Form_477_submission>
74 <& /elements/footer.html &>
78 my $curuser = $FS::CurrentUser::CurrentUser;
81 unless $curuser->access_right('List packages');
83 my $state = uc($cgi->param('state'));
84 $state =~ /^[A-Z]{2}$/ or die "illegal state: $state";
86 my %part = map { $_ => 1 } grep { /^\w+$/ } $cgi->param('part');
87 my $type = $cgi->param('_type') || 'html';
88 my $xlsname = '477report';
89 my @technology_option = &FS::Report::FCC_477::parse_technology_option($cgi,1);
91 # save upload and download mappings
92 my @download = $cgi->param('part1_column_option');
93 my @upload = $cgi->param('part1_row_option');
94 for(my $i=0; $i < scalar(@download); $i++) {
95 &FS::Report::FCC_477::save_fcc477map("part1_column_option_$i",$download[$i]);
97 for(my $i=0; $i < scalar(@upload); $i++) {
98 &FS::Report::FCC_477::save_fcc477map("part1_row_option_$i",$upload[$i]);
101 my @part2a_row_option = $cgi->param('part2a_row_option');
102 for(my $i=0; $i < scalar(@part2a_row_option); $i++) {
103 &FS::Report::FCC_477::save_fcc477map("part2a_row_option_$i",$part2a_row_option[$i]);
106 my @part2b_row_option = $cgi->param('part2b_row_option');
107 for(my $i=0; $i < scalar(@part2b_row_option); $i++) {
108 &FS::Report::FCC_477::save_fcc477map("part2b_row_option_$i",$part2b_row_option[$i]);
111 my $part5_report_option = $cgi->param('part5_report_option');
112 if ( $part5_report_option ) {
113 FS::Report::FCC_477::save_fcc477map('part5_report_option', $part5_report_option);
116 my $url_mangler = sub {
118 my $url = $cgi->url('-path_info' => 1, '-full' => 1);
119 $url =~ s/477\./477part$part./;
122 my @parts = qw( IA IIA IIB IV V VI_census );