root/trunk/install/php/reserveepg.php

リビジョン 1, 4.4 kB (コミッタ: jplcom, コミット時期: 17 年 前)

initial import

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($rowdata[7]);
84 $progcat z2h($progcat);
85 $epgid = $epgid ;
86 $stationid = htmlspecialchars($rowdata[10]);
87
88 if ($now > $endfoltime){
89     print "この番組はすでに終了しているため、録画されません。<br>";
90 }elseif($now > $startfoltime){
91     print "この番組はすでに放映開始しているため、録画されません。<br>";
92 }elseif($now > ($startfoltime - 10) ){
93     print "この番組は放映直前なため、録画されない可能性があります。<br>";
94 }
95
96 //重複確認
97
98     $query = "
99 SELECT  foltia_program.title,foltia_subtitle.tid,foltia_subtitle.pid
100 FROM foltia_subtitle ,foltia_program ,foltia_tvrecord
101 WHERE startdatetime ='$startfoltime'
102 AND enddatetime = '$endfoltime'
103 AND foltia_subtitle.stationid = '$stationid' 
104 AND foltia_program.tid = foltia_subtitle.tid
105 AND foltia_tvrecord.tid =  foltia_program.tid
106 AND foltia_tvrecord.stationid = foltia_subtitle.stationid
107 ";   
108     
109     $rs = m_query($con, $query, "DBクエリに失敗しました");
110     $maxrows = pg_num_rows($rs);
111
112         if ($maxrows == 0) {
113         //重複なし
114         }else{
115         $chkoverwrap = pg_fetch_row($rs, 0);
116         $prereservedtitle = htmlspecialchars($chkoverwrap[0]);
117         $tid htmlspecialchars($chkoverwrap[1]);
118         $pid htmlspecialchars($chkoverwrap[2]);
119         print "<strong>この番組は既に予約済みです。</strong> \n";
120             if ($tid > 1){
121             print "予約番組名:<a href=\"http://cal.syoboi.jp/tid/$tid/time/#$pid\" target=\"_blank\">$prereservedtitle</a><br>\n";
122             }else{
123             print "予約方法:EPG録画<br>\n";
124             }
125         }
126         
127
128
129 print "<table width=\"100%\" border=\"0\">
130     <tr><td>放送局</td><td>$stationjname</td></tr>
131     <tr><td>放送開始</td><td>$startprinttime</td></tr>
132     <tr><td>放送終了</td><td>$endprinttime</td></tr>
133     <tr><td>尺(分)</td><td>$lengthmin</td></tr>
134     <tr><td>放送チャンネル</td><td>$recch</td></tr>
135     <tr><td>番組名</td><td>$progname</td></tr>
136     <tr><td>内容</td><td>$progdesc</td></tr>
137     <tr><td>ジャンル</td><td>$progcat</td></tr>
138     <tr><td>番組ID</td><td>$epgid</td></tr>
139     <tr><td>局コード</td><td>$stationid</td></tr>
140     
141 </table>
142
143 <input type=\"hidden\" name=\"stationid\" value=\"$stationid\" />
144 <input type=\"hidden\" name=\"subtitle\" value=\"$progname $progdesc\" />
145 <input type=\"hidden\" name=\"startdatetime\" value=\"$startfoltime\" />
146 <input type=\"hidden\" name=\"enddatetime\" value=\"$endfoltime\" />
147 <input type=\"hidden\" name=\"lengthmin\" value=\"$lengthmin\" />
148
149 ";
150
151     
152 ?>
153
154 </FORM>
155
156
157 </body>
158 </html>
159
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。
track feed