#!/oracle/app/oracle/product/7.3.3/bin/oraperl

##### set Oracle's variables #####
$ENV{'ORACLE_HOME'}='/oracle/app/oracle/product/7.3.3';
$ENV{'ORACLE_SID'}='rabbit';
$orauser="vod";
$orapass="vod";

#### set web server address ####
$WSA = "http://clarissa.npac.syr.edu/vod";
$PROJDIR="/project/K136/VOD";




$input = <>;
#chop $input;

@param = split(/\&/, $input );

foreach (@param)
{
    ##### for URL decoding ######
    ### convert plus to space ###
    $_ =~ s/\+/ /g;
    ### convert %XX from hex numbers to alphanumeric ###
    $_ =~ s/%(..)/pack("c", hex($1))/ge;

    $archiveid = $1 if /archiveid=(.*)/;

}

if ( $archiveid eq "" ) {
print ("Content-type: TEXT/HTML\n\n");
print <<"EndOfHTML";
<HTML>
<TITLE>Video News Database - Modify Archive</TITLE>
<BODY bgcolor="coral">
<H3>Error: you have not selected any archive to modify!</H3>
<A HREF="$WSA/cgi-bin/modcollform">
<B>Another chance...</B></A>
</BODY>
</HTML>
EndOfHTML
die;
}


##### logon oracle #####
$lda = &ora_login('', $orauser, $orapass);

$csr = &ora_open
($lda, " select aname, adesc from archivetable where archiveid = $archiveid ");
($aname, $adesc ) = &ora_fetch($csr) ;
##### logoff oracle #####

print ("Content-type: TEXT/HTML\n\n");
print <<"EndOfHTML"; 
<HTML>
<TITLE>Video News Database - Modify Archive Properties - Archive: $aname</TITLE>
<BODY bgcolor="tan">
<H1>Modify Archive Description</H1>
<HR>
<CENTER>
<FORM ACTION="$WSA/cgi-bin/modcolldoit" METHOD="POST">
<INPUT TYPE="HIDDEN" NAME="archiveid" VALUE="$archiveid">
<TABLE BORDER="3" WIDTH="60%">
<TR><TD>
Archive Name</TD><TD> 
<INPUT TYPE="text" NAME="aname" VALUE="$aname" SIZE="15" MAXLENGTH="15"></TD></TR>
<BR>
<TR><TD>Description</TD><TD>
<INPUT NAME="adesc" SIZE="60" VALUE="$adesc" MAXLENGTH="60"></TD></TR> 
</TABLE></CENTER>
<P>
<INPUT TYPE="Submit" VALUE="MODIFY">
<INPUT TYPE="RESET" VALUE ="RESET">
</FORM>
<HR>
EndOfHTML
