番組表


番組表を表示します。 \n"; $yesterday = date ("YmdHi",mktime($starthour , 0 , 0, $startmonth , $startday -1 , $startyear)); $today0400 = date ("YmdHi",mktime(4 , 0 , 0, $startmonth , $startday , $startyear)); $today1200 = date ("YmdHi",mktime(12 , 0 , 0, $startmonth , $startday , $startyear)); $today2000 = date ("YmdHi",mktime(20 , 0 , 0, $startmonth , $startday , $startyear)); $day1after = date ("YmdHi",mktime($starthour , 0 , 0, $startmonth , $startday +1 , $startyear)); $day1 = date ("m/d",mktime($starthour , 0 , 0, $startmonth , $startday +1 , $startyear)); $day2after = date ("YmdHi",mktime($starthour , 0 , 0, $startmonth , $startday +2 , $startyear)); $day2 = date ("m/d",mktime($starthour , 0 , 0, $startmonth , $startday +2 , $startyear)); $day3after = date ("YmdHi",mktime($starthour , 0 , 0, $startmonth , $startday +3 , $startyear)); $day3 = date ("m/d",mktime($starthour , 0 , 0, $startmonth , $startday +3 , $startyear)); $day4after = date ("YmdHi",mktime($starthour , 0 , 0, $startmonth , $startday +4 , $startyear)); $day4 = date ("m/d",mktime($starthour , 0 , 0, $startmonth , $startday +4 , $startyear)); $day5after = date ("YmdHi",mktime($starthour , 0 , 0, $startmonth , $startday +5 , $startyear)); $day5 = date ("m/d",mktime($starthour , 0 , 0, $startmonth , $startday +5 , $startyear)); $day6after = date ("YmdHi",mktime($starthour , 0 , 0, $startmonth , $startday +6 , $startyear)); $day6 = date ("m/d",mktime($starthour , 0 , 0, $startmonth , $startday +6 , $startyear)); $day7after = date ("YmdHi",mktime($starthour , 0 , 0, $startmonth , $startday +7 , $startyear)); $day7 = date ("m/d",mktime($starthour , 0 , 0, $startmonth , $startday +7 , $startyear)); //表示局選定 // $page = 1 ~ $maxdisplay = 8; $query = "SELECT stationid, stationname, stationrecch, ontvcode FROM foltia_station WHERE \"ontvcode\" ~~ '%ontvjapan%' "; $rs = m_query($con, $query, "DBクエリに失敗しました"); $maxrows = pg_num_rows($rs); if ($maxrows > $maxdisplay){ $pages = ceil($maxrows / $maxdisplay) ; } $page = getgetnumform(p); if (($page == "")|| ($page <= 0) ){ $page = 1 ; $offset = 0 ; }else{ $page = ereg_replace( "[^0-9]", "", $page); if ($page > $pages){ $page = $pages ; }elseif ($page <= 0) { $page = 1 ; } $offset = ($page * $maxdisplay ) - $maxdisplay; } print "←前の日 現在 当日(4:00 12:00 20:00) 次の日 $day2 $day3 $day4 $day5 $day6 $day7
\n"; if ($maxrows > $maxdisplay){ //複数ページ //$pages = ceil($maxrows / $maxdisplay) ; if ($page > 1){ $beforepage = $page - 1; print ""; } print " $page / $pages (放送局) "; if ($page < $pages){ $nextpage = $page + 1; print ""; } } $query = "SELECT stationid, stationname, stationrecch, ontvcode FROM foltia_station WHERE \"ontvcode\" ~~ '%ontvjapan%' ORDER BY stationid ASC , stationrecch OFFSET $offset LIMIT $maxdisplay "; $rs = m_query($con, $query, "DBクエリに失敗しました"); //print ""; $viewstations = pg_num_rows($rs); print "

"; for ($i=0 ; $i < $viewstations ; $i++){ $rowdata = pg_fetch_row($rs, $i); if ($rowdata[1] != ""){ print " \n"; } } print " "; for ($i=0 ; $i < $viewstations ; $i++){ $rowdata = pg_fetch_row($rs, $i); if ($rowdata[3] != ""){ print "\n"; } } print "
$rowdata[1]
"; renderepgstation($con,$rowdata[3],$start); print "
"; ?>