#! /usr/oracle/bin/oraperl

# read the parameter from the input
#$clipid = $ENV{'QUERY_STRING'};
$clipid = <>;

print ("Content-type: TEXT/HTML\n\n");

print ("<HTML><TITLE>ADMP response</TITLE><BODY>\n");
print ("<h2>you asked for clipid = $clipid </h2>");

#print ("<h2>you asked for clipid = $ENV{'QUERY_STRING'} </h2>");


$ENV{'ORACLE_HOME'}='/usr/oracle';
$ENV{'ORACLE_SID'}='nodb';



#SQL stuff

$lda = &ora_login('','michal', 'michal');
print ("$lda\n<BR>");

$csr = &ora_open($lda, "select 
title, server, filename, encoding, length, foff from clip 
where clipid = $clipid ");

($title, $server, $filename, $encoding, $length, $foff) = (&ora_fetch($csr, 1));

print ("<FORM ACTION=\"http://kayak.npac.syr.edu:1963/cgi-bin/vser/upd\" method=\"POST\">\n");

print ("<B>Title:</B>");
print ("<input name=\"title\" type=\"text\" size=40 maxlength=100
value=\"$title\"><BR>\n");

print ("<b>Server:</b>\n");
print ("<input name=\"server\" type=\"text\" size=15 maxlength=15 
value=\"$server\"><BR>\n");

print ("<b>Filename: </b>");
print ("<input name=\"filename\" type=\"text\" size=50 maxlength=100
value=\"$filename\"><BR>\n");

print ("<b>Encoding: </b>");
print ("<input name=\"enc\" type=\"text\" size=10 maxlength=100
value=\"$encoding\"><BR>\n");

print ("<b>Length: </b>");
print ("<input name=\"length\" type=\"text\" size=15 maxlength=100
value=\"$length\"><BR>\n");

print ("<b>URL: </b>");
print ("<input name=\"url\" type=\"text\" size=50 maxlength=100
value=\"$foff\"<BR><HR>\n");

print("</FORM>\n");

&ora_logoff($lda);


print ("</BODY></HTML>");


