1 |
<?php |
---|
2 |
|
---|
3 |
|
---|
4 |
|
---|
5 |
|
---|
6 |
|
---|
7 |
|
---|
8 |
|
---|
9 |
|
---|
10 |
|
---|
11 |
|
---|
12 |
|
---|
13 |
|
---|
14 |
|
---|
15 |
|
---|
16 |
|
---|
17 |
?> |
---|
18 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
---|
19 |
<html lang="ja"> |
---|
20 |
<head> |
---|
21 |
<meta http-equiv="Content-Type" content="text/html; charset=EUC-JP"> |
---|
22 |
<meta http-equiv="Content-Style-Type" content="text/css"> |
---|
23 |
<link rel="stylesheet" type="text/css" href="graytable.css"> |
---|
24 |
|
---|
25 |
<?php |
---|
26 |
|
---|
27 |
include("./foltialib.php"); |
---|
28 |
|
---|
29 |
$epgid = getgetnumform(epgid); |
---|
30 |
if ($epgid == "") { |
---|
31 |
print " <title>foltia:EPG予約:Error</title></head>\n"; |
---|
32 |
die_exit("登録番組がありません<BR>"); |
---|
33 |
} |
---|
34 |
print " <title>foltia:EPG予約:$epgid</title> |
---|
35 |
</head>\n"; |
---|
36 |
|
---|
37 |
|
---|
38 |
$con = m_connect(); |
---|
39 |
$now = date("YmdHi"); |
---|
40 |
|
---|
41 |
|
---|
42 |
$query = " |
---|
43 |
|
---|
44 |
|
---|
45 |
|
---|
46 |
|
---|
47 |
; |
---|
48 |
$rs = m_query($con, $query, "DBクエリに失敗しました"); |
---|
49 |
$maxrows = pg_num_rows($rs); |
---|
50 |
|
---|
51 |
$maxrows == 0) { |
---|
52 |
die_exit("登録番組がありません<BR>"); |
---|
53 |
|
---|
54 |
$rowdata = pg_fetch_row($rs, 0); |
---|
55 |
|
---|
56 |
?> |
---|
57 |
<body BGCOLOR="#ffffff" TEXT="#494949" LINK="#0047ff" VLINK="#000000" ALINK="#c6edff" > |
---|
58 |
|
---|
59 |
<?php |
---|
60 |
printhtmlpageheader(); |
---|
61 |
?> |
---|
62 |
|
---|
63 |
<p align="left"><font color="#494949" size="6">番組予約</font></p> |
---|
64 |
<hr size="4"> |
---|
65 |
EPGから下記番組を録画予約します。 <br> |
---|
66 |
|
---|
67 |
|
---|
68 |
<?php |
---|
69 |
$stationjname = htmlspecialchars($rowdata[8]); |
---|
70 |
$startfoltime = htmlspecialchars($rowdata[1]); |
---|
71 |
$startprinttime = foldate2print($startfoltime); |
---|
72 |
$endfoltime = htmlspecialchars($rowdata[2]); |
---|
73 |
$endprinttime = foldate2print($endfoltime); |
---|
74 |
$lengthmin = htmlspecialchars($rowdata[3]); |
---|
75 |
$recch = htmlspecialchars($rowdata[9]); |
---|
76 |
$progname = htmlspecialchars($rowdata[5]); |
---|
77 |
$progname = z2h($progname); |
---|
78 |
$progdesc = htmlspecialchars($rowdata[6]); |
---|
79 |
$progdesc = z2h($progdesc); |
---|
80 |
$progcat = htmlspecialchars(z2h($rowdata[7])); |
---|
81 |
|
---|
82 |
if ($progcat == "information"){ |
---|
83 |
$progcat = '情報'; |
---|
84 |
}elseif ($progcat == "anime"){ |
---|
85 |
$progcat = 'アニメ・特撮'; |
---|
86 |
}elseif ($progcat == "news"){ |
---|
87 |
$progcat = 'ニュース・報道'; |
---|
88 |
}elseif ($progcat == "drama"){ |
---|
89 |
$progcat = 'ドラマ'; |
---|
90 |
}elseif ($progcat == "variety"){ |
---|
91 |
$progcat = 'バラエティ'; |
---|
92 |
}elseif ($progcat == "documentary"){ |
---|
93 |
$progcat = 'ドキュメンタリー・教養'; |
---|
94 |
}elseif ($progcat == "education"){ |
---|
95 |
$progcat = '教育'; |
---|
96 |
}elseif ($progcat == "music"){ |
---|
97 |
$progcat = '音楽'; |
---|
98 |
}elseif ($progcat == "cinema"){ |
---|
99 |
$progcat = '映画'; |
---|
100 |
}elseif ($progcat == "hobby"){ |
---|
101 |
$progcat = '趣味・実用'; |
---|
102 |
}elseif ($progcat == "kids"){ |
---|
103 |
$progcat = 'キッズ'; |
---|
104 |
}elseif ($progcat == "sports"){ |
---|
105 |
$progcat = 'スポーツ'; |
---|
106 |
}elseif ($progcat == "etc"){ |
---|
107 |
$progcat = 'その他'; |
---|
108 |
}elseif ($progcat == "stage"){ |
---|
109 |
$progcat = '演劇'; |
---|
110 |
} |
---|
111 |
|
---|
112 |
$epgid = $epgid ; |
---|
113 |
$stationid = htmlspecialchars($rowdata[10]); |
---|
114 |
|
---|
115 |
if ($now > $endfoltime){ |
---|
116 |
print "この番組はすでに終了しているため、録画されません。<br>"; |
---|
117 |
}elseif($now > $startfoltime){ |
---|
118 |
print "この番組はすでに放映開始しているため、録画されません。<br>"; |
---|
119 |
}elseif($now > ($startfoltime - 10) ){ |
---|
120 |
print "この番組は放映直前なため、録画されない可能性があります。<br>"; |
---|
121 |
} |
---|
122 |
|
---|
123 |
|
---|
124 |
$query = " |
---|
125 |
SELECT |
---|
126 |
foltia_program .title, |
---|
127 |
foltia_program .tid, |
---|
128 |
stationname, |
---|
129 |
foltia_station.stationid , |
---|
130 |
foltia_subtitle.countno, |
---|
131 |
foltia_subtitle.subtitle, |
---|
132 |
foltia_subtitle.startdatetime , |
---|
133 |
foltia_subtitle.lengthmin , |
---|
134 |
foltia_tvrecord.bitrate , |
---|
135 |
foltia_subtitle.startoffset , |
---|
136 |
foltia_subtitle.pid |
---|
137 |
FROM foltia_subtitle , foltia_program ,foltia_station ,foltia_tvrecord |
---|
138 |
WHERE foltia_tvrecord.tid = foltia_program.tid AND foltia_tvrecord.stationid = foltia_station .stationid AND foltia_program.tid = foltia_subtitle.tid AND foltia_station.stationid = foltia_subtitle.stationid |
---|
139 |
AND foltia_subtitle.startdatetime ='$startfoltime' |
---|
140 |
AND foltia_subtitle.enddatetime = '$endfoltime' |
---|
141 |
AND foltia_station.stationid = '$stationid' |
---|
142 |
UNION |
---|
143 |
SELECT |
---|
144 |
foltia_program .title, |
---|
145 |
foltia_program .tid, |
---|
146 |
stationname, |
---|
147 |
foltia_station.stationid , |
---|
148 |
foltia_subtitle.countno, |
---|
149 |
foltia_subtitle.subtitle, |
---|
150 |
foltia_subtitle.startdatetime , |
---|
151 |
foltia_subtitle.lengthmin , |
---|
152 |
foltia_tvrecord.bitrate , |
---|
153 |
foltia_subtitle.startoffset , |
---|
154 |
foltia_subtitle.pid |
---|
155 |
FROM foltia_tvrecord |
---|
156 |
LEFT OUTER JOIN foltia_subtitle on (foltia_tvrecord.tid = foltia_subtitle.tid ) |
---|
157 |
LEFT OUTER JOIN foltia_program on (foltia_tvrecord.tid = foltia_program.tid ) |
---|
158 |
LEFT OUTER JOIN foltia_station on (foltia_subtitle.stationid = foltia_station.stationid ) |
---|
159 |
WHERE foltia_tvrecord.stationid = 0 |
---|
160 |
AND foltia_subtitle.startdatetime ='$startfoltime' |
---|
161 |
AND foltia_subtitle.enddatetime = '$endfoltime' |
---|
162 |
AND foltia_station.stationid = '$stationid' |
---|
163 |
"; |
---|
164 |
|
---|
165 |
|
---|
166 |
|
---|
167 |
$rs = m_query($con, $query, "DBクエリに失敗しました"); |
---|
168 |
$maxrows = pg_num_rows($rs); |
---|
169 |
|
---|
170 |
|
---|
171 |
|
---|
172 |
print "<form name=\"recordingsetting\" method=\"POST\" action=\"reserveepgcomp.php\">\n"; |
---|
173 |
|
---|
174 |
if ($maxrows == 0) { |
---|
175 |
|
---|
176 |
print "<input type=\"submit\" value=\"予約\" ><br>\n"; |
---|
177 |
}else{ |
---|
178 |
$chkoverwrap = pg_fetch_row($rs, 0); |
---|
179 |
$prereservedtitle = htmlspecialchars($chkoverwrap[0]); |
---|
180 |
$tid = htmlspecialchars($chkoverwrap[1]); |
---|
181 |
$pid = htmlspecialchars($chkoverwrap[2]); |
---|
182 |
print "<input type=\"submit\" value=\"それでも予約\" ><br><strong>この番組は既に予約済みです。</strong> \n"; |
---|
183 |
if ($tid > 1){ |
---|
184 |
print "予約番組名:<a href=\"http://cal.syoboi.jp/tid/$tid/time/#$pid\" target=\"_blank\">$prereservedtitle</a><br>\n"; |
---|
185 |
}else{ |
---|
186 |
print "予約方法:EPG録画<br>\n"; |
---|
187 |
} |
---|
188 |
} |
---|
189 |
|
---|
190 |
|
---|
191 |
|
---|
192 |
print "<table width=\"100%\" border=\"0\"> |
---|
193 |
<tr><td>放送局</td><td>$stationjname</td></tr> |
---|
194 |
<tr><td>放送開始</td><td>$startprinttime</td></tr> |
---|
195 |
<tr><td>放送終了</td><td>$endprinttime</td></tr> |
---|
196 |
<tr><td>尺(分)</td><td>$lengthmin</td></tr> |
---|
197 |
<tr><td>放送チャンネル</td><td>$recch</td></tr> |
---|
198 |
<tr><td>番組名</td><td>$progname</td></tr> |
---|
199 |
<tr><td>内容</td><td>$progdesc</td></tr> |
---|
200 |
<tr><td>ジャンル</td><td>$progcat</td></tr> |
---|
201 |
<tr><td>番組ID</td><td>$epgid</td></tr> |
---|
202 |
<tr><td>局コード</td><td>$stationid</td></tr> |
---|
203 |
|
---|
204 |
</table> |
---|
205 |
|
---|
206 |
<input type=\"hidden\" name=\"stationid\" value=\"$stationid\" /> |
---|
207 |
<input type=\"hidden\" name=\"subtitle\" value=\"$progname $progdesc\" /> |
---|
208 |
<input type=\"hidden\" name=\"startdatetime\" value=\"$startfoltime\" /> |
---|
209 |
<input type=\"hidden\" name=\"enddatetime\" value=\"$endfoltime\" /> |
---|
210 |
<input type=\"hidden\" name=\"lengthmin\" value=\"$lengthmin\" /> |
---|
211 |
|
---|
212 |
"; |
---|
213 |
|
---|
214 |
|
---|
215 |
?> |
---|
216 |
|
---|
217 |
</FORM> |
---|
218 |
|
---|
219 |
|
---|
220 |
</body> |
---|
221 |
</html> |
---|
222 |
|
---|