root/trunk/install/php/reserveepg.php

リビジョン 94, 6.6 kB (コミッタ: sorshi, コミット時期: 15 年 前)

SQLite採用

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