root/trunk/install/php/viewepg.php

リビジョン 1, 5.4 kB (コミッタ: jplcom, コミット時期: 20 年 前)

initial import

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 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
23 <html lang="ja">
24 <head>
25 <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP">
26 <meta http-equiv="Content-Style-Type" content="text/css">
27 <link rel="stylesheet" type="text/css" href="graytable.css">
28 <body BGCOLOR="#ffffff" TEXT="#494949" LINK="#0047ff" VLINK="#000000" ALINK="#c6edff" >
29
30 <?php
31   include("./foltialib.php");
32
33     printhtmlpageheader();
34 ?>
35   <p align="left"><font color="#494949" size="6">番組予約</font></p>
36   <hr size="4">
37 <?php
38
39 $stationid = getnumform(stationid);
40 $subtitle = getform(subtitle);
41 $startdatetime = getnumform(startdatetime);
42 $enddatetime = getnumform(enddatetime);
43 $lengthmin = getnumform(lengthmin);
44
45         if ($stationid == "" || $startdatetime < 0 ||  $enddatetime < 0 || $lengthmin < 0) {
46         print "    <title>foltia:EPG予約:Error</title></head>\n";
47         die_exit("登録番組がありません<BR>");
48         }
49 print "    <title>foltia:EPG予約:完了</title>
50 </head>\n";
51 $con = m_connect();
52 $now = date("YmdHi");   
53 // - DB登録作業
54
55 //時刻検査
56 if (($startdatetime > $now ) && ($enddatetime > $now ) && ($enddatetime  > $startdatetime ) ){
57
58 //min pidを探す
59 $query = "SELECT min(pid) FROM  foltia_subtitle ";
60     $rs = m_query($con, $query, "DBクエリに失敗しました");
61     $maxrows = pg_num_rows($rs);
62     if ($maxrows == 0){
63     $insertpid = -1 ;
64     }else{
65     $rowdata = pg_fetch_row($rs, 0);
66     $insertpid = $rowdata[0];
67     $insertpid-- ;
68     }
69 // next 話数を探す
70 $query = "SELECT max(countno) FROM  foltia_subtitle WHERE tid = 0";
71     $rs = m_query($con, $query, "DBクエリに失敗しました");
72     $maxrows = pg_num_rows($rs);
73     if ($maxrows == 0){
74     $nextcno = 1 ;
75     }else{
76     $rowdata = pg_fetch_row($rs, 0);
77     $pan style="color: #007700">= date ("m/d",mktime($starthour , 0 , 0, $startmonth , $startday +1 , $startyear));
78 $day2after = date ("YmdHi",mktime($starthour , 0 , 0, $startmonth , $startday +2 , $startyear));
79 $day2 = date ("m/d",mktime($starthour , 0 , 0, $startmonth , $startday +2 , $startyear));
80 $day3after = date ("YmdHi",mktime($starthour , 0 , 0, $startmonth , $startday +3 , $startyear));
81 $day3 = date ("m/d",mktime($starthour , 0 , 0, $startmonth , $startday +3 , $startyear));
82 $day4after = date ("YmdHi",mktime($starthour , 0 , 0, $startmonth , $startday +4 , $startyear));
83 $day4 = date ("m/d",mktime($starthour , 0 , 0, $startmonth , $startday +4 , $startyear));
84 $day5after = date ("YmdHi",mktime($starthour , 0 , 0, $startmonth , $startday +5 , $startyear));
85 $day5 = date ("m/d",mktime($starthour , 0 , 0, $startmonth , $startday +5 , $startyear));
86 $day6after = date ("YmdHi",mktime($starthour , 0 , 0, $startmonth , $startday +6 , $startyear));
87 $day6 = date ("m/d",mktime($starthour , 0 , 0, $startmonth , $startday +6 , $startyear));
88 $day7after = date ("YmdHi",mktime($starthour , 0 , 0, $startmonth , $startday +7 , $startyear));
89 $day7 = date ("m/d",mktime($starthour , 0 , 0, $startmonth , $startday +7 , $startyear));
90
91
92
93 //表示局選定
94 // $page = 1 ~
95 $maxdisplay = 8;
96
97     $query = "SELECT stationid, stationname, stationrecch, ontvcode FROM foltia_station WHERE \"ontvcode\" ~~ '%ontvjapan%'
98     ";
99     $rs = m_query($con, $query, "DBクエリに失敗しました");
100     $maxrows = pg_num_rows($rs);
101
102 if ($maxrows > $maxdisplay){
103     $pages = ceil($maxrows / $maxdisplay) ;
104 }
105
106 $page = getgetnumform(p);
107
108 if (($page == "")|| ($page <= 0) ){
109     $page = 1 ;
110     $offset = ;
111 }else{
112   $page = ereg_replace( "[^0-9]", "", $page);
113   if ($page > $pages){
114       $page = $pages ;
115   }elseif ($page <= 0) {
116   $page = 1 ;
117   }
118   $offset = ($page * $maxdisplay ) - $maxdisplay;
119 }
120
121
122 print "←<A HREF=\"./viewepg.php?p=$page&start=$yesterday\">前の日</A> <A HREF=\"./viewepg.php\">現在</A> 当日(<A HREF=\"./viewepg.php?p=$page&start=$today0400\">4:00</A> <A HREF=\"./viewepg.php?p=$page&start=$today1200\">12:00</A> <A HREF=\"./viewepg.php?p=$page&start=$today2000\">20:00</A>) <A HREF=\"./viewepg.php?p=$page&start=$day1after\">次の日</A> <A HREF=\"./viewepg.php?p=$page&start=$day2after\">$day2</A> <A HREF=\"./viewepg.php?p=$page&start=$day3after\">$day3</A> <A HREF=\"./viewepg.php?p=$page&start=$day4after\">$day4</A> <A HREF=\"./viewepg.php?p=$page&start=$day5after\">$day5</A> <A HREF=\"./viewepg.php?p=$page&start=$day6after\">$day6</A> <A HREF=\"./viewepg.php?p=$page&start=$day7after\">$day7</A>→<BR>\n";
123
124
125
126 if ($maxrows > $maxdisplay){
127 //複数ページ
128 //$pages = ceil($maxrows / $maxdisplay) ;
129 if ($page > 1){
130     $beforepage = $page - 1;
131     print "<a href = \"./viewepg.php?p=$beforepage&start=$start\">←</A>";
132 }
133
134 print " $page / $pages (放送局) ";
135
136 if ($page < $pages){
137     $nextpage = $page + 1;
138     print "<a href = \"./viewepg.php?p=$nextpage&start=$start\">→</A>";
139 }
140 }
141
142
143     $query = "SELECT stationid, stationname, stationrecch, ontvcode FROM foltia_station WHERE \"ontvcode\" ~~ '%ontvjapan%'  ORDER BY stationid ASC , stationrecch OFFSET $offset LIMIT $maxdisplay
144     ";
145     $rs = m_query($con, $query, "DBクエリに失敗しました");
146
147 //print "<!--$query  -->";
148 $viewstations = pg_num_rows($rs);
149 print "</p>
150  <table width=\"100%\"  border=\"0\">
151   <tbody>
152    <tr class=\"kyoku\">
153 ";
154 for ($i=0 ; $i < $viewstations ; $i++){
155     $rowdata = pg_fetch_row($rs, $i);
156     if ($rowdata[1] != ""){
157     print "    <th scope=\"col\">$rowdata[1]</th>\n";
158     }
159 }
160
161 print "  </tr>
162
163  <tr  valign = top>
164 ";
165 for ($i=0 ; $i < $viewstations ; $i++){
166     $rowdata = pg_fetch_row($rs, $i);
167     if ($rowdata[3] != ""){
168     print "<td>";
169         renderepgstation($con,$rowdata[3],$start);
170     print "</td>\n";
171     }
172 }
173
174 print " </tr>
175       </tbody>
176 </table>
177 ";
178
179  ?>
180
181 </body>
182 </html>
183
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。
track feed