require'../title_small.php';
//Retrieve information from submit form
$page = $_REQUEST['page'];
//Connect to MySQL
mysqli_connect('localhost','adminhp83','zxcv9009') OR DIE("Unable to connect to database");
//Select the database
mysqli_select_db('hp_events');
//Get requested page from database, and display it
$query = mysqlii_query('SELECT * FROM newsbox_multi_content WHERE id = '.$page);
while($news = mysqli_fetch_array($query)) {
//Convert start date to timestamp
$date1=strtotime($news['start_date']);
//Calculate day of week for the start date
$day=date(l,$date1);
//$date2=strtotime($news['start_date']);
//Convert end date to a timestamp
$date3=strtotime($news['end_date']);
//Get the day of week for the end date
$day1=date(l,$date3);
//Check to see if the end date is blank, if not format the end date to "Day of Week, DD/MM/YYYY
if ($date1==$date3) {$date4="";} else {$date4=" - ".$day1.", ".date(n.'/'.j.'/'.Y,$date3);}
print "".$day.", ".date(n.'/'.j.'/'.Y,$date1).$date4."
";
print "".$news['headline']."
";
print "".$news['content']."
";
print "
";
print "Back to List";
}
require'../footer.php';
//mysqli_close($query);
?>