### Intialize static lists for $this_rep = "swr031b.hts"; @selectionList = ( "V_SITE_ANTENNA_FREQ.file_numberC/File Number", "FILENUM_XREF.old_file_numberC/Old File Number", "ADDRESS.address_nameC/Name", "V_SITE_ANTENNA_FREQ.callsignC/Callsign", "STATUS_CODE.status_textC/Status", "ACTION_CODE.descriptionC/Last Action", "V_SITE_ANTENNA_FREQ.date_grantD/Date Granted", "V_SITE_ANTENNA_FREQ.date_expireD/Date Expire", "V_SITE_ANTENNA_FREQ.submission_idC/Submission ID", "V_SITE_ANTENNA_FREQ.aff_pub_notice_dateD/Aff Pub Notice Date", "CLASS_OF_STATION_CODE.descriptionC/Description", "V_SITE_ANTENNA_FREQ.app_type_codeC/Application Type Code"); @fieldNames = ( "File Number:", "Accepted For Filing PN Date:", "Callsign:", "Action Taken PN Date:", "Streamlined:", "Term Begin Date:", "Environmental Impact:", "Term End Date:", "Status:", "Date Filed:", "Red Light:", "", "Status Date:", "Date Last Updated:", "Last Action:", "Last Action Date:", "Grant Date:", "Bond Date:", "DA #:", "Adopted Date:", "Released Date:", "", "Application Category:", "", "Old File Number:", "Applicant:", "Contact:","", "", "", "", "", "", "Description:", "", "", "", "", "", ""); 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.filing_key, V_SITE_ANTENNA_FREQ.file_number, ISNULL(CONVERT(char,V_SITE_ANTENNA_FREQ.aff_pub_notice_date,101), 'None'), ISNULL(V_SITE_ANTENNA_FREQ.callsign, 'None'), ISNULL(CONVERT(char,V_SITE_ANTENNA_FREQ.act_pub_notice_date,101), 'None'), ISNULL(SECTION_214.streamlined_sw, 'N/A'), ISNULL(CONVERT(CHAR,V_SITE_ANTENNA_FREQ.date_begin,101), 'None'), ISNULL(FORM_312.environ_effect_sw, 'None'), ISNULL(CONVERT(CHAR,V_SITE_ANTENNA_FREQ.date_expire,101), 'None'), ISNULL(STATUS_CODE.status_text, 'None'), ISNULL(CONVERT(CHAR,V_SITE_ANTENNA_FREQ.date_filed,101), 'None'), ADDRESS.redlight, "", ISNULL(CONVERT(CHAR,V_SITE_ANTENNA_FREQ.status_date,101), 'None'), ISNULL(CONVERT(CHAR,V_SITE_ANTENNA_FREQ.date_last_update,101), 'None'), ISNULL(ACTION_CODE.description, 'None'), ISNULL(CONVERT(CHAR,V_SITE_ANTENNA_FREQ.last_action_date,101), 'None'), ISNULL(CONVERT(CHAR,V_SITE_ANTENNA_FREQ.date_grant,101), 'None'), "Bond Date", "Da Number", "Adopted Date", "Released Date", "", V_SITE_ANTENNA_FREQ.keyword1, V_SITE_ANTENNA_FREQ.keyword2, ISNULL(FILENUM_XREF.old_file_number, 'None'), ISNULL(CONTACT.contact_name, 'None'), ISNULL(ADDRESS.address_name, 'None'), CONTACT.company_name, ADDRESS.street1, CONTACT.street1, ADDRESS.street2, CONTACT.street2, ADDRESS.city, ADDRESS.state_code, ADDRESS.zipcode, ISNULL((substring(" ", charindex("UKN", ADDRESS.country_code) , 1)), ADDRESS.country_code), CONTACT.city, CONTACT.state_code, CONTACT.zipcode, CONTACT.country_code, V_SITE_ANTENNA_FREQ.description, TRANSFERRED_HISTORY.file_number_from, TRANSFERRED_HISTORY.bureau_from_name, TRANSFERRED_HISTORY.division_from_name, TRANSFERRED_HISTORY.file_number_to, TRANSFERRED_HISTORY.bureau_to_name, TRANSFERRED_HISTORY.division_to_name $fromWhere ORDER BY $SORT !; } sub doFromWhere { #setup FROM and WHERE cla$res > 0 uses &setFromWhere(); $fromWhere = qq ! FROM V_SITE_ANTENNA_FREQ, FORM_312, ADDRESS, CONTACT, STATUS_CODE, ACTION_CODE, CLASS_OF_STATION_CODE, SECTION_214, 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 ( V_SITE_ANTENNA_FREQ.status_code $outerSTATUS_CODE= STATUS_CODE.status_code ) AND ( V_SITE_ANTENNA_FREQ.class_of_station_code $outerCLASS_OF_STATION_CODE= CLASS_OF_STATION_CODE.class_of_station_code ) and ( V_SITE_ANTENNA_FREQ.filing_key $outerFORM_312= FORM_312.filing_key ) and ( V_SITE_ANTENNA_FREQ.filing_key $outerSECTION_214= SECTION_214.filing_key ) and $subsystem_code $f_state $selectionCriteria ( V_SITE_ANTENNA_FREQ.contact_key $outerCONTACT= CONTACT.contact_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) ! ; } sub doFromWhereCount { #setup FROM and WHERE cla$res > 0 uses &setFromWhere(); $fromWhere = qq ! FROM V_SITE_ANTENNA_FREQ WHERE $selectionCriteria $subsystem_code $f_state 1 = 1 ! ; } sub setTitle { print qq ! $subsystem $filing_state SELECTED APPLICATION LISTING $uby
REPORT WR07!; } sub setStuff { print qq !
FCC $fsList Application List
!; } sub doRows { my ($total) = $ws_form{COUNT}; my ($filenum); my ($subSystemValue); # my ($my_q_set); # my ($column); if ($total == 0) { $total = $returned; } # if not specified use all for ($i = 1; $i < $returned && $total-- > 0; ) { $filing_key = $rs[$i++]; $filenum = $rs[$i]; substr ($rs[$i], 3, 0) = "-"; substr ($rs[$i], 7, 0) = "-"; substr ($rs[$i], 16, 0) = "-"; # $column = "MAIN.file_numberC/File Number"; # $my_q_set = $column . $filenum ; print "
"; print ""; $daNumber = "None"; $datePublished = "None"; $dateProcessed = "None"; #WR3191, increment k by 2 for ($k = 0; $k < 20; ) { if (($k == 1 && $rs[$i] != "None") || ($k == 3 && $rs[$i] != "None")) { # added link for Public Notice Report under column PN Date by SShieh on 10/24/2001 #added link for Action Taken PN Date by SShieh on 05/09/2002 WR2548 $publishedDate = $rs[$i]; & findPNReportKey; if ($reportSize > 0 && $reportDays > 0 ) #if ($reportSize > 0 ) { print "reportsize=$reportSize"; print "
$fieldNames[$k++] $rs[$i++] "; }else { print "$fieldNames[$k++] $rs[$i++]"; } } else { if ($k == 14) { print "
$fieldNames[$k++] $rs[$i++]"; my $p; my $mod_filenum; $p = $i -1; if ($rs[$p] eq "File Transferred to") { print "
$rs[$p + 31]/$rs[$p + 32]"; $mod_filenum = $rs[$p + 30]; if ($mod_filenum != NULL) { substr ($mod_filenum, 3, 0) = "-"; substr ($mod_filenum, 7, 0) = "-"; substr ($mod_filenum, 16, 0) = "-"; } print "
       New File #: $mod_filenum"; } if ($rs[$p] eq "File Transferred from") { $mod_filenum = $rs[$p + 27]; if ($mod_filenum != NULL) { substr ($mod_filenum, 3, 0) = "-"; substr ($mod_filenum, 7, 0) = "-"; substr ($mod_filenum, 16, 0) = "-"; } print "
$rs[$p + 28]/$rs[$p +29]"; print "
       Old File #: $mod_filenum"; } } elsif ($k == 18) { print "
$fieldNames[$k++] $daNumber"; $i++; } else { print "
$fieldNames[$k++] $rs[$i++]"; } } if (($k == 1 && $rs[$i] != "None") || ($k == 3 && $rs[$i] != "None")) { $publishedDate = $rs[$i]; & findPNReportKey; if ($reportSize > 0 && $reportDays > 0) #if ($reportSize > 0) { print "$fieldNames[$k++] $rs[$i++]"; } else { print "$fieldNames[$k++] $rs[$i++]"; } } elsif ( $k == 17) { my ( @rs4 ) ; my ( $bondSelect ) ; $bondSelect = qq ! SELECT ISNULL(convert(char(10),max(date_submitted),101),"None") FROM MILESTONE_ATTACHMENTS a WHERE a.filing_key = $filing_key AND a.milestone_attachment_code = "BOND" !; @rs4 = callSql ($ws_db, $bondSelect); $bondDate = $rs4[1]; print "$fieldNames[$k++] $bondDate"; $i++; } elsif ($k == 19) { print "$fieldNames[$k++] $dateProcessed"; $i++; } elsif ($k == 13) { # On 05/24/2006 By SShieh for WR10299, skip date_last_update print ""; $k++; $i++; } else { print "$fieldNames[$k++] $rs[$i++]"; } } if ($k == 20) { print "
$fieldNames[$k++] $dateProcessed"; $i++; } else { print "
$fieldNames[$k++] $rs[$i++]"; } $k++; $i++; ## added sql3 to fix CARS588 (SAT should not have link to Site Information) DMarple 2/28/2001 ws_sql($ws_db, "SET ROWCOUNT 0"); &doNatureOfService(); # show nature of service &do214ServiceType(); # show service types &doSiteInformation($filenum); #show link for site info and other related filings ## &doAttachmentMenu(); # only shows a link to the menu if it is an Internet filing. print "

"; print "
$fieldNames[$k++]$fieldNames[$k++] $rs[$i++] "; for (; $k < 33; $k += 2 ) { print "
$rs[$i++]"; print "$rs[$i++]"; } print "
$rs[$i++]"; if ( $rs[$i-1] ne "") { print ", "; } print "$rs[$i++] $rs[$i++] $rs[$i++]$rs[$i++]"; if ( $rs[$i-1] ne "") { print ", "; } print "$rs[$i++] $rs[$i++] $rs[$i++]\n"; print "
"; $i++; $i++; $i++; $i++; $i++; $i++; &doASGorTC($filenum); # handle assignments and transfers of control &doSURList($filenum); &doCONList($filenum); print "
$fieldNames[$k++] $rs[$i++]

"; } } sub doNatureOfService { my ( @rs, $i, $returned ); $select = qq ! SELECT description from NATURE_OF_SERVICE_CODE WHERE nature_of_service_code IN (SELECT nature_of_service_code from NATURE_OF_SERVICE WHERE filing_key = $filing_key) !; #print "$select
"; @rs = callSql ($ws_db, $select); if ($rs[0] == 0) { print "Unable to access $procDb table info$end"; } else { $returned = $#rs-1; #Number of elements in returned array if ( $returned > 0 ) { ### if no results skip this print "Nature of Service: "; for ( $i=1; $i < $returned+1; $i++ ) { print "$rs[$i]
"; } print ""; } } } sub doSiteInformation { my ( $file_number ) = @_[0] ; #print " file number = $file_number"; ## added sql3 to fix CARS588 (SAT should not have link to Site Information) DMarple 2/28/2001 print qq !!; ## end last table and create new one for formatting. print qq !
!; $sql3 = qq ! select subsystem_code, app_type_code, filing_state from MAIN where filing_key = $filing_key ! ; @rs3 = callSql ($ws_db, $sql3); $subSystemValue = $rs3[1] ; $appTypeCode = $rs3[2]; $filing_st = $rs3[3]; #print "filing_st = $filing_st"; # on 10/20/2008 by SShieh, WR 3122 Add View Licenses to IHF filers. #and filing_state <> 3 $sql = qq ! select count(*) from MAIN where subsystem_code in ('SES', 'IHF') and confidential in ('N',NULL) and ( app_type_code not in ('AMD','EXT','MSC','PDR','STA', 'T/C', 'ASG') or app_type_code is null ) and ( last_action not in ('D/A', 'DDA','DEN','DIS', 'DSC', 'RVC', 'SUR') or last_action is null ) and filing_key = $filing_key ! ; @rs2 = callSql ($ws_db, $sql); if ($rs2[0] == 0) { ## error print "" ; } if ( $rs2[1] == 0 ) { ## count is zero print SITE else print View License # If app_type_code = ASG, T/C, there is no Site Information . By SShieh on 10/24/2001 if ($subSystemValue ne "SAT" && $appTypeCode ne "ASG" && $appTypeCode ne "T/C") { print qq !!; } else { ## view license print qq !! ; ## for formatting purposes } } else { if ($filing_st == 2 || $filing_st == 1) { #my $actuate_url = "http://dettifoss.fcc.gov/acweb/dettifoss/IBFS/IBFS_Ses_License.rox?Submit&filing_key=-2099849119&__scheduleType=immediate&__wait=wait"; my $actuate_url = $javaServletPath . "ib.page.FetchLicense?filing_key=" . $filing_key ; my $lic_rewrite_url ; #my $lic_rewrite_url = $myibfsPath . "displayLicense.do?filingKey=" . $filing_key ; if ( $subSystemValue eq "SES" ) { $lic_rewrite_url = $javaHostPath . "myibfs/" . "displayLicense.do?filingKey=" . $filing_key ; } else { $lic_rewrite_url = $javaHostPath . "myibfs/" . "displayIHFLicense.do?filingKey=" . $filing_key ; } #print qq!!; } else { print qq!!; } } #comment out for WR2750 my $PnUrl = $hostPathWithSlash . $websqlPath . $curDir . "public_notice_menu.hts?filing_key=" . $filing_key; print qq !!; &doAttachmentMenu(); # only shows a link to the menu if it is an Internet filing. $i += 2; ### remove displaying application category $k += 2; ### print "
Document Viewing
Site Information
View License
Other filings related to this application (Petitions, comments, etc) Public Notice List Licensee History
"; print "" ; } if ($ms_attachment_key) { print "" ; } else { print ""; } if ($id_form_num < 10) { $form_name = "P00" ; } else { $form_name = "P0" ; } $form_name .= $id_form_num ; $form_name .= "_101.htm" ; #$basicFormURL = $javaServletPath . 'ib.page.FetchForm?id_app_num=' . $id_app_num . '&form=' . $form_name . '&mode=' ; #$basicFormURL = $javaServletPath . 'ib.page.FetchAppPDF?attachment_key=' . $pdf_attachment_key; $basicFormURL = $javaHostPath .'myibfs/download.do?attachment_key=' . $pdf_attachment_key; #$basicHtmlURL = $javaServletPath . 'ib.page.FetchAttachment?attachment_key=' . $html_attachment_key; $basicHtmlURL = $javaHostPath . 'myibfs/download.do?attachment_key=' . $html_attachment_key; #$basicAttachmentURL = $javaServletPath . 'ib.page.FetchAttachment?attachment_key=' ; $basicAttachmentURL = $javaHostPath . 'myibfs/download.do?attachment_key=' ; #$pdfURL = $basicFormURL . "pdf" ; $pdfURL = $basicFormURL; #$htmlURL = $basicFormURL . "display" ; $htmlURL = $basicHtmlURL; $table_body = ""; ## $table_body .= "
$fieldNames[$k++] $rs[$i++]"; } ## end doSiteInformation sub doAttachmentMenu { my ( @rs, $i, $returned, $result ); $select = qq ! SELECT M.submission_id, ac.id_app_num, ac.form_id_num,ac.applicant_id,a.attachment_key,M.filing_key,ah.attachment_key, ah1.attachment_key, ma.attachment_key FROM MAIN M, $formsDb..app_ctrl ac, ATTACHMENT a , ATTACHMENT ah, ATTACHMENT ah1, MILESTONE_ATTACHMENTS ma WHERE M.filing_key = $filing_key /* AND M.submission_id is not NULL */ AND M.submission_id *= ac.submission_id AND M.filing_key *= a.filing_key AND M.filing_key *= ah.filing_key AND ah.attachment_name = "Application" AND M.filing_key *= ah1.filing_key AND ah1.attachment_name = "HTML" AND M.filing_key *= ma.filing_key !; #AND ac.id_app_num *= a.id_app_num #print "sql = $select
"; @rs = callSql ($ws_db, $select); if ($rs[0] == 0) { print "Unable to access $procDb table info$end"; } else { $returned = $#rs-1; #Number of elements in returned array if ( $returned > 0 ) { ### if no results skip this $i = 1; $submission_id = $rs[$i++]; $id_app_num = $rs[$i++]; $id_form_num = $rs[$i++]; $acctid = $rs[$i++]; $attachment_key = $rs[$i++]; $filing_key = $rs[$i++]; $pdf_attachment_key = $rs[$i++]; $html_attachment_key = $rs[$i++]; $ms_attachment_key = $rs[$i++]; if ($attachment_key) { my $attachmentUrl = $hostPathWithSlash . $websqlPath . $curDir . "attachment_menu.hts?id_app_num=" . $id_app_num . "&acct=" . $acctid . "&id_form_num=" . $id_form_num . "&filing_key=" . $filing_key ; ## my $attachmentUrl = $hostPathWithSlash . $websqlPath . $curDir . "attachment_menu.hts?id_app_num=" . $id_app_num . "&acct=" . $acctid . "&id_form_num=" . $id_form_num . "&q_set=" . $q_set . "&column=" . $column ; print "
Attachment Menu Milestones Documents
"; if ($pdf_attachment_key ) { $table_body .= "" ; } if ($html_attachment_key ) { $table_body .= "" ; } print $table_body ; } } while ( @rs ) { $result .= pop( @rs ) . "
"; } ## print "results = $result
"; } # end of doAttachmentMenu sub do214ServiceType { my ( @rs, $i, $returned ); $select = qq ! SELECT description from SECTION_214_SERVICE_CODE WHERE section_214_service_code IN (SELECT section_214_service_code from SECTION_214_SERVICE WHERE filing_key = $filing_key) !; #print "$select
"; @rs = callSql ($ws_db, $select); if ($rs[0] == 0) { print "Unable to access $procDb table info$end"; } else { $returned = $#rs-1; #Number of elements in returned array if ( $returned > 0 ) { ### if no results skip this print ""; } } } # Added to find PN report_key by SShieh on 10/24/2001 sub findPNReportKey { my ( @rs3 ) ; my ( $reportSelect ) ; $reportSelect = qq ! SELECT p.report_key, p.pub_notice_type_code, ISNULL(p.da_number,"None"), ISNULL(convert(char(10),p.date_published,101),"None"), ISNULL(convert(char(10), p.date_processed, 101), "None"), datalength(processed_document), datediff(day, p.date_published, getdate() ) FROM PUB_NOTICE_REPORT p, PUB_NOTICE_HISTORY h WHERE convert(char(10),p.date_published,101) = \'$publishedDate\' AND p.report_key = h.report_key AND h.filing_key = $filing_key !; @rs3 = callSql ($ws_db, $reportSelect); $reportKeys = $rs3[1]; $reportSize = $rs3[6]; $reportDays = $rs3[7]; if ($rs3[2] == "ATPN") { if ($rs3[3] != NULL) { $daNumber = $rs3[3]; } $datePublished = $rs3[4]; $dateProcessed = $rs3[5]; } } sub doSURList { my ($filenum) = @_; my (@rs, $rs, @rs2, $rs2, $select, $i, $j, $k, $returned, @fieldNames,@rsDis, $rsDis); my ($subsys, $apptype, $x) = $filenum =~ /(...)(...).*/; if ($subsys eq 'SUR') { $select_surr = qq! SELECT b.file_number FROM MAIN_MAIN_XREF a, MAIN b WHERE a.xref_filing_key = b.filing_key AND a.filing_key = $filing_key!; print "
PDF Version of this application.HTML version of this application.
Service Type: "; for ( $i=1; $i < $returned+1; $i++ ) { print "$rs[$i]
"; } print "

"; @rs2 = callSql ($ws_db, $select_surr); if ($rs2[0] == 0) { print "Unable to access $procDb table info $end"; } else { $returned2 = $#rs2; #Number of elements in returned array print ""; if ( $returned2 < 2 ) { print "None
"; } else { for ($j = 1; $j < $returned2; ) { print ""; print ""; print ""; } } print "
"; $file_num = $rs2[$j]; $select_dismiss = qq! SELECT c.file_number FROM DISMISSED_FOR_SURRENDERED c WHERE c.authorization_number = "$file_num" !; substr ($file_num, 3, 0) = "-"; substr ($file_num, 7, 0) = "-"; substr ($file_num, 16, 0) = "-"; print " !; @rsDis = callSql ($ws_db, $select_dismiss); $returnedDis = $#rsDis; if ($returnedDis >= 2) { print ""; } print "
Surrendered Authorization:
"; print qq !$file_num
Dismissed Pending Application(s):"; for ($g = 1; $g < $returnedDis; ) { $file_num = $rsDis[$g]; substr ($file_num, 3, 0) = "-"; substr ($file_num, 7, 0) = "-"; substr ($file_num, 16, 0) = "-"; print qq !
$file_num !; } print "

