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" &>
9 <TD ALIGN="right" CLASS="noprint">
10 Download full results<BR>
11 % $cgi->param('_type', 'xml');
12 as <A HREF="<% $cgi->self_url %>">XML file</A><BR>
14 % $cgi->param('_type', 'html-print');
15 as <A HREF="<% $cgi->self_url %>">printable copy</A>
18 % $cgi->param('_type', $type );
22 % foreach my $part ( @parts ) {
23 % if ( $part{$part} ) {
25 % if ( $part eq 'V' ) {
26 % next unless ( $part{'IIA'} || $part{'IIB'} );
29 % if ( $part eq 'VI_census' ) {
30 % next unless $part{'IA'};
34 % if ( $part eq 'IA' ) {
35 % for ( my $tech = 0; $tech < scalar(@technology_option); $tech++ ) {
36 % next unless $technology_option[$tech];
37 % my $url = &{$url_mangler}($part);
38 % if ( $type eq 'xml' ) {
39 <<% 'Part_IA_'. chr(65 + $tech) %>>
41 <& "477part${part}_summary.html", 'tech_code' => $tech, 'url' => $url &>
42 <& "477part${part}_detail.html", 'tech_code' => $tech, 'url' => $url &>
43 % if ( $type eq 'xml' ) {
44 </<% 'Part_IA_'. chr(65 + $tech) %>>
48 % if ( $type eq 'xml' ) {
49 <<% 'Part_'. $part %>>
51 % my $url = &{$url_mangler}($part);
52 <& "477part${part}.html", 'url' => $url &>
53 % if ( $type eq 'xml' ) {
54 </<% 'Part_'. $part %>>
60 % if ( $type eq 'xml' ) {
61 </Form_477_submission>
63 <& /elements/footer.html &>
67 my $curuser = $FS::CurrentUser::CurrentUser;
70 unless $curuser->access_right('List packages');
72 my $state = uc($cgi->param('state'));
73 $state =~ /^[A-Z]{2}$/ or die "illegal state: $state";
75 my %part = map { $_ => 1 } grep { /^\w+$/ } $cgi->param('part');
76 my $type = $cgi->param('_type') || 'html';
77 my $xlsname = '477report';
78 my @technology_option = &FS::Report::FCC_477::parse_technology_option($cgi,1);
80 # save upload and download mappings
81 my @download = $cgi->param('part1_column_option');
82 my @upload = $cgi->param('part1_row_option');
83 for(my $i=0; $i < scalar(@download); $i++) {
84 &FS::Report::FCC_477::save_fcc477map("part1_column_option_$i",$download[$i]);
86 for(my $i=0; $i < scalar(@upload); $i++) {
87 &FS::Report::FCC_477::save_fcc477map("part1_row_option_$i",$upload[$i]);
90 my @part2a_row_option = $cgi->param('part2a_row_option');
91 for(my $i=0; $i < scalar(@part2a_row_option); $i++) {
92 &FS::Report::FCC_477::save_fcc477map("part2a_row_option_$i",$part2a_row_option[$i]);
95 my @part2b_row_option = $cgi->param('part2b_row_option');
96 for(my $i=0; $i < scalar(@part2b_row_option); $i++) {
97 &FS::Report::FCC_477::save_fcc477map("part2b_row_option_$i",$part2b_row_option[$i]);
100 my $part5_report_option = $cgi->param('part5_report_option');
101 if ( $part5_report_option ) {
102 FS::Report::FCC_477::save_fcc477map('part5_report_option', $part5_report_option);
105 my $url_mangler = sub {
107 my $url = $cgi->url('-path_info' => 1, '-full' => 1);
108 $url =~ s/477\./477part$part./;
111 my @parts = qw( IA IIA IIB IV V VI_census );