#!/usr/local/bin/perl

#########################################################
# report1.pl by Mike Moxcey #
# First try at displaying data for Oracle/Perl tutorial #
#########################################################

$| = 1; # prevents forking so stuff is printed in correct order

############################################
# Define include files #
############################################

require "cgi-lib.pl"; #ReadParse
require "oracle.pl"; #&sql,fix_string
require "oratut.pl";

########
# main #
########

print &PrintHeader;
print &HtmlTopTut("Calls in Database");
print <<EOM;
<table border>
<tr><th>ID Nr
</th><th>Pri
</th><th>Date
</th><th>Time
</th><th>Name
</th><th>Email
</th><th>Problem
</th></tr>
EOM

@sql_show = <<ENDOFSQL;
select
'<tr><td>', seq,
'</td><td>', priority,
'</td><td>', open_date,
'</td><td>', to_char(open_date,'HH:MI PM'),
'</td><td>', name,
'</td><td>', email,
'</td><td>',substr(problem,1,30),
'</td></tr>'
from oratut.calls;
ENDOFSQL

##DEBUG print "SQLShow:@sql_show!";
&sql($sql_login,@sql_show);

print "</table>";
print &HtmlBotTut;


home