User's Manual

Extending the Basic Employee Form
5-6 Oracle Database Express Edition 2 Day Plus PHP Developer Guide Beta Draft
echo '<p>No Employee found</p>';
}
else {
echo <<<END
<form method="post" action="$posturl">
<table>
<tr>
<th>&nbsp;</th>
<th>Employee<br>ID</th>
<th>Employee<br>Name</th>
<th>Hiredate</th>
<th>Salary</th>
<th>Commission<br>(%)</th>
</tr>
END;
// Write one row per employee
foreach ($employeerecords as $emp) {
echo '<tr>';
echo '<td><input type="radio" name="emprec" value="'.
htmlentities($emp['EMPLOYEE_ID']).'"></td>';
echo '<td align="right">'.
htmlentities($emp['EMPLOYEE_ID']).'</td>';
echo '<td>'.htmlentities($emp['EMPLOYEE_NAME']).'</td>';
echo '<td>'.htmlentities($emp['HIRE_DATE']).'</td>';
echo '<td align="right">'.
htmlentities($emp['SALARY']).'</td>';
echo '<td align="right">'.
htmlentities($emp['COMMISSION_PCT']).'</td>';
echo '</tr>';
}
echo <<<END
</table>
<input type="submit" value="Modify" name="modifyemp">
<input type="submit" value="Delete" name="deleteemp">
&nbsp;&nbsp;
<input type="submit" value="Insert new employee"
name="insertemp">
</form>
END;
}
}
The form prints a radio button in the first column of each row to enable you to
select the record to be modified or deleted.
13. Edit anyco_ui.inc. Add ui_print_insert_employee() to generate the
form to input new employee data:
function ui_print_insert_employee($emp, $posturl)
{
if (!$emp) {
echo "<p>No employee details found</p>";
}
else {
$deptid = htmlentities($emp['DEPARTMENT_ID']);
$hiredate = htmlentities($emp['HIRE_DATE']);
echo <<<END
<form method="post" action="$posturl">
<table>
<tr>