Mercurial > epgrec.yaz
comparison keywordTable.php @ 1:f5a9f0eb4858
deleted: LICENSE.ja
author | Sushi-k <epgrec@park.mda.or.jp> |
---|---|
date | Wed, 08 Jul 2009 11:44:50 +0900 |
parents | |
children | e5f9aa34d06f |
comparison
equal
deleted
inserted
replaced
0:96312e6ab8d4 | 1:f5a9f0eb4858 |
---|---|
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" ); | |
8 | |
9 // 新規キーワードがポストされた | |
10 | |
11 if( isset($_POST["add_keyword"]) ) { | |
12 if( $_POST["add_keyword"] == 1 ) { | |
13 try { | |
14 $rec = new Keyword(); | |
15 $rec->keyword = $_POST['k_search']; | |
16 $rec->type = $_POST['k_type']; | |
17 $rec->category_id = $_POST['k_category']; | |
18 $rec->channel_id = $_POST['k_station']; | |
19 $rec->use_regexp = $_POST['k_use_regexp']; | |
20 | |
21 // 録画予約実行 | |
22 $rec->reservation(); | |
23 } | |
24 catch( Exception $e ) { | |
25 exit( $e->getMessage() ); | |
26 } | |
27 } | |
28 } | |
29 | |
30 | |
31 $keywords = array(); | |
32 try { | |
33 $recs = Keyword::createRecords(TBL_PREFIX.KEYWORD_TBL); | |
34 foreach( $recs as $rec ) { | |
35 $arr = array(); | |
36 $arr['id'] = $rec->id; | |
37 $arr['keyword'] = $rec->keyword; | |
38 $arr['type'] = $rec->type == "*" ? "すべて" : $rec->type; | |
39 | |
40 if( $rec->channel_id ) { | |
41 $crec = new DBRecord(TBL_PREFIX.CHANNEL_TBL, "id", $rec->channel_id ); | |
42 $arr['channel'] = $crec->name; | |
43 } | |
44 else $arr['channel'] = 'すべて'; | |
45 | |
46 if( $rec->category_id ) { | |
47 $crec = new DBRecord(TBL_PREFIX.CATEGORY_TBL, "id", $rec->category_id ); | |
48 $arr['category'] = $crec->name_jp; | |
49 } | |
50 else $arr['category'] = 'すべて'; | |
51 | |
52 $arr['use_regexp'] = $rec->use_regexp; | |
53 | |
54 array_push( $keywords, $arr ); | |
55 } | |
56 } | |
57 catch( Exception $e ) { | |
58 exit( $e->getMessage() ); | |
59 } | |
60 | |
61 $smarty = new Smarty(); | |
62 | |
63 $smarty->assign( "keywords", $keywords ); | |
64 $smarty->assign( "sitetitle", "自動録画キーワードの管理" ); | |
65 $smarty->display( "keywordTable.html" ); | |
66 ?> |