I've been using PHP and Oracle (OPAL) since we do not run MySQL and I like the flexibility PHP provides outside of the Oracle development tools. Here is the full code:
<html>
<head>
<LINK REL=StyleSheet HREF="style.css" TYPE="text/css">
</head>
<body>
<?php
session_start();
$ID = $_POST['IdNum'];
$ap_year = $_POST['yeardropdown'];
$conn = ocilogon($_SESSION['user'],$_SESSION['password'], $_SESSION['db']);
if (!$conn) {
$e = oci_error();
print htmlentities($e['message']);
exit;
}
$query = "select a.id_num,corp_name,
A.STRT1, A.CITY, A.ST, LPAD(A.zip1,5,0) ZIP, c.plan_cat, c.event_name,
case
when start_date > sysdate then to_char(c.start_date,'MM/DD/YYYY')
else to_char(sysdate,'MM/DD/YYYY')
end as start_date,
to_char(c.end_date,'MM/DD/YYYY') end_date
from vps1 a, VPS2 b, (select id_num, b.event_name, b.start_date, b.end_date,
tab_to_string(cast(collect(b.event||' '||cat) as t_varchar2_tab)) as cat, max(ap_num) ap_num
from vps1 a, event_matrix b
where date_canceled is null and ap_year=$ap_year
and id_num=$ID
and a.plan=b.plan
) c
where b.AP_NUM = C.AP_NUM
AND b.ap_num = a.ap_num
and RANK = '1' and a.id_num = $ID
and c.id_num=a.id_num";
$stid = oci_parse($conn, $query);
if (!$stid) {
$e = oci_error($conn);
print htmlentities($e['message']);
exit;
}
$r = oci_execute($stid, OCI_DEFAULT);
if (!$r) {
$e = oci_error($stid);
echo htmlentities($e['message']);
exit;
}
oci_close($conn);
print '<form method="POST" action="loa_test.php">';
print '<table class="Table" cellspacing="1" cellpadding="5" rules="none"
frame="void" border="9px" bordercolor="#000000"
summary="Procedure Report: Detailed and/or summarized report">';
print '<tr>';
print '<TD BGCOLOR=#5F9EA0 width=180 height=550>';
print '</td>';
print '<td>';
print '<br>';
print '<br>';
print '<br>';
print '<br>';
print '<br>';
print '<table>';
print '<colgroup>';
print '<col>';
print '<col>';
print '<col>';
print '<col>';
print '</colgroup>';
print '<tr>';
print '<th class=" header" scope="col"> </th>';
print '<th class=" header" colspan="6" scope="colgroup"><b>LOA Eligibility</b></th>';
print '</tr>';
print '<tr>';
print '<th class=" header" scope="col"></th>';
print '<th class=" header" scope="col">event Name</th>';
print '<th class=" header" scope="col">Plan & Category</th>';
print '<th class=" header" scope="col">Name</th>';
print '<th class=" header" scope="col">ID<br>Number</th>';
print '<th class=" header" scope="col">Start<br>Date</th>';
print '<th class=" header" scope="col">End<br>Date</th>';
print '</tr>';
print '</thead>';
print '<tbody>';
$count = 0;
while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS)) {
$count=$count+1;
print '<tr>';
print '<td class=" DataStrong">';
print '<input name="id[]" type="checkbox" value="';
print $row[9].'"'.'</td>'.'<td class="DataStrong">'.$row[9].'<td class="DataStrong">'.$row[8].'<td class="DataStrong">'.$row[1].'<td class="DataStrong">'.$row[0].'<td class="DataStrong"><input style="width: 80px" type="text" name="StartDate'.$count.'" value ="'.$row[10].'"'.'<td class="DataStrong"><input style="width: 80px" type="text" name="EndDate'.$count.'" value ="'.$row[11].'"';
print '</td>';
print '</tr>';
$_SESSION['corp_Name']=$row[3];
$_SESSION['Name']=$row[1];
$_SESSION['Street_Address']=$row[4];
$_SESSION['ID_Number']=$row[0];
$_SESSION['City']=$row[5];
$_SESSION['State']=$row[6];
$_SESSION['Zip']=$row[7];
$_SESSION['Plan'] = $row[10];
$_SESSION['event_Number']=$row[2];
$_SESSION['Category']=$row[11];
//$_SESSION['event']=$row[12];
}
$_SESSION['counter']=$count;
print '<td>';
print '</td>';
print '<td>';
print '</td>';
print '<td class="DataStrong"><input type="submit" value="Submit"></td>';
print '</body>';
print '</table>';
?>
<tr>
</tr>
<tr>
<td>
</td>
</tr>
</form>
</table>
</html>