"; }//end function printtitle() //同一番組他局検索 $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 >= '$now' ORDER BY \"startdatetime\" ASC "; $reservedrssametid = m_query($con, $query, "DBクエリに失敗しました"); $reservedmaxrowssameid = pg_num_rows($reservedrssametid); if ($reservedmaxrowssameid > 0 ){ for ($rrow = 0; $rrow < $reservedmaxrowssameid ; $rrow++) { $rowdata = pg_fetch_row($reservedrssametid, $rrow); $reservedpidsametid[] = $rowdata[7]; } $rowdata = ""; $rrow = ""; }else{ $reservedpidsametid = "" ; }//end if //録画番組検索 $query = " 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_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 \"startdatetime\" ASC "; $reservedrs = m_query($con, $query, "DBクエリに失敗しました"); $reservedmaxrows = pg_num_rows($reservedrs); if ($reservedmaxrows > 0 ){ for ($rrow = 0; $rrow < $reservedmaxrows ; $rrow++) { $rowdata = pg_fetch_row($reservedrs, $rrow); $reservedpid[] = $rowdata[8]; } }else{ $reservedpid = ""; }//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 "; $rs = m_query($con, $query, "DBクエリに失敗しました"); $maxrows = pg_num_rows($rs); }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 "; $rs = m_query($con, $query, "DBクエリに失敗しました"); $maxrows = pg_num_rows($rs); }//end if if ($maxrows == 0) { header("Status: 404 Not Found",TRUE,404); printtitle(); print "
放映番組リストを表示します。
/* フィールド数 */ $maxcols = pg_num_fields($rs); ?>TID | 放映局 | タイトル | 話数 | サブタイトル | 開始時刻(ズレ) | 総尺 | "; if ($tid == 0 ){ print "$tid"; }else{ print "$tid"; } print " | \n"; // 放映局 echo("".htmlspecialchars($rowdata[1])." | \n");
// タイトル
print ""; if ($tid == 0 ){ print "$title"; }else{ print "$title"; } print " | \n"; // 話数 echo("".htmlspecialchars($rowdata[3])." | \n");
// サブタイ
if ($pid > 0 ){
print "$subtitle | \n";
}else{
print "$subtitle | \n";
}
// 開始時刻(ズレ)
echo("".htmlspecialchars(foldate2print($rowdata[5]))." (".htmlspecialchars($rowdata[8]).") | \n");
// 総尺
echo("".htmlspecialchars($rowdata[6])." | \n");
echo("\n");
}
?>
---|