Hej. Jeg får en fejl der siger request is not defined i min fejl-konsol.
Her er mine koder:
Index.php
<?php include('cp/config.php'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="tr" lang="tr" dir="ltr">
<head>
<title>Calendar Script</title>
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css" media="all">@import "kalender/style.css";</style>
<script type="text/javascript" src="event.js"></script>
</SCRIPT>
</head>
<body>
<script type="text/JavaScript">
var ol_width=140;
var ol_delay=10;
var ol_fgcolor="#FFFFFF";
var ol_bgcolor="#AAAAAA";
var ol_offsetx=10;
var ol_offsety=10;
var ol_border=1;
var ol_vauto=1;
</script>
<div id="overDiv" style="position: absolute; visibility: hidden; z-index: 1000;"></div>
<script type="text/JavaScript" src="overlib_mini.js"><!-- overLIB (c) Erik Bosrup --></script>
<center>
<?php
// Free Calendar Script
// Coded and Designed by Bahadir Kocaoglu (bahadir@eggdrop.gen.tr)
// (C) 2007 Eggdrop Inc.
// http://www.eggdrop.gen.tr
// bahadir@eggdrop.gen.tr
if (empty($_GET['month'])) {
$month = date('m');
} else {
$month = $_GET['month'];
}
if (empty($_GET['year'])) {
$year = date('Y');
} else {
$year = $_GET['year'];
}
$theday = date('w', mktime(0, 0, 0, $month, 0, $year));
$daysinmonth = date("t", mktime(0, 0, 0, $month, 1, $year));
?>
<table cellspacing="1" cellpadding="0" border="0" class="mainTable">
<tr>
<td align="center" colspan="7" class="monthRow">
<a href="<?php echo $_SERVER['PHP_SELF']; if ($month == '01') { $prevmonth = '12'; $prevyear = $year - 1; echo '?month=' . $prevmonth; echo '&year=' . $prevyear; } else { $prevmonth = $month - 1; echo '?month=' . $prevmonth; echo '&year=' . $year; } ?>" id="a_no_back">«</a>
<?php
$monthName = date('F', mktime(0, 0, 0, $month, 1, $year));
$yearName = date('Y', mktime(0, 0, 0, $month, 1, $year));
echo $monthName . ' ' . $yearName;
$id = $_GET['id']
?>
<a href="<?php echo $_SERVER['PHP_SELF']; if ($month == '12') { $nextmonth = '01'; $nextyear = $year + 1; echo '?month=' . $nextmonth; echo '&year=' . $nextyear; } else { $nextmonth = $month + 1; echo '?month=' . $nextmonth; echo '&year=' . $year; } if ($id != '') { echo '&id=' . $id; }; ?>" id="a_no_back">»</a>
</td>
</tr>
<tr class="dayNamesText">
<td class="dayNamesRow" width="25" align="center">M</td>
<td class="dayNamesRow" width="25" align="center">T</td>
<td class="dayNamesRow" width="25" align="center">O</td>
<td class="dayNamesRow" width="25" align="center">T</td>
<td class="dayNamesRow" width="25" align="center">F</td>
<td class="dayNamesRow" width="25" align="center">L</td>
<td class="dayNamesRow" width="25" align="center">S</td>
</tr>
<tr class="rows">
<?php
for ($i = 0; $i < $theday; $i++) {
?>
<td> </td>
<?php
}
$theday = $theday+1;
for ($list_day = 1; $list_day <= $daysinmonth; $list_day++) {
$tm = date("U", mktime(0, 0, 0, $month, $list_day, $year)) - 86400; // Bir gün önce
$tn = date("U", mktime(0, 0, 0, $month, $list_day, $year)); // O gün ...
$tp = date("U", mktime(0, 0, 0, $month, $list_day, $year)) + 86400; // Bir gün sonra
$Q = sprintf("SELECT * FROM `events` WHERE `date` > '%s' AND `date` < '%s' AND `day` = '%s';", $tm, $tp, $list_day);
$R = mysql_query($Q);
$D = mysql_fetch_assoc($R);
$S = mysql_num_rows($R);
$Y = $D['date'];
$TheDay = date('d', $Y);
$TheMon = date('F', $Y);
$TheYea = date('Y', $Y);
mysql_free_result($R);
if ($S) {
?>
<td align="center" onclick="request(<?php echo $D['day']; ?>, <?php echo $D['month']; ?>, <?php echo $D['year']; ?>)" style="background-color: #CCFF00; color: #333333; cursor: pointer;" onmouseover="return overlib('<table width="100%" border="0" cellpadding="2" cellspacing="0" class="popupDateTable"><tr><td align="center" class="popupDate"><?php echo $TheDay; ?> <?php echo $TheMon; ?> <?php echo $TheYea; ?></td></tr></table><div class="eventTitle s23"><?php echo $S; ?> Record(s)</div>');" onmouseout="return nd();" title="">
<?php
} elseif ($tn > $tm AND $tn < $tp AND date('j') == $list_day AND date('m') == $month AND date('Y') == $year) {
?>
<td align="center" style="background-color: #FFC18A; color: #CF0000; cursor: pointer;" onmouseover="return overlib('<div style="background-color: #FFC18A; color: #CF0000; padding: 4px;">Today</div>');" onmouseout="return nd();">
<?php
} elseif ($theday == 6 or $theday == 7) {
?>
<td align="center" style="background-color: #EEEEEE; color: #666666;">
<?php
} else {
?>
<td align="center" style="background-color: #CCCCCC; color: #333333;">
<?php
}
echo $list_day;
echo '</td>';
if ($theday == 7) {
echo '</tr>';
echo '<tr class="rows">';
$theday = 0;
}
$theday++;
}
?>
</tr>
</table>
<div id="event_space"></div>
</center>
</body>
</html>
event.js
function request(day, month, year)
{
var xmlhttp=null;
if (window.XMLHttpRequest)
{
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
alert("Your browser does not support XMLHTTP!");
return;
}
var url="event.php?day=" + day;
url=url+"&month="+month;
url=url+"&year="+year;
url=url+"&sid="+Math.random();
xmlhttp.open('GET', url, true);
xmlhttp.onreadystatechange = function (aEvt) {
if (xmlhttp.readyState == 4) {
if(xmlhttp.status == 200)
{
document.geteElemintById('element').InnerHTML=xmlhttp.responseText;
}
else
{
dump("Error loading page\n");
}
}
};
xmlhttp.send(null);
}
Håber der er nogle der kan hjælpe mig.
//Kentora