Mercurial > epgrec.yaz
comparison recordedTable.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 | 152b146bd276 |
comparison
equal
deleted
inserted
replaced
0:96312e6ab8d4 | 1:f5a9f0eb4858 |
---|---|
1 <?php | |
2 include_once('config.php'); | |
3 include_once( INSTALL_PATH . '/DBRecord.class.php' ); | |
4 include_once( INSTALL_PATH . '/Smarty/Smarty.class.php' ); | |
5 | |
6 $order = ""; | |
7 $search = ""; | |
8 $category_id = 0; | |
9 $station = 0; | |
10 | |
11 #$options = "WHERE complete='1'"; | |
12 $options = "WHERE starttime < '". date("Y-m-d H:i:s")."'"; // ながら再生は無理っぽい? | |
13 | |
14 if(isset( $_POST['do_search'] )) { | |
15 if( isset($_POST['search'])){ | |
16 if( $_POST['search'] != "" ) { | |
17 $search = $_POST['search']; | |
18 $options .= " AND CONCAT(title,description) like '%".mysql_real_escape_string($_POST['search'])."%'"; | |
19 } | |
20 } | |
21 if( isset($_POST['category_id'])) { | |
22 if( $_POST['category_id'] != 0 ) { | |
23 $category_id = $_POST['category_id']; | |
24 $options .= " AND category_id = '".$_POST['category_id']."'"; | |
25 } | |
26 } | |
27 if( isset($_POST['station'])) { | |
28 if( $_POST['station'] != 0 ) { | |
29 $station = $_POST['station']; | |
30 $options .= " AND channel_id = '".$_POST['station']."'"; | |
31 } | |
32 } | |
33 } | |
34 | |
35 | |
36 $options .= " ORDER BY starttime DESC"; | |
37 | |
38 try{ | |
39 $rvs = DBRecord::createRecords(TBL_PREFIX.RESERVE_TBL, $options ); | |
40 $records = array(); | |
41 foreach( $rvs as $r ) { | |
42 $cat = new DBRecord(TBL_PREFIX.CATEGORY_TBL, "id", $r->category_id ); | |
43 $ch = new DBRecord(TBL_PREFIX.CHANNEL_TBL, "id", $r->channel_id ); | |
44 $arr = array(); | |
45 $arr['id'] = $r->id; | |
46 $arr['station_name'] = $ch->name; | |
47 $arr['starttime'] = $r->starttime; | |
48 $arr['endtime'] = $r->endtime; | |
49 $arr['title'] = "<a href=\"".INSTALL_URL."/viewer.php?reserve_id=".$r->id."\">".htmlspecialchars($r->title,ENT_QUOTES)."</a>"; | |
50 $arr['description'] = "<a href=\"".INSTALL_URL."/viewer.php?reserve_id=".$r->id."\">".htmlspecialchars($r->description,ENT_QUOTES)."</a>"; | |
51 $arr['thumb'] = "<a href=\"".INSTALL_URL."/viewer.php?reserve_id=".$r->id."\"><img src=\"".INSTALL_URL.THUMBS."/".$r->path.".jpg\" /></a>"; | |
52 $arr['cat'] = $cat->name_en; | |
53 $arr['mode'] = $RECORD_MODE[$r->mode]['name']; | |
54 | |
55 array_push( $records, $arr ); | |
56 } | |
57 | |
58 $crecs = DBRecord::createRecords(TBL_PREFIX.CATEGORY_TBL ); | |
59 $cats = array(); | |
60 $cats[0]['id'] = 0; | |
61 $cats[0]['name'] = "すべて"; | |
62 $cats[0]['selected'] = $category_id == 0 ? "selected" : ""; | |
63 foreach( $crecs as $c ) { | |
64 $arr = array(); | |
65 $arr['id'] = $c->id; | |
66 $arr['name'] = $c->name_jp; | |
67 $arr['selected'] = $c->id == $category_id ? "selected" : ""; | |
68 array_push( $cats, $arr ); | |
69 } | |
70 | |
71 $crecs = DBRecord::createRecords(TBL_PREFIX.CHANNEL_TBL ); | |
72 $stations = array(); | |
73 $stations[0]['id'] = 0; | |
74 $stations[0]['name'] = "すべて"; | |
75 $stations[0]['selected'] = (! $station) ? "selected" : ""; | |
76 foreach( $crecs as $c ) { | |
77 $arr = array(); | |
78 $arr['id'] = $c->id; | |
79 $arr['name'] = $c->name; | |
80 $arr['selected'] = $station == $c->id ? "selected" : ""; | |
81 array_push( $stations, $arr ); | |
82 } | |
83 | |
84 | |
85 $smarty = new Smarty(); | |
86 $smarty->assign("sitetitle","録画済一覧"); | |
87 $smarty->assign( "records", $records ); | |
88 $smarty->assign( "search", $search ); | |
89 $smarty->assign( "stations", $stations ); | |
90 $smarty->assign( "cats", $cats ); | |
91 $smarty->assign( "use_thumbs", USE_THUMBS ); | |
92 | |
93 $smarty->display("recordedTable.html"); | |
94 | |
95 | |
96 } | |
97 catch( exception $e ) { | |
98 exit( $e->getMessage() ); | |
99 } | |
100 ?> |