1 <% include('/elements/header.html', 'FCC Form 477 Report' ) %>
3 <FORM ACTION="477.html" METHOD="GET">
4 <INPUT TYPE="hidden" NAME="magic" VALUE="active">
6 <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
9 <TH CLASS="background" COLSPAN=2 ALIGN="left">
10 <FONT SIZE="+1">Search options</FONT>
14 <% include( '/elements/tr-select-agent.html',
15 'curr_value' => scalar( $cgi->param('agentnum') ),
20 <& /elements/tr-td-label.html, 'label' => 'State' &>
24 <OPTION VALUE="<% $_ %>"><% $_ %></OPTION>
29 <% include( '/elements/tr-select-pkg_class.html',
31 'empty_label' => '(empty class)',
35 <SCRIPT type="text/javascript">
36 function partchange(what) {
37 var id = 'part' + what.value;
38 var element = document.getElementById(id);
40 element.style.display = '';
42 element.style.display = 'none';
46 document.getElementById('enableV').disabled =
47 ! (document.getElementById('enableIIA').checked ||
48 document.getElementById('enableIIB').checked);
51 document.getElementById('enableVI').disabled =
52 ! document.getElementById('enableIA').checked;
56 <% include( '/elements/tr-checkbox.html',
57 'label' => 'Enable part IA?',
61 'onchange' => 'partchange(this); toggleVI();',
65 <TR id='partIA' style="display:none"><TD>Part IA</TD><TD><TABLE>
66 <TR><TD>Download speeds</TD><TD>
69 % foreach my $speed ( @FS::Report::FCC_477::download ) {
73 <% include( '/elements/select-table.html',
74 'table' => 'part_pkg_report_option',
76 'hashref' => { 'disabled' => '' },
77 'element_name' => 'part1_column_option',
80 FS::Report::FCC_477::restore_fcc477map("part1_column_option_$i"),
88 <TD>Upload speeds</TD><TD>
91 % foreach my $speed ( @FS::Report::FCC_477::upload ) {
95 <% include( '/elements/select-table.html',
96 'table' => 'part_pkg_report_option',
98 'hashref' => { 'disabled' => '' },
99 'element_name' => 'part1_row_option',
100 'disable_empty' => 1,
102 FS::Report::FCC_477::restore_fcc477map("part1_row_option_$i"),
110 <TR><TD>Technologies</TD><TD>
113 % foreach my $tech ( @FS::Report::FCC_477::technology ) {
117 <% include( '/elements/select-table.html',
118 'table' => 'part_pkg_report_option',
119 'name_col' => 'name',
120 'hashref' => { 'disabled' => '' },
121 'element_name' => "part1_technology_option_$i",
122 'empty_label' => '(omit)',
124 FS::Report::FCC_477::restore_fcc477map("part1_technology_option_$i"),
134 <% include( '/elements/tr-checkbox.html',
135 'label' => 'Enable part IIA?',
139 'onchange' => 'partchange(this); toggleV();',
143 <TR id='partIIA' style="display:none"><TD>Part IIA</TD><TD><TABLE>
145 % foreach my $option ( @FS::Report::FCC_477::part2aoption ) {
147 <TH><% $option %></TH>
149 <% include( '/elements/select-table.html',
150 'table' => 'part_pkg_report_option',
151 'name_col' => 'name',
152 'hashref' => { 'disabled' => '' },
153 'element_name' => 'part2a_row_option',
155 FS::Report::FCC_477::restore_fcc477map("part2a_row_option_$i"),
164 <% include( '/elements/tr-checkbox.html',
165 'label' => 'Enable part IIB?',
169 'onchange' => 'partchange(this); toggleV();',
173 <TR id='partIIB' style="display:none"><TD>Part IIB</TD><TD><TABLE>
175 % foreach my $option ( @FS::Report::FCC_477::part2boption ) {
177 <TH><% $option %></TH>
179 <% include( '/elements/select-table.html',
180 'table' => 'part_pkg_report_option',
181 'name_col' => 'name',
182 'hashref' => { 'disabled' => '' },
183 'element_name' => 'part2b_row_option',
185 FS::Report::FCC_477::restore_fcc477map("part2b_row_option_$i"),
194 <% include( '/elements/tr-checkbox.html',
195 'label' => 'Enable part IV?',
197 'id' => 'enableIV', #unused
199 'onchange' => 'partchange(this)',
203 <TR id='partIV' style="display:none"><TD>Part IV</TD><TD><TABLE>
204 <% include( '/elements/tr-textarea.html',
205 'label' => 'Explanatory notes',
214 <% include( '/elements/tr-checkbox.html',
215 'label' => 'Enable part V?',
219 'onchange' => 'partchange(this)',
221 ' <FONT SIZE="-1">(requires Part IIA or IIB)</FONT>',
224 <TR id='partV' style="display:none">
227 <% include( '/elements/select-table.html',
228 'table' => 'part_pkg_report_option',
229 'name_col' => 'name',
230 'hashref' => { 'disabled' => '' },
231 'element_name' => 'partv_report_option',
238 <% include( '/elements/tr-checkbox.html',
239 'label' => 'Enable part VI?',
242 'value' => 'VI_census',
244 ' <FONT SIZE="-1">(requires part IA)</FONT>',
247 <SCRIPT TYPE="text/javascript">
254 <INPUT TYPE="submit" VALUE="Get Report">
258 <% include('/elements/footer.html') %>
262 unless $FS::CurrentUser::CurrentUser->access_right('List packages');
266 'table' => 'cust_main',
267 'select' => 'DISTINCT(state)',
268 'hashref' => { 'country' => 'US' }, # 477 report isn't relevant elsewhere
271 'table' => 'cust_main',
272 'select' => 'DISTINCT(ship_state) AS state',
273 'hashref' => { 'country' => 'US' },
276 'table' => 'cust_location',
277 'select' => 'DISTINCT(state)',
278 'hashref' => { 'country' => 'US' },
283 my %seen = map {$_->get('state') => 1} @states;
284 @states = grep $_, sort keys(%seen);