Index: trunk/install/php/m.php =================================================================== --- trunk/install/php/m.php (リビジョン 46) +++ trunk/install/php/m.php (リビジョン 46) @@ -0,0 +1,244 @@ + + + + + + + + "; + +print "foltia:番組手動予約 +"; +}//end function printtitle() + +printtitle(); +?> + +
+ +
+

+番組手動予約 +

+
+全項目手動指定で予約します。

\n"; +}else{ + +$lengthmin = getgetnumform(lengthmin); +$recstid = getgetnumform(recstid); +$pname = getgetform(pname); +//確認 +$startdatetime = "$startdate"."$starttime"; +if (foldatevalidation($startdatetime)){ +//print "valid"; +}else{ + $errflag = 1; + $errmsg = "日付が不正です。"; +} +if ($lengthmin < 361){ +//valid +}else{ + $errflag = 2; + $errmsg = "録画時間は360分で区切ってください。"; +} +//局確認 +if ($recstid != ""){ +$query = " +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{ + $errflag = 3; + $errmsg = "放送局設定が異常です。"; + } +} +//正しければ +if ($errflag == 0){ +//重複があるか? +//未チェック + +//デモモードじゃなかったら書き込み +$enddatetime = calcendtime($startdatetime,$lengthmin); + +//時刻検査 +if (($startdatetime > $now ) && ($enddatetime > $now ) && ($enddatetime > $startdatetime ) ){ + +//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 ; + }else{ + $rowdata = pg_fetch_row($rs, 0); + $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){ + $nextcno = 1 ; + }else{ + $rowdata = pg_fetch_row($rs, 0); + $nextcno = $rowdata[0]; + $nextcno++ ; + } + +//INSERT +if ($demomode){ +}else{ + +$query = " +insert into foltia_subtitle +values ( '$insertpid','0','$recstid', + '$nextcno','$pname','$startdatetime','$enddatetime','0' ,'$lengthmin')"; + + $rs = m_query($con, $query, "DBクエリに失敗しました"); + +//addatq.pl +//キュー入れプログラムをキック +//引数 TID チャンネルID +//echo("$toolpath/perl/addatq.pl $tid $station"); + + $oserr = system("$toolpath/perl/addatq.pl 0 0"); + +}//end if demomode + +print "下記予約を完了いたしました。
"; +//結果表示 +print "録画開始:"; +echo foldate2print($startdatetime); +print "
+録画終了:"; +echo foldate2print($enddatetime); +print "
+録画尺: $lengthmin 分
+録画局:$recstationname[0]
+番組名:$pname
+"; +exit(); +}else{ +print "時刻が不正なために予約できませんでした。
"; + +} + + +}else{ + print "入力項目が正しくなさそうです。$errmsg
\n"; +} + +}// 初回表示かデータ処理か +?> +
+

放送日: + + 年月日 Ex.19800121

+

録画開始時刻: + + 時分 Ex.2304

+

+ 録画尺: + + 分 (最長360分)

+

録画局: + 0 +ORDER BY \"stationid\" ASC"; + + $stations = m_query($con, $query, "DBクエリに失敗しました"); + $stationcount = pg_num_rows($stations); + +if ($stationcount > 0 ){ + for ($row = 0; $row < $stationcount ; $row++) { + $rowdata = pg_fetch_row($stations, $row); + if ($recstid == $rowdata[0]){ + print " $rowdata[1] ($rowdata[2]ch) \n"; + }else{ + print " $rowdata[1] ($rowdata[2]ch) \n"; + } + } +}else{ +print "放送局データベースが正しくセットアップされていません。録画可能局がありません"; +} + +$query = " +SELECT stationid,stationname,stationrecch +FROM foltia_station +WHERE stationrecch > -2 AND stationrecch < 1 +ORDER BY \"stationid\" ASC"; + + $stations = m_query($con, $query, "DBクエリに失敗しました"); + $stationcount = pg_num_rows($stations); + +if ($stationcount > 0 ){ + for ($row = 0; $row < $stationcount ; $row++) { + $rowdata = pg_fetch_row($stations, $row); + if ($rowdata[0] != 0){ + if ($recstid == $rowdata[0]){ + print " $rowdata[1] \n"; + }else{ + print " $rowdata[1] \n"; + } + + } + } +} + +?> +

番組名: + +

+  +
+ + + Index: trunk/install/php/foltialib.php =================================================================== --- trunk/install/php/foltialib.php (リビジョン 32) +++ trunk/install/php/foltialib.php (リビジョン 46) @@ -457,5 +457,5 @@ if ($freebytes == "" ){ // -print ""; +//print ""; }elseif($freebytes > 1024*1024*100 ){// 100GB以上あいてれば //なにもしない @@ -486,5 +486,5 @@ "; }else{ -print ""; +//print ""; @@ -497,5 +497,27 @@ - +function foldatevalidation($foldate){ + +if (strlen($foldate) == 12 ){ + + $startyear = substr($foldate,0,4); + $startmonth = substr($foldate,4,2); + $startday = substr($foldate,6,2); + $starthour = substr($foldate,8,2); + $startmin = substr($foldate,10,2); + + $startepoch = date ("U",mktime($starthour , $startmin , 0, $startmonth , $startday, $startyear)); + $nowe = time(); + if ($startepoch > $nowe){ + //print "$foldate:$startepoch:$nowe"; + return TRUE; + }else{ + return FALSE; + } //end if $startepoch > $nowe +}else{ + return FALSE; +}//end if ($foldate) == 12 + +}//end function Index: trunk/install/php/viewepg.php =================================================================== --- trunk/install/php/viewepg.php (リビジョン 42) +++ trunk/install/php/viewepg.php (リビジョン 46) @@ -23,5 +23,5 @@ -foltia:EPG +foltia:EPG番組表 -

EPG番組表

-
+

EPG番組表

+

番組手動予約

+

EPG番組表を表示します。