root/trunk/install/php/reserveepg.php

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

環境ポリシー機能搭載

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='$epgid' AND foltia_station.ontvcode = foltia_epg.ontvchannel
59     ";//4812
60     $rs = m_query($con, $query, "DBクエリに失敗しました");
61     $maxrows = pg_num_rows($rs);
62             
63         if ($maxrows == 0) {
64         die_exit("登録番組がありません<BR>");
65         }
66         $rowdata = pg_fetch_row($rs, 0);
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,
139 foltia_program .tid,
140 stationname,
141 foltia_station.stationid , 
142 foltia_subtitle.countno,
143 foltia_subtitle.subtitle,
144 foltia_subtitle.startdatetime ,
145 foltia_subtitle.lengthmin ,
146 foltia_tvrecord.bitrate  ,
147 foltia_subtitle.startoffset ,
148 foltia_subtitle.pid 
149 FROM foltia_subtitle , foltia_program ,foltia_station ,foltia_tvrecord
150 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
151 AND foltia_subtitle.startdatetime ='$startfoltime' 
152 AND foltia_subtitle.enddatetime = '$endfoltime'
153 AND foltia_station.stationid = '$stationid'   
154 UNION
155 SELECT
156 foltia_program .title,
157 foltia_program .tid,
158 stationname,
159 foltia_station.stationid , 
160 foltia_subtitle.countno,
161 foltia_subtitle.subtitle,
162 foltia_subtitle.startdatetime ,
163 foltia_subtitle.lengthmin ,
164 foltia_tvrecord.bitrate ,
165 foltia_subtitle.startoffset ,
166 foltia_subtitle.pid 
167 FROM foltia_tvrecord
168 LEFT OUTER JOIN foltia_subtitle on (foltia_tvrecord.tid = foltia_subtitle.tid )
169 LEFT OUTER JOIN foltia_program on (foltia_tvrecord.tid = foltia_program.tid )
170 LEFT OUTER JOIN foltia_station on (foltia_subtitle.stationid = foltia_station.stationid )
171 WHERE foltia_tvrecord.stationid = 0
172 AND foltia_subtitle.startdatetime ='$startfoltime' 
173 AND foltia_subtitle.enddatetime = '$endfoltime'
174 AND foltia_station.stationid =  '$stationid' 
175 ";
176
177
178
179     $rs = m_query($con, $query, "DBクエリに失敗しました");
180     $maxrows = pg_num_rows($rs);
181
182 //print "<!--$query \n $maxrows\n -->";
183
184 print "<form name=\"recordingsetting\" method=\"POST\" action=\"reserveepgcomp.php\">\n";
185
186         if ($maxrows == 0) {
187         //重複なし
188         print "<input type=\"submit\" value=\"予約\" ><br>\n";
189         }else{
190         $chkoverwrap = pg_fetch_row($rs, 0);
191         $prereservedtitle = htmlspecialchars($chkoverwrap[0]);
192         $tid htmlspecialchars($chkoverwrap[1]);
193         $pid htmlspecialchars($chkoverwrap[2]);
194         print "<input type=\"submit\" value=\"それでも予約\" ><br><strong>この番組は既に予約済みです。</strong> \n";
195             if ($tid > 1){
196             print "予約番組名:<a href=\"http://cal.syoboi.jp/tid/$tid/time/#$pid\" target=\"_blank\">$prereservedtitle</a><br>\n";
197             }else{
198             print "予約方法:EPG録画<br>\n";
199             }
200         }
201         
202
203
204 print "<table width=\"100%\" border=\"0\">
205     <tr><td>放送局</td><td>$stationjname</td></tr>
206     <tr><td>放送開始</td><td>$startprinttime</td></tr>
207     <tr><td>放送終了</td><td>$endprinttime</td></tr>
208     <tr><td>尺(分)</td><td>$lengthmin</td></tr>
209     <tr><td>放送チャンネル</td><td>$recch</td></tr>
210     <tr><td>番組名</td><td>$progname</td></tr>
211     <tr><td>内容</td><td>$progdesc</td></tr>
212     <tr><td>ジャンル</td><td>$progcat</td></tr>
213     <tr><td>番組ID</td><td>$epgid</td></tr>
214     <tr><td>局コード</td><td>$stationid</td></tr>
215     
216 </table>
217
218 <input type=\"hidden\" name=\"stationid\" value=\"$stationid\" />
219 <input type=\"hidden\" name=\"subtitle\" value=\"$progname $progdesc\" />
220 <input type=\"hidden\" name=\"startdatetime\" value=\"$startfoltime\" />
221 <input type=\"hidden\" name=\"enddatetime\" value=\"$endfoltime\" />
222 <input type=\"hidden\" name=\"lengthmin\" value=\"$lengthmin\" />
223
224 ";
225
226     
227 ?>
228
229 </FORM>
230
231
232 </body>
233 </html>
234
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。
track feed