root/trunk/install/php/delepgp.php

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

SQLite採用

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 <body BGCOLOR="#ffffff" TEXT="#494949" LINK="#0047ff" VLINK="#000000" ALINK="#c6edff" >
44
45 <?php
46
47     printhtmlpageheader();
48
49 $pid = getgetnumform(pid);
50         if ($pid == "") {
51         die_exit("番組がありません<BR>");
52         }
53
54 $now = date("YmdHi");   
55
56
57 //タイトル取得
58 $query = "
59 SELECT
60 foltia_subtitle.pid  ,
61 foltia_subtitle.stationid ,
62 foltia_subtitle.countno ,
63 foltia_subtitle.subtitle  ,
64 foltia_subtitle.startdatetime ,
65 foltia_subtitle.enddatetime ,
66 foltia_subtitle.lengthmin ,
67 foltia_station.stationname ,
68 foltia_station.stationrecch
69 FROM foltia_subtitle , foltia_station
70 WHERE foltia_subtitle.tid = 0 AND
71 foltia_station.stationid = foltia_subtitle.stationid AND
72 foltia_subtitle.pid = ?
73  ";
74
75 //    $rs = m_query($con, $query, "DBクエリに失敗しました");
76     $rs = sql_query($con, $query, "DBクエリに失敗しました",array($pid));
77 $rowdata = $rs->fetch();
78 if (! $rowdate) {
79         die_exit("登録番組がありません<BR>");
80         }
81
82         $pid = htmlspecialchars($rowdata[0]);
83         $stationid = htmlspecialchars($rowdata[1]);
84         $countno = htmlspecialchars($rowdata[2]);
85         $subtitle = htmlspecialchars($rowdata[3]);
86         $starttime = htmlspecialchars($rowdata[4]);
87         $startprinttime = htmlspecialchars(foldate2print($rowdata[4]));
88         $endtime = htmlspecialchars($rowdata[5]);
89         $endprinttime = htmlspecialchars(foldate2print($rowdata[5]));
90         $lengthmin = htmlspecialchars($rowdata[6]);
91         $stationjname = htmlspecialchars($rowdata[7]);
92         $recch = htmlspecialchars($rowdata[8]);
93 $delflag = getgetnumform(delflag);
94 ?>
95
96   <p align="left"><font color="#494949" size="6">EPG予約解除</font></p>
97   <hr size="4">
98 <?php
99 if ($delflag == "1") {
100     //時刻確認
101     if ($now < $starttime ){
102         print "EPG予約「".$subtitle."」の録画予約を解除しました。 <br>\n";
103         
104         //削除処理
105         if (($demomode) || ($protectmode) ){
106         //demomodeやprotectmodeならなにもしない
107         }else{
108         //キュー更新
109 //        $oserr = system("$toolpath/perl/addatq.pl 0 $stationid ");
110         $oserr = system("$toolpath/perl/addpidatq.pl $pid ");
111         //DB削除
112         $query = "
113         DELETE 
114         FROM  foltia_subtitle 
115         WHERE foltia_subtitle.pid = ? AND  foltia_subtitle.tid = 0 ";
116 //            $rs = m_query($con, $query, "DBクエリに失敗しました");
117             $rs = sql_query($con, $query, "DBクエリに失敗しました",array($pid));
118         }
119     }else{
120         print "<strong>過去番組は予約削除出来ません。</strong>";
121     }//end if
122
123 }else{//delflagが1じゃなければ
124
125     //時刻確認
126     if ($now < $starttime ){
127     print "EPG予約「".$subtitle."」の録画予約を解除します。 <br>\n";
128
129     print "<form name=\"deletereserve\" method=\"GET\" action=\"delepgp.php\">
130     <input type=\"submit\" value=\"予約解除\" >\n";
131     }else{
132     print "<strong>過去番組は予約削除出来ません。</strong>";
133     }//end if
134 }
135
136 print "<br>
137     <table width=\"100%\" border=\"0\">
138     <tr><td>放送局</td><td>$stationjname</td></tr>
139     <tr><td>放送開始</td><td>$startprinttime</td></tr>
140     <tr><td>放送終了</td><td>$endprinttime</td></tr>
141     <tr><td>尺(分)</td><td>$lengthmin</td></tr>
142     <tr><td>放送チャンネル</td><td>$recch</td></tr>
143     <tr><td>番組名</td><td>$subtitle</td></tr>
144     <tr><td>番組ID</td><td>$pid</td></tr>
145     <tr><td>局コード</td><td>$stationid</td></tr>
146     
147 </table>
148 ";
149
150 if ($delflag == "1") {
151
152 }else{
153 print "
154 <input type=\"hidden\" name=\"pid\" value=\"$pid\">
155 <input type=\"hidden\" name=\"delflag\" value=\"1\">
156 </form>\n";
157
158 }
159
160 ?> 
161 </table>
162
163 </body>
164 </html>
165
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。
track feed