<html>
<head>
<title>Exapmle of Calendar Base 2.0</title>
</head>
<body>
<?php
session_start();
include_once("calendar_class.php");
include_once("db_class.php");
if (isset($_REQUEST['month'])){$month=$_REQUEST['month'];}else{$month=date("M");}
if (isset($_REQUEST['y'])){$year=$_REQUEST['y'];}else{$year=date("Y");}
$cal = new BaseCalendar($year,$month);
?>
<table width="600">
<tr><td colpsan="2"><a href="<?php echo $_SERVER['PHP_SELF'];?>?act=agenda&vis=day">dayly</a> - <a href="<?php echo $_SERVER['PHP_SELF'];?>?act=agenda&vis=week">weekly</a></td></tr>
<tr>
<td valign="top">
<?php
if(isset($_REQUEST['vis'])){
$_SESSION['vis']=$_REQUEST['vis'];}elseif(!isset($_SESSION['vis'])){$_SESSION['vis']='week';}
if (isset($_REQUEST['delapp']) and isset($_REQUEST['delapp2'])){
$cal->del_event($_REQUEST['id']);
}
if(isset($_REQUEST['sub_app']) and $_REQUEST['sub_app']=='Insert'){
$cal->add_event();
}elseif(isset($_REQUEST['sub_app']) and $_REQUEST['sub_app']=='Modify'){
$cal->upd_event();
}
if(isset($_REQUEST['day'])){$day=$_REQUEST['day'];}else{$day=date("j");}
if ($_SESSION['vis']=='day'){$cal->displayday($day);}else{$cal->week($day);}
?>
</td>
<td>
<?php
if(isset($_REQUEST['id'])){$id=$_REQUEST['id'];}else{$id='';}
$cal->display_cal();
$cal->event_form($day,$month,$year,$id);
?>
</td>
</tr>
</table>
</body>
</html>
|