fix 477 report, #16408
[freeside.git] / httemplate / search / report_477.html
1 <% include('/elements/header.html', 'FCC Form 477 Report' ) %>
2
3 <FORM ACTION="477.html" METHOD="GET">
4 <INPUT TYPE="hidden" NAME="magic" VALUE="active">
5
6   <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
7
8     <TR>
9       <TH CLASS="background" COLSPAN=2 ALIGN="left">
10         <FONT SIZE="+1">Search options</FONT>
11       </TH>
12     </TR>
13
14     <% include( '/elements/tr-select-agent.html',
15                    'curr_value'    => scalar( $cgi->param('agentnum') ),
16                    'disable_empty' => 0,
17                )
18     %>
19
20     <% include( '/elements/tr-select-pkg_class.html',
21                    'multiple'       => 1,
22                    'empty_label' => '(empty class)',
23                )
24     %>
25
26     <SCRIPT type="text/javascript">
27       function partchange(what) {
28         var id = 'part' + what.value;
29         var element = document.getElementById(id);
30         if (what.checked) {
31           element.style.display = '';
32         } else {
33           element.style.display = 'none';
34         }
35       }
36       function toggleV() {
37         document.getElementById('enableV').disabled =
38           ! (document.getElementById('enableIIA').checked ||
39              document.getElementById('enableIIB').checked);
40       }
41       function toggleVI() {
42         document.getElementById('enableVI').disabled =
43           ! document.getElementById('enableIA').checked;
44       }
45     </SCRIPT>
46
47     <% include( '/elements/tr-checkbox.html',
48                    'label' => 'Enable part IA?',
49                    'field' => 'part',
50                    'id'    => 'enableIA',
51                    'value' => 'IA',
52                    'onchange' => 'partchange(this); toggleVI();',
53                )
54     %>
55
56     <TR id='partIA' style="display:none"><TD>Part IA</TD><TD><TABLE>
57       <TR><TD>Download speeds</TD><TD>
58         <TABLE>
59 %       my $i = 0;
60 %       foreach my $speed ( @FS::Report::FCC_477::download ) {
61           <TR>
62             <TH><% $speed %></TH>
63             <TD>
64             <% include( '/elements/select-table.html',
65                            'table'        => 'part_pkg_report_option',
66                            'name_col'     => 'name',
67                            'hashref'      => { 'disabled' => '' },
68                            'element_name' => 'part1_column_option',
69                            'disable_empty' => 1,
70                            'curr_value'   =>
71                                 FS::Report::FCC_477::restore_fcc477map("part1_column_option_$i"),
72                        )
73             %>
74             </TD>
75           </TR>
76 %       $i++
77 %       }
78         </TABLE></TD>
79       <TD>Upload speeds</TD><TD>
80         <TABLE>
81 %       $i = 0;
82 %       foreach my $speed ( @FS::Report::FCC_477::upload ) {
83           <TR>
84             <TH><% $speed %></TH>
85             <TD>
86             <% include( '/elements/select-table.html',
87                            'table'        => 'part_pkg_report_option',
88                            'name_col'     => 'name',
89                            'hashref'      => { 'disabled' => '' },
90                            'element_name' => 'part1_row_option',
91                            'disable_empty' => 1,
92                            'curr_value'   =>
93                                 FS::Report::FCC_477::restore_fcc477map("part1_row_option_$i"),
94                        )
95             %>
96             </TD>
97           </TR>
98 %       $i++
99 %       }
100         </TABLE></TD></TR>
101       <TR><TD>Technologies</TD><TD>
102         <TABLE>
103 %       $i = 0;
104 %       foreach my $tech ( @FS::Report::FCC_477::technology ) {
105           <TR>
106             <TH><% $tech %></TH>
107             <TD>
108             <% include( '/elements/select-table.html',
109                            'table'        => 'part_pkg_report_option',
110                            'name_col'     => 'name',
111                            'hashref'      => { 'disabled' => '' },
112                            'element_name' => "part1_technology_option_$i",
113                            'empty_label'  => '(omit)',
114                            'curr_value'   =>
115                                 FS::Report::FCC_477::restore_fcc477map("part1_technology_option_$i"),
116                        )
117             %>
118             </TD>
119           </TR>
120 %       $i++
121 %       }
122         </TABLE></TD></TR>
123     </TABLE></TD></TR>
124
125     <% include( '/elements/tr-checkbox.html',
126                    'label' => 'Enable part IIA?',
127                    'field' => 'part',
128                    'id'    => 'enableIIA',
129                    'value' => 'IIA',
130                    'onchange' => 'partchange(this); toggleV();',
131                )
132     %>
133
134     <TR id='partIIA' style="display:none"><TD>Part IIA</TD><TD><TABLE>
135 %   $i = 0;
136 %   foreach my $option ( @FS::Report::FCC_477::part2aoption ) {
137     <TR>
138       <TH><% $option %></TH>
139       <TD>
140       <% include( '/elements/select-table.html',
141                      'table'        => 'part_pkg_report_option',
142                      'name_col'     => 'name',
143                      'hashref'      => { 'disabled' => '' },
144                      'element_name' => 'part2a_row_option',
145                      'curr_value'   =>
146                            FS::Report::FCC_477::restore_fcc477map("part2a_row_option_$i"),
147                  )
148       %>
149       </TD>
150     </TR>
151 %    $i++
152 %   }
153   </TABLE></TD></TR>
154
155     <% include( '/elements/tr-checkbox.html',
156                    'label' => 'Enable part IIB?',
157                    'field' => 'part',
158                    'id'    => 'enableIIB',
159                    'value' => 'IIB',
160                    'onchange' => 'partchange(this); toggleV();',
161                )
162     %>
163
164     <TR id='partIIB' style="display:none"><TD>Part IIB</TD><TD><TABLE>
165 %   $i = 0;
166 %   foreach my $option ( @FS::Report::FCC_477::part2boption ) {
167     <TR>
168       <TH><% $option %></TH>
169       <TD>
170       <% include( '/elements/select-table.html',
171                      'table'        => 'part_pkg_report_option',
172                      'name_col'     => 'name',
173                      'hashref'      => { 'disabled' => '' },
174                      'element_name' => 'part2b_row_option',
175                       'curr_value'   =>
176                             FS::Report::FCC_477::restore_fcc477map("part2b_row_option_$i"),
177                  )
178       %>
179       </TD>
180     </TR>
181 %    $i++
182 %   }
183   </TABLE></TD></TR>
184
185     <% include( '/elements/tr-checkbox.html',
186                    'label' => 'Enable part IV?',
187                    'field' => 'part',
188                    'id'    => 'enableIV', #unused
189                    'value' => 'IV',
190                    'onchange' => 'partchange(this)',
191                )
192     %>
193
194     <TR id='partIV' style="display:none"><TD>Part IV</TD><TD><TABLE>
195     <% include( '/elements/tr-textarea.html',
196                    'label'        => 'Explanatory notes',
197                    'id'           => 'partIV',
198                    'field'         => 'notes',
199                    'rows'         => 15,
200                    'cols'         => 80,
201                )
202     %>
203   </TABLE></TD></TR>
204
205     <% include( '/elements/tr-checkbox.html',
206                    'label' => 'Enable part V?',
207                    'field' => 'part',
208                    'value' => 'V',
209                    'id'    => 'enableV',
210                    'onchange' => 'partchange(this)',
211                    'postfix'  => 
212                     '&nbsp;<FONT SIZE="-1">(requires Part IIA or IIB)</FONT>',
213                )
214     %>
215     <TR id='partV' style="display:none">
216         <TD>Part V</TD>
217         <TD>
218             <% include( '/elements/select-table.html',
219                      'table'        => 'part_pkg_report_option',
220                      'name_col'     => 'name',
221                      'hashref'      => { 'disabled' => '' },
222                      'element_name' => 'partv_report_option',
223                  )
224             %>
225         </TD>
226     </TR>
227
228
229     <% include( '/elements/tr-checkbox.html',
230                    'label' => 'Enable part VI?',
231                    'field' => 'part',
232                    'id'    => 'enableVI',
233                    'value' => 'VI_census',
234                    'postfix'  =>
235                     '&nbsp;<FONT SIZE="-1">(requires part IA)</FONT>',
236                )
237     %>
238   <SCRIPT TYPE="text/javascript">
239   toggleV();
240   toggleVI();
241   </SCRIPT>
242   </TABLE>
243
244 <BR>
245 <INPUT TYPE="submit" VALUE="Get Report">
246
247 </FORM>
248
249 <% include('/elements/footer.html') %>
250 <%init>
251
252 die "access denied"
253   unless $FS::CurrentUser::CurrentUser->access_right('List packages');
254
255 </%init>