### Intialize static lists for $this_rep = "swr023b.hts"; @selectionList = ( "V_SITE_ANTENNA_FREQ.file_numberC/File Number", "V_SITE_ANTENNA_FREQ.submission_idC/Submission id", "FILENUM_XREF.old_file_numberC/Old File Number", "ADDRESS.address_nameC/Name", "V_SITE_ANTENNA_FREQ.callsignC/Callsign", "STATUS_CODE.status_textC/Status", "V_SITE_ANTENNA_FREQ.status_dateD/Status Date", "ACTION_CODE.descriptionC/Last Action", "V_SITE_ANTENNA_FREQ.last_action_dateD/Last Action Date"); @headers = ( 153, "File Number", 40, "P/E", 197, "Name", 150, "Last Action", 63, "Action Date", 134, "Status", 55, "Status Date"); require "webrep.pl"; ### Main web report logic module ### Report specific subroutines sub DataSelect { # get data for full report $select = qq ! SELECT V_SITE_ANTENNA_FREQ.file_number, ISNULL(SUBSTRING('E', CHARINDEX('I', submission_id) ,1),'P'), ADDRESS.address_name, ACTION_CODE.description, CONVERT(CHAR,V_SITE_ANTENNA_FREQ.last_action_date,101), STATUS_CODE.status_text, CONVERT(CHAR,V_SITE_ANTENNA_FREQ.status_date,101), TRANSFERRED_HISTORY.file_number_to, TRANSFERRED_HISTORY.bureau_to_name, TRANSFERRED_HISTORY.division_to_name, TRANSFERRED_HISTORY.file_number_from, TRANSFERRED_HISTORY.bureau_from_name, TRANSFERRED_HISTORY.division_from_name, $SORT $fromWhere ORDER BY $SORT !; } sub doFromWhere { #setut FROM and WHERE clauses &setFromWhere(); $fromWhere = qq ! FROM V_SITE_ANTENNA_FREQ, ADDRESS, ACTION_CODE, STATUS_CODE, FILENUM_XREF, TRANSFERRED_HISTORY , V_MAX_TRANSFERRED_HISTORY WHERE ( V_SITE_ANTENNA_FREQ.address_key $outerADDRESS= ADDRESS.address_key ) AND ( V_SITE_ANTENNA_FREQ.last_action $outerACTION_CODE= ACTION_CODE.action_code) and ( V_SITE_ANTENNA_FREQ.filing_key $outerFILENUM_XREF= FILENUM_XREF.filing_key ) AND $subsystem_code $f_state $selectionCriteria ( V_SITE_ANTENNA_FREQ.status_code $outerSTATUS_CODE= STATUS_CODE.status_code ) and ( V_SITE_ANTENNA_FREQ.filing_key *= V_MAX_TRANSFERRED_HISTORY.filing_key) and ( V_MAX_TRANSFERRED_HISTORY.history_key *= TRANSFERRED_HISTORY.transferred_history_key) !; #ws_sql($ws_db, "SET ROWCOUNT 1"); } sub doFromWhereCount { #setut FROM and WHERE clauses &setFromWhere(); $fromWhere = qq ! FROM V_SITE_ANTENNA_FREQ, ADDRESS, ACTION_CODE, STATUS_CODE, FILENUM_XREF WHERE ( V_SITE_ANTENNA_FREQ.address_key $outerADDRESS= ADDRESS.address_key ) AND ( V_SITE_ANTENNA_FREQ.last_action $outerACTION_CODE= ACTION_CODE.action_code) and ( V_SITE_ANTENNA_FREQ.filing_key $outerFILENUM_XREF= FILENUM_XREF.filing_key ) AND $subsystem_code $f_state $selectionCriteria ( V_SITE_ANTENNA_FREQ.status_code $outerSTATUS_CODE= STATUS_CODE.status_code ) !; #ws_sql($ws_db, "SET ROWCOUNT 1"); } sub setTitle { print qq ! $subsystem $filing_state SELECTED APPLICATION STATUS $uby
REPORT WR023!; } sub setStuff { print qq !
FCC $fsList Application List
!; } sub doRows { my ($total) = $ws_form{COUNT}; if ($total == 0) { $total = $returned; } # if not specified use all $j = $linesPerTable; for ($i = 1; $i < $returned && $total-- > 0; ) { if ($j-- == 0) { $j = $linesPerTable -1; print ""; &tabletop(); &doColHeaders; print ""; } $file_num = $rs[$i]; $as_subsystem_code = substr ($file_num, 0, 3); #get subsys code substr ($file_num, 3, 0) = "-"; substr ($file_num, 7, 0) = "-"; substr ($file_num, 16, 0) = "-"; print ""; print qq !$file_num!; #WR2776: one column added, so increase k by 1 for ($k = 0; $k++ < 6; ) { print ""; if ($k < 7) { print $rs[$i++] ne "" ? $rs[$i-1] : ' '; } if ($k == 3) { my $mod_filenum; if ($rs[$i-1] eq "File Transferred to") { #print " $rs[$i + 3]" ; print "
$rs[$i + 4]/$rs[$i + 5]"; $mod_filenum = $rs[$i + 3]; if (length($mod_filenum) > 16 ) { substr ($mod_filenum, 3, 0) = "-"; substr ($mod_filenum, 7, 0) = "-"; substr ($mod_filenum, 16, 0) = "-"; } print qq !
$mod_filenum!; } if ($rs[$i-1] eq "File Transferred from") { #print " $rs[$i + 6]"; print "
$rs[$i + 7]/$rs[$i + 8]"; $mod_filenum = $rs[$i + 6]; if (length($mod_filenum) > 16 ) { substr ($mod_filenum, 3, 0) = "-"; substr ($mod_filenum, 7, 0) = "-"; substr ($mod_filenum, 16, 0) = "-"; } print qq !
$mod_filenum!; } } } $i++; # WR3191 for the new retrieved field, but not displayed $i++; # WR3191 for the new retrieved field, but not displayed $i++; # WR3191 for the new retrieved field, but not displayed $i++; # WR3191 for the new retrieved field, but not displayed $i++; # WR3191 for the new retrieved field, but not displayed $i++; # WR3191 for the new retrieved field, but not displayed $i++; # WR9487 to remove distinct, the add extra retrieved filed "sort", but not dispaly print ""; } }