"; $days_in_month = days_in_month ($month, $year); $first_day = mktime(0,0,0,$month,1,$year); $date_first = getdate ($first_day); $last_day = mktime(0,0,0,$month,$days_in_month,$year); $date_last = getdate($last_day); $dayofweekfirst = $date_first['wday']; $dayofweeklast = $date_last['wday']; ############################################# #printMonth($month, $year); printDays(); $current = printFirstWeek($dayofweekfirst); $current = printWeek($current, $days_in_month); printLastWeek($current, $dayofweeklast); echo ""; echo "
"; printMonth($month, $year); echo "
"; echo "

"; echo "
Na koledarju si lahko ogledate
trenutno stanje rezervacij, lahko pa
oddate svojo rezervacijo.
Morebitna vprašanja lahko pošljete
agenciji preko katere oddajamo,
lahko pa tudi nam."; echo "

"; function getEvents(){ global $year; global $month; global $day; $link = mysql_connect('localhost', 'rezervacije', ':#SLOvenIJA#:') or die('Ne morem se povezati na strežnik: ' . mysql_error()); mysql_select_db('rezervacije') or die('Ne morem odpreti podatkovne baze.'); $query = "SELECT COUNT(*) FROM vnosi WHERE `from` <= '$year-$month-$day' AND `to` >= '$year-$month-$day';"; $result = mysql_query($query) or die('Poizvedba neuspešna: ' . mysql_error()); $line = mysql_fetch_array($result, MYSQL_ASSOC); mysql_free_result($result); $i = $line['COUNT(*)']; $query = "SELECT `type`, `email` FROM vnosi WHERE `from` <= '$year-$month-$day' AND `to` >= '$year-$month-$day';"; $result = mysql_query($query) or die('Poizvedba neuspešna: ' . mysql_error()); while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { foreach ($line as $vnos) { if($line['type'] == 5){ return 'FF4242'; } if($line['email'] == $_COOKIE['umail']){ return '1B8099'; } } } mysql_free_result($result); mysql_close($link); return 'CCCCCC'; } function days_in_month($_month, $_year){ if($_month == 2) { return days_in_feb($_year); } else { if($_month == 1 || $_month == 3 || $_month == 5 || $_month == 7 || $_month == 8 || $_month == 10 || $_month == 12) { return(31); } else { return(30); } } } function selectMonth($_month){ $selectstart = " "; echo $selectstart; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo $selectend; } function selectYear($selectedyear){ $day = getdate(); $year = $day['year']; $selectyeartop = " "; echo $selectyeartop; for($i=$year; $i<$year+5; $i++) { echo " "; } echo $selectyearbottom; } function days_in_feb($year){ if ($year < 0) $year++; $year += 4800; if ( ($year % 4) == 0) { if (($year % 100) == 0) { if (($year % 400) == 0) { return(29); } else { return(28); } } else { return(29); } } else { return(28); } } function printMonth($_month, $_year){ $monthText = convertNumtoMonth($_month); $monthtext1 = // "
"; $monthtext2 = "
"; echo "$monthtext1
"; selectMonth($_month); selectYear($_year); echo "
$monthtext2"; } function printDays(){ global $width; global $height; $daybar = " "; echo $daybar; } function printFirstWeek($_day){ global $width; global $height; global $day; echo " "; $current_day = 1; $spot = 0; while ($spot < $_day){ echo " "; $spot++; } while ($spot < 7){ $day = $current_day; echo " "; $spot++; $current_day++; } echo" "; return $current_day; } function printWeek($_day, $_last){ global $width; global $height; global $day; while ($_day <= ($_last - 7)){ $count = 0; echo " "; while($count < 7){ $day = $_day; echo " "; $_day++; $count++; } echo " "; } return $_day; } function printLastWeek($_day, $_lastday){ global $width; global $height; global $day; $count = 0; echo " "; while($count <= $_lastday) { $day = $_day; echo " "; $_day++; $count++; } while($count < 7) { echo " "; $count++; $_day++; } echo " "; ?>
N P T S Č P S
 $current_day
$_day
$_day
 
Prosto
Vaša trenutna izbira
Rezervirano
"; } ?>