root/trunk/install/php/reserveepgcomp.php

リビジョン 83, 3.7 kB (コミッタ: sorshi, コミット時期: 15 年 前)

foltiaHD最初のリリース。
デジタル録画はFriio/Friio BS/CSのみに対応。
ivtvは1.0系使用になりました。

Line 
1 <?php
2 /*
3  Anime recording system foltia
4  http://www.dcc-jpl.com/soft/foltia/
5
6 reserveepgcomp.php
7
8 目的
9 EPG番組の予約登録をします。
10
11 引数
12 stationid:録画局ID
13 subtitle:番組名
14 startdatetime:録画開始時刻 (ex.200510070145)
15 enddatetime:録画終了時刻 (ex.200510070215)
16 lengthmin:録画時間(単位:分)
17
18  DCC-JPL Japan/foltia project
19
20 */
21
22 include("./foltialib.php");
23 $con = m_connect();
24
25 if ($useenvironmentpolicy == 1){
26 if (!isset($_SERVER['PHP_AUTH_USER'])) {
27     header("WWW-Authenticate: Basic realm=\"foltia\"");
28     header("HTTP/1.0 401 Unauthorized");
29     redirectlogin();
30     exit;
31 } else {
32 login($con,$_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW']);
33 }
34 }//end if login
35
36
37 ?>
38 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
39 <html lang="ja">
40 <head>
41 <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP">
42 <meta http-equiv="Content-Style-Type" content="text/css">
43 <link rel="stylesheet" type="text/css" href="graytable.css">
44 <body BGCOLOR="#ffffff" TEXT="#494949" LINK="#0047ff" VLINK="#000000" ALINK="#c6edff" >
45
46 <?php
47
48     printhtmlpageheader();
49 ?>
50   <p align="left"><font color="#494949" size="6">番組予約</font></p>
51   <hr size="4">
52 <?php
53
54 $stationid = getnumform(stationid);
55 $subtitle = getform(subtitle);
56 $startdatetime = getnumform(startdatetime);
57 $enddatetime = getnumform(enddatetime);
58 $lengthmin = getnumform(lengthmin);
59
60         if ($stationid == "" || $startdatetime < 0 ||  $enddatetime < 0 || $lengthmin < 0) {
61         print "    <title>foltia:EPG予約:Error</title></head>\n";
62         die_exit("登録番組がありません<BR>");
63         }
64 print "    <title>foltia:EPG予約:完了</title>
65 </head>\n";
66 $now = date("YmdHi");   
67 // - DB登録作業
68
69 //時刻検査
70 if (($startdatetime > $now ) && ($enddatetime > $now ) && ($enddatetime  > $startdatetime ) ){
71
72 //min pidを探す
73 $query = "SELECT min(pid) FROM  foltia_subtitle ";
74     $rs = m_query($con, $query, "DBクエリに失敗しました");
75     $maxrows = pg_num_rows($rs);
76     if ($maxrows == 0){
77     $insertpid = -1 ;
78     }else{
79     $rowdata = pg_fetch_row($rs, 0);
80     
81     $insertpid = $rowdata[0];
82         if ($insertpid > 0){
83         $insertpid = -1;
84         }else{
85         $insertpid-- ;
86         }
87     }
88 // next 話数を探す
89 $query = "SELECT max(countno) FROM  foltia_subtitle WHERE tid = 0";
90     $rs = m_query($con, $query, "DBクエリに失敗しました");
91     $maxrows = pg_num_rows($rs);
92     if ($maxrows == 0){
93     $nextcno = 1 ;
94     }else{
95     $rowdata = pg_fetch_row($rs, 0);
96     $nextcno = $rowdata[0];
97     $nextcno++ ;
98     }
99
100 //INSERT
101 if ($demomode){
102     print "下記予約を完了いたしました。<br>";
103 }else{
104 $userclass = getuserclass($con);
105 if ( $userclass <= 2){
106 /*
107 pid
108 tid
109 stationid 
110 countno
111 subtitle
112 startdatetime 
113 enddatetime 
114 startoffset 
115 lengthmin 
116 m2pfilename
117 pspfilename
118 epgaddedby 
119
120 */
121
122 $memberid = getmymemberid($con);
123     $query = "
124 insert into foltia_subtitle  (pid ,tid ,stationid , countno ,subtitle ,
125 startdatetime ,enddatetime ,startoffset , lengthmin , epgaddedby )
126 values ( '$insertpid','0','$stationid',
127     '$nextcno','$subtitle','$startdatetime','$enddatetime','0' ,'$lengthmin' , '$memberid')";
128     $rs = m_query($con, $query, "DBクエリに失敗しました");
129
130     //addatq.pl
131     //キュー入れプログラムをキック
132     //引数 TID チャンネルID
133     //echo("$toolpath/perl/addatq.pl $tid $station");
134
135     $oserr = system("$toolpath/perl/addatq.pl 0 0");
136     print "下記予約を完了いたしました。<br>";
137 }else{
138     print "EPG予約を行う権限がありません。";
139 }// end if $userclass <= 2
140 }//end if demomode
141
142
143
144 }else{
145 print "時刻が不正なために予約できませんでした。 <br>";
146
147 }
148
149
150 print "<table width=\"100%\" border=\"0\">
151     <tr><td>放送開始</td><td>$startdatetime</td></tr>
152     <tr><td>放送終了</td><td>$enddatetime</td></tr>
153     <tr><td>局コード</td><td>$stationid</td></tr>
154     <tr><td>尺(分)</td><td>$lengthmin</td></tr>
155     <tr><td>番組名</td><td>$subtitle</td></tr>
156     
157 </tbody>
158 </table>";
159
160 ?>
161 </body>
162 </html>
163
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。
track feed