チェンジセット 94: trunk/install/php/reserveepg.php

差分発生行の前後
無視リスト:
コミット日時:
2010/02/28 22:28:26 (15 年前)
コミッタ:
sorshi
ログメッセージ:

SQLite採用

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • trunk/install/php/reserveepg.php

    r70 r94  
    5656        stationname , stationrecch ,stationid  
    5757        FROM foltia_epg , foltia_station  
    58         WHERE epgid='$epgid' AND foltia_station.ontvcode = foltia_epg.ontvchannel 
     58        WHERE epgid = ? AND foltia_station.ontvcode = foltia_epg.ontvchannel 
    5959        ";//4812 
    60       $rs = m_query($con, $query, "DBクエリに失敗しました"); 
    61         $maxrows = pg_num_rows($rs); 
    62                          
    63                if ($maxrows == 0) { 
     60//    $rs = m_query($con, $query, "DBクエリに失敗しました"); 
     61        $rs = sql_query($con, $query, "DBクエリに失敗しました",array($epgid)); 
     62$rowdata = $rs->fetch(); 
     63if (! $rowdata) { 
    6464                die_exit("登録番組がありません<BR>"); 
    6565                } 
    66                 $rowdata = pg_fetch_row($rs, 0); 
     66 
    6767                //$title = htmlspecialchars($rowdata[0]); 
    6868?> 
     
    136136$query = " 
    137137SELECT 
    138 foltia_program .title, 
    139 foltia_program .tid, 
    140 stationname, 
    141 foltia_station.stationid ,   
    142 foltia_subtitle.countno, 
    143 foltia_subtitle.subtitle, 
    144 foltia_subtitle.startdatetime , 
    145 foltia_subtitle.lengthmin , 
    146 foltia_tvrecord.bitrate  ,  
    147 foltia_subtitle.startoffset ,  
    148 foltia_subtitle.pid   
     138 foltia_program.title, foltia_program.tid, stationname, 
     139 foltia_station.stationid, foltia_subtitle.countno, 
     140 foltia_subtitle.subtitle, foltia_subtitle.startdatetime, 
     141 foltia_subtitle.lengthmin, foltia_tvrecord.bitrate, 
     142 foltia_subtitle.startoffset, foltia_subtitle.pid 
    149143FROM foltia_subtitle , foltia_program ,foltia_station ,foltia_tvrecord 
    150144WHERE 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 
    151 AND foltia_subtitle.startdatetime ='$startfoltime'  
    152 AND foltia_subtitle.enddatetime = '$endfoltime'  
    153 AND foltia_station.stationid = '$stationid'   
     145AND foltia_subtitle.startdatetime = ?  
     146AND foltia_subtitle.enddatetime = ?  
     147AND foltia_station.stationid = ?  
    154148UNION 
    155149SELECT 
    156 foltia_program .title, 
    157 foltia_program .tid, 
    158 stationname, 
    159 foltia_station.stationid ,   
    160 foltia_subtitle.countno, 
    161 foltia_subtitle.subtitle, 
    162 foltia_subtitle.startdatetime , 
    163 foltia_subtitle.lengthmin , 
    164 foltia_tvrecord.bitrate ,  
    165 foltia_subtitle.startoffset ,  
    166 foltia_subtitle.pid   
     150 foltia_program.title, foltia_program.tid, stationname, 
     151 foltia_station.stationid, foltia_subtitle.countno, 
     152 foltia_subtitle.subtitle, foltia_subtitle.startdatetime, 
     153 foltia_subtitle.lengthmin, foltia_tvrecord.bitrate, 
     154 foltia_subtitle.startoffset, foltia_subtitle.pid 
    167155FROM foltia_tvrecord 
    168156LEFT OUTER JOIN foltia_subtitle on (foltia_tvrecord.tid = foltia_subtitle.tid ) 
     
    170158LEFT OUTER JOIN foltia_station on (foltia_subtitle.stationid = foltia_station.stationid ) 
    171159WHERE foltia_tvrecord.stationid = 0  
    172 AND foltia_subtitle.startdatetime ='$startfoltime'  
    173 AND foltia_subtitle.enddatetime = '$endfoltime'  
    174 AND foltia_station.stationid = '$stationid'  
     160AND foltia_subtitle.startdatetime = ?  
     161AND foltia_subtitle.enddatetime = ?  
     162AND foltia_station.stationid = ?  
    175163"; 
    176164 
    177  
    178  
    179         $rs = m_query($con, $query, "DBクエリに失敗しました"); 
    180         $maxrows = pg_num_rows($rs); 
    181  
    182165//print "<!--$query \n $maxrows\n -->"; 
    183166 
    184167print "<form name=\"recordingsetting\" method=\"POST\" action=\"reserveepgcomp.php\">\n"; 
    185168 
    186                 if ($maxrows == 0) { 
     169//$rs = m_query($con, $query, "DBクエリに失敗しました"); 
     170$rs = sql_query($con, $query, "DBクエリに失敗しました",array($startfoltime,$endfoltime,$stationid,$startfoltime,$endfoltime,$stationid)); 
     171$chkoverwrap = $rs->fetch(); 
     172if (! $chkoverwrap) { 
    187173                //重複なし 
    188174                print "<input type=\"submit\" value=\"予約\" ><br>\n"; 
    189175                }else{ 
    190                 $chkoverwrap = pg_fetch_row($rs, 0); 
    191176                $prereservedtitle = htmlspecialchars($chkoverwrap[0]); 
    192177                $tid =  htmlspecialchars($chkoverwrap[1]); 
track feed