File size: 3.51Kb
<?php
include("head.php");
////////////////////////////////////////MAIN PAGE
if($action=="main")
{
addvisitor();
addonline(getuid_sid($sid),"Bank","");
//saveuinfo($sid);
echo "<card id=\"main\" title=\"wapirate\">";
echo "<p align=\"center\">";
$wapirateNew_Time = time() + (23 * 60 * 60);
$wapiratetime=date("H:i",$wapirateNew_Time);
echo "<b>Calendar!</b><br/><br/><b>".date("D d M y - ")." $wapiratetime</b>";
$monthNames = Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
if (!isset($_REQUEST["month"])) $_REQUEST["month"] = date("n");
if (!isset($_REQUEST["year"])) $_REQUEST["year"] = date("Y");
$cMonth = $_REQUEST["month"];
$cYear = $_REQUEST["year"];
$prev_year = $cYear;
$next_year = $cYear;
$prev_month = $cMonth-1;
$next_month = $cMonth+1;
if ($prev_month == 0 ) {
$prev_month = 12;
$prev_year = $cYear - 1;
}
if ($next_month == 13 ) {
$next_month = 1;
$next_year = $cYear + 1;
}
?>
<br/><br/><table width="200" align="center">
<tr align="center">
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" align="left"> <a href="<?php echo $_SERVER["PHP_SELF"] . "?sid=". $sid ."&action=". $action ."&month=". $prev_month . "&year=" . $prev_year; ?>" >Previous</a></td>
<td width="50%" align="right"><a href="<?php echo $_SERVER["PHP_SELF"] . "?sid=". $sid ."&action=". $action ."&month=". $next_month . "&year=" . $next_year; ?>" >Next</a><br/></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center">
<table width="100%" border="0" cellpadding="2" cellspacing="2">
<tr align="center">
<td colspan="7"><b><?php echo $monthNames[$cMonth-1].' '.$cYear; ?></b></td>
</tr>
<tr>
<td align="center"><b>S</b></td>
<td align="center"><b>M</b></td>
<td align="center"><b>T</b></td>
<td align="center"><b>W</b></td>
<td align="center"><b>T</b></td>
<td align="center"><b>F</b></td>
<td align="center"><b>S</b></td>
</tr>
<?php
$timestamp = mktime(0,0,0,$cMonth,1,$cYear);
$maxday = date("t",$timestamp);
$thismonth = getdate ($timestamp);
$startday = $thismonth['wday'];
for ($i=0; $i<($maxday+$startday); $i++) {
if(($i % 7) == 0 ) echo "<tr>\n";
if($i < $startday) echo "<td></td>\n";
else echo "<td align='center' valign='middle' height='20px'>". ($i - $startday + 1) . "</td>\n";
if(($i % 7) == 6 ) echo "</tr>\n";
}
?>
</tr>
</table>
</td>
</tr>
</table>
<?php
echo "<a href=\"egen.php?action=main&sid=$sid\">Back</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images$folder/home.gif\" alt=\"*\"/>Home</a>";
echo "</p>";
echo "</card>";
}
?>
</wml>