Mercurial > epgrec.yaz
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 76:69e0dabc765a | 77:cb7da56c4198 |
|---|---|
| 4 include_once( INSTALL_PATH . '/Smarty/Smarty.class.php' ); | 4 include_once( INSTALL_PATH . '/Smarty/Smarty.class.php' ); |
| 5 include_once( INSTALL_PATH . '/Settings.class.php' ); | 5 include_once( INSTALL_PATH . '/Settings.class.php' ); |
| 6 | 6 |
| 7 $settings = Settings::factory(); | 7 $settings = Settings::factory(); |
| 8 | 8 |
| 9 | |
| 10 $options = " WHERE starttime > '".date("Y-m-d H:i:s", time() + 300 )."'"; | 9 $options = " WHERE starttime > '".date("Y-m-d H:i:s", time() + 300 )."'"; |
| 11 | 10 |
| 11 // 曜日 | |
| 12 $weekofdays = array( | |
| 13 array( "name" => "月", "id" => 0, "selected" => "" ), | |
| 14 array( "name" => "火", "id" => 1, "selected" => "" ), | |
| 15 array( "name" => "水", "id" => 2, "selected" => "" ), | |
| 16 array( "name" => "木", "id" => 3, "selected" => "" ), | |
| 17 array( "name" => "金", "id" => 4, "selected" => "" ), | |
| 18 array( "name" => "土", "id" => 5, "selected" => "" ), | |
| 19 array( "name" => "日", "id" => 6, "selected" => "" ), | |
| 20 array( "name" => "なし", "id" => 7, "selected" => "" ), | |
| 21 ); | |
| 22 | |
| 23 $autorec_modes = $RECORD_MODE; | |
| 24 $autorec_modes[(int)($settings->autorec_mode)]['selected'] = "selected"; | |
| 25 | |
| 26 $weekofday = 7; | |
| 12 $search = ""; | 27 $search = ""; |
| 13 $use_regexp = 0; | 28 $use_regexp = 0; |
| 14 $type = "*"; | 29 $type = "*"; |
| 15 $category_id = 0; | 30 $category_id = 0; |
| 16 $station = 0; | 31 $station = 0; |
| 48 if( $_POST['station'] != 0 ) { | 63 if( $_POST['station'] != 0 ) { |
| 49 $station = $_POST['station']; | 64 $station = $_POST['station']; |
| 50 $options .= " AND channel_id = '".$_POST['station']."'"; | 65 $options .= " AND channel_id = '".$_POST['station']."'"; |
| 51 } | 66 } |
| 52 } | 67 } |
| 68 if( isset($_POST['weekofday']) ) { | |
| 69 $weekofday = $_POST['weekofday']; | |
| 70 if( $weekofday != 7 ) { | |
| 71 $options .= " AND WEEKDAY(starttime) = '".$weekofday."'"; | |
| 72 } | |
| 73 } | |
| 53 } | 74 } |
| 54 $options .= " ORDER BY starttime ASC LIMIT 300"; | 75 $options .= " ORDER BY starttime ASC LIMIT 300"; |
| 55 $do_keyword = 0; | 76 $do_keyword = 0; |
| 56 if( ($search != "") || ($type != "*") || ($category_id != 0) || ($station != 0) ) | 77 if( ($search != "") || ($type != "*") || ($category_id != 0) || ($station != 0) ) |
| 57 $do_keyword = 1; | 78 $do_keyword = 1; |
| 77 | 98 |
| 78 array_push( $programs, $arr ); | 99 array_push( $programs, $arr ); |
| 79 } | 100 } |
| 80 | 101 |
| 81 $k_category_name = ""; | 102 $k_category_name = ""; |
| 82 $crecs = DBRecord::createRecords(CATEGORY_TBL ); | 103 $crecs = DBRecord::createRecords(CATEGORY_TBL); |
| 83 $cats = array(); | 104 $cats = array(); |
| 84 $cats[0]['id'] = 0; | 105 $cats[0]['id'] = 0; |
| 85 $cats[0]['name'] = "すべて"; | 106 $cats[0]['name'] = "すべて"; |
| 86 $cats[0]['selected'] = $category_id == 0 ? "selected" : ""; | 107 $cats[0]['selected'] = $category_id == 0 ? "selected" : ""; |
| 87 foreach( $crecs as $c ) { | 108 foreach( $crecs as $c ) { |
| 133 $arr['name'] = $c->name; | 154 $arr['name'] = $c->name; |
| 134 $arr['selected'] = $station == $c->id ? "selected" : ""; | 155 $arr['selected'] = $station == $c->id ? "selected" : ""; |
| 135 if( $station == $c->id ) $k_station_name = $c->name; | 156 if( $station == $c->id ) $k_station_name = $c->name; |
| 136 array_push( $stations, $arr ); | 157 array_push( $stations, $arr ); |
| 137 } | 158 } |
| 159 $weekofdays["$weekofday"]["selected"] = "selected" ; | |
| 138 | 160 |
| 139 $smarty = new Smarty(); | 161 $smarty = new Smarty(); |
| 140 $smarty->assign("sitetitle","番組検索"); | 162 $smarty->assign("sitetitle","番組検索"); |
| 141 $smarty->assign("do_keyword", $do_keyword ); | 163 $smarty->assign("do_keyword", $do_keyword ); |
| 142 $smarty->assign( "programs", $programs ); | 164 $smarty->assign( "programs", $programs ); |
| 148 $smarty->assign( "search" , $search ); | 170 $smarty->assign( "search" , $search ); |
| 149 $smarty->assign( "use_regexp", $use_regexp ); | 171 $smarty->assign( "use_regexp", $use_regexp ); |
| 150 $smarty->assign( "stations", $stations ); | 172 $smarty->assign( "stations", $stations ); |
| 151 $smarty->assign( "k_station", $station ); | 173 $smarty->assign( "k_station", $station ); |
| 152 $smarty->assign( "k_station_name", $k_station_name ); | 174 $smarty->assign( "k_station_name", $k_station_name ); |
| 175 $smarty->assign( "weekofday", $weekofday ); | |
| 176 $smarty->assign( "k_weekofday", $weekofdays["$weekofday"]["name"] ); | |
| 177 $smarty->assign( "weekofday", $weekofday ); | |
| 178 $smarty->assign( "weekofdays", $weekofdays ); | |
| 179 $smarty->assign( "autorec_modes", $autorec_modes ); | |
| 153 $smarty->display("programTable.html"); | 180 $smarty->display("programTable.html"); |
| 154 } | 181 } |
| 155 catch( exception $e ) { | 182 catch( exception $e ) { |
| 156 exit( $e->getMessage() ); | 183 exit( $e->getMessage() ); |
| 157 } | 184 } |