"; } print "
"; } else { return; } } sub doCONList { my ($filenum) = @_; my (@rs, $rs, @rs2, $rs2, $select, $i, $j, $k, $returned, @fieldNames,@rsDis,$rsDis); my ($subsys, $apptype, $x) = $filenum =~ /(...)(...).*/; if ($subsys eq 'CON') { $select_surr = qq! SELECT b.file_number FROM MAIN_MAIN_XREF a, MAIN b WHERE a.xref_filing_key = b.filing_key AND a.filing_key = $filing_key!; print "
"; #print ""; } } } print "
"; @rs2 = callSql ($ws_db, $select_surr); if ($rs2[0] == 0) { print "Unable to access $procDb table info $end"; } else { $returned2 = $#rs2; #Number of elements in returned array if ( $returned2 < 2 ) { print "None
"; } else { print "Consummated Authorization:
"; for ($j = 1; $j < $returned2; ) { #print "
"; $file_num = $rs2[$j]; substr ($file_num, 3, 0) = "-"; substr ($file_num, 7, 0) = "-"; substr ($file_num, 16, 0) = "-"; print qq !$file_num
!; #print "
"; } else { return; } } sub doASGorTC { my ($filenum) = @_; my (@rs, $rs, @rs2, $rs2, $select, $i, $j, $k, $returned, @fieldNames); my ($subsys, $apptype, $x) = $filenum =~ /(...)(...).*/; if ( $apptype eq 'ASG' ) { @fieldNames = ("FROM:", "TO:"); $select = qq ! SELECT B.dba_name, B.address_name, A.address_name, B.street1, A.street1, B.street2, A.street2, B.city, B.state_code, B.zipcode, B.country_code, A.city, A.state_code, A.zipcode, A.country_code, CONVERT(varchar,MAIN.filing_key) FROM MAIN, ADDRESS A, ASSIGNMENT, ADDRESS B WHERE ( MAIN.file_number = "$filenum" ) AND ( MAIN.filing_key = ASSIGNMENT.filing_key ) AND ( ASSIGNMENT.transferee_key = A.address_key ) AND ( ASSIGNMENT.licensee_key = B.address_key ) ! ; } elsif ( $apptype eq 'T/C' ) { @fieldNames = ("FROM:", "TO:"); $select = qq ! SELECT B.contact_name, B.company_name, A.address_name, B.street1, A.street1, B.street2, A.street2, B.city, B.state_code, B.zipcode, B.country_code, A.city, A.state_code, A.zipcode, A.country_code, CONVERT(varchar,MAIN.filing_key) FROM MAIN, ADDRESS A, ASSIGNMENT, CONTACT B WHERE ( MAIN.file_number = "$filenum" ) AND ( MAIN.filing_key = ASSIGNMENT.filing_key ) AND ( ASSIGNMENT.transferee_key = A.address_key ) AND ( ASSIGNMENT.transferor_key = B.contact_key ) ! ; } else { return; } # only for assignments and tranfers #print "$select
"; @rs = callSql ($ws_db, $select); if ($rs[0] == 0) { print "Unable to access $procDb table info$end"; } else { $returned = $#rs-1; #Number of elements in returned array if ( $returned > 0 ) { ### if no results skip this $i = 1; print "
"; print "
$fieldNames[0]$rs[$i++]$fieldNames[1] "; for ($k = 0; $k < 6; $k += 2 ) { print "
$rs[$i++]"; print "$rs[$i++]\n"; } print "
$rs[$i++]"; if ( $rs[$i-1] ne "") { print ", "; } print "$rs[$i++] $rs[$i++] $rs[$i++]$rs[$i++]"; if ( $rs[$i-1] ne "") { print ", "; } print "$rs[$i++] $rs[$i++] $rs[$i++]\n"; if ( $subsys eq 'ITC' ) { $select = qq !SELECT file_number FROM FILENUM_ASSIGN_LIST WHERE FILENUM_ASSIGN_LIST.filing_key = $rs[$i++]!; } else { $select = qq !SELECT callsign FROM ASSIGN_LIST WHERE ASSIGN_LIST.filing_key = $rs[$i++]!; } #print "
$select "; print "
"; @rs2 = callSql ($ws_db, $select); if ($rs2[0] == 0) { print "Unable to access $procDb table info$end"; } else { $returned2 = $#rs2; #Number of elements in returned array if ( $subsys eq 'ITC' ) { print "File Numbers: "; } else { print "Callsigns: "; } if ( $returned2 < 2 ) { print "None
"; } else { for ($j = 1; $j < $returned2; ) { if ( $subsys eq 'ITC' ) { $file_num = $rs2[$j]; substr ($file_num, 3, 0) = "-"; substr ($file_num, 7, 0) = "-"; substr ($file_num, 16, 0) = "-"; print qq !$file_num, !; } else { print "$rs2[$j++]"; } } } } } print "
"; } }