Ben şu anda veritabanına olayları eklemek için izin veren bir takvim komut dosyası oluşturma çalışıyorum ve araç-ipuçları olarak görünür
i sayıları artmakta ve gün olay calandar de $ güne eşit ise onun calandar oluşturma gibi çok eklendiği ile olay ve gün dışarı dışarı yazdırır zaten bağlı değilse veritabanına bağlanmak ve istiyorum sınıf heres ne ben şu anda var ama onun doğru çalışmıyor.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Calandar</title>
<link rel="stylesheet" href="css/master.css" type="text/css" media="screen" charset="utf-8" />
<script src="js/jquery-1.3.min.js" type="text/javascript"> </script>
<script src="js/coda.js" type="text/javascript"> </script>
</head>
<body>
<table cellspacing="0">
<thead>
<tr>
<?php
include 'connect.php';
$days = mysql_query("Select * FROM calandar ORDER BY id");
while($dayz = mysql_fetch_array($days)){
if(is_array($dayz)){
foreach($dayz as $key => $value)
$$key = stripslashes($value);
}
echo "<th>".$day."</th>";
}
?>
</tr>
</thead>
<tbody>
<?php
$date = time();
$dayt = date('j', $date);
$month = date('m', $date);
$year = date('Y', $date);
$first_day = mktime(0,0,0,$month, 1, $year);
$month_title = date('F', $first_day);
$days_of_week = date('D', $first_day);
switch($days_of_week){
case "Mon": $blank = 0; break;
case "Tue": $blank = 1; break;
case "Wed": $blank = 2; break;
case "Thu": $blank = 3; break;
case "Fri": $blank = 4; break;
case "Sat": $blank = 5; break;
case "Sun": $blank = 6; break;
}
$days_in_month = cal_days_in_month(0, $month, $year);
//counts days goes up to 7
$day_count = 1;
echo "<tr>";
//take care of blank days
while($blank > 0)
{
echo "<td></td>";
$blank = $blank-1;
$day_count++;
}
$day_num = 1;
//count days until its equal to the days in the current month
$days = mysql_query("Select * FROM events ORDER BY id");
while($dayz = mysql_fetch_array($days)){
if(is_array($dayz)){
foreach($dayz as $key => $value)
$$key = stripslashes($value);
}
while($day_num <= $days_in_month)
{
if($day === $day_num){
echo $day_num. ",";
echo "<td class='date_has_event'> $day_num
<div class='events'>
<ul>
<li>
<span class='title'> $title </span>
<span class='desc'> $desc </span>
</li>
</ul>
</div>
</td>";
}else{
echo $day_num;
echo "<td> $day_num </td>";
}
$day_num++;
$day_count++;
//echo "<td> $day_num </td>";
//$day_num++;
//$day_count++;
//if statement to check if its been a full week
if($day_count > 7)
{
echo "</tr><tr>";
$day_count = 1;
}
}
}
while($day_count > 1 && $day_count <= 7)
{
echo"<td></td>";
$day_count++;
}
echo "</tr>";
?>
</tbody>
<tfoot>
<th>Mon</th><th>Tue</th><th>Wed</th>
<th>Thu</th><th>Fri</th><th>Sat</th>
<th>Sun</th>
</tfoot>
</table>
<input type="hidden" name="today" id="today" value="<?php echo $dayt ?>">
<script type="text/javascript">
$(function () {
var day = $("#today").val();
$("td").each(function(i){
//alert(i);
if(i - 1 == day){
$(this).addClass("today");
}
});
});
</script>
</body>
</html>