1
2
3
4
5
6
7
8
9
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
44
45
46
47
48
49
50
51
52
53
|
<? $intro_page = "Y"; include_once("./_common.php");
include("../../manage/category/common.php");
$sql = "select * from holidays where y = '' or y = '".date("Y")."' "; $res = mysql_query($sql); while($info = mysql_fetch_array($res)){ if($info['y']==''){ $holi[date("Y")."-".$info['m-d']] = "Y"; } else { $holi[$info['y']."-".$info['m-d']] = "Y"; } }
function not_holy_rtn($date){ Global $holi; $time = strtotime($date); $w = date("w",$time); if($w=='0' || $w=='6'){ _pr("{$date} ÈÞÀÏ"); $date = date("Y-m-d",$time-(60*60*24)); return not_holy_rtn($date); } else { if($holi[$date]=='Y'){ _pr("{$date} ÈÞÀÏ"); $date = date("Y-m-d",$time-(60*60*24)); return not_holy_rtn($date); } } return $date; }
$w = date("w"); echo $w;
/*$sql = "select * from holidays where y = '' or y = '".date("Y")."' "; $res = mysql_query($sql); while($info = mysql_fetch_array($res)){
}*/
$cur_date = date("Y-m-d",time()-(60*60*24)); $time = strtotime("2020-10-03"); $cur_date = date("Y-m-d",$time); $ck_date = $cur_date; $c_date = not_holy_rtn($cur_date); echo $c_date; $c_date = date("m/d");
?>
|