- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
<?
if ($GET['cat'] == 'read') $y=date("Y");
else $y=$GET['cat'] ;
if ($GET['alb'] == 'read') $m=date("m");
else $m=$GET['alb'] ;
if (!isset($y) OR $y < 1970 OR $y > 2037) $y=date("Y");
if (!isset($m) OR $m < 1 OR $m > 12) $m=date("m");
include_once './libs/mysql.php';
$res='';
$rows='';
$date_array = array();
$arraycount=1;
$res = mysqlQuery("SELECT *
FROM `". BG_DBPREFIX ."calendar`
WHERE YEAR(date)=".$y." AND MONTH(date)=".$m."
ORDER BY date ASC"
);
if(mysql_num_rows($res) > 0) // Если записи есть, вытаскиваем по одной в цикле
{
while($rows = htmlChars(mysql_fetch_assoc($res))) // попутно обрабатывая функцией htmlChars()
{
$date_array[$arraycount]['id']=$rows['id'];
$date_array[$arraycount]['date']=$rows['date'];
$date_array[$arraycount]['name']=$rows['name'];
$date_array[$arraycount]['status']=$rows['status'];
$arraycount++;
};
}
$prev_y=date('Y',mktime (0,0,0,$m-1,1,$y));
$prev_m=date('m',mktime (0,0,0,$m-1,1,$y));
$next_y=date('Y',mktime (0,0,0,$m+1,1,$y));
$next_m=date('m',mktime (0,0,0,$m+1,1,$y));
echo "<a href=\"".href('cat='.$prev_y,'alb='.$prev_m)."\">Prev</a>";
echo "<a href=\"".href('cat='.$next_y,'alb='.$next_m)."\">Next</a>";
tr00_gr1m_doomster 22.03.2011 11:57 # +1
rO_ot 22.03.2011 23:02 # +1
Vasiliy 22.03.2011 23:06 # 0
Lure Of Chaos 23.03.2011 18:14 # 0
Vasiliy 23.03.2011 20:35 # 0
istem 22.03.2011 23:41 # 0
Lure Of Chaos 23.03.2011 18:09 # +1