### Intialize static lists for $this_rep = "swr040b.hts"; @headers = ( 130, "File Number", 20, "P/E", 125, "Applicant Name", 50, "Callsign", 57, "Orbit Location Requested", 57, "Orbit Location Assigned", 100, "Frequency Band", 100, "Status", 140, "Last Action", 55, "Last Action Date", 55, "Date Expire", 55, "AFFPN Date"); $site = "Y"; # the state is a SITE state #require "webrep_status.pl"; ### Main web report logic module require 'ctime.pl'; require "dbsql.pl"; require "path.pl"; ### Report specific subroutines $start = &ctime(time); &doFromWhere(); &DataSelect(); #ws_sql($ws_db,"use ib_licenses"); ws_sql($ws_db,"use $procDb"); @rs = callSql ($ws_db, $select); if ($rs[0] == 0) { print "Unable to access $procDb info$end"; } else { $returned = $#rs-1; #Number of elements in returned array &formtop; if ( $returned < 1 ) { print "No records found
"; } else { $returned = $#rs-2; #Number of elements in returned array #&formtop; print ""; &tabletop; &doColHeaders; print ""; &doRows; # process each row result print ""; &doTrailer; # finish page } } sub formtop { if ( $by) { $uby = "BY $by"; $uby =~ tr/a-z/A-Z/; } if ($subsystem) { $subsystem =~ tr/a-z/A-Z/; } print qq % FCC INTERNATIONAL BUREAU $javaScript
INTERNATIONAL BUREAU
FCC %; &setTitle(); print qq ! - $start
!; if ($showCriteria ne "") { print qq !
!; } print qq ! $showCriteria

!; } sub doTrailer { my( $telecom ) = $hostPathWithSlash . $curDir . "Telecom.htm" ; my( $earthreport ) = $hostPathWithSlash . $curDir . "earthreport.htm" ; my( $spacereport ) = $hostPathWithSlash . $curDir . "spacereport.htm" ; my( $radioreport ) = $hostPathWithSlash . $curDir . "radioreport.htm" ; my( $oth_reps ) = $hostPathWithSlash . $curDir . "oth_reps.htm" ; my( $ibfsreport ) = $hostPathWithSlash . $curDir . "ibfsreport.htm" ; $end = &ctime(time); print qq ! <\!--
International Telecommunications | Satellite Earth Stations | Satellite Space Stations | International HF Broadcast Stations and&nb sp;Public Fixed Radio Stations | General Reports and Query Tool | International Bureau Homepage | IBFS Reports Homepage
-->


FCC - Federal Communications Commission - IBFS Internet Reports - $end
!; } sub tabletop { if (defined @headers) { print qq ! !; } } sub doColHeaders { if (defined @headers) { my ($k); for ($k = 0; $k < $#headers; ) { print qq ! !; } } } sub DataSelect { # get data for full report # Added distinct for car834 $select = qq ! SELECT distinct V_SITE_ANTENNA_FREQ.file_number, ISNULL(SUBSTRING('E', CHARINDEX('I', submission_id) ,1),'P'), ADDRESS.address_name, V_SITE_ANTENNA_FREQ.callsign, FORM_312.orbit_location + FORM_312.long_hemi, FORM_312.orbit_location_assigned + FORM_312.long_hemi_assigned, str(convert(numeric,FREQUENCY_SAT.frequency_lower)) + "-" + str(convert(numeric,FREQUENCY_SAT.frequency_upper)), STATUS_CODE.status_text, ACTION_CODE.description, CONVERT(CHAR(10),V_SITE_ANTENNA_FREQ.last_action_date,101), CONVERT(CHAR(10),V_SITE_ANTENNA_FREQ.date_expire,101), CONVERT(CHAR(10),V_SITE_ANTENNA_FREQ.aff_pub_notice_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 $fromWhere !; #!print "select = $select"; } sub doFromWhere { #setup FROM and WHERE clauses $fromWhere = qq ! FROM V_SITE_ANTENNA_FREQ, ADDRESS, ACTION_CODE, STATUS_CODE, FILENUM_XREF, ACCOUNTING_CHANGE, TRANSFERRED_HISTORY , V_MAX_TRANSFERRED_HISTORY, FORM_312, FREQUENCY_SAT WHERE ( V_SITE_ANTENNA_FREQ.address_key *= ADDRESS.address_key ) AND ( V_SITE_ANTENNA_FREQ.last_action *= ACTION_CODE.action_code) and ( V_SITE_ANTENNA_FREQ.filing_key *= FILENUM_XREF.filing_key ) AND ( V_SITE_ANTENNA_FREQ.status_code *= STATUS_CODE.status_code ) AND ( V_SITE_ANTENNA_FREQ.filing_key *= ACCOUNTING_CHANGE.filing_key) 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) AND ( V_SITE_ANTENNA_FREQ.filing_key *= FORM_312.filing_key) AND ( V_SITE_ANTENNA_FREQ.filing_key *= FREQUENCY_SAT.filing_key) AND ( V_SITE_ANTENNA_FREQ.subsystem_code = "SAT") AND ( datediff(day,V_SITE_ANTENNA_FREQ.last_action_date, getdate())<=21) order by last_action_date desc !; #! print "
in doFromWhere - $fromWhere"; } sub setTitle { #print qq ! $subsystem $filing_state LIST $uby
REPORT WR041!; print qq ! $subsystem $filing_state LIST BY FILE NUMBER
REPORT WR041!; } sub setStuff { print qq !
FCC $fsList Application List
!; } sub doRows { $linesPerTable = 50; 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 "
$headers[$k++]
"; &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!; #WR2751: one column added, so increase k by 1 for ($k = 0; $k++ < 11; ) { print ""; if ($k < 12) { print $rs[$i++] ne "" ? $rs[$i-1] : ' '; } if ($k == 8) { my $mod_filenum; if ($rs[$i-1] eq "File Transferred to") { #print " $rs[$i + 2]" ; 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 + 5]"; 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 print ""; } }