- 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
- 43
$w=isset($_POST['w'])?(int)$_POST['w']:time();
$p=$w-(24*3600)*7;
$n=$w+(24*3600)*7;
mysql_query("set @start=date_format(date_sub(from_unixtime($w), interval weekday(from_unixtime($w)) day), '%m%d'),
@end=date_format(date_add(from_unixtime($w), interval 6-weekday(from_unixtime($w)) day), '%m%d')");
$ste=mysql_fetch_assoc(mysql_query('select @start as s,@end as e'));
if($_SESSION['userinfo']['login']=='Stormsfb') echo "date_format(date_sub(from_unixtime($w), interval weekday(from_unixtime($w)) day), '%m%d') <br>date_format(date_add(from_unixtime($w), interval 6-weekday(from_unixtime($w)) day), '%m%d')<br>".
"select *,unix_timestamp(d) as u,
date_format(d,'%e %b') as dm,
date_format(d,'%m%d') as md,
date_format(d,'%d.%m.%y') as mdf from users where
date_format(d, '%m%d') between
".($_POST['month']!='false'?
date('m',$w).'01 and '.date('mt',$w):
($ste['s']>$ste['e']?' @start and 1231
or date_format(d, "%m%d") between '.date('m',$n).'01 and @end ':' @start and @end '))." order by ".($_POST['month']=='false'?'weekday(d)':'date_format(d,"%m%d")');
$q=mysql_query("select *,unix_timestamp(d) as u,
date_format(d,'%e %b') as dm,
date_format(d,'%m%d') as md,
date_format(d,'%d.%m') as mdf from users where
date_format(d, '%m%d') between
".($_POST['month']!='false'?
date('m',$w).'01 and '.date('mt',$w):
($ste['s']>$ste['e']?' @start and 1231
or date_format(d, "%m%d") between '.date('m',$n).'01 and @end ':' @start and @end '))." order by ".($_POST['month']=='false'?'md':'date_format(d,"%m%d")'),_LINK_) or die(mysql_error(_LINK_)); // || $ste['s']>$ste['e']
/*
это пиздец
"select *,unix_timestamp(d) as u,
date_format(d,'%e %b') as dm,
date_format(d,'%m%d') as md,
date_format(d,'%d.%m') as mdf from users where
date_format(d, '%m%d') between
".($_POST['month']!='false'?
date('m',$w).'01 and '.date('mt',$w):
($ste['s']>$ste['e']?' @start and 1231
union select *,unix_timestamp(d) as u,
date_format(d,"%e %b") as dm,
date_format(d,"%m%d") as md,
date_format(d,"%d.%m") as mdf from users where
date_format(d, "%m%d")
between '.date('m',$n).'01 and @end ':' @start and @end '))." order by date_format(d, '%m%d')"
*/
yasenhui 05.08.2011 18:32 # 0
Vasiliy 06.08.2011 21:15 # +1