#!/usr/bin/perl require "cgi-lib.cgi"; require "homer-lib.cgi"; $lda = &ora_login($system_id, $netid, $pwd) || &oracle_error($ora_errstr); print "Content-type: text/html\n\n"; print "\n", $ServiceTitle, "\n"; print < JBLK2 print '
'; $rep_item = $in{'rep_item'}; $rep_id = $in{'rep_id'}; $target_loc = $in{'loc'}; $rep_variant_id = $in{'rep_variant_id'}; if($rep_item) { # print "Locations (Var. #$rep_item):
"; } elsif($rep_variant_id) { # print "Locations (Var. #1):
"; } else { # print "Locations (Master):
"; } if($rep_id) { $sql = "SELECT /*+ USE_NL(work) USE_NL(line_location) ORDERED */ work.sgmlid,work.work_id, rep_location.level1_id, rep_location.level2_id, rep_location.line_id, line_location.trad_loc FROM rep_location,line_location,work WHERE rep_location.rep_id = $rep_id"; if($rep_variant_id) {$sql .= " AND rep_location.rep_variant_id = $rep_variant_id ";} $sql .= " AND rep_location.level1_id = work.level1_id AND (work.level2_id is NULL OR work.level2_id = rep_location.level2_id) AND line_location.work_id = work.work_id AND line_location.book = rep_location.level2_id AND line_location.line = rep_location.line_id ORDER BY rep_location.level1_id, rep_location.level2_id, rep_location.line_id"; $count = 0; # print "

$sql

"; $csr = &ora_open($lda,$sql) || &oracle_error($ora_errstr); print '
'; while (($abrv,$work_id,$level1_id,$book,$line,$tradloc) = &ora_fetch($csr)) { if($prev_loc eq $tradloc) {next;} else {$prev_loc = $tradloc;} # Check if this is a Hesiod work if($level1_id == 3) { $address = "$abrv.$line"; $loc = $line; } else { $address = "$abrv.$book.$line"; $loc = "$book.$line"; } ## $url = "show_rep_text.cgi?work=$work&loc=$loc&browse_width=$state_array{'browse_width'}&"; $url = "javascript:window.parent.parent.page_browse($work_id,$book,$line)"; ## if($address eq $target_loc) { $tradloc = "$tradloc";} if($count) { print "$tradloc
"; } else { print "$tradloc
"; } $count++; } print '
'; &ora_close($csr); } print '

'; &show_footer; &ora_logoff($lda) || &oracle_error($ora_errstr);