Index: trunk/install/php/delreserve.php =================================================================== --- trunk/install/php/delreserve.php (リビジョン 128) +++ trunk/install/php/delreserve.php (リビジョン 1) @@ -17,19 +17,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 - ?> @@ -44,13 +29,16 @@ "); } - $sid = getgetnumform("sid"); +$sid = getgetnumform(sid); if ($sid == "") { die_exit("局がありません
"); } +$con = m_connect(); $now = date("YmdHi"); ?> @@ -69,13 +57,14 @@ foltia_tvrecord.stationid FROM foltia_tvrecord , foltia_program , foltia_station -WHERE foltia_tvrecord.tid = foltia_program.tid AND foltia_tvrecord.stationid = foltia_station .stationid AND foltia_tvrecord.tid = ? AND foltia_tvrecord.stationid = ? "; +WHERE foltia_tvrecord.tid = foltia_program.tid AND foltia_tvrecord.stationid = foltia_station .stationid AND foltia_tvrecord.tid = $tid AND foltia_tvrecord.stationid = $sid "; -// $rs = m_query($con, $query, "DBクエリに失敗しました"); - $rs = sql_query($con, $query, "DBクエリに失敗しました",array($tid,$sid)); -$rowdata = $rs->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); + $tid = htmlspecialchars($rowdata[0]); $stationname = htmlspecialchars($rowdata[1]); @@ -105,8 +94,6 @@ DELETE FROM foltia_tvrecord -WHERE foltia_tvrecord.tid = ? AND foltia_tvrecord.stationid = ? "; -$rs->closeCursor(); -// $rs = m_query($con, $query, "DBクエリに失敗しました"); - $rs = sql_query($con, $query, "DBクエリに失敗しました",array($tid,$sid)); +WHERE foltia_tvrecord.tid = $tid AND foltia_tvrecord.stationid = $sid "; + $rs = m_query($con, $query, "DBクエリに失敗しました"); } @@ -128,7 +115,7 @@ - - - + + + @@ -164,14 +151,15 @@ FROM foltia_subtitle , foltia_program ,foltia_station WHERE foltia_program.tid = foltia_subtitle.tid AND foltia_station.stationid = foltia_subtitle.stationid - AND foltia_subtitle.startdatetime >= ? AND foltia_program.tid = ? + AND foltia_subtitle.startdatetime >= '$now' AND foltia_program.tid ='$tid' ORDER BY foltia_subtitle.startdatetime ASC "; -// $rs = m_query($con, $query, "DBクエリに失敗しました"); - $rs = sql_query($con, $query, "DBクエリに失敗しました",array($now,$tid)); -$rowdata = $rs->fetch(); -if (! $rowdata) { + $rs = m_query($con, $query, "DBクエリに失敗しました"); + $maxrows = pg_num_rows($rs); + + if ($maxrows == 0) { echo("放映予定はありません
"); -}else{ - $maxcols = $rs->columnCount(); + } + else{ + $maxcols = pg_num_fields($rs); ?> @@ -191,11 +179,14 @@ \n"); + /* pg_fetch_row で一行取り出す */ + $rowdata = pg_fetch_row($rs, $row); + for ($col = 0; $col < $maxcols; $col++) { /* 列に対応 */ echo("\n"); } echo("\n"); - } while ($row = $rs->fetch()); + } }//end if ?>
".htmlspecialchars($rowdata[$col])."