Mercurial > epgrec.yaz
annotate keywordTable.php @ 129:1e93ea03ebd9
mod: typofix
author | Sushi-k <epgrec@park.mda.or.jp> |
---|---|
date | Wed, 17 Mar 2010 20:39:36 +0900 |
parents | 57676bb30f64 |
children |
rev | line source |
---|---|
1 | 1 <?php |
2 include_once('config.php'); | |
3 include_once( INSTALL_PATH . '/Smarty/Smarty.class.php' ); | |
4 include_once( INSTALL_PATH . "/DBRecord.class.php" ); | |
5 include_once( INSTALL_PATH . "/reclib.php" ); | |
6 include_once( INSTALL_PATH . "/Reservation.class.php" ); | |
7 include_once( INSTALL_PATH . "/Keyword.class.php" ); | |
39
8965ef108821
change: modify all scripts for web base setting.
Sushi-k <epgrec@park.mda.or.jp>
parents:
37
diff
changeset
|
8 // include_once( INSTALL_PATH . "/Settings.class.php" ); |
1 | 9 |
77 | 10 |
11 $weekofdays = array( "月", "火", "水", "木", "金", "土", "日", "なし" ); | |
106 | 12 $prgtimes = array(); |
13 for( $i=0 ; $i < 25; $i++ ) { | |
14 $prgtimes[$i] = $i == 24 ? "なし" : $i."時~"; | |
15 } | |
77 | 16 |
1 | 17 // 新規キーワードがポストされた |
18 | |
19 if( isset($_POST["add_keyword"]) ) { | |
20 if( $_POST["add_keyword"] == 1 ) { | |
21 try { | |
22 $rec = new Keyword(); | |
23 $rec->keyword = $_POST['k_search']; | |
24 $rec->type = $_POST['k_type']; | |
25 $rec->category_id = $_POST['k_category']; | |
26 $rec->channel_id = $_POST['k_station']; | |
27 $rec->use_regexp = $_POST['k_use_regexp']; | |
77 | 28 $rec->weekofday = $_POST['k_weekofday']; |
106 | 29 $rec->prgtime = $_POST['k_prgtime']; |
77 | 30 $rec->autorec_mode = $_POST['autorec_mode']; |
1 | 31 |
32 // 録画予約実行 | |
33 $rec->reservation(); | |
34 } | |
35 catch( Exception $e ) { | |
36 exit( $e->getMessage() ); | |
37 } | |
38 } | |
39 } | |
40 | |
41 | |
42 $keywords = array(); | |
43 try { | |
37
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
44 $recs = Keyword::createRecords(KEYWORD_TBL); |
1 | 45 foreach( $recs as $rec ) { |
46 $arr = array(); | |
47 $arr['id'] = $rec->id; | |
48 $arr['keyword'] = $rec->keyword; | |
49 $arr['type'] = $rec->type == "*" ? "すべて" : $rec->type; | |
50 | |
51 if( $rec->channel_id ) { | |
37
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
52 $crec = new DBRecord(CHANNEL_TBL, "id", $rec->channel_id ); |
1 | 53 $arr['channel'] = $crec->name; |
54 } | |
55 else $arr['channel'] = 'すべて'; | |
56 | |
57 if( $rec->category_id ) { | |
37
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
58 $crec = new DBRecord(CATEGORY_TBL, "id", $rec->category_id ); |
1 | 59 $arr['category'] = $crec->name_jp; |
60 } | |
61 else $arr['category'] = 'すべて'; | |
62 | |
63 $arr['use_regexp'] = $rec->use_regexp; | |
64 | |
77 | 65 $arr['weekofday'] = $weekofdays["$rec->weekofday"]; |
66 | |
106 | 67 $arr['prgtime'] = $prgtimes["$rec->prgtime"]; |
68 | |
77 | 69 $arr['autorec_mode'] = $RECORD_MODE[(int)$rec->autorec_mode]['name']; |
70 | |
1 | 71 array_push( $keywords, $arr ); |
72 } | |
73 } | |
74 catch( Exception $e ) { | |
75 exit( $e->getMessage() ); | |
76 } | |
77 | |
78 $smarty = new Smarty(); | |
79 | |
80 $smarty->assign( "keywords", $keywords ); | |
81 $smarty->assign( "sitetitle", "自動録画キーワードの管理" ); | |
82 $smarty->display( "keywordTable.html" ); | |
83 ?> |