#!/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=(.*)/;
    $aname    = $1 if /aname=(.*)/;
    $adesc= $1 if /adesc=(.*)/;
}


print "Content-type: text/html\n\n ";
print <<"EndOfHTML";
<HTML>
<TITLE>NPAC Video News DataBase : Modify Archive Property</TITLE>
<BODY bgcolor="coral">
<B>
<H1> Results of the "Modify an Archive" operation </H1>
<HR>
<FONT Size="4"> Input data <BR><BR>
<FONT Size="3">
Archive name : $aname <BR>
Description : $adesc<BR>
<HR>
<FONT Size="4"> Results of the "Modify in Archive" operation: <BR><BR>
<FONT Size="3">
EndOfHTML

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

$ret = &ora_do 
       ($lda, " update archivetable set aname='$aname', adesc='$adesc'   
        where archiveid=$archiveid ");
if($ret==1)  {
  &ora_commit($lda);
  print "$ret row is updated<BR>";
} else  {
  print "Error occured.<BR>$ora_errstr<BR>";
}

&ora_logoff($lda);

print <<"EndOfHTML";
<HR>
<A HREF="$WSA/cgi-bin/modcollform">MODIFY ANOTHER</A>
</BODY>
</HTML>
EndOfHTML
