<?php
// INCLUDE HEADER IN PAGE
include('other_header.php');
// GET CURRENT DATE AND TIME
$date = date('Y-m-d H:i:s');
// Check if exist
$a1 = "SELECT `id` FROM `pages` WHERE `name` = '$page' LIMIT 1";
if (@mysql_num_rows(mysql_query($a1))!=1) {
	$title = "404";
	$c2 = "Not found";
	$c3 = "Please try check your URL, there may be any errors there.";
} else {
	$b1 = mysql_query($a1) or die($a1."<br/><br/>".mysql_error());
	$c1 = mysql_result($b1, 0);
	// Page Name
	$a2 = "SELECT `name` FROM `pages` WHERE `id` = '$c1'";
	$b2 = mysql_query($a2) or die($a2."<br/><br/>".mysql_error());
	$c2 = mysql_result($b2, 0);
	// Page HTML
	$a3 = "SELECT `html` FROM `pages` WHERE `id` = '$c1'";
	$b3 = mysql_query($a3) or die($a3."<br/><br/>".mysql_error());
	$c3 = mysql_result($b3, 0);
}
?>

  <div class="container">

    <div class="text-center">
      <h1><?php echo $title; ?> <small>/ <?php echo $c2; ?></small></h1>
    </div>
	</br>

    <!-- BASE CSS   =========================================================== -->

    <!-- Tables -->
	<div class="row">
      <div class="col-md-8 col-md-offset-2">
				<?php echo $c3; ?>
      </div>
    </div>	
</div>

<?php
include('other_footer.php');
?>