チェンジセット 94: trunk/install/php/m.php
- コミット日時:
- 2010/02/28 22:28:26 (15 年前)
- ファイル:
-
- trunk/install/php/m.php (更新) (8 diffs)
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
trunk/install/php/m.php
r83 r94 97 97 SELECT stationname 98 98 FROM foltia_station 99 WHERE stationid = $recstid"; 100 $stationvalid = m_query($con, $query, "DBクエリに失敗しました"); 101 $stationcount = pg_num_rows($stationvalid); 102 103 if ($stationcount == 1){ 104 $recstationname = pg_fetch_row($stationvalid, 0); 105 //valid 106 }else{ 99 WHERE stationid = ? "; 100 // $stationvalid = m_query($con, $query, "DBクエリに失敗しました"); 101 $stationvalid = sql_query($con, $query, "DBクエリに失敗しました",array($recstid)); 102 $recstationname = $stationvalid->fetch(); 103 if (! $recstationname) { 107 104 $errflag = 3; 108 105 $errmsg = "放送局設定が異常です。"; … … 128 125 //min pidを探す 129 126 $query = "SELECT min(pid) FROM foltia_subtitle "; 130 $rs = m_query($con, $query, "DBクエリに失敗しました"); 131 $maxrows = pg_num_rows($rs); 132 if ($maxrows == 0){ 133 $insertpid = -1 ; 127 // $rs = m_query($con, $query, "DBクエリに失敗しました"); 128 $rs = sql_query($con, $query, "DBクエリに失敗しました"); 129 $rowdata = $rs->fetch(); 130 if (! $rowdata) { 131 $insertpid = -1 ; 134 132 }else{ 135 $rowdata = pg_fetch_row($rs, 0); 136 $insertpid = $rowdata[0]; 137 $insertpid-- ; 133 if ($rowdata[0] > 0) { 134 $insertpid = -1 ; 135 }else{ 136 $insertpid = $rowdata[0]; 137 $insertpid-- ; 138 } 138 139 } 139 140 // next 話数を探す 140 141 $query = "SELECT max(countno) FROM foltia_subtitle WHERE tid = 0"; 141 $rs = m_query($con, $query, "DBクエリに失敗しました"); 142 $maxrows = pg_num_rows($rs); 143 if ($maxrows == 0){ 142 // $rs = m_query($con, $query, "DBクエリに失敗しました"); 143 $rs = sql_query($con, $query, "DBクエリに失敗しました"); 144 $rowdata = $rs->fetch(); 145 if (! $rowdata) { 144 146 $nextcno = 1 ; 145 147 }else{ 146 $rowdata = pg_fetch_row($rs, 0);147 148 $nextcno = $rowdata[0]; 148 149 $nextcno++ ; … … 159 160 insert into foltia_subtitle (pid ,tid ,stationid , countno ,subtitle , 160 161 startdatetime ,enddatetime ,startoffset , lengthmin , epgaddedby ) 161 values ( '$insertpid','0','$recstid', 162 '$nextcno','$pname','$startdatetime','$enddatetime','0' ,'$lengthmin', '$memberid')"; 162 values ( ?,'0',?,?,?,?,?,'0',?,?)"; 163 163 164 $rs = m_query($con, $query, "DBクエリに失敗しました"); 164 // $rs = m_query($con, $query, "DBクエリに失敗しました"); 165 //print "【DEBUG】$insertpid,$recstid,$nextcno,$pname,$startdatetime,$enddatetime ,$lengthmin,$memberid <br>\n"; 166 $rs = sql_query($con, $query, "DBクエリに失敗しました",array($insertpid,$recstid,$nextcno,$pname,$startdatetime,$enddatetime ,$lengthmin,$memberid)); 165 167 166 168 //addatq.pl … … 168 170 //引数 TID チャンネルID 169 171 //echo("$toolpath/perl/addatq.pl $tid $station"); 170 171 $oserr = system("$toolpath/perl/addatq.pl 0 0"); 172 exec("$toolpath/perl/addatq.pl 0 0"); 173 $oserr = system("$toolpath/perl/addatq.pl 0 0"); 174 //--------------------------------------------------- 175 if ($oserr){ 176 print "[DEBUG]$oserr 「$toolpath/perl/addatq.pl 0 0」<br>\n"; 177 }else{ 178 print "[DEBUG]exec addatq.pl false 「$toolpath/perl/addatq.pl 0 0」<br>\n"; 179 180 $oserr = system("$toolpath/perl/perltestscript.pl"); 181 if ($oserr){ 182 print "[DEBUG]exec perltestscript.pl $oserr<br>\n"; 183 }else{ 184 print "[DEBUG]exec perltestscript.pl false <br>\n"; 185 } 186 187 } 188 //----------------------------------------------------- 172 189 }else{ 173 190 print "EPG予約を行う権限がありません。"; … … 200 217 }// 初回表示かデータ処理か 201 218 ?> 202 <form id="record" name="record" method="get" action="./m.php" >219 <form id="record" name="record" method="get" action="./m.php" autocomplete="off"> 203 220 <p>放送日: 204 221 <input name="startdate" type="text" id="startdate" size="9" value="<?=$startdate?>" /> … … 215 232 <?php 216 233 $query = " 217 SELECT stationid ,stationname,stationrecch ,digitalch234 SELECT stationid as x, stationname, stationrecch, digitalch 218 235 FROM foltia_station 219 236 WHERE stationrecch > 0 … … 221 238 SELECT DISTINCT stationid,stationname,stationrecch ,digitalch 222 239 FROM foltia_station 223 WHERE digitalch > 0 224 ORDER BY \"stationid\" ASC"; 225 226 $stations = m_query($con, $query, "DBクエリに失敗しました"); 227 $stationcount = pg_num_rows($stations); 228 229 if ($stationcount > 0 ){ 230 for ($row = 0; $row < $stationcount ; $row++) { 231 $rowdata = pg_fetch_row($stations, $row); 240 WHERE digitalch > 0 241 ORDER BY x ASC"; 242 243 $stations = sql_query($con, $query, "DBクエリに失敗しました"); 244 $rowdata = $stations->fetch(); 245 246 if ($rowdata) { 247 do { 232 248 if ($recstid == $rowdata[0]){ 233 print " <input name=\"recstid\" type=\"radio\" value=\"$rowdata[0]\" checked /> $rowdata[1] ($rowdata[2]ch ) \n";249 print " <input name=\"recstid\" type=\"radio\" value=\"$rowdata[0]\" checked /> $rowdata[1] ($rowdata[2]ch / $rowdata[3]ch) \n"; 234 250 }else{ 235 print " <input name=\"recstid\" type=\"radio\" value=\"$rowdata[0]\" /> $rowdata[1] ($rowdata[2]ch ) \n";251 print " <input name=\"recstid\" type=\"radio\" value=\"$rowdata[0]\" /> $rowdata[1] ($rowdata[2]ch / $rowdata[3]ch) \n"; 236 252 } 237 }253 } while ($rowdata = $stations->fetch()); 238 254 }else{ 239 255 print "放送局データベースが正しくセットアップされていません。録画可能局がありません"; 240 256 } 241 257 //外部入力チャンネル 242 258 $query = " 243 SELECT stationid ,stationname,stationrecch259 SELECT stationid as x ,stationname,stationrecch 244 260 FROM foltia_station 245 261 WHERE stationrecch > -2 AND stationrecch < 1 246 ORDER BY \"stationid\" ASC"; 247 248 $stations = m_query($con, $query, "DBクエリに失敗しました"); 249 $stationcount = pg_num_rows($stations); 250 251 if ($stationcount > 0 ){ 252 for ($row = 0; $row < $stationcount ; $row++) { 253 $rowdata = pg_fetch_row($stations, $row); 262 ORDER BY x ASC"; 263 264 // $stations = m_query($con, $query, "DBクエリに失敗しました"); 265 $stations = sql_query($con, $query, "DBクエリに失敗しました"); 266 $rowdata = $stations->fetch(); 267 if ($rowdata) { 268 do { 254 269 if ($rowdata[0] != 0){ 255 270 if ($recstid == $rowdata[0]){ … … 260 275 261 276 } 262 } 277 } while ($rowdata = $stations->fetch()); 263 278 } 264 279 /*