Index: trunk/install/php/m.php
===================================================================
--- trunk/install/php/m.php (リビジョン 83)
+++ trunk/install/php/m.php (リビジョン 94)
@@ -97,12 +97,9 @@
SELECT stationname
FROM foltia_station
-WHERE stationid = $recstid";
- $stationvalid = m_query($con, $query, "DBクエリに失敗しました");
- $stationcount = pg_num_rows($stationvalid);
-
- if ($stationcount == 1){
- $recstationname = pg_fetch_row($stationvalid, 0);
- //valid
- }else{
+WHERE stationid = ? ";
+// $stationvalid = m_query($con, $query, "DBクエリに失敗しました");
+ $stationvalid = sql_query($con, $query, "DBクエリに失敗しました",array($recstid));
+ $recstationname = $stationvalid->fetch();
+ if (! $recstationname) {
$errflag = 3;
$errmsg = "放送局設定が異常です。";
@@ -128,21 +125,25 @@
//min pidを探す
$query = "SELECT min(pid) FROM foltia_subtitle ";
- $rs = m_query($con, $query, "DBクエリに失敗しました");
- $maxrows = pg_num_rows($rs);
- if ($maxrows == 0){
- $insertpid = -1 ;
+// $rs = m_query($con, $query, "DBクエリに失敗しました");
+ $rs = sql_query($con, $query, "DBクエリに失敗しました");
+ $rowdata = $rs->fetch();
+ if (! $rowdata) {
+ $insertpid = -1 ;
}else{
- $rowdata = pg_fetch_row($rs, 0);
- $insertpid = $rowdata[0];
- $insertpid-- ;
+ if ($rowdata[0] > 0) {
+ $insertpid = -1 ;
+ }else{
+ $insertpid = $rowdata[0];
+ $insertpid-- ;
+ }
}
// next 話数を探す
$query = "SELECT max(countno) FROM foltia_subtitle WHERE tid = 0";
- $rs = m_query($con, $query, "DBクエリに失敗しました");
- $maxrows = pg_num_rows($rs);
- if ($maxrows == 0){
+// $rs = m_query($con, $query, "DBクエリに失敗しました");
+ $rs = sql_query($con, $query, "DBクエリに失敗しました");
+ $rowdata = $rs->fetch();
+ if (! $rowdata) {
$nextcno = 1 ;
}else{
- $rowdata = pg_fetch_row($rs, 0);
$nextcno = $rowdata[0];
$nextcno++ ;
@@ -159,8 +160,9 @@
insert into foltia_subtitle (pid ,tid ,stationid , countno ,subtitle ,
startdatetime ,enddatetime ,startoffset , lengthmin , epgaddedby )
- values ( '$insertpid','0','$recstid',
- '$nextcno','$pname','$startdatetime','$enddatetime','0' ,'$lengthmin', '$memberid')";
+ values ( ?,'0',?,?,?,?,?,'0',?,?)";
- $rs = m_query($con, $query, "DBクエリに失敗しました");
+// $rs = m_query($con, $query, "DBクエリに失敗しました");
+//print "【DEBUG】$insertpid,$recstid,$nextcno,$pname,$startdatetime,$enddatetime ,$lengthmin,$memberid
\n";
+ $rs = sql_query($con, $query, "DBクエリに失敗しました",array($insertpid,$recstid,$nextcno,$pname,$startdatetime,$enddatetime ,$lengthmin,$memberid));
//addatq.pl
@@ -168,6 +170,21 @@
//引数 TID チャンネルID
//echo("$toolpath/perl/addatq.pl $tid $station");
-
- $oserr = system("$toolpath/perl/addatq.pl 0 0");
+ exec("$toolpath/perl/addatq.pl 0 0");
+ $oserr = system("$toolpath/perl/addatq.pl 0 0");
+ //---------------------------------------------------
+ if ($oserr){
+ print "[DEBUG]$oserr 「$toolpath/perl/addatq.pl 0 0」
\n";
+ }else{
+ print "[DEBUG]exec addatq.pl false 「$toolpath/perl/addatq.pl 0 0」
\n";
+
+ $oserr = system("$toolpath/perl/perltestscript.pl");
+ if ($oserr){
+ print "[DEBUG]exec perltestscript.pl $oserr
\n";
+ }else{
+ print "[DEBUG]exec perltestscript.pl false
\n";
+ }
+
+ }
+ //-----------------------------------------------------
}else{
print "EPG予約を行う権限がありません。";
@@ -200,5 +217,5 @@
}// 初回表示かデータ処理か
?>
-