= 2008){ $year[$count]['label'] = $count.'年'; $year[$count]['link'] = '/en/game/schedule/'; $year[$count]['link'] .=$count.$m.'/'; $count --; } // カレンダー用配列作成 2014/03/26 Hosaka $d = 1; $calendar = array(); $week = array(); $first_day_of_num = date('w', mktime( 0, 0, 0, $m, $d, $y)); if($first_day_of_num > 0) { for($i = 0; $i < $first_day_of_num; $i++) { $week[$i] = 0; } } while (checkdate($m, $d, $y)) { $week_of_date = date('w', mktime( 0, 0, 0, $m, $d, $y)); $week[$week_of_date] = $d; if($week_of_date == '6') { $calendar[] = $week; $week = array(); } $d++; } if(count($week) < 6 && count($week) > 0) { for($i = count($week); $i < 7; $i++) { $week[$i] = 0; } } $calendar[] = $week; // 試合日程の取得 $sstart = date('Y-m-d',strtotime($y.$m.'01')); $ssend = date('Y-m-d',strtotime($sstart.' +1 month')); $date['yyyymm'] = $ym; $date['Y'] = $y; $date['m'] = (int)$m; $date['month_name'] = date('F',strtotime($y.$m.'01')); $date['today'] = $today; $navi['prev'] = '/en/game/schedule/'.date('Ym',strtotime($ym.'01 -1 month')).'/'; $navi['next'] = '/en/game/schedule/'.date('Ym',strtotime($ym.'01 +1 month')).'/'; /*if($team){ $navi['prev'] = '/en/game/schedule/'.$team.'/'.date('Ym',strtotime($ym.'01 -1 month')).'/'; $navi['next'] = '/en/game/schedule/'.$team.'/'.date('Ym',strtotime($ym.'01 +1 month')).'/'; }*/ //unset($list); //print_r($mlist); //unset($mlist); $game = PcUtil::GetGameResultMonth(array('yyyymmdd'=>$sstart,'homerun'=>1,'versus'=>1), 'en'); $broad = PcUtil::GetBroadCastMonth(array('yyyymmdd'=>$sstart)); //print_r($broad); if($game){ $count = 1; foreach($game as $key=>$val){ if($count % 2){ $list[$key]['trClass'] = 'wt'; } else { $list[$key]['trClass'] = 'statsTable01'; } $list[$key]['day'] = date('j',strtotime($key)); $w = date('w',strtotime($key)); $list[$key]['wday'] = $WEEKDAY[$w]; if($w == 0){ $list[$key]['dateClass'] = 'colorSun01 '; } elseif($w == 6){ $list[$key]['dateClass'] = 'colorSat01 '; } else { $list[$key]['dateClass'] = 'date '; } if($val[0]){ $list[$key]['game'][0] = CorrectStatus($val[0]); $list[$key]['gcount'] ++; } if($val[1]){ $list[$key]['game'][1] = CorrectStatus($val[1]); $list[$key]['gcount'] ++; } if($broad[$key]){ $list[$key]['broad'] = $broad[$key]; } $d = date('j',strtotime($key)); if($d <= 10){ if(!$mlist[1]['start']) { $mlist[1]['start'] = $d; } $mlist[1]['end'] = $d; } elseif($d <= 20){ if(!$mlist[2]['start']){ $mlist[2]['start'] = $d; } $mlist[2]['end'] = $d; } else { if(!$mlist[3]['start']) { $mlist[3]['start'] = $d; } $mlist[3]['end'] = $d; } if($list[$key]['game']['0']['homeflg'] == '0' AND ($list[$key]['game']['0']['vsN'] == 'ct' || $list[$key]['game']['0']['vsN'] == 'cd')){ $list[$key]['game']['0']['movie'] = ''; } // -- added 2013/08/28 Yoshikawa $Ymd = date("Ymd", strtotime($key)); if ( isset($aryLEGEND_DAYS) && $aryLEGEND_DAYS[$Ymd] != "" ) { $leg2013_imgdir = $aryLEGEND_DAYS[$Ymd]; if ( $list[$key]['game']['0']['vsIcon'] ) { $vsimg = basename($list[$key]['game']['0']['vsIcon']); $list[$key]['game']['0']['vsIcon'] = str_replace($vsimg, $leg2013_imgdir . "/" . $vsimg, $list[$key]['game']['0']['vsIcon']); } } // added 2013/08/28 Yoshikawa -- $count ++; } } function CorrectStatus($arr){ //print_r($arr); global $list; switch($arr['sCode']){ case '000': case '700': case '800': unset($arr['dstartp']); // unset($arr['start']); break; case '600': case '699': // unset($arr['start']); break; case '900': // unset($arr['start']); $list[$arr['date']]['trClass'] = 'no'; break; case '901': // unset($arr['start']); $list[$arr['date']]['trClass'] = 'no'; break; } switch($arr['sflg']){ case '1': case '2': case '3': // unset($arr['start']); $list[$arr['date']]['trClass'] = 'no'; break; case '4': // unset($arr['start']); break; } if((strtotime($arr['date']) > strtotime(date('Y-m-d'))) and (!$arr['report']) or (!isset($arr['score']))){ unset($arr['glink']); } return $arr; } $_SMARTY->assign("list",$list); $_SMARTY->assign("calendar",$calendar); $_SMARTY->assign("month",$month); $_SMARTY->assign("year",$year); $_SMARTY->assign("navi",$navi); $_SMARTY->assign("date",$date); $_SMARTY->assign("team_id",$team); $_SMARTY->assign("title_for_layout", "試合日程・結果"); $_SMARTY->assign("mlist",$mlist); $_SMARTY->assign("link",$link); $_SMARTY->assign("meta",$meta); $_SMARTY->assign("SMPFLG",$SMPFLG); $_SMARTY->assign("SMPURL",$SMPURL); $_SMARTY->display($tpl,$cache_key); //print_r($game); ?>