チェンジセット 94: trunk/install/php/reserveprogram.php
- コミット日時:
- 2010/02/28 22:28:26 (15 年前)
- ファイル:
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
trunk/install/php/reserveprogram.php
r83 r94 53 53 54 54 //タイトル取得 55 $query = "select title from foltia_program where tid ='$tid'";56 $rs = m_query($con, $query, "DBクエリに失敗しました");57 $maxrows = pg_num_rows($rs);58 59 if ($maxrows == 0) {55 $query = "select title from foltia_program where tid = ? "; 56 // $rs = m_query($con, $query, "DBクエリに失敗しました"); 57 $rs = sql_query($con, $query, "DBクエリに失敗しました",array($tid)); 58 $rowdata = $rs->fetch(); 59 if (! $rowdata) { 60 60 die_exit("登録番組がありません<BR>"); 61 61 } 62 $rowdata = pg_fetch_row($rs, 0); 62 63 63 $title = htmlspecialchars($rowdata[0]); 64 64 ?> … … 100 100 FROM foltia_subtitle , foltia_program ,foltia_station 101 101 WHERE foltia_program.tid = foltia_subtitle.tid AND foltia_station.stationid = foltia_subtitle.stationid 102 AND foltia_program.tid = '$tid'102 AND foltia_program.tid = ? 103 103 ORDER BY stationrecch DESC 104 104 "; 105 106 $rs = m_query($con, $query, "DBクエリに失敗しました"); 107 $maxrows = pg_num_rows($rs); 108 109 if ($maxrows == 0) { 105 // $rs = m_query($con, $query, "DBクエリに失敗しました"); 106 $rs = sql_query($con, $query, "DBクエリに失敗しました",array($tid)); 107 $rowdata = $rs->fetch(); 108 if (! $rowdata) { 110 109 echo("放映局情報がまだはいってません<BR>"); 111 110 } 112 111 else{ 113 $maxcols = pg_num_fields($rs);112 $maxcols = $rs->columnCount(); 114 113 115 114 echo("<select name=\"station\">\n"); 116 115 /* テーブルのデータを出力 */ 117 for ($row = 0; $row < $maxrows; $row++) { /* 行に対応 */ 118 /* pg_fetch_row で一行取り出す */ 119 $rowdata = pg_fetch_row($rs, $row); 116 do { 120 117 echo("<option value=\""); 121 118 echo(htmlspecialchars($rowdata[0])); … … 123 120 echo(htmlspecialchars($rowdata[1])); 124 121 echo("</option>\n"); 125 }//for122 } while ($rowdata = $rs->fetch()); 126 123 echo("<option value=\"0\">全局</option>\n</select>\n"); 127 124 }//endif … … 182 179 FROM foltia_subtitle , foltia_program ,foltia_station 183 180 WHERE foltia_program.tid = foltia_subtitle.tid AND foltia_station.stationid = foltia_subtitle.stationid 184 AND foltia_subtitle.startdatetime >= '$now' AND foltia_program.tid ='$tid'181 AND foltia_subtitle.startdatetime >= ? AND foltia_program.tid = ? 185 182 ORDER BY foltia_subtitle.startdatetime ASC 186 183 "; 187 $rs = m_query($con, $query, "DBクエリに失敗しました");188 $maxrows = pg_num_rows($rs);189 190 if ($maxrows == 0) {184 // $rs = m_query($con, $query, "DBクエリに失敗しました"); 185 $rs = sql_query($con, $query, "DBクエリに失敗しました",array($now,$tid)); 186 $rowdata = $rs->fetch(); 187 if (! $rowdata) { 191 188 echo("放映予定はありません<BR>"); 192 189 } 193 190 else{ 194 $maxcols = pg_num_fields($rs);191 $maxcols = $rs->columnCount(); 195 192 ?> 196 193 <table BORDER="0" CELLPADDING="0" CELLSPACING="2" WIDTH="100%" BGCOLOR="#bcf1be"> … … 210 207 <?php 211 208 /* テーブルのデータを出力 */ 212 for ($row = 0; $row < $maxrows; $row++) { /* 行に対応 */ 209 do { 213 210 echo("<tr>\n"); 214 /* pg_fetch_row で一行取り出す */215 $rowdata = pg_fetch_row($rs, $row);216 217 211 for ($col = 0; $col < $maxcols; $col++) { /* 列に対応 */ 218 212 if ($col == 3){ … … 223 217 } 224 218 echo("</tr>\n"); 225 } 219 } while ($rowdata = $rs->fetch()); 226 220 }//end if 227 221 ?>