| 1 | <?php | 
|---|
| 2 |  | 
|---|
| 3 |  | 
|---|
| 4 |  | 
|---|
| 5 |  | 
|---|
| 6 |  | 
|---|
| 7 |  | 
|---|
| 8 |  | 
|---|
| 9 |  | 
|---|
| 10 |  | 
|---|
| 11 |  | 
|---|
| 12 |  | 
|---|
| 13 |  | 
|---|
| 14 |  | 
|---|
| 15 |  | 
|---|
| 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 | } | 
|---|
| 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 |  | 
|---|
| 110 | }else{ | 
|---|
| 111 |  | 
|---|
| 112 | //        $oserr = system("$toolpath/perl/addatq.pl 0 $stationid "); | 
|---|
| 113 | $oserr = system("$toolpath/perl/addpidatq.pl $pid "); | 
|---|
| 114 |  | 
|---|
| 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 | } | 
|---|
| 124 |  | 
|---|
| 125 | }else{ | 
|---|
| 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 | } | 
|---|
| 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 |  | 
|---|