Location: PHPKode > projects > LDAP contact manager > ldapmgr/task.php
<?php

//check value of todo then display relevant form

$todo = $HTTP_GET_VARS["todo"];
print '<form action="dowork.php" method="GET">' ;
print '<table cellpadding="1" cellspacing="1" border="0" align="center" valign="middle" width="90%">' ;
switch ($todo) {
	Case "new" :
		print '<th colspan=3>Enter Details for New Entry</th>';
		print '<tr colspan=3><td><input type="hidden" name="toDo" value="new"></td></tr>';
		print '<tr><td align=right>First Name</td><td><input type="text" name="fname" size="20" maxlength="20"></td><td><font color=red>Required Field</font></td></tr>';
		print '<tr><td align=right>Surname</td><td><input type="text" name="sname" size="20" maxlength="20"></td><td><font color=red>Required Field</font></td></tr>';
		print '<tr><td align=right>Company</td><td><input type="text" name="company" size="20" maxlength="20"></td><td><font color=red>Required Field</font></td></tr>';
		print '<tr><td align=right>Email Address</td><td><input type="text" name="email" size="20" maxlength="20"></td></tr>';
		print '<tr><td align=right>Cell Number</td><td><input type="text" name="cellnum" size="20" maxlength="20"></td></tr>';
		print '<tr><td></td><td><input type=submit value="Create Entry"></td><td></td></tr>';
		break ;
	
	Case "edit" :
		print '<th colspan=3>Enter Details of Entry to Edit</th>';
		print '<tr colspan=3><td><input type="hidden" name="toDo" value="edit"></td></tr>';
		print '<tr><td align=right>First Name</td><td><input type="text" name="fname" size="20" maxlength="20"></td></tr>';
		print '<tr><td align=right>Surname</td><td><input type="text" name="sname" size="20" maxlength="20"></td></tr>';
		print '<tr><td></td><td><input type=submit value="Edit Entry"></td><td></td></tr>';
		break ;

	Case "search" :
		print '<th colspan=3>Enter Search Criteria</th>';
		print '<tr colspan=3><td><input type="hidden" name="toDo" value="search"></td></tr>';
		print '<tr><td align=right>First Name</td><td><input type="text" name="fname" size="20" maxlength="20"></td></tr>';
		print '<tr><td align=right>Surname</td><td><input type="text" name="sname" size="20" maxlength="20"></td></tr>';
		print '<tr><td align=right>Company</td><td><input type="text" name="company" size="20" maxlength="20"></td></tr>';
		print '<tr><td align=right>Email Address</td><td><input type="text" name="email" size="20" maxlength="20"></td></tr>';
		print '<tr><td align=right>Cell Number</td><td><input type="text" name="cellnum" size="20" maxlength="20"></td></tr>';
		print '<tr><td></td><td><input type=submit value="Search"></td><td></td></tr>';
		
		break ;

	Case "delete" :
		print '<th colspan=3>Enter Details of Entry to Delete</th>';
		print '<tr colspan=3><td><input type="hidden" name="toDo" value="delete"></td></tr>';
		print '<tr><td align=right>First Name</td><td><input type="text" name="fname" size="20" maxlength="20"></td><td><font color=red>Required Field</font></td></tr>';
		print '<tr><td align=right>Surname</td><td><input type="text" name="sname" size="20" maxlength="20"></td></tr>';
		print '<tr><td></td><td><input type=submit value="Delete Entry"></td><td></td></tr>';
		break ;
}

print '</table>';

print '</form>';
?>
		
		
Return current item: LDAP contact manager