209912342353 )){ $now = date("YmdHi"); } function printtitle(){ print " "; //ディスク空き容量によって背景色表示変更 warndiskfreearea(); print "foltia:放映予定 "; }//end function printtitle() ////////////////////////// //ページの表示レコード数 $lim = 300; //クエリ取得 $p = getgetnumform(p); //ページ取得の計算 list($st,$p,$p2) = number_page($p,$lim); //////////////////////////// //同一番組他局検索 $query = " SELECT foltia_program .tid, foltia_program .title, foltia_subtitle.countno, foltia_subtitle.subtitle, foltia_subtitle.startdatetime , foltia_subtitle.lengthmin , foltia_tvrecord.bitrate , foltia_subtitle.pid FROM foltia_subtitle , foltia_program ,foltia_tvrecord WHERE foltia_tvrecord.tid = foltia_program.tid AND foltia_program.tid = foltia_subtitle.tid AND foltia_subtitle.enddatetime >= ? ORDER BY \"startdatetime\" ASC LIMIT 1000 "; // $reservedrssametid = m_query($con, $query, "DBクエリに失敗しました"); $reservedrssametid = sql_query($con, $query, "DBクエリに失敗しました",array($now)); $rowdata = $reservedrssametid->fetch(); if ($rowdata) { do { $reservedpidsametid[] = $rowdata[7]; } while ($rowdata = $reservedrssametid->fetch()); $rowdata = ""; }else{ $reservedpidsametid = array(); }//end if $reservedrssametid->closeCursor(); //録画番組検索 $query = " SELECT foltia_program.tid, stationname, foltia_program.title, foltia_subtitle.countno, foltia_subtitle.subtitle, foltia_subtitle.startdatetime as x, foltia_subtitle.lengthmin, foltia_tvrecord.bitrate, 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.enddatetime >= '$now' UNION SELECT foltia_program.tid, stationname, foltia_program.title, foltia_subtitle.countno, foltia_subtitle.subtitle, foltia_subtitle.startdatetime, foltia_subtitle.lengthmin, foltia_tvrecord.bitrate, 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.enddatetime >= '$now' ORDER BY x ASC LIMIT 1000 "; //$reservedrs = m_query($con, $query, "DBクエリに失敗しました"); $query = " SELECT foltia_program.tid, stationname, foltia_program.title, foltia_subtitle.countno, foltia_subtitle.subtitle, foltia_subtitle.startdatetime as x, foltia_subtitle.lengthmin, foltia_tvrecord.bitrate, 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.enddatetime >= ? UNION SELECT foltia_program.tid, stationname, foltia_program.title, foltia_subtitle.countno, foltia_subtitle.subtitle, foltia_subtitle.startdatetime, foltia_subtitle.lengthmin, foltia_tvrecord.bitrate, 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.enddatetime >= ? ORDER BY x ASC "; $reservedrs = sql_query($con, $query, "DBクエリに失敗しました",array($now,$now)); $rowdata = $reservedrs->fetch(); if ($rowdata) { do { $reservedpid[] = $rowdata[8]; } while ($rowdata = $reservedrs->fetch()); }else{ $reservedpid = array(); }//end if $mode = getgetform(mode); if ($mode == "new"){ //新番組表示モード $query = " SELECT foltia_program.tid, stationname, foltia_program.title, foltia_subtitle.countno, foltia_subtitle.subtitle, foltia_subtitle.startdatetime, foltia_subtitle.lengthmin, foltia_subtitle.pid, foltia_subtitle.startoffset FROM foltia_subtitle , foltia_program ,foltia_station WHERE foltia_program.tid = foltia_subtitle.tid AND foltia_station.stationid = foltia_subtitle.stationid AND foltia_subtitle.enddatetime >= '$now' AND foltia_subtitle.countno = '1' ORDER BY foltia_subtitle.startdatetime ASC LIMIT 1000 "; $query = " SELECT foltia_program.tid, stationname, foltia_program.title, foltia_subtitle.countno, foltia_subtitle.subtitle, foltia_subtitle.startdatetime, foltia_subtitle.lengthmin, foltia_subtitle.pid, foltia_subtitle.startoffset FROM foltia_subtitle , foltia_program ,foltia_station WHERE foltia_program.tid = foltia_subtitle.tid AND foltia_station.stationid = foltia_subtitle.stationid AND foltia_subtitle.enddatetime >= ? AND foltia_subtitle.countno = '1' ORDER BY foltia_subtitle.startdatetime ASC LIMIT 1000 "; }else{ $query = " SELECT foltia_program.tid, stationname, foltia_program.title, foltia_subtitle.countno, foltia_subtitle.subtitle, foltia_subtitle.startdatetime, foltia_subtitle.lengthmin, foltia_subtitle.pid, foltia_subtitle.startoffset FROM foltia_subtitle , foltia_program ,foltia_station WHERE foltia_program.tid = foltia_subtitle.tid AND foltia_station.stationid = foltia_subtitle.stationid AND foltia_subtitle.enddatetime >= '$now' ORDER BY foltia_subtitle.startdatetime ASC LIMIT 1000 "; ///////////////////////////////////////////////////////////// //レコード総数取得 $query = " SELECT COUNT(*) AS cnt FROM foltia_subtitle , foltia_program ,foltia_station WHERE foltia_program.tid = foltia_subtitle.tid AND foltia_station.stationid = foltia_subtitle.stationid AND foltia_subtitle.enddatetime >= ? LIMIT 1000 "; $rs = sql_query($con, $query, "DBクエリに失敗しました",array($now)); $rowdata = $rs->fetch(); $dtcnt = htmlspecialchars($rowdata[0]); // echo $dtcnt; if (! $rowdata) { die_exit("番組データがありません
"); }//endif //////////////////////////////////////////////////////////// //レコード表示 $query = " SELECT foltia_program.tid, stationname, foltia_program.title, foltia_subtitle.countno, foltia_subtitle.subtitle, foltia_subtitle.startdatetime, foltia_subtitle.lengthmin, foltia_subtitle.pid, foltia_subtitle.startoffset FROM foltia_subtitle , foltia_program ,foltia_station WHERE foltia_program.tid = foltia_subtitle.tid AND foltia_station.stationid = foltia_subtitle.stationid AND foltia_subtitle.enddatetime >= ? ORDER BY foltia_subtitle.startdatetime ASC LIMIT $lim OFFSET $st "; ///////////////////////////////////////////////////////////////// }//end if //$rs = m_query($con, $query, "DBクエリに失敗しました"); $rs = sql_query($con, $query, "DBクエリに失敗しました",array($now)); $rowdata = $rs->fetch(); // // if (! $rowdata) { header("Status: 404 Not Found",TRUE,404); printtitle(); print "
\n"; printhtmlpageheader(); print "
\n"; die_exit("番組データがありません
"); }//endif printtitle(); ?>


放映番組リストを表示します。

columnCount(); //Autopager echo "
"; ?> \n"); // TID print "\n"; // 放映局 echo("\n"); // タイトル print "\n"; // 話数 echo("\n"); // サブタイ if ($pid > 0 ){ print "\n"; }else{ print "\n"; } // 開始時刻(ズレ) echo("\n"); // 総尺 echo("\n"); echo("\n"); } while ($rowdata = $rs->fetch()); ?>
TID 放映局 タイトル 話数 サブタイトル 開始時刻(ズレ) 総尺
"; if ($tid == 0 ){ print "$tid"; }else{ print "$tid"; } print "".htmlspecialchars($rowdata[1])."
"; if ($tid == 0 ){ print "$title"; }else{ print "$title"; } print "".htmlspecialchars($rowdata[3])."
$subtitle
$subtitle
".htmlspecialchars(foldate2print($rowdata[5]))."
(".htmlspecialchars($rowdata[8]).")
".htmlspecialchars($rowdata[6])."