| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
?> |
|---|
| 19 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
|---|
| 20 |
<html lang="ja"> |
|---|
| 21 |
<head> |
|---|
| 22 |
<meta http-equiv="Content-Type" content="text/html; charset=EUC-JP"> |
|---|
| 23 |
<meta http-equiv="Content-Style-Type" content="text/css"> |
|---|
| 24 |
<link rel="stylesheet" type="text/css" href="graytable.css"> |
|---|
| 25 |
<title>foltia:EPG</title> |
|---|
| 26 |
</head> |
|---|
| 27 |
|
|---|
| 28 |
<?php |
|---|
| 29 |
include("./foltialib.php"); |
|---|
| 30 |
|
|---|
| 31 |
$con = m_connect(); |
|---|
| 32 |
|
|---|
| 33 |
$start = getgetnumform(start); |
|---|
| 34 |
|
|---|
| 35 |
if ($start == ""){ |
|---|
| 36 |
$start = date("YmdHi"); |
|---|
| 37 |
}else{ |
|---|
| 38 |
$start = ereg_replace( "[^0-9]", "", $start); |
|---|
| 39 |
} |
|---|
| 40 |
|
|---|
| 41 |
?> |
|---|
| 42 |
|
|---|
| 43 |
<body BGCOLOR="#ffffff" TEXT="#494949" LINK="#0047ff" VLINK="#000000" ALINK="#c6edff" > |
|---|
| 44 |
<div align="center"> |
|---|
| 45 |
<?php |
|---|
| 46 |
printhtmlpageheader(); |
|---|
| 47 |
?> |
|---|
| 48 |
<p align="left"><font color="#494949" size="6">番組表</font></p> |
|---|
| 49 |
<hr size="4"> |
|---|
| 50 |
<p align="left">番組表を表示します。 |
|---|
| 51 |
<?php |
|---|
| 52 |
|
|---|
| 53 |
$startyear = substr($start,0,4); |
|---|
| 54 |
$startmonth = substr($start,4,2); |
|---|
| 55 |
$startday = substr($start,6,2); |
|---|
| 56 |
$starthour = substr($start,8,2); |
|---|
| 57 |
$startmin = substr($start,10,2); |
|---|
| 58 |
print "($startyear/$startmonth/$startday $starthour:$startmin-)<BR>\n"; |
|---|
| 59 |
|
|---|
| 60 |
$yesterday = date ("YmdHi",mktime($starthour , 0 , 0, $startmonth , $startday -1 , $startyear)); |
|---|
| 61 |
$today0400 = date ("YmdHi",mktime(4 , 0 , 0, $startmonth , $startday , $startyear)); |
|---|
| 62 |
$today1200 = date ("YmdHi",mktime(12 , 0 , 0, $startmonth , $startday , $startyear)); |
|---|
| 63 |
$today2000 = date ("YmdHi",mktime(20 , 0 , 0, $startmonth , $startday , $startyear)); |
|---|
| 64 |
$day1after = date ("YmdHi",mktime($starthour , 0 , 0, $startmonth , $startday +1 , $startyear)); |
|---|
| 65 |
$day1 = date ("m/d",mktime($starthour , 0 , 0, $startmonth , $startday +1 , $startyear)); |
|---|
| 66 |
$day2after = date ("YmdHi",mktime($starthour , 0 , 0, $startmonth , $startday +2 , $startyear)); |
|---|
| 67 |
$day2 = date ("m/d",mktime($starthour , 0 , 0, $startmonth , $startday +2 , $startyear)); |
|---|
| 68 |
$day3after = date ("YmdHi",mktime($starthour , 0 , 0, $startmonth , $startday +3 , $startyear)); |
|---|
| 69 |
$day3 = date ("m/d",mktime($starthour , 0 , 0, $startmonth , $startday +3 , $startyear)); |
|---|
| 70 |
$day4after = date ("YmdHi",mktime($starthour , 0 , 0, $startmonth , $startday +4 , $startyear)); |
|---|
| 71 |
$day4 = date ("m/d",mktime($starthour , 0 , 0, $startmonth , $startday +4 , $startyear)); |
|---|
| 72 |
$day5after = date ("YmdHi",mktime($starthour , 0 , 0, $startmonth , $startday +5 , $startyear)); |
|---|
| 73 |
$day5 = date ("m/d",mktime($starthour , 0 , 0, $startmonth , $startday +5 , $startyear)); |
|---|
| 74 |
$day6after = date ("YmdHi",mktime($starthour , 0 , 0, $startmonth , $startday +6 , $startyear)); |
|---|
| 75 |
$day6 = date ("m/d",mktime($starthour , 0 , 0, $startmonth , $startday +6 , $startyear)); |
|---|
| 76 |
$day7after = date ("YmdHi",mktime($starthour , 0 , 0, $startmonth , $startday +7 , $startyear)); |
|---|
| 77 |
$day7 = date ("m/d",mktime($starthour , 0 , 0, $startmonth , $startday +7 , $startyear)); |
|---|
| 78 |
|
|---|
| 79 |
|
|---|
| 80 |
|
|---|
| 81 |
|
|---|
| 82 |
|
|---|
| 83 |
$maxdisplay = 8; |
|---|
| 84 |
|
|---|
| 85 |
$query = "SELECT stationid, stationname, stationrecch, ontvcode FROM foltia_station WHERE \"ontvcode\" ~~ '%ontvjapan%' |
|---|
| 86 |
"; |
|---|
| 87 |
$rs = m_query($con, $query, "DBクエリに失敗しました"); |
|---|
| 88 |
$maxrows = pg_num_rows($rs); |
|---|
| 89 |
|
|---|
| 90 |
if ($maxrows > $maxdisplay){ |
|---|
| 91 |
$pages = ceil($maxrows / $maxdisplay) ; |
|---|
| 92 |
} |
|---|
| 93 |
|
|---|
| 94 |
$page = getgetnumform(p); |
|---|
| 95 |
|
|---|
| 96 |
if (($page == "")|| ($page <= 0) ){ |
|---|
| 97 |
$page = 1 ; |
|---|
| 98 |
$offset = 0 ; |
|---|
| 99 |
}else{ |
|---|
| 100 |
$page = ereg_replace( "[^0-9]", "", $page); |
|---|
| 101 |
if ($page > $pages){ |
|---|
| 102 |
$page = $pages ; |
|---|
| 103 |
}elseif ($page <= 0) { |
|---|
| 104 |
$page = 1 ; |
|---|
| 105 |
} |
|---|
| 106 |
$offset = ($page * $maxdisplay ) - $maxdisplay; |
|---|
| 107 |
} |
|---|
| 108 |
|
|---|
| 109 |
|
|---|
| 110 |
print "←<A HREF=\"./viewepg.php?p=$page&start=$yesterday\">前の日</A> <A HREF=\"./viewepg.php\">現在</A> 当日(<A HREF=\"./viewepg.php?p=$page&start=$today0400\">4:00</A> <A HREF=\"./viewepg.php?p=$page&start=$today1200\">12:00</A> <A HREF=\"./viewepg.php?p=$page&start=$today2000\">20:00</A>) <A HREF=\"./viewepg.php?p=$page&start=$day1after\">次の日</A> <A HREF=\"./viewepg.php?p=$page&start=$day2after\">$day2</A> <A HREF=\"./viewepg.php?p=$page&start=$day3after\">$day3</A> <A HREF=\"./viewepg.php?p=$page&start=$day4after\">$day4</A> <A HREF=\"./viewepg.php?p=$page&start=$day5after\">$day5</A> <A HREF=\"./viewepg.php?p=$page&start=$day6after\">$day6</A> <A HREF=\"./viewepg.php?p=$page&start=$day7after\">$day7</A>→<BR>\n"; |
|---|
| 111 |
|
|---|
| 112 |
|
|---|
| 113 |
|
|---|
| 114 |
if ($maxrows > $maxdisplay){ |
|---|
| 115 |
|
|---|
| 116 |
|
|---|
| 117 |
if ($page > 1){ |
|---|
| 118 |
$beforepage = $page - 1; |
|---|
| 119 |
print "<a href = \"./viewepg.php?p=$beforepage&start=$start\">←</A>"; |
|---|
| 120 |
} |
|---|
| 121 |
|
|---|
| 122 |
print " $page / $pages (放送局) "; |
|---|
| 123 |
|
|---|
| 124 |
if ($page < $pages){ |
|---|
| 125 |
$nextpage = $page + 1; |
|---|
| 126 |
print "<a href = \"./viewepg.php?p=$nextpage&start=$start\">→</A>"; |
|---|
| 127 |
} |
|---|
| 128 |
} |
|---|
| 129 |
|
|---|
| 130 |
|
|---|
| 131 |
$query = "SELECT stationid, stationname, stationrecch, ontvcode FROM foltia_station WHERE \"ontvcode\" ~~ '%ontvjapan%' ORDER BY stationid ASC , stationrecch OFFSET $offset LIMIT $maxdisplay |
|---|
| 132 |
"; |
|---|
| 133 |
$rs = m_query($con, $query, "DBクエリに失敗しました"); |
|---|
| 134 |
|
|---|
| 135 |
|
|---|
| 136 |
$viewstations = pg_num_rows($rs); |
|---|
| 137 |
print "</p> |
|---|
| 138 |
<table width=\"100%\" border=\"0\"> |
|---|
| 139 |
<tbody> |
|---|
| 140 |
<tr class=\"kyoku\"> |
|---|
| 141 |
"; |
|---|
| 142 |
for ($i=0 ; $i < $viewstations ; $i++){ |
|---|
| 143 |
$rowdata = pg_fetch_row($rs, $i); |
|---|
| 144 |
if ($rowdata[1] != ""){ |
|---|
| 145 |
print " <th scope=\"col\">$rowdata[1]</th>\n"; |
|---|
| 146 |
} |
|---|
| 147 |
} |
|---|
| 148 |
|
|---|
| 149 |
print " </tr> |
|---|
| 150 |
|
|---|
| 151 |
<tr valign = top> |
|---|
| 152 |
"; |
|---|
| 153 |
for ($i=0 ; $i < $viewstations ; $i++){ |
|---|
| 154 |
$rowdata = pg_fetch_row($rs, $i); |
|---|
| 155 |
if ($rowdata[3] != ""){ |
|---|
| 156 |
print "<td>"; |
|---|
| 157 |
renderepgstation($con,$rowdata[3],$start); |
|---|
| 158 |
print "</td>\n"; |
|---|
| 159 |
} |
|---|
| 160 |
} |
|---|
| 161 |
|
|---|
| 162 |
print " </tr> |
|---|
| 163 |
</tbody> |
|---|
| 164 |
</table> |
|---|
| 165 |
"; |
|---|
| 166 |
|
|---|
| 167 |
?> |
|---|
| 168 |
|
|---|
| 169 |
</body> |
|---|
| 170 |
</html> |
|---|
| 171 |
|
|---|