#!/usr/bin/perl -w
#
# join-form, a CGI
#    purpose:  to read several files from JGTEMP/port_no/remote_host:
#              join-object-1, parameters and from_loc
#              and display the contents of the first 2
#              then, to allow users to return to previous screen
#              by presenting a 'Cancel' button pointing to from_loc
#
# NB: this file belongs in the directory configured as ScriptAlias /jg/
#     on this HTTPD server.  (typically htmlbin or optbin)
#     Generated from a template by a makefile in the source tree
#  
#
#   3 Jun 05.  WJS
#	A couple of variables "imported" from getfile1vars.pl generate
#	"used only once" diagnostics.  Postfix empty strings to have a 
#	phony second reference (don't just undef - the join interface
# 	seems to have a lot of files that "do" other files to define
#	things.  Unlikely here, but an undef would, of course, kill the defn)
#  16 Mar 05.  WJS
#	Hardcode perl location - obviates need for template file
#
do 'getfile1vars.pl';

  print "Content-type: text/html\n\n";
  print "<BODY BGCOLOR=\"ffffff\">\n";
#
# getfile1vars gets/sets these values from files in JGTEMP/port:
#   $object1
#   $dispobj
#   $dispss
#   $subsels
#   $refloc  myaddr /jg/otheropt
#
#
  if ($subsels eq "") {
    $display_full_object="$dispobj";
  } else {
    $display_full_object="$dispobj"."("."$dispss".")";
  }
  &print_top_frame;

  $dispss .= "";
  $refloc .= "";
  
################### print_top_frame
sub print_top_frame{

  $cancel_string="http://"."$refloc"."$dispobj"."?"."$subsels";
  print <<ENDOFSUB;
   <FORM METHOD="POST" ACTION="$cancel_string" TARGET="_top">
   <DL><DT><B><FONT SIZE="4">Join object:$display_full_object
   <DD>  with:  </FONT> 
    [ second object ] <FONT COLOR="FF0000">
        please choose from  
        below, by clicking on the hyperlinks</FONT><P>

      Or, you may choose to <FONT COLOR="0000FF">
            <INPUT ALIGN="right" TYPE="submit" VALUE="Cancel">
            </FONT>
   </B></DL>
   </FORM>\n

   </BODY>
   </HTML>
ENDOFSUB
}

