Citation :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <!-- <meta http-equiv="Content-Type" content="text/html;Charset=iso-8859-15"> --> <meta http-equiv="Content-Type" content="text/html;Charset=utf-8"> <meta name="description" content="IIUM Online Course Application"> <meta name="keywords" content="IIUM, Online, Course, Application"> <meta name="identifier-url" content=""> <meta name="robots" content="follow,index,all"> <meta name="REVISIT-AFTER" content="7 days"> <meta name="page-topic" content="IIUM Online Course Application"> <meta name="rating" content="All"> <title>IIUM Online Course Application - Admin</title> <link rel="stylesheet" type="text/css" href="../style.css"> </head> <?php require( '../include/connectDB.inc.php' ); // We need to tell mysql that the client will send characters using the utf8 character set (for the chinese characters) // The connection will be set to utf8 also, and the results will be sent back to the client using utf8 $query = 'SET NAMES \'utf8\''; mysql_query( $query ); $appNr = isset ( $_POST['applicantNr'] ) ? (int)$_POST['applicantNr'] : 0; echo ' <body> <div id="adminPage"> /////////////// CHECK CHECK CHECK <form action="index.php" method="post"> <div id="leftMenu"> <div id="actions"> <form action="index.php" method="post" style="margin-bottom:0px;"> <input type="hidden" name="applicantNr" value="' .$appNr .'" /> <input name="action" type="submit" value="Accept"' .( $appNr == 0 ? 'disabled="disabled"' : '' ) .'style="width:100px;margin-bottom:20px;" /> <input name="action" type="submit" value="Update"' .( $appNr == 0 ? 'disabled="disabled"' : '' ) . 'style="width:100px;margin-bottom:20px;" /> <input name="action" type="submit" value="Delete"' .( $appNr == 0 ? 'disabled="disabled"' : '' ) . 'style="width:100px;margin-bottom:20px;" /> </form> </div> <hr /> <div id="appList"> <form action="index.php" method="post"> <select name="applicantNr" size="10" style="width:120px;"> '; $query = 'SELECT * FROM APPLICANT'; $result = mysql_query( $query ); while ( $row = mysql_fetch_array( $result ) ) { echo '<option' .( $appNr == $row['id'] ? ' selected="selected"' : '' ) .'>' .$row['id'] .'</option>'; } ?> </select> <input type="submit" value="Choose Applicant" style="width:120px;"> </form> </div> </div> <div id="info"> <?php // This is where the information given to the user is given // If there is an action did by the user if ( isset( $_POST['action'] ) == true ) { // Check if the action has been confirmed already, cancelled or there is no yet if ( isset( $_POST['confirm'] ) == true ) { switch ( $_POST['confirm'] ) { case 'Confirm': if ( $_POST['action'] == 'Accept' ) { echo '###########WRITE THE CODE TO ACCEPT###########<br />'; echo 'The Applicant Nr <span style="color:black;font-size:22px;">' .$_POST['applicantNr'] .'</span> has been successfuly accepted<br />'; } else if ( $_POST['action'] == 'Update' ) { echo '###########WRITE THE CODE TO UPDATE###########<br />'; echo 'The Applicant Nr <span style="color:black;font-size:22px;">' .$_POST['applicantNr'] .'</span> has been successfuly updated<br />'; } else if ( $_POST['action'] == 'Delete' ) { echo '###########WRITE THE CODE TO DELETE###########<br />'; echo 'The Applicant Nr <span style="color:black;font-size:22px;">' .$_POST['applicantNr'] .'</span> has been successfuly deleted<br />'; } break; case 'Cancel': break; } } else { echo '<form action="index.php" method="post">'; switch ( $_POST['action'] ) { case 'Accept': echo 'Please confirm that you want to accept Applicant Nr <br /><span style="color:black;font-size:22px;">' .$_POST['applicantNr'] .'</span>'; break; case 'Update': echo 'Please confirm that you want to update Applicant Nr <br /><span style="color:black;font-size:22px;">' .$_POST['applicantNr'] .'</span>'; break; case 'Delete': echo 'Please confirm that you want to delete Applicant Nr <br /><span style="color:black;font-size:22px;">' .$_POST['applicantNr'] .'</span>'; break; } echo '<br /><br />'; echo '<input type="hidden" name="applicantNr" value="' .$_POST['applicantNr'] .'" />'; echo '<input type="hidden" name="action" value="' .$_POST['action'] .'" />'; echo '<input type="submit" name="confirm" value="Confirm" />'; echo '<input type="submit" name="confirm" value="Cancel" />'; echo '</form>'; } } // If there is no applicant chosen if ( $appNr == 0 ) { echo 'Please choose an Applicant Number and click \'Choose Applicant\''; } ?> </div> <!--<form action="index.php" method="post">--> <div id="studentId"> </div> <div id="studentInfo"> <?php // If applicant info has been requested $query = 'SELECT * FROM APPLICANT WHERE id = ' .$appNr; $result = mysql_query( $query ); // Ther e is only 1 row to get if ( ( $row = mysql_fetch_array( $result ) ) != false ) { // Show the information and make it editable echo ' <h2>Personal Information:</h2> Full name (in English): <input style="margin-left:43px;" type="text" name="englishFullName" size="32" value="' .$row['fullNameEnglish'] .'" /> <br /><br /> Preferred name (in English): <input style="margin-left:5px;" type="text" name="englishPreferredName" size="32" value="' .$row['preferredNameEnglish'] .'" /> <br /><br /> Full name (in Chinese): <input style="margin-left:37px;" type="text" name="chineseName" size="32" value="' .$row['fullNameChinese'] .'" /> <br /><br /> Gender: <input style="margin-left:131px;" type="text" name="gender" size="1" value="' .$row['gender'] .'" /> <br /><br /> Date of birth (dd/mm/yyyy): <input style="margin-left:8px;" type="text" name="dateOfBirth" size="8" value="' .$row['dateOfBirth'] .'" /> <br /><br /> Place of birth: <input style="margin-left:95px;" type="text" name="placeOfBirth" size="32" value="' .$row['placeOfBirth'] .'" /> <br /><br /> Nationality: <input style="margin-left:110px;" type="text" name="nationality" size="32" value="' .$row['nationality'] .'" /> <br /><br /> I.D. Card/Passport: <br /> <span style="margin-left:15px;">Number:</span><input style="margin-left:139px;" type="text" name="passportNumber" size="32" value="' .$row['idOrPassportNumber'] .'" /> <br /> <span style="margin-left:15px;"></span>Date of issue (dd/mm/yyyy):</span><input style="margin-left:15px;margin-top:5px;" type="text" name="passportDateOfIssue" size="8" value="' .$row['idOrPassportDateOfIssue'] .'" /> <br /> <span style="margin-left:15px;">Place of issue:</span><input style="margin-left:102px;margin-top:5px;" type="text" name="passportPlaceOfIssue" size="32" value="' .$row['idOrPassportPlaceOfIssue'] .'" /> <br /> <span style="margin-left:15px;">Date of expiry (dd/mm/yyyy):</span><input style="margin-left:10px;margin-top:5px;" type="text" name="passportDateOfExpiry" size="8" value="' .$row['idOrPassportDateofExpiry'] .'" /> <br /> <span style="margin-left:15px;">Scanned copy:</span><input style="margin-left:101px;margin-top:5px;width:370px;" type="input" name="scannedCopy" size="58" value="' .$row['scannedCopy'] .'" /> <br /><br /><br /> Home address: <input style="margin-left:86px;width:392px;" type="text" name="homeAddress" size="62" value="' .$row['homeAddress'] .'" /> <br /><br /> Mailing address: <input style="margin-left:79px;width:392px" type="text" name="mailingAddress" size="62" value="' .$row['mailingAddress'] .'" /> <br /><br /> <span>Phone number: </span><input style="margin-left:85px;" type="text" name="phoneNumber" size="16" value="' .$row['phoneNumber'] .'" /> <br /><br /> <span>Private email address: </span><input style="margin-left:41px;" type="text" name="emailAddress" size="48" value="' .$row['privateEmailAddress'] .'" /> <br /><br /> <h2>Program(s) applied for</h2> <input style="width:578px;" type="text" name="emailAddress" size="94" value="' .$row['programsApplied'] .'" /> '; } ?> </div> ////////////// CHECK CHECK CHECK</form> </div> </body> </html>
|