root/trunk/install/php/delepgp.php

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

環境ポリシー機能搭載

Line 
1 <?php
2 /*
3  Anime recording system foltia
4  http://www.dcc-jpl.com/soft/foltia/
5
6 delepgp.php
7
8 目的
9 EPG録画予約の予約解除を行います
10
11 引数
12 pid:プログラムID
13 delflag:確認フラグ
14
15  DCC-JPL Japan/foltia project
16
17 */
18
19 include("./foltialib.php");
20 $con = m_connect();
21
22 if ($useenvironmentpolicy == 1){
23 if (!isset($_SERVER['PHP_AUTH_USER'])) {
24     header("WWW-Authenticate: Basic realm=\"foltia\"");
25     header("HTTP/1.0 401 Unauthorized");
26     redirectlogin();
27     exit;
28 } else {
29 login($con,$_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW']);
30 }
31 }//end if login
32
33
34 ?>
35 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
36 <html lang="ja">
37 <head>
38 <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP">
39 <meta http-equiv="Content-Style-Type" content="text/css">
40 <link rel="stylesheet" type="text/css" href="graytable.css">
41 <title>foltia:delete EPG Program</title>
42 </head>
43
44 <?php
45
46
47 $pid = getgetform(pid);
48         if ($pid == "") {
49         die_exit("番組がありません<BR>");
50         }
51
52 $now = date("YmdHi");   
53 ?>
54 <body BGCOLOR="#ffffff" TEXT="#494949" LINK="#0047ff" VLINK="#000000" ALINK="#c6edff" >
55
56 <?php
57     printhtmlpageheader();
58
59 //タイトル取得
60 $query = "
61 SELECT
62 foltia_subtitle.pid  ,
63 foltia_subtitle.stationid ,
64 foltia_subtitle.countno ,
65 foltia_subtitle.subtitle  ,
66 foltia_subtitle.startdatetime ,
67 foltia_subtitle.enddatetime ,
68 foltia_subtitle.lengthmin ,
69 foltia_station.stationname ,
70 foltia_station.stationrecch
71 FROM     foltia_subtitle
72 WHERE    foltia_subtitle.tid = 0 AND
73 foltia_station.stationid = foltia_subtitle.stationid AND
74 foltia_subtitle.pid = $pid
75  ";
76
77     $rs = m_query($con, $query, "DBクエリに失敗しました");
78     $maxrows = pg_num_rows($rs);
79             
80         if ($maxrows == 0) {
81         die_exit("登録番組がありません<BR>");
82         }
83         $rowdata = pg_fetch_row($rs, 0);
84
85         $pid = htmlspecialchars($rowdata[0]);
86         $stationid = htmlspecialchars($rowdata[1]);
87         $countno = htmlspecialchars($rowdata[2]);
88         $subtitle = htmlspecialchars($rowdata[3]);
89         $starttime = htmlspecialchars($rowdata[4]);
90         $startprinttime = htmlspecialchars(foldate2print($rowdata[4]));
91         $endtime = htmlspecialchars($rowdata[5]);
92         $endprinttime = htmlspecialchars(foldate2print($rowdata[5]));
93         $lengthmin = htmlspecialchars($rowdata[6]);
94         $stationjname = htmlspecialchars($rowdata[7]);
95         $recch = htmlspecialchars($rowdata[8]);
96 $delflag = getgetnumform(delflag);
97 ?>
98
99   <p align="left"><font color="#494949" size="6">EPG予約解除</font></p>
100   <hr size="4">
101 <?php
102 if ($delflag == "1") {
103     //時刻確認
104     if ($now < $starttime ){
105         print "EPG予約「".$subtitle."」の録画予約を解除しました。 <br>\n";
106         
107         //削除処理
108         if (($demomode) || ($protectmode) ){
109         //demomodeやprotectmodeならなにもしない
110         }else{
111         //キュー更新
112 //        $oserr = system("$toolpath/perl/addatq.pl 0 $stationid ");
113         $oserr = system("$toolpath/perl/addpidatq.pl $pid ");
114         //DB削除
115         $query = "
116         DELETE 
117         FROM  foltia_subtitle 
118         WHERE foltia_subtitle.pid = $pid AND  foltia_subtitle.tid = 0 ";
119             $rs = m_query($con, $query, "DBクエリに失敗しました");
120         }
121     }else{
122         print "<strong>過去番組は予約削除出来ません。</strong>";
123     }//end if
124
125 }else{//delflagが1じゃなければ
126
127     //時刻確認
128     if ($now < $starttime ){
129     print "EPG予約「".$subtitle."」の録画予約を解除します。 <br>\n";
130
131     print "<form name=\"deletereserve\" method=\"GET\" action=\"delepgp.php\">
132     <input type=\"submit\" value=\"予約解除\" >\n";
133     }else{
134     print "<strong>過去番組は予約削除出来ません。</strong>";
135     }//end if
136 }
137
138 print "<br>
139     <table width=\"100%\" border=\"0\">
140     <tr><td>放送局</td><td>$stationjname</td></tr>
141     <tr><td>放送開始</td><td>$startprinttime</td></tr>
142     <tr><td>放送終了</td><td>$endprinttime</td></tr>
143     <tr><td>尺(分)</td><td>$lengthmin</td></tr>
144     <tr><td>放送チャンネル</td><td>$recch</td></tr>
145     <tr><td>番組名</td><td>$subtitle</td></tr>
146     <tr><td>番組ID</td><td>$pid</td></tr>
147     <tr><td>局コード</td><td>$stationid</td></tr>
148     
149 </table>
150 ";
151
152 if ($delflag == "1") {
153
154 }else{
155 print "
156 <input type=\"hidden\" name=\"pid\" value=\"$pid\">
157 <input type=\"hidden\" name=\"delflag\" value=\"1\">
158 </form>\n";
159
160 }
161
162 ?> 
163 </table>
164
165 </body>
166 </html>
167
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。
track feed