root/trunk/install/php/delepgp.php

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

SQLが不正だったのを修正。
数字の評価をする関数getgetnumformを負の数にも対応。

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 = $pid
73  ";
74
75     $rs = m_query($con, $query, "DBクエリに失敗しました");
76     $maxrows = pg_num_rows($rs);
77             
78         if ($maxrows == 0) {
79         die_exit("登録番組がありません<BR>");
80         }
81         $rowdata = pg_fetch_row($rs, 0);
82
83         $pid = htmlspecialchars($rowdata[0]);
84         $stationid = htmlspecialchars($rowdata[1]);
85         $countno = htmlspecialchars($rowdata[2]);
86         $subtitle = htmlspecialchars($rowdata[3]);
87         $starttime = htmlspecialchars($rowdata[4]);
88         $startprinttime = htmlspecialchars(foldate2print($rowdata[4]));
89         $endtime = htmlspecialchars($rowdata[5]);
90         $endprinttime = htmlspecialchars(foldate2print($rowdata[5]));
91         $lengthmin = htmlspecialchars($rowdata[6]);
92         $stationjname = htmlspecialchars($rowdata[7]);
93         $recch = htmlspecialchars($rowdata[8]);
94 $delflag = getgetnumform(delflag);
95 ?>
96
97   <p align="left"><font color="#494949" size="6">EPG予約解除</font></p>
98   <hr size="4">
99 <?php
100 if ($delflag == "1") {
101     //時刻確認
102     if ($now < $starttime ){
103         print "EPG予約「".$subtitle."」の録画予約を解除しました。 <br>\n";
104         
105         //削除処理
106         if (($demomode) || ($protectmode) ){
107         //demomodeやprotectmodeならなにもしない
108         }else{
109         //キュー更新
110 //        $oserr = system("$toolpath/perl/addatq.pl 0 $stationid ");
111         $oserr = system("$toolpath/perl/addpidatq.pl $pid ");
112         //DB削除
113         $query = "
114         DELETE 
115         FROM  foltia_subtitle 
116         WHERE foltia_subtitle.pid = $pid AND  foltia_subtitle.tid = 0 ";
117             $rs = m_query($con, $query, "DBクエリに失敗しました");
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