get_lecture_season_list(1); $this->smarty->assign("m_list",$m_list); $m_count = count($m_list); $this->smarty->assign("m_count",$m_count); $this->smarty->assign("m_row_count",ceil($m_count/2)); $y_list = $this->get_lecture_season_list(2); $this->smarty->assign("y_list",$y_list); $y_count = count($y_list); $this->smarty->assign("y_count",$y_count); $this->smarty->assign("y_row_count",ceil($y_count/2)); $s_list = $this->get_lecture_season_list(3); $this->smarty->assign("s_list",$s_list); $s_count = count($s_list); $this->smarty->assign("s_count",$s_count); $this->smarty->assign("s_row_count",ceil($s_count/2)); $this->smarty->assign("rowspan",ceil($m_count/2)+1+ceil($y_count/2)+1+ceil($s_count/2)+1); /* $time = time(); $date = getdate($time); $now = sprintf("1%02d%02d",$date["mon"],$date["mday"]); $season_text = ""; if($now >= 10301 && $now < 10801) { $season_text = "夏期"; } //夏 if($now >= 10801 && $now < 11001) { $season_text = "夏期"; } //秋 if($now >= 11001 && $now < 11201) { $season_text = "秋期"; } //冬 if($now >= 11201 || $now < 10301) { $season_text = "冬季"; } */ $date = getdate(time()); $season = $this->get_season_id(); $season_text = $this->get_season_text($season); $this->smarty->assign("season_id",$season); $this->smarty->assign("season_text",$season_text); $this->smarty->assign("now_year",$date["year"]); } protected function get_lecture_season_list($class) { /* $time = time(); $date = getdate($time); $now = sprintf("1%02d%02d",$date["mon"],$date["mday"]); $add_where = ""; //春 if($now >= 10301 && $now < 10801) { $add_where .= " and season = 1 "; } //夏 if($now >= 10801 && $now < 11001) { $add_where .= " and season = 2 "; } //秋 if($now >= 11001 && $now < 11201) { $add_where .= " and season = 3 "; } //冬 if($now >= 11201 || $now < 10301) { } */ $season_id = $this->get_season_id(); $add_where = " and season = ? "; $params = array($season_id); $add_where .= " and class = ? "; // $params = array($class); array_push($params,$class); $date = getdate(time()); if(strcmp($date["mon"],1) == 0 ) { $date["year"]--; } $add_where .= " and year = ? "; array_push($params,$date["year"]); $sql = "select * from t_lecture_season where status = 1 ".$add_where." order by lecture_season_id"; $list = $this->db->get_all($sql,$params); return $list; } } new ExPage(); ?>