Admissions – 2019

[insert_php]

if(!isset($_SESSION)){session_start();}
$hostname = “mysql1005.mochahost.com”;
$database = “fosco1_admission”;
$username = “fosco1_wp527”;
$password = “S82..2qi9p”;
$connStr = ‘mysql:host=mysql1005.mochahost.com;dbname=fosco1_admission’;
$user = ‘fosco1_wp527’;
$pass = ‘S82..2qi9p’;
//set_exception_handler(‘exceptionHandler’);
try
{
$conn = new PDO($connStr, $user, $pass);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
catch(PDOException $e)
{
showError(“Sorry, an error has occurred. Please try your request
later\n” . $e->getMessage());
}

$year=date(‘Y’);
if(isset($_POST[‘application_no’])){
// Issue the query
$applicant = “SELECT id, application_no, surname, othername, programme, years, offer_expiry, status, lastmodified FROM offers WHERE application_no ='”.$_POST[‘application_no’].”‘ AND years = ‘$year’ ORDER BY programme, surname “;

}

if(isset($_POST[‘programme’])){

// Issue the query
$applicant = “SELECT id, application_no, surname, othername, programme, years, offer_expiry, status, lastmodified FROM offers WHERE programme ='”.$_POST[‘programme’].”‘ AND years = ‘$year’ ORDER BY programme, surname “;

}

$programmes=”SELECT DISTINCT(programme) as programmes FROM offers WHERE years = ‘$year’ “;

echo ‘

Search by Application Number

Search by Programme

‘;
if((isset($_POST[‘application_no’])) || (isset($_POST[‘programme’]))){
echo ‘

‘;

foreach($conn->query($applicant) as $rapplicant) {
echo’

‘;
}
echo ‘

# Application Number Name Programme Offer Expiry Status
‘. $rapplicant[‘application_no’] .’ ‘. $rapplicant[‘surname’].’, ‘.$rapplicant[‘othername’] .’ ‘. $rapplicant[‘programme’] .’ ‘. $rapplicant[‘offer_expiry’] .’ ‘; if($rapplicant[‘status’]==’yes’) { echo ‘‘; } else if($rapplicant[‘status’]==’no’) { echo ‘‘; } echo ‘

‘;
}
echo ‘

‘;
[/insert_php]