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