annotate programTable.php @ 77:cb7da56c4198

modified: Keyword.class.php modified: config.php.sample modified: index.php modified: install/step1.php modified: keywordTable.php modified: programTable.php modified: simpleReservation.php modified: templates/index.html modified: templates/keywordTable.html modified: templates/programTable.html
author Sushi-k <epgrec@park.mda.or.jp>
date Wed, 24 Feb 2010 20:22:19 +0900
parents a2c4665b310c
children 57676bb30f64
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
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
23 $autorec_modes = $RECORD_MODE;
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
24 $autorec_modes[(int)($settings->autorec_mode)]['selected'] = "selected";
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
25
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
26 $weekofday = 7;
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
27 $search = "";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
28 $use_regexp = 0;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
29 $type = "*";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
30 $category_id = 0;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
31 $station = 0;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
32
10
152b146bd276 fixed: mysql_connect before mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents: 1
diff changeset
33 // mysql_real_escape_stringより先に接続しておく必要がある
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 10
diff changeset
34 $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
35
10
152b146bd276 fixed: mysql_connect before mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents: 1
diff changeset
36 // パラメータの処理
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
37 if(isset( $_POST['do_search'] )) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
38 if( isset($_POST['search'])){
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
39 if( $_POST['search'] != "" ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
40 $search = $_POST['search'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
41 if( isset($_POST['use_regexp']) && ($_POST['use_regexp']) ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
42 $use_regexp = $_POST['use_regexp'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
43 $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
44 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
45 else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
46 $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
47 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
48 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
49 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
50 if( isset($_POST['type'])){
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
51 if( $_POST['type'] != "*" ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
52 $type = $_POST['type'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
53 $options .= " AND type = '".$_POST['type']."'";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
54 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
55 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
56 if( isset($_POST['category_id'])) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
57 if( $_POST['category_id'] != 0 ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
58 $category_id = $_POST['category_id'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
59 $options .= " AND category_id = '".$_POST['category_id']."'";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
60 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
61 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
62 if( isset($_POST['station'])) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
63 if( $_POST['station'] != 0 ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
64 $station = $_POST['station'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
65 $options .= " AND channel_id = '".$_POST['station']."'";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
66 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
67 }
77
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
68 if( isset($_POST['weekofday']) ) {
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
69 $weekofday = $_POST['weekofday'];
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
70 if( $weekofday != 7 ) {
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
71 $options .= " AND WEEKDAY(starttime) = '".$weekofday."'";
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
72 }
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
73 }
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
74 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
75 $options .= " ORDER BY starttime ASC LIMIT 300";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
76 $do_keyword = 0;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
77 if( ($search != "") || ($type != "*") || ($category_id != 0) || ($station != 0) )
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
78 $do_keyword = 1;
10
152b146bd276 fixed: mysql_connect before mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents: 1
diff changeset
79
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
80 try{
10
152b146bd276 fixed: mysql_connect before mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents: 1
diff changeset
81
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 10
diff changeset
82 $precs = DBRecord::createRecords(PROGRAM_TBL, $options );
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 $programs = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
85 foreach( $precs as $p ) {
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 10
diff changeset
86 $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
87 $cat = new DBRecord(CATEGORY_TBL, "id", $p->category_id );
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
88 $arr = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
89 $arr['type'] = $p->type;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
90 $arr['station_name'] = $ch->name;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
91 $arr['starttime'] = $p->starttime;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
92 $arr['endtime'] = $p->endtime;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
93 $arr['title'] = $p->title;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
94 $arr['description'] = $p->description;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
95 $arr['id'] = $p->id;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
96 $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
97 $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
98
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
99 array_push( $programs, $arr );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
100 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
101
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
102 $k_category_name = "";
77
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
103 $crecs = DBRecord::createRecords(CATEGORY_TBL);
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
104 $cats = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
105 $cats[0]['id'] = 0;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
106 $cats[0]['name'] = "すべて";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
107 $cats[0]['selected'] = $category_id == 0 ? "selected" : "";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
108 foreach( $crecs as $c ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
109 $arr = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
110 $arr['id'] = $c->id;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
111 $arr['name'] = $c->name_jp;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
112 $arr['selected'] = $c->id == $category_id ? "selected" : "";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
113 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
114 array_push( $cats, $arr );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
115 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
116
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
117 $types = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
118 $types[0]['name'] = "すべて";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
119 $types[0]['value'] = "*";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
120 $types[0]['selected'] = $type == "*" ? "selected" : "";
57
73350e16077a fix: bug
Sushi-k <epgrec@park.mda.or.jp>
parents: 39
diff changeset
121 if( $settings->gr_tuners != 0 ) {
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
122 $arr = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
123 $arr['name'] = "GR";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
124 $arr['value'] = "GR";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
125 $arr['selected'] = $type == "GR" ? "selected" : "";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
126 array_push( $types, $arr );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
127 }
57
73350e16077a fix: bug
Sushi-k <epgrec@park.mda.or.jp>
parents: 39
diff changeset
128 if( $settings->bs_tuners != 0 ) {
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
129 $arr = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
130 $arr['name'] = "BS";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
131 $arr['value'] = "BS";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
132 $arr['selected'] = $type == "BS" ? "selected" : "";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
133 array_push( $types, $arr );
67
a2c4665b310c add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents: 57
diff changeset
134
a2c4665b310c add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents: 57
diff changeset
135 // CS
a2c4665b310c add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents: 57
diff changeset
136 if ($settings->cs_rec_flg != 0) {
a2c4665b310c add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents: 57
diff changeset
137 $arr = array();
a2c4665b310c add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents: 57
diff changeset
138 $arr['name'] = "CS";
a2c4665b310c add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents: 57
diff changeset
139 $arr['value'] = "CS";
a2c4665b310c add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents: 57
diff changeset
140 $arr['selected'] = $type == "CS" ? "selected" : "";
a2c4665b310c add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents: 57
diff changeset
141 array_push( $types, $arr );
a2c4665b310c add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents: 57
diff changeset
142 }
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
143 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
144
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
145 $k_station_name = "";
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 10
diff changeset
146 $crecs = DBRecord::createRecords(CHANNEL_TBL);
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
147 $stations = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
148 $stations[0]['id'] = 0;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
149 $stations[0]['name'] = "すべて";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
150 $stations[0]['selected'] = (! $station) ? "selected" : "";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
151 foreach( $crecs as $c ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
152 $arr = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
153 $arr['id'] = $c->id;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
154 $arr['name'] = $c->name;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
155 $arr['selected'] = $station == $c->id ? "selected" : "";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
156 if( $station == $c->id ) $k_station_name = $c->name;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
157 array_push( $stations, $arr );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
158 }
77
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
159 $weekofdays["$weekofday"]["selected"] = "selected" ;
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
160
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
161 $smarty = new Smarty();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
162 $smarty->assign("sitetitle","番組検索");
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
163 $smarty->assign("do_keyword", $do_keyword );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
164 $smarty->assign( "programs", $programs );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
165 $smarty->assign( "cats", $cats );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
166 $smarty->assign( "k_category", $category_id );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
167 $smarty->assign( "k_category_name", $k_category_name );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
168 $smarty->assign( "types", $types );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
169 $smarty->assign( "k_type", $type );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
170 $smarty->assign( "search" , $search );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
171 $smarty->assign( "use_regexp", $use_regexp );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
172 $smarty->assign( "stations", $stations );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
173 $smarty->assign( "k_station", $station );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
174 $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
175 $smarty->assign( "weekofday", $weekofday );
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
176 $smarty->assign( "k_weekofday", $weekofdays["$weekofday"]["name"] );
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
177 $smarty->assign( "weekofday", $weekofday );
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
178 $smarty->assign( "weekofdays", $weekofdays );
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 67
diff changeset
179 $smarty->assign( "autorec_modes", $autorec_modes );
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
180 $smarty->display("programTable.html");
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
181 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
182 catch( exception $e ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
183 exit( $e->getMessage() );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
184 }
57
73350e16077a fix: bug
Sushi-k <epgrec@park.mda.or.jp>
parents: 39
diff changeset
185 ?>