='$todayMySQL' order by sq is NULL DESC, sq";
}
$result = $db->query($sql);
if (!$result){
print ("SQLの実行に失敗しました:イベント情報一覧読出
");
print('$sql='.$sql.'
');
exit;
} else {
$news_data = $result->fetchAll(PDO::FETCH_ASSOC);
}
$page_html = str_replace('###NEWSLIST###', listNews($news_data), $page_html);
$page_html = str_replace('###TAB0###', $tab[0], $page_html);
$page_html = str_replace('###TAB1###', $tab[1], $page_html);
$page_html = str_replace('###TAB2###', $tab[2], $page_html);
//イベントカレンダー
//最終週
$sql = "select endday from news where shop_code='event' and exp=1 and startday<='$todayMySQL' and lastday>='$todayMySQL' order by endday DESC limit 1";
$result = $db->query($sql);
if (!$result){
print ("SQLの実行に失敗しました:イベントカレンダー最終週読出
");
print('$sql='.$sql.'
');
exit;
} else {
$data = $result->fetch(PDO::FETCH_ASSOC);
}
$last_endday = $data['endday'];
$last_endday_week = date('w', strtotime($last_endday));
if($last_endday_week == 0) $last_endday_week = 7;
//最終週月曜日
$last_monday = date('Y-m-d', strtotime('-'.($last_endday_week-1).' day '.$last_endday));
//今週の月曜日
$this_monday = date('Y-m-d', strtotime('Monday this week'));
if($this_monday > date("Y-m-d")) $this_monday = date('Y-m-d', strtotime('Monday last week'));
//最終週まで何週(何画面)
$cal_pages = (strtotime($last_monday) - strtotime($this_monday)) / (7*60*60*24) + 1;
/*
print('$this_monday='.$this_monday.' / ');
print('$last_monday='.$last_monday.' / ');
print('$cal_pages='.$cal_pages.'
');
*/
$cal_html = '';
$slot = array();
$num_max = 1;
$pre_row = 0;
for($i=0;$i<$cal_pages;$i++){
$cal_html .= '
| '.date('n/j', strtotime($p_day)).' ('.$week_arry[$p].') | '.chr(10);
}
$cal_html .= '
|---|
| '.chr(10); } $cal_html .= ' |
');
print_r($events);
print('');
*/
if(count($events) > 0){
$e = 0;
foreach($events as $data){
//日数
$op_utime = strtotime($data['openday']);
$ev_days = (strtotime($data['endday']) - $op_utime) / (60*60*24) + 1;
//print('$ev_days='.$ev_days.'');
print_r($slot);
print('');
*/
print(Qde($page_html));
?>