annotate programTable.php @ 106:57676bb30f64

add: 時間帯で絞り込みを追加
author Sushi-k <epgrec@park.mda.or.jp>
date Mon, 08 Mar 2010 18:07:19 +0900
parents cb7da56c4198
children 9b9e22be8407 7a64d5e3baee
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1 <?php
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
2 include_once('config.php');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
3 include_once( INSTALL_PATH . '/DBRecord.class.php' );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
4 include_once( INSTALL_PATH . '/Smarty/Smarty.class.php' );
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 10
diff changeset
5 include_once( INSTALL_PATH . '/Settings.class.php' );
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 10
diff changeset
6
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 10
diff changeset
7 $settings = Settings::factory();
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 10
diff changeset
8
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
9 $options = " WHERE starttime > '".date("Y-m-d H:i:s", time() + 300 )."'";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
10
77
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
11 //
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
12 $weekofdays = array(
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
13 array( "name" => "", "id" => 0, "selected" => "" ),
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
14 array( "name" => "", "id" => 1, "selected" => "" ),
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
15 array( "name" => "羂", "id" => 2, "selected" => "" ),
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
16 array( "name" => "", "id" => 3, "selected" => "" ),
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
17 array( "name" => "", "id" => 4, "selected" => "" ),
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
18 array( "name" => "", "id" => 5, "selected" => "" ),
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
19 array( "name" => "", "id" => 6, "selected" => "" ),
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
20 array( "name" => "", "id" => 7, "selected" => "" ),
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
21 );
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
22
106
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
23
77
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
24 $autorec_modes = $RECORD_MODE;
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
25 $autorec_modes[(int)($settings->autorec_mode)]['selected'] = "selected";
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
26
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
27 $weekofday = 7;
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
28 $search = "";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
29 $use_regexp = 0;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
30 $type = "*";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
31 $category_id = 0;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
32 $station = 0;
106
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
33 $prgtime = 24;
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
34
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
35
10
152b146bd276 fixed: mysql_connect before mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents: 1
diff changeset
36 // mysql_real_escape_string・膓鏆荀
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 10
diff changeset
37 $dbh = @mysql_connect($settings->db_host, $settings->db_user, $settings->db_pass );
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
38
10
152b146bd276 fixed: mysql_connect before mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents: 1
diff changeset
39 // <若帥
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
40 if(isset( $_POST['do_search'] )) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
41 if( isset($_POST['search'])){
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
42 if( $_POST['search'] != "" ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
43 $search = $_POST['search'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
44 if( isset($_POST['use_regexp']) && ($_POST['use_regexp']) ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
45 $use_regexp = $_POST['use_regexp'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
46 $options .= " AND CONCAT(title,description) REGEXP '".mysql_real_escape_string($search)."'";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
47 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
48 else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
49 $options .= " AND CONCAT(title,description) like '%".mysql_real_escape_string($search)."%'";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
50 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
51 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
52 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
53 if( isset($_POST['type'])){
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
54 if( $_POST['type'] != "*" ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
55 $type = $_POST['type'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
56 $options .= " AND type = '".$_POST['type']."'";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
57 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
58 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
59 if( isset($_POST['category_id'])) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
60 if( $_POST['category_id'] != 0 ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
61 $category_id = $_POST['category_id'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
62 $options .= " AND category_id = '".$_POST['category_id']."'";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
63 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
64 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
65 if( isset($_POST['station'])) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
66 if( $_POST['station'] != 0 ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
67 $station = $_POST['station'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
68 $options .= " AND channel_id = '".$_POST['station']."'";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
69 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
70 }
77
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
71 if( isset($_POST['weekofday']) ) {
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
72 $weekofday = $_POST['weekofday'];
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
73 if( $weekofday != 7 ) {
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
74 $options .= " AND WEEKDAY(starttime) = '".$weekofday."'";
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
75 }
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
76 }
106
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
77 if( isset($_POST['prgtime']) ) {
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
78 $prgtime = (int)($_POST['prgtime']);
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
79 if( $prgtime != 24 ) {
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
80 $options .= " AND time(starttime) BETWEEN cast('".sprintf( "%02d:00:00", $prgtime)."' as time) AND cast('".sprintf("%02d:59:59", $prgtime)."' as time)";
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
81 }
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
82 }
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
83 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
84 $options .= " ORDER BY starttime ASC LIMIT 300";
106
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
85
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
86
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
87 $do_keyword = 0;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
88 if( ($search != "") || ($type != "*") || ($category_id != 0) || ($station != 0) )
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
89 $do_keyword = 1;
10
152b146bd276 fixed: mysql_connect before mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents: 1
diff changeset
90
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
91 try{
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 10
diff changeset
92 $precs = DBRecord::createRecords(PROGRAM_TBL, $options );
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
93
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
94 $programs = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
95 foreach( $precs as $p ) {
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 10
diff changeset
96 $ch = new DBRecord(CHANNEL_TBL, "id", $p->channel_id );
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 10
diff changeset
97 $cat = new DBRecord(CATEGORY_TBL, "id", $p->category_id );
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
98 $arr = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
99 $arr['type'] = $p->type;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
100 $arr['station_name'] = $ch->name;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
101 $arr['starttime'] = $p->starttime;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
102 $arr['endtime'] = $p->endtime;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
103 $arr['title'] = $p->title;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
104 $arr['description'] = $p->description;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
105 $arr['id'] = $p->id;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
106 $arr['cat'] = $cat->name_en;
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 10
diff changeset
107 $arr['rec'] = DBRecord::countRecords(RESERVE_TBL, "WHERE program_id='".$p->id."'");
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
108
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
109 array_push( $programs, $arr );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
110 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
111
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
112 $k_category_name = "";
77
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
113 $crecs = DBRecord::createRecords(CATEGORY_TBL);
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
114 $cats = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
115 $cats[0]['id'] = 0;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
116 $cats[0]['name'] = "鴻";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
117 $cats[0]['selected'] = $category_id == 0 ? "selected" : "";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
118 foreach( $crecs as $c ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
119 $arr = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
120 $arr['id'] = $c->id;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
121 $arr['name'] = $c->name_jp;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
122 $arr['selected'] = $c->id == $category_id ? "selected" : "";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
123 if( $c->id == $category_id ) $k_category_name = $c->name_jp;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
124 array_push( $cats, $arr );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
125 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
126
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
127 $types = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
128 $types[0]['name'] = "鴻";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
129 $types[0]['value'] = "*";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
130 $types[0]['selected'] = $type == "*" ? "selected" : "";
57
73350e16077a fix: bug
Sushi-k <epgrec@park.mda.or.jp>
parents: 39
diff changeset
131 if( $settings->gr_tuners != 0 ) {
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
132 $arr = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
133 $arr['name'] = "GR";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
134 $arr['value'] = "GR";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
135 $arr['selected'] = $type == "GR" ? "selected" : "";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
136 array_push( $types, $arr );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
137 }
57
73350e16077a fix: bug
Sushi-k <epgrec@park.mda.or.jp>
parents: 39
diff changeset
138 if( $settings->bs_tuners != 0 ) {
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
139 $arr = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
140 $arr['name'] = "BS";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
141 $arr['value'] = "BS";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
142 $arr['selected'] = $type == "BS" ? "selected" : "";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
143 array_push( $types, $arr );
67
a2c4665b310c add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents: 57
diff changeset
144
a2c4665b310c add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents: 57
diff changeset
145 // CS
a2c4665b310c add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents: 57
diff changeset
146 if ($settings->cs_rec_flg != 0) {
a2c4665b310c add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents: 57
diff changeset
147 $arr = array();
a2c4665b310c add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents: 57
diff changeset
148 $arr['name'] = "CS";
a2c4665b310c add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents: 57
diff changeset
149 $arr['value'] = "CS";
a2c4665b310c add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents: 57
diff changeset
150 $arr['selected'] = $type == "CS" ? "selected" : "";
a2c4665b310c add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents: 57
diff changeset
151 array_push( $types, $arr );
a2c4665b310c add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents: 57
diff changeset
152 }
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
153 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
154
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
155 $k_station_name = "";
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 10
diff changeset
156 $crecs = DBRecord::createRecords(CHANNEL_TBL);
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
157 $stations = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
158 $stations[0]['id'] = 0;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
159 $stations[0]['name'] = "鴻";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
160 $stations[0]['selected'] = (! $station) ? "selected" : "";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
161 foreach( $crecs as $c ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
162 $arr = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
163 $arr['id'] = $c->id;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
164 $arr['name'] = $c->name;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
165 $arr['selected'] = $station == $c->id ? "selected" : "";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
166 if( $station == $c->id ) $k_station_name = $c->name;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
167 array_push( $stations, $arr );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
168 }
77
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
169 $weekofdays["$weekofday"]["selected"] = "selected" ;
106
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
170
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
171 // 絽
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
172 $prgtimes = array();
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
173 for( $i=0; $i < 25; $i++ ) {
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
174 array_push( $prgtimes,
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
175 array( "name" => ( $i == 24 ? "" : sprintf("%0d鐔",$i) ),
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
176 "value" => $i,
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
177 "selected" => ( $i == $prgtime ? "selected" : "" ) )
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
178 );
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
179 }
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
180
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
181
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
182
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
183 $smarty = new Smarty();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
184 $smarty->assign("sitetitle","腟罎膣");
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
185 $smarty->assign("do_keyword", $do_keyword );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
186 $smarty->assign( "programs", $programs );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
187 $smarty->assign( "cats", $cats );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
188 $smarty->assign( "k_category", $category_id );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
189 $smarty->assign( "k_category_name", $k_category_name );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
190 $smarty->assign( "types", $types );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
191 $smarty->assign( "k_type", $type );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
192 $smarty->assign( "search" , $search );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
193 $smarty->assign( "use_regexp", $use_regexp );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
194 $smarty->assign( "stations", $stations );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
195 $smarty->assign( "k_station", $station );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
196 $smarty->assign( "k_station_name", $k_station_name );
77
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
197 $smarty->assign( "weekofday", $weekofday );
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
198 $smarty->assign( "k_weekofday", $weekofdays["$weekofday"]["name"] );
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
199 $smarty->assign( "weekofday", $weekofday );
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
200 $smarty->assign( "weekofdays", $weekofdays );
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
201 $smarty->assign( "autorec_modes", $autorec_modes );
106
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
202 $smarty->assign( "prgtimes", $prgtimes );
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
203 $smarty->assign( "prgtime", $prgtime );
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
204 $smarty->display("programTable.html");
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
205 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
206 catch( exception $e ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
207 exit( $e->getMessage() );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
208 }
57
73350e16077a fix: bug
Sushi-k <epgrec@park.mda.or.jp>
parents: 39
diff changeset
209 ?>