root/trunk/install/php/reserveepg.php

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

EPG番組表をジャンルごとにカラー塗り分け

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 <!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     SELECT epgid,startdatetime,enddatetime,lengthmin, ontvchannel,epgtitle,epgdesc,epgcategory ,
44     stationname , stationrecch ,stationid
45     FROM foltia_epg , foltia_station
46     WHERE epgid='$epgid' AND foltia_station.ontvcode = foltia_epg.ontvchannel
47     ";//4812
48     $rs = m_query($con, $query, "DBクエリに失敗しました");
49     $maxrows = pg_num_rows($rs);
50             
51         if ($maxrows == 0) {
52         die_exit("登録番組がありません<BR>");
53         }
54         $rowdata = pg_fetch_row($rs, 0);
55         //$title = htmlspecialchars($rowdata[0]);
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 <form name="recordingsetting" method="POST" action="reserveepgcomp.php">
67 <input type="submit" value="予約" >
68 <br>
69
70
71 <?php   
72 $stationjname = htmlspecialchars($rowdata[8]);
73 $startfoltime = htmlspecialchars($rowdata[1]);
74 $startprinttime foldate2print($startfoltime);
75 $endfoltime = htmlspecialchars($rowdata[2]);
76 $endprinttime = foldate2print($endfoltime);
77 $lengthmin = htmlspecialchars($rowdata[3]);
78 $recch = htmlspecialchars($rowdata[9]);
79 $progname = htmlspecialchars($rowdata[5]);
80 $progname = z2h($progname);
81 $progdesc = htmlspecialchars($rowdata[6]);
82 $progdesc z2h($progdesc);
83 $progcat = htmlspecialchars(z2h($rowdata[7]));
84
85 if ($progcat == "information"){
86 $progcat '情報';
87 }elseif ($progcat == "anime"){
88 $progcat 'アニメ・特撮';
89 }elseif ($progcat == "news"){
90 $progcat 'ニュース・報道';
91 }elseif ($progcat == "drama"){
92 $progcat 'ドラマ';
93 }elseif ($progcat == "variety"){
94 $progcat 'バラエティ';
95 }elseif ($progcat == "documentary"){
96 $progcat 'ドキュメンタリー・教養';
97 }elseif ($progcat == "education"){
98 $progcat '教育';
99 }elseif ($progcat == "music"){
100 $progcat '音楽';
101 }elseif ($progcat == "cinema"){
102 $progcat '映画';
103 }elseif ($progcat == "hobby"){
104 $progcat '趣味・実用';
105 }elseif ($progcat == "kids"){
106 $progcat 'キッズ';
107 }elseif ($progcat == "sports"){
108 $progcat 'スポーツ';
109 }elseif ($progcat == "etc"){
110 $progcat 'その他';
111 }elseif ($progcat == "stage"){
112 $progcat '演劇';
113 }
114
115 $epgid = $epgid ;
116 $stationid = htmlspecialchars($rowdata[10]);
117
118 if ($now > $endfoltime){
119     print "この番組はすでに終了しているため、録画されません。<br>";
120 }elseif($now > $startfoltime){
121     print "この番組はすでに放映開始しているため、録画されません。<br>";
122 }elseif($now > ($startfoltime - 10) ){
123     print "この番組は放映直前なため、録画されない可能性があります。<br>";
124 }
125
126 //重複確認
127
128     $query = "
129 SELECT  foltia_program.title,foltia_subtitle.tid,foltia_subtitle.pid
130 FROM foltia_subtitle ,foltia_program ,foltia_tvrecord
131 WHERE startdatetime ='$startfoltime'
132 AND enddatetime = '$endfoltime'
133 AND foltia_subtitle.stationid = '$stationid' 
134 AND foltia_program.tid = foltia_subtitle.tid
135 AND foltia_tvrecord.tid =  foltia_program.tid
136 AND foltia_tvrecord.stationid = foltia_subtitle.stationid
137 ";   
138     
139     $rs = m_query($con, $query, "DBクエリに失敗しました");
140     $maxrows = pg_num_rows($rs);
141
142         if ($maxrows == 0) {
143         //重複なし
144         }else{
145         $chkoverwrap = pg_fetch_row($rs, 0);
146         $prereservedtitle = htmlspecialchars($chkoverwrap[0]);
147         $tid htmlspecialchars($chkoverwrap[1]);
148         $pid htmlspecialchars($chkoverwrap[2]);
149         print "<strong>この番組は既に予約済みです。</strong> \n";
150             if ($tid > 1){
151             print "予約番組名:<a href=\"http://cal.syoboi.jp/tid/$tid/time/#$pid\" target=\"_blank\">$prereservedtitle</a><br>\n";
152             }else{
153             print "予約方法:EPG録画<br>\n";
154             }
155         }
156         
157
158
159 print "<table width=\"100%\" border=\"0\">
160     <tr><td>放送局</td><td>$stationjname</td></tr>
161     <tr><td>放送開始</td><td>$startprinttime</td></tr>
162     <tr><td>放送終了</td><td>$endprinttime</td></tr>
163     <tr><td>尺(分)</td><td>$lengthmin</td></tr>
164     <tr><td>放送チャンネル</td><td>$recch</td></tr>
165     <tr><td>番組名</td><td>$progname</td></tr>
166     <tr><td>内容</td><td>$progdesc</td></tr>
167     <tr><td>ジャンル</td><td>$progcat</td></tr>
168     <tr><td>番組ID</td><td>$epgid</td></tr>
169     <tr><td>局コード</td><td>$stationid</td></tr>
170     
171 </table>
172
173 <input type=\"hidden\" name=\"stationid\" value=\"$stationid\" />
174 <input type=\"hidden\" name=\"subtitle\" value=\"$progname $progdesc\" />
175 <input type=\"hidden\" name=\"startdatetime\" value=\"$startfoltime\" />
176 <input type=\"hidden\" name=\"enddatetime\" value=\"$endfoltime\" />
177 <input type=\"hidden\" name=\"lengthmin\" value=\"$lengthmin\" />
178
179 ";
180
181     
182 ?>
183
184 </FORM>
185
186
187 </body>
188 </html>
189
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。
track feed