| Autor | Zpráva | ||
|---|---|---|---|
| Miky Profil * |
#1 · Zasláno: 5. 3. 2009, 20:53:49
Dobry den,
nevite proc mi to hazi zacatek tydne v Nedeli misto Pondeli? Zdrojovy kod: <?
#-----------------------------------------------------------------------------
function cal_display_month($property_id = false, $this_date=false, $hilight="Y", $next_links="Y", $price_type="week", $link_all_days=false) {
#-----------------------------------------------------------------------------
if (empty($this_date)) $this_date = date("Ymd");
$bookedcolor = "#AAAAAA";
$availablecolor = "#a8f3a5";
echo "<table class=\"calendarBASE\" cellpadding=\"0\" cellspacing=\"0\"><tr>";
for ($monthCount=0;$monthCount<1;$monthCount++){
if ($next_date != "") {
$this_date = $next_date;
}
echo "<td align=\"center\">";
# TENTO MESIC
$this_year = date("Y",strtotime($this_date));
$this_month = date("m",strtotime($this_date));
$this_day = date("d",strtotime($this_date));
$this_month_txt = system_showDate("F",strtotime($this_date));
if ($hilight=="N") { $this_day = ""; }
# PREDCHOZI MESIC
$last_date = date("Ymd",mktime(0,0,0,(int)$this_month-1,1,(int)$this_year));
# DALSI MESIC
$next_date = date("Ymd",mktime(0,0,0,(int)$this_month+1,1,(int)$this_year));
$fotm = mktime(0,0,0,(int)$this_month,1,(int)$this_year);
$this_ndays = date("t",$fotm);
$this_fdow = date("w",$fotm);
$this_month_txt = system_showDate("F",$fotm);
$this_date = sprintf("%04s%02s%02s",$this_year,$this_month,1);
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
echo "<tr><td valign=\"top\">";
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr>";
# MONTH-YEAR HEADER
echo "<td colspan=\"7\">";
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr>";
echo "<th align=\"left\">";
if (($next_links == "Y" || $next_links == "L") && $monthCount==0 ) {
echo "<a href=\"".EVENT_DEFAULT_URL."/results.php?month=".substr($last_date,0,6)."&this_date=$last_date\">«</a>";
} else {
echo " ";
}
echo "</th>";
echo "<th>";
echo "<a href=\"".EVENT_DEFAULT_URL."/results.php?month=$this_year$this_month&this_date=$this_date\">$this_month_txt $this_year</a></th>";
if (($next_links == "Y")) {
echo "<th align=\"right\"><a href=\"".EVENT_DEFAULT_URL."/results.php?month=".substr($next_date,0,6)."&this_date=$next_date\">»</a>";
} else {
echo " ";
}
echo "</th>";
echo "</tr></table>";
echo "</td>";
echo "</tr>";
# WEEKDAY HLAVICKY
$weekdays_list = explode(",", LANG_DATE_WEEKDAYS);
echo "<tr>";
for ($i=0;$i<count($weekdays_list);$i++) {
echo "<th class=\"calendar-weekday\">".ucwords(substr($weekdays_list[$i], 0, 3))."</th>";
}
echo "</tr>";
# DNY V TYDNU
echo "<tr>";
for($this_dow=0; $this_dow<$this_fdow; $this_dow++) { echo "<td> </td>"; }
for($i=1; $i<=$this_ndays; $i++) {
$i = sprintf("%02s",$i);
$this_date = sprintf("%04s%02s%02s",$this_year,$this_month,$i);
if (++$this_dow == "8") {
$this_dow = "1";
echo "</tr><tr>";
}
$this_date_timestamp = strtotime($this_date);
if ($this_date_timestamp == $a_end_date ){
if ($row = mysql_fetch_row($a_rs)){;
$a_start_date = strtotime($row[0]);
$a_end_date = strtotime($row[1]);
$a_available = $row[2];
}
}
echo "<td align=\"center\" width=\"22\" class=\"td-day\">";
$new_date = $this_date;
$current_year = date("Y");
$current_month = date("m");
$current_day = date("d");
$current_month_txt = system_showDate("F");
$current_yyyy_mm = $current_year.$current_month;
$current_yyyy_mm_dd = $current_year.$current_month.$current_day;
if (($_GET["this_date"]) && ($_GET["this_date"] == $this_date) && (!$_GET["month"]) && ($_GET["search_by_day"])) {
$date_style = $i;
$day_class = "normal";
} elseif ((($_GET["month"] == $current_yyyy_mm) && ($current_yyyy_mm_dd == $this_date)) || (($current_yyyy_mm_dd == $this_date) && (!$_GET["month"]))) {
$date_style = $i;
$day_class = "today";
} else {
$date_style = $i;
$day_class = "dayclass";
}
echo "<a href=\"javascript:set_cal_date('".$this_date."')\" class='$day_class'>".$date_style."</a>";
echo "</td>";
}
for($i=$this_dow;$i<7;$i++) { echo "<td> </td>"; }
echo "</tr></table>\n";
echo "</td></tr></table>";
echo "</td>";
}
echo "</tr></table>";
}
?>
|
||
| Cargas Profil |
#2 · Zasláno: 5. 3. 2009, 22:35:25 · Upravil/a: Cargas
tezko rict .... zkus
radek 122 .... for($i=$this_dow;$i<=7;$i++) { echo "<td> </td>"; } |
||
| ninja Profil |
#3 · Zasláno: 6. 3. 2009, 00:08:16
Miky: manual jsi cetl?
w Numeric representation of the day of the week 0 (for Sunday) through 6 (for Saturday) |
||
| Daniel01 Profil |
#4 · Zasláno: 6. 3. 2009, 02:19:08
|
||
| Miky Profil * |
#5 · Zasláno: 6. 3. 2009, 15:09:00
ninja: Takze jak mam udelat abych to mel normalne? Jak dosadim N je to to same.
|
||
| Joker Profil |
#6 · Zasláno: 6. 3. 2009, 15:37:03
Miky
Amíci mají prostě jako první den týdne neděli. Je potřeba to o den šoupnout |
||
| Miky Profil * |
#7 · Zasláno: 6. 3. 2009, 15:41:08
Joker: Jasný, ale nechápu jak..
|
||
| Miky Profil * |
#8 · Zasláno: 7. 3. 2009, 11:41:26
Muze mi nekdo poradit?
|
||
| ninja Profil |
#9 · Zasláno: 7. 3. 2009, 16:04:26
Miky: zkuste pouzit hlavu, Situace je jasna. Pondeli = 1, ... sobota = 6, nedele = 0. Upravte si cyklus a pridejte jednu podminku.
|
||
|
Časová prodleva: 18 let
|
|||
0