<?php
/////////////////////////
// INITIAL SETUP START //
/////////////////////////
if (file_exists("install/index.php")) {

    // LOAD DB VARIABLES
	if (file_exists("config.inc.php")) {
    $epcLoadDb=1;
    require("config.inc.php");

    // OPEN DATABASE CONNECTION
    $error="";
    $db = @mysql_connect($sqlHost, $sqlUserLogin, $sqlPassword) or $error = (mysql_error()."<br>");
    @mysql_select_db($sqlDatabaseName, $db) or $error .= (mysql_error());
	
	// SET CHARSET
      if ($sqlDatabaseFormat==1 && version_compare(mysql_get_server_info(), '4.1.0', '>=')) {
      mysql_query('SET NAMES "utf8"', $db);
      }
	}
else {$error="1";}

    if ($error!="") {
        // LOAD INSTALL
	    $host  = $_SERVER['HTTP_HOST'];
        $uri   = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
        $extra = 'install/index.php';
        header("Location: http://$host$uri/$extra");
	    exit;
    }
    else {
		echo "<strong>WARNING!</strong> You must remove the install directory before continuing!";
		exit;
	}
}
/////////////////////////
// INITIAL SETUP END   //
/////////////////////////
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Easy PHP Calendar Demo Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<?php $CSS=1; require("calendar.php"); ?>
<style type="text/css">
<!--
.style1 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 9px;
}
.style2 {	color: #FFFFFF;
	font-weight: bold;
}
-->
</style>
</head>
<body>
<?php $OL=1; require("calendar.php"); ?>
<div align="center">
  <table width="500" border="0" cellspacing="0" cellpadding="5">
    <tr>
      <td align="center" bgcolor="#FFFF00"><span class="style1"><strong>This is a demo page. </strong><br>
Edit index.php to remove this message and to change the layout or features.<br>
View the <a href="examples/index.php">Examples Page</a> for more calendar layouts. </span></td>
    </tr>
  </table>
  <p><span class="style1"><a href="events/index.php"><img src="images/loginUsers.gif" alt="Log In" width="30" height="30" border="0" align="absmiddle"> Log In</a><a href="events/index.php"></a></span><br>
</p>
</div>
<table width="100%" align="center">
  <tr><td align="center">
<?php
// DISPLAY STANDARD CALENDAR
$TOC=1; // UNCOMMENT THIS LINE TO SHOW TEXT ON CALENDAR
require("calendar.php"); 
?>
<br /><br />
<?php
// DISPLAY AGENDA CALENDAR
$LIST=1;
$DF = "M jS, Y (D)"; 
$template="modern.php";
require("calendar.php");
?>
</td>
</tr></table>
</body>
</html>