Mercurial > epgrec.yaz
changeset 120:cb04c9ca1cb0
add: チャンネルスキップの追加途中(改造中)
author | yoneda <epgrec@park.mda.or.jp> |
---|---|
date | Sun, 14 Mar 2010 23:49:11 +0900 |
parents | f268d7d10590 |
children | ea54c3128da3 |
files | Reservation.class.php channelInfo.php index.php templates/index.html |
diffstat | 4 files changed, 149 insertions(+), 95 deletions(-) [+] |
line wrap: on
line diff
--- a/Reservation.class.php Sat Mar 13 23:30:11 2010 +0900 +++ b/Reservation.class.php Sun Mar 14 23:49:11 2010 +0900 @@ -77,7 +77,7 @@ $crec = new DBRecord( CHANNEL_TBL, "id", $channel_id ); // √篋膣 = TUNER - $tuners = ($crec->type == "GR") ? $settings->gr_tuners : $settings->bs_tuners; + $tuners = ($crec->type == "GR") ? (int)($settings->gr_tuners) : (int)($settings->bs_tuners); $type_str = ($crec->type == "GR") ? "type = 'GR' " : "(type = 'BS' OR type = 'CS') "; $battings = DBRecord::countRecords( RESERVE_TBL, "WHERE complete = '0' ".
--- a/channelInfo.php Sat Mar 13 23:30:11 2010 +0900 +++ b/channelInfo.php Sun Mar 14 23:49:11 2010 +0900 @@ -23,6 +23,9 @@ // 若 echo '<form method="post" action="channelSetSID.php">'; + echo '<div class="prg_channel"><span class="labelLeft">荀眼鐚</span>'; + echo '<span><input type="text" name="n_sid" size="20" id="id_sid" value="'. $crec->sid .'" /></span>'; + echp '</div>'; echo '<div class="prg_channel"><span class="labelLeft">泣若ID鐚</span>'; echo '<span><input type="text" name="n_sid" size="20" id="id_sid" value="'. $crec->sid .'" /></span>'; echo '<input type="hidden" name="n_channel_disc" id="id_disc" value="'. $crec->channel_disc .'" />';
--- a/index.php Sat Mar 13 23:30:11 2010 +0900 +++ b/index.php Sun Mar 14 23:49:11 2010 +0900 @@ -37,29 +37,33 @@ } $last_time = $top_time + 3600 * $program_length; - // 紙 - for( $i = 0 ; $i < $program_length; $i++ ) { +// 紙 +for( $i = 0 ; $i < $program_length; $i++ ) { $tvtimes[$i] = date("H", $top_time + 3600 * $i ); - } - - - // 腟茵 - $programs = array(); - if( $type == "BS" ) $channel_map = $BS_CHANNEL_MAP; - else if( $type == "GR" ) $channel_map = $GR_CHANNEL_MAP; - else if( $type == "CS" ) $channel_map = $CS_CHANNEL_MAP; - $st = 0; - $prec = null; - try { - $prec = new DBRecord(PROGRAM_TBL); - } - catch( Exception $e ) { +} + + +// 腟茵 +$programs = array(); +if( $type == "BS" ) $channel_map = $BS_CHANNEL_MAP; +else if( $type == "GR" ) $channel_map = $GR_CHANNEL_MAP; +else if( $type == "CS" ) $channel_map = $CS_CHANNEL_MAP; +$st = 0; +$prec = null; +try { + $prec = new DBRecord(PROGRAM_TBL); +} +catch( Exception $e ) { exit('違若絖сゃ潟鴻若眼.'); - } - foreach( $channel_map as $channel_disc => $channel ) { +} +$num_ch = 0; +foreach( $channel_map as $channel_disc => $channel ) { $prev_end = $top_time; try { $crec = new DBRecord( CHANNEL_TBL, "channel_disc", $channel_disc ); + $programs[$st]["skip"] = $crec->skip; + if( $crec->skip == 0 ) $num_ch++; + $programs[$st]["station_name"] = $crec->name; $programs[$st]["channel_disc"] = $crec->channel_disc; @@ -126,36 +130,35 @@ $num++; } $st++; - } - $prec = null; - - // 絮綛 - $ch_set_width = $settings->ch_set_width; - // 篏綛 - $chs_width = $ch_set_width * count( $channel_map ); +} +$prec = null; - // GET< - $get_param = $_SERVER['SCRIPT_NAME'] . "?type=".$type."&length=".$program_length.""; - - $smarty = new Smarty(); - - // 眼筝荀 - $crec = DBRecord::createRecords( CATEGORY_TBL ); - $cats = array(); - $num = 0; - foreach( $crec as $val ) { +// 絮綛 +$ch_set_width = (int)($settings->ch_set_width); +// 篏綛 +$chs_width = $ch_set_width * $num_ch; + +// GET< +$get_param = $_SERVER['SCRIPT_NAME'] . "?type=".$type."&length=".$program_length.""; + +$smarty = new Smarty(); + +// 眼筝荀 +$crec = DBRecord::createRecords( CATEGORY_TBL ); +$cats = array(); +$num = 0; +foreach( $crec as $val ) { $cats[$num]['name_en'] = $val->name_en; $cats[$num]['name_jp'] = $val->name_jp; $num++; - } - $smarty->assign( "cats", $cats ); - +} +$smarty->assign( "cats", $cats ); - // 帥ゃ御 - $types = array(); - $i = 0; - if( $settings->bs_tuners != 0 ) { +// 帥ゃ御 +$types = array(); +$i = 0; +if( $settings->bs_tuners != 0 ) { $types[$i]['selected'] = $type == "BS" ? 'class="selected"' : ""; $types[$i]['link'] = $_SERVER['SCRIPT_NAME'] . "?type=BS&length=".$program_length."&time=".date( "YmdH", $top_time); $types[$i]['name'] = "BS"; @@ -168,65 +171,67 @@ $types[$i]['name'] = "CS"; $i++; } - } - if( $settings->gr_tuners != 0 ) { +} +if( $settings->gr_tuners != 0 ) { $types[$i]['selected'] = $type == "GR" ? 'class="selected"' : ""; $types[$i]['link'] = $_SERVER['SCRIPT_NAME'] . "?type=GR&length=".$program_length."&time=".date( "YmdH", $top_time); $types[$i]['name'] = "遺吾帥"; $i++; - } - $smarty->assign( "types", $types ); - - // ヤ御 - $days = array(); - $day = array(); - $day['d'] = ""; - $day['link'] = $get_param . "&time=". date( "YmdH", time() - 3600 *24 ); - $day['ofweek'] = ""; - $day['selected'] = $top_time < mktime( 0, 0 , 0) ? 'class="selected"' : ''; - - array_push( $days , $day ); - $day['d'] = "憜"; - $day['link'] = $get_param; - $day['ofweek'] = ""; - $day['selected'] = ""; - array_push( $days, $day ); - for( $i = 0 ; $i < 8 ; $i++ ) { +} +$smarty->assign( "types", $types ); + +// ヤ御 +$days = array(); +$day = array(); +$day['d'] = ""; +$day['link'] = $get_param . "&time=". date( "YmdH", time() - 3600 *24 ); +$day['ofweek'] = ""; +$day['selected'] = $top_time < mktime( 0, 0 , 0) ? 'class="selected"' : ''; + +array_push( $days , $day ); +$day['d'] = "憜"; +$day['link'] = $get_param; +$day['ofweek'] = ""; +$day['selected'] = ""; +array_push( $days, $day ); +for( $i = 0 ; $i < 8 ; $i++ ) { $day['d'] = "".date("d", time() + 24 * 3600 * $i ) . ""; $day['link'] = $get_param . "&time=".date( "Ymd", time() + 24 * 3600 * $i) . date("H" , $top_time ); $day['ofweek'] = $DAY_OF_WEEK[(int)date( "w", time() + 24 * 3600 * $i )]; $day['selected'] = date("d", $top_time) == date("d", time() + 24 * 3600 * $i ) ? 'class="selected"' : ''; array_push( $days, $day ); - } - $smarty->assign( "days" , $days ); - - // 御 - $toptimes = array(); - for( $i = 0 ; $i < 24; $i+=4 ) { +} +$smarty->assign( "days" , $days ); + +// 御 +$toptimes = array(); +for( $i = 0 ; $i < 24; $i+=4 ) { $tmp = array(); $tmp['hour'] = sprintf( "%02d:00", $i ); $tmp['link'] = $get_param . "&time=".date("Ymd", $top_time ) . sprintf("%02d", $i ); array_push( $toptimes, $tmp ); - } - $smarty->assign( "toptimes" , $toptimes ); - - $smarty->assign( "tvtimes", $tvtimes ); - $smarty->assign( "programs", $programs ); - $smarty->assign( "ch_set_width", $settings->ch_set_width ); - $smarty->assign( "chs_width", $chs_width ); - $smarty->assign( "height_per_hour", $settings->height_per_hour ); - $smarty->assign( "height_per_min", $settings->height_per_hour / 60 ); +} +$smarty->assign( "toptimes" , $toptimes ); + +$smarty->assign( "tvtimes", $tvtimes ); +$smarty->assign( "programs", $programs ); +$smarty->assign( "ch_set_width", (int)($settings->ch_set_width) ); +$smarty->assign( "chs_width", $chs_width ); +$smarty->assign( "height_per_hour", $settings->height_per_hour ); +$smarty->assign( "height_per_min", $settings->height_per_hour / 60 ); +$smarty->assign( "num_ch", $num_ch ); +$smarty->assign( "num_all_ch" , count( $channel_map ) ); // date("Y-m-d H:i:s", $timestamp); - - $sitetitle = date( "Y", $top_time ) . "綛" . date( "m", $top_time ) . "" . date( "d", $top_time ) . "". date( "H", $top_time ) . + +$sitetitle = date( "Y", $top_time ) . "綛" . date( "m", $top_time ) . "" . date( "d", $top_time ) . "". date( "H", $top_time ) . "鐔".( $type == "GR" ? "遺吾帥" : "BS吾帥" )."腟茵"; - - $smarty->assign("sitetitle", $sitetitle ); - - $smarty->assign("top_time", str_replace( "-", "/" ,toDatetime($top_time)) ); - $smarty->assign("last_time", str_replace( "-", "/" ,toDatetime($last_time)) ); - - - $smarty->display("index.html"); + +$smarty->assign("sitetitle", $sitetitle ); + +$smarty->assign("top_time", str_replace( "-", "/" ,toDatetime($top_time)) ); +$smarty->assign("last_time", str_replace( "-", "/" ,toDatetime($last_time)) ); + + +$smarty->display("index.html"); ?>
--- a/templates/index.html Sat Mar 13 23:30:11 2010 +0900 +++ b/templates/index.html Sun Mar 14 23:49:11 2010 +0900 @@ -189,6 +189,28 @@ $('#floatBox4Dialog').dialog('close'); } }); + }, + CH_Skip: 0, + toggle:function() { + if( this.CH_Skip ) { + $('#float_titles').width(INISet.num_all_ch * INISet.ch_width + 80); + $('#tv_chs').width(INISet.num_all_ch * INISet.ch_width ); + $('#tvtimes2').css( { left: INISet.num_all_ch * INISet.ch_width + 40 } ).show(); + tvtimes_scroll(); + $('#ch_title_bar div.ch_title_skip').show(); + $('#tv_chs div.ch_set_skip').show(); + + this.CH_Skip = 0; + } + else { + $('#tv_chs div.ch_set_skip').hide(); + $('#ch_title_bar div.ch_title_skip').hide(); + $('#float_titles').width( INISet.num_ch * INISet.ch_width + 80 ); + $('#tv_chs').width( INISet.num_ch * INISet.ch_width ); + $('#tvtimes2').css( { left: INISet.num_ch * INISet.ch_width + 40 }).show(); + tvtimes_scroll(); + this.CH_Skip = 1; + } } } var CTG = { @@ -319,6 +341,8 @@ DG2.dialog({title:'c潟',width:600}); DG2.dialog('close'); + PRG.toggle(); + nowBar.INI(); CTG.INI(); MDA.SCR.INI(); // 腟茵篏臀篆絖 @@ -368,10 +392,14 @@ #tvtable div.tvtimetop {padding:8px 0px;} #tvtable div.ch_set {width:{/literal}{$ch_set_width}{literal}px;float:left;background-color:#BBB;} +#tvtable div.ch_set_skip {width:{/literal}{$ch_set_width}{literal}px;float:left;background-color:#BBB; } #tvtable div.ch_title, #tvtable div.prg {margin-right:2px;} #tvtable div.ch_title {padding:8px 0px;background-color:#333;color:#DDD;font-weight:bold;text-align:center} +#tvtable div.ch_title_skip, #tvtable div.prg {margin-right:2px;} +#tvtable div.ch_title_skip {padding:8px 0px;background-color:#333;color:#DDD;font-weight:bold;text-align:center; } + #tvtable div.prg { overflow:hidden; color:#444; @@ -412,6 +440,9 @@ #float_titles div.ch_title {width:{/literal}{$ch_set_width}{literal}px;float:left;color:#FFF;font-weight:bold;text-align:center} #float_titles div.ch_title div{padding:8px 0px;margin:0 6px 0 4px;background-image: url(imgs/trancBG50.png);} +#float_titles div.ch_title_skip {width:{/literal}{$ch_set_width}{literal}px;float:left;color:#FFF;font-weight:bold;text-align:center; } +#float_titles div.ch_title_skip div{padding:8px 0px;margin:0 6px 0 4px;background-image: url(imgs/trancBG50.png); } + #float_follows {position:absolute;} #prg_info { display:none; @@ -453,7 +484,7 @@ <h2>{$sitetitle}</h2> -<div id="float_titles" style="width: {math equation="x + 80" x=$chs_width}px;height:120px;"> +<div id="float_titles" style="width: {math equation="x + 80" x=$chs_width }px;height:120px;"> <div id="float_follows"> <div class="set"> @@ -490,6 +521,11 @@ {/foreach} </ul><br style="clear:left;" /> </div> + + <div class="set"> + <ul><li><a class="jump" href="javascript:PRG.toggle()">c潟茵腓</a></li></ul> + </div> + <br style="clear:left;" /> <div class="set"> @@ -515,12 +551,17 @@ <div id="prg_info"><div class="dummy">test</div></div> </div> -<div style="position:absolute;bottom:0;"> + +<!-- c潟絮 --> +<div id="ch_title_bar" style="position:absolute;bottom:0;"> <div class="tvtimeDM" style="float:left;"> </div> {foreach from=$programs item=program } - <div class="ch_title" ><div style="cursor: pointer" onClick="javascript:PRG.chdialog('{$program.channel_disc}')" >{$program.station_name}</div></div> + <div {if $program.skip == 1 } class="ch_title_skip" {else} class="ch_title" {/if} > + <div {if $program.skip == 1 } class="ch_title_skip" {/if} style="cursor: pointer" onClick="javascript:PRG.chdialog('{$program.channel_disc}')" >{$program.station_name}</div> + </div> {/foreach} </div> + <br style="clear:left;" /> <div id="prg_info"><div class="dummy"> </div></div> </div> @@ -538,7 +579,7 @@ <div id="tv_chs" style="width: {$chs_width}px" > {foreach from=$programs item=program } - <div class="ch_set" style="width: {$ch_set_width}px" > + <div {if $program.skip == 1 } class="ch_set_skip" {else} class="ch_set" {/if} style="width: {$ch_set_width}px" > <div class="ch_programs"> {foreach from=$program.list item=item } <div {if $item.id}id="prgID_{$item.id}"{/if} class="prg {if ! $item.id}prg_none {/if} ctg_{$item.category_name}{if $item.rec gt 0 } prg_rec{/if}" style="height:{$item.height}px;"> @@ -573,12 +614,17 @@ {literal} <script type="text/javascript"> var INISet = { +{/literal} prgRecordURL : 'simpleReservation.php', // 膂≧篋膣 prgRecordPlusURL : 'recordp.php', // 荅括完篋膣 prgCancelURL : 'cancelReservation.php', // 篋膣c潟祉 - dotMin : {/literal}{$height_per_min}{literal}, - tableStartTime : {/literal}'{$top_time}', - tableEndTime : '{$last_time}'{literal} + dotMin : {$height_per_min}, + tableStartTime : '{$top_time}', + tableEndTime : '{$last_time}', + ch_width : {$ch_set_width}, + num_ch : {$num_ch}, + num_all_ch : {$num_all_ch} +{literal} } </script> {/literal}