"); //print("htmlcolumnfile='".$htmlcolumnfile."'
"); // システム設定CSVから新着・イベント情報の取得 $csvfile = "../".$DATA_DIRECTORY_NAME."/".$COMMON_CSV_FILE_NAME; $fp = fopen($csvfile, "r"); while ($data = fgetcsv($fp, 100000)) { $common_list[] = $data; } $max = count($common_list); for($i=0;$i<$max;$i++) { $csvfile = $common_list[$i][2]; } // CSVデータの取得 $i = 0; $fp = fopen($csvfile, "r"); while ($data = fgetcsv($fp, 100000)) { // CSVファイルを1行ごとに読み込み $w_data_list[] = $data; } $data_cnt = count($w_data_list); // テンプレートHTMLの取得 $html = template_file_read($htmlfile); // 外枠HTMLの取得 $frame_html = template_file_read($htmlframefile); // カラムHTMLの取得 $column_html = template_file_read($htmlcolumnfile); $html = str_replace("%_CALENDER_%", $frame_html, $html); $day = getdate(); $O_calendar = new calendar(0, 1); //$calendar_data = $O_calendar->show_calendar($day["year"], $day["mon"], $day["mday"]); // if (! checkdate($mo,1,$ye) ) { $ye = $day["year"]; $mo = $day["mon"]; } $calendar_data = $O_calendar->show_calendar($ye, $mo); // $days_html = ""; $max = count($calendar_data); for ($i=0; $i<$max; $i++){ // イベントの生成 $data = $calendar_data[$i]["holiday"]; if ($calendar_data[$i]["holiday"] != "") { $data .= "
"; } // イベントCSVからデータを取得(同じ日にイベントが複数件になる場合あり) $event_cnt = 0; for ($j=0; $j<$data_cnt; $j++){ //print("w_data_list[j][6]='".$w_data_list[$j][6]."'
"); //print("str_calendar_data='".$str_calendar_data."'
"); $str_calendar_data = $calendar_data[$i]["year"]."/".date_format($calendar_data[$i]["month"])."/".date_format($calendar_data[$i]["day"]); if (trim($w_data_list[$j][6]) == trim($str_calendar_data) ){ $data .= "".$w_data_list[$j][2]."
"; if ($event_cnt > 0){ $data .= "
"; } } $event_cnt++; } $day_html = $column_html; $day_html = str_replace("%_BGCOLOR_%", $calendar_data[$i]["bgcolor"], $day_html); $day_html = str_replace("%_DAY_%" , $calendar_data[$i]["day"] , $day_html); $day_html = str_replace("%_WEEK_%" , $calendar_data[$i]["week"] , $day_html); $day_html = str_replace("%_DATA_%" , $data , $day_html); $days_html .= $day_html; } // 日付の表示 $today = getdate(); $month_html = $ye."年".$mo."月"; // $schk = "off"; $fst = strtotime(" -1 month"); $schk = ""; /* $fm = "Y年n月"; $ym = date($fm, $fst); $y = date("Y", $fst); $n = date("n", $fst); $month_page_html .= "".$ym.""; $fst = strtotime(" -1 month"); */ //$ymd_date = getdate(mktime(0, 0, 0, $n+$x+1, 1, $fy)); $ymd_date = getdate(); $month_page_html .= sprintf(' %d年%d月',$ymd_date['year'], $ymd_date['mon'], $ymd_date['year'], $ymd_date['mon']); $n = $ymd_date['mon']; // 月の表示 for($x=0; $x<6; $x++){ $st = strtotime(" +".$x." month"); $fy = date("Y", $st); $fn = date("n", $st); // print("fy=".$fy."
"); // print("fn=".$fn."

"); // print("n=".$n."
"); // print("x=".$x."

"); // print("year=".$ymd_date['year']."
"); // 日付 $mkmonth = $n + $x + 1; // print("mkmonth=".$mkmonth."
"); // $next_date = getdate(mktime(0, 0, 0, $mkmonth, 1, $fy)); $next_date = getdate(mktime(0, 0, 0, $mkmonth, 1, $ymd_date['year'])); // print_r($next_date); // print("

"); // print_r("TEST='".getdate(mktime(0, 0, 0, 14, 1, 2007))."'

"); $month_page_html .= sprintf(' %d月', $next_date['year'], $next_date['mon'], $next_date['mon']); /* if ( ((trim($y)) != (trim($fy))) && ($schk != "on") ) { $schk = "on"; $fm = "Y年n月"; $ym = date($fm, $st); $month_page_html .= "
"."".$ym.""; }else{ $fm = "n月"; $ym = date($fm, $st); $month_page_html .= " "."".$ym.""; } */ } // データの置き換え $html = str_replace("%_MONTH_%", $month_html, $html); $html = str_replace("%_MONTH_PAGE_%", $month_page_html, $html); $html = str_replace("%_DAYS_%", $days_html, $html); // HTMLの表示 print($html); ?>