Index: trunk/install/php/reserveepg.php =================================================================== --- trunk/install/php/reserveepg.php (リビジョン 122) +++ trunk/install/php/reserveepg.php (リビジョン 1) @@ -15,18 +15,4 @@ */ - -include("./foltialib.php"); -$con = m_connect(); - -if ($useenvironmentpolicy == 1){ - if (!isset($_SERVER['PHP_AUTH_USER'])) { - header("WWW-Authenticate: Basic realm=\"foltia\""); - header("HTTP/1.0 401 Unauthorized"); - redirectlogin(); - exit; - } else { - login($con,$_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW']); - } -}//end if login ?> @@ -39,4 +25,5 @@ fetch(); -if (! $rowdata) { + $rs = m_query($con, $query, "DBクエリに失敗しました"); + $maxrows = pg_num_rows($rs); + + if ($maxrows == 0) { die_exit("登録番組がありません
"); } - + $rowdata = pg_fetch_row($rs, 0); //$title = htmlspecialchars($rowdata[0]); ?> @@ -76,4 +64,7 @@
EPGから下記番組を録画予約します。
+
+ +
@@ -90,36 +81,6 @@ $progdesc = htmlspecialchars($rowdata[6]); $progdesc = z2h($progdesc); -$progcat = htmlspecialchars(z2h($rowdata[7])); - -if ($progcat == "information"){ -$progcat = '情報'; -}elseif ($progcat == "anime"){ -$progcat = 'アニメ・特撮'; -}elseif ($progcat == "news"){ -$progcat = 'ニュース・報道'; -}elseif ($progcat == "drama"){ -$progcat = 'ドラマ'; -}elseif ($progcat == "variety"){ -$progcat = 'バラエティ'; -}elseif ($progcat == "documentary"){ -$progcat = 'ドキュメンタリー・教養'; -}elseif ($progcat == "education"){ -$progcat = '教育'; -}elseif ($progcat == "music"){ -$progcat = '音楽'; -}elseif ($progcat == "cinema"){ -$progcat = '映画'; -}elseif ($progcat == "hobby"){ -$progcat = '趣味・実用'; -}elseif ($progcat == "kids"){ -$progcat = 'キッズ'; -}elseif ($progcat == "sports"){ -$progcat = 'スポーツ'; -}elseif ($progcat == "etc"){ -$progcat = 'その他'; -}elseif ($progcat == "stage"){ -$progcat = '演劇'; -} - +$progcat = htmlspecialchars($rowdata[7]); +$progcat = z2h($progcat); $epgid = $epgid ; $stationid = htmlspecialchars($rowdata[10]); @@ -134,48 +95,27 @@ //重複確認 -$query = " -SELECT - foltia_program.title, foltia_program.tid, stationname, - foltia_station.stationid, foltia_subtitle.countno, - foltia_subtitle.subtitle, foltia_subtitle.startdatetime, - foltia_subtitle.lengthmin, foltia_tvrecord.bitrate, - foltia_subtitle.startoffset, foltia_subtitle.pid -FROM foltia_subtitle , foltia_program ,foltia_station ,foltia_tvrecord -WHERE foltia_tvrecord.tid = foltia_program.tid AND foltia_tvrecord.stationid = foltia_station .stationid AND foltia_program.tid = foltia_subtitle.tid AND foltia_station.stationid = foltia_subtitle.stationid -AND foltia_subtitle.startdatetime = ? -AND foltia_subtitle.enddatetime = ? -AND foltia_station.stationid = ? -UNION -SELECT - foltia_program.title, foltia_program.tid, stationname, - foltia_station.stationid, foltia_subtitle.countno, - foltia_subtitle.subtitle, foltia_subtitle.startdatetime, - foltia_subtitle.lengthmin, foltia_tvrecord.bitrate, - foltia_subtitle.startoffset, foltia_subtitle.pid -FROM foltia_tvrecord -LEFT OUTER JOIN foltia_subtitle on (foltia_tvrecord.tid = foltia_subtitle.tid ) -LEFT OUTER JOIN foltia_program on (foltia_tvrecord.tid = foltia_program.tid ) -LEFT OUTER JOIN foltia_station on (foltia_subtitle.stationid = foltia_station.stationid ) -WHERE foltia_tvrecord.stationid = 0 -AND foltia_subtitle.startdatetime = ? -AND foltia_subtitle.enddatetime = ? -AND foltia_station.stationid = ? -"; -//print ""; + $query = " +SELECT foltia_program.title,foltia_subtitle.tid,foltia_subtitle.pid +FROM foltia_subtitle ,foltia_program ,foltia_tvrecord +WHERE startdatetime ='$startfoltime' +AND enddatetime = '$endfoltime' +AND foltia_subtitle.stationid = '$stationid' +AND foltia_program.tid = foltia_subtitle.tid +AND foltia_tvrecord.tid = foltia_program.tid +AND foltia_tvrecord.stationid = foltia_subtitle.stationid +"; + + $rs = m_query($con, $query, "DBクエリに失敗しました"); + $maxrows = pg_num_rows($rs); -print "\n"; - -//$rs = m_query($con, $query, "DBクエリに失敗しました"); -$rs = sql_query($con, $query, "DBクエリに失敗しました",array($startfoltime,$endfoltime,$stationid,$startfoltime,$endfoltime,$stationid)); -$chkoverwrap = $rs->fetch(); -if (! $chkoverwrap) { + if ($maxrows == 0) { //重複なし - print "
\n"; }else{ + $chkoverwrap = pg_fetch_row($rs, 0); $prereservedtitle = htmlspecialchars($chkoverwrap[0]); $tid = htmlspecialchars($chkoverwrap[1]); $pid = htmlspecialchars($chkoverwrap[2]); - print "
この番組は既に予約済みです。 \n"; + print "この番組は既に予約済みです。 \n"; if ($tid > 1){ print "予約番組名:$prereservedtitle
\n"; @@ -201,5 +141,4 @@ -