Mercurial > epgrec.yaz
comparison index.php @ 37:e5f9aa34d06f
change: modify all script for web base setting
author | yoneda <epgrec@park.mda.or.jp> |
---|---|
date | Tue, 28 Jul 2009 00:00:04 +0900 |
parents | 7d1f7e4cac82 |
children | 2bc96d657ba1 |
comparison
equal
deleted
inserted
replaced
36:c2522d1df005 | 37:e5f9aa34d06f |
---|---|
46 // 番組表 | 46 // 番組表 |
47 $programs = array(); | 47 $programs = array(); |
48 if( $type == "BS" ) $channel_map = $BS_CHANNEL_MAP; | 48 if( $type == "BS" ) $channel_map = $BS_CHANNEL_MAP; |
49 else if( $type == "GR" ) $channel_map = $GR_CHANNEL_MAP; | 49 else if( $type == "GR" ) $channel_map = $GR_CHANNEL_MAP; |
50 $st = 0; | 50 $st = 0; |
51 $prec = new DBRecord($settings->tbl_prefix.PROGRAM_TBL); | 51 $prec = new DBRecord(PROGRAM_TBL); |
52 foreach( $channel_map as $channel_disc => $channel ) { | 52 foreach( $channel_map as $channel_disc => $channel ) { |
53 $prev_end = $top_time; | 53 $prev_end = $top_time; |
54 try { | 54 try { |
55 $crec = new DBRecord( $settings->tbl_prefix . CHANNEL_TBL, "channel_disc", $channel_disc ); | 55 $crec = new DBRecord( CHANNEL_TBL, "channel_disc", $channel_disc ); |
56 $programs[$st]["station_name"] = $crec->name; | 56 $programs[$st]["station_name"] = $crec->name; |
57 | 57 |
58 $reca = $prec->fetch_array( "channel_disc", $channel_disc, | 58 $reca = $prec->fetch_array( "channel_disc", $channel_disc, |
59 "endtime > '".toDatetime($top_time)."' ". | 59 "endtime > '".toDatetime($top_time)."' ". |
60 "AND starttime < '". toDatetime($last_time)."' ". | 60 "AND starttime < '". toDatetime($last_time)."' ". |
88 if( toTimestamp($prg['endtime']) > $last_time ) { | 88 if( toTimestamp($prg['endtime']) > $last_time ) { |
89 $height = (int)(($last_time - toTimestamp($prg['starttime'])) * $settings->height_per_hour / 3600); | 89 $height = (int)(($last_time - toTimestamp($prg['starttime'])) * $settings->height_per_hour / 3600); |
90 } | 90 } |
91 | 91 |
92 // プログラムを埋める | 92 // プログラムを埋める |
93 $cat = new DBRecord( $settings->tbl_prefix . CATEGORY_TBL, "id", $prg['category_id'] ); | 93 $cat = new DBRecord( CATEGORY_TBL, "id", $prg['category_id'] ); |
94 $programs[$st]['list'][$num]['category_name'] = $cat->name_en; | 94 $programs[$st]['list'][$num]['category_name'] = $cat->name_en; |
95 $programs[$st]['list'][$num]['height'] = $height; | 95 $programs[$st]['list'][$num]['height'] = $height; |
96 $programs[$st]['list'][$num]['title'] = $prg['title']; | 96 $programs[$st]['list'][$num]['title'] = $prg['title']; |
97 $programs[$st]['list'][$num]['starttime'] = date("H:i", $start )."" ; | 97 $programs[$st]['list'][$num]['starttime'] = date("H:i", $start )."" ; |
98 $programs[$st]['list'][$num]['description'] = $prg['description']; | 98 $programs[$st]['list'][$num]['description'] = $prg['description']; |
99 $programs[$st]['list'][$num]['prg_start'] = str_replace( "-", "/", $prg['starttime']); | 99 $programs[$st]['list'][$num]['prg_start'] = str_replace( "-", "/", $prg['starttime']); |
100 $programs[$st]['list'][$num]['duration'] = "" . (toTimestamp($prg['endtime']) - toTimestamp($prg['starttime'])); | 100 $programs[$st]['list'][$num]['duration'] = "" . (toTimestamp($prg['endtime']) - toTimestamp($prg['starttime'])); |
101 $programs[$st]['list'][$num]['channel'] = ($prg['type'] == "GR" ? "地上D" : "BS" ) . ":". $prg['channel'] . "ch"; | 101 $programs[$st]['list'][$num]['channel'] = ($prg['type'] == "GR" ? "地上D" : "BS" ) . ":". $prg['channel'] . "ch"; |
102 $programs[$st]['list'][$num]['id'] = "" . ($prg['id']); | 102 $programs[$st]['list'][$num]['id'] = "" . ($prg['id']); |
103 $programs[$st]['list'][$num]['rec'] = DBRecord::countRecords( $settings->tbl_prefix.RESERVE_TBL, "WHERE complete = '0' AND program_id = '".$prg['id']."'" ); | 103 $programs[$st]['list'][$num]['rec'] = DBRecord::countRecords(RESERVE_TBL, "WHERE complete = '0' AND program_id = '".$prg['id']."'" ); |
104 $num++; | 104 $num++; |
105 } | 105 } |
106 } | 106 } |
107 catch( exception $e ) { | 107 catch( exception $e ) { |
108 exit( $e->getMessage() ); | 108 exit( $e->getMessage() ); |
133 $get_param = $_SERVER['SCRIPT_NAME'] . "?type=".$type."&length=".$program_length.""; | 133 $get_param = $_SERVER['SCRIPT_NAME'] . "?type=".$type."&length=".$program_length.""; |
134 | 134 |
135 $smarty = new Smarty(); | 135 $smarty = new Smarty(); |
136 | 136 |
137 // カテゴリ一覧 | 137 // カテゴリ一覧 |
138 $crec = DBRecord::createRecords( $settings->tbl_prefix . CATEGORY_TBL ); | 138 $crec = DBRecord::createRecords( CATEGORY_TBL ); |
139 $cats = array(); | 139 $cats = array(); |
140 $num = 0; | 140 $num = 0; |
141 foreach( $crec as $val ) { | 141 foreach( $crec as $val ) { |
142 $cats[$num]['name_en'] = $val->name_en; | 142 $cats[$num]['name_en'] = $val->name_en; |
143 $cats[$num]['name_jp'] = $val->name_jp; | 143 $cats[$num]['name_jp'] = $val->name_jp; |