Mercurial > epgrec.yaz
changeset 122:709bc9c69318
mod: チャンネルスキップ引き続き実装中(まだ途中)
author | yoneda <epgrec@park.mda.or.jp> |
---|---|
date | Tue, 16 Mar 2010 23:08:59 +0900 |
parents | ea54c3128da3 |
children | 57ca9a15dfad |
files | channelInfo.php index.php templates/index.html |
diffstat | 3 files changed, 54 insertions(+), 57 deletions(-) [+] |
line wrap: on
line diff
--- a/channelInfo.php Tue Mar 16 12:46:37 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -<?php -include_once('config.php'); -include_once( INSTALL_PATH . "/DBRecord.class.php" ); -include_once( INSTALL_PATH . "/Settings.class.php" ); - -if( isset($_GET['channel_disc']) ) { - - try { - $crec = new DBRecord( CHANNEL_TBL, "channel_disc", $_GET['channel_disc'] ); - - echo '<div class="prg_title">'; - echo $crec->name . "</div>"; - - // 腮 - echo '<div class="prg_channel"><span class="labelLeft">腮ワ</span><span class="bold">'; - echo $crec->type; - echo '</span></div>'; - - // c潟 - echo '<div class="prg_channel"><span class="labelLeft">c潟鐚</span><span class="bold">'; - echo $crec->channel; - echo '</span></div>'; - - // 若 - 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 .'" />'; - echo '</div>'; - echo '</form>'; - } - catch( Exception $e ) { - echo "error:c潟宴緇紊掩"; - } -} -?> \ No newline at end of file
--- a/index.php Tue Mar 16 12:46:37 2010 +0900 +++ b/index.php Tue Mar 16 23:08:59 2010 +0900 @@ -64,9 +64,9 @@ $programs[$st]["skip"] = $crec->skip; if( $crec->skip == 0 ) $num_ch++; $programs[$st]["channel_disc"] = $channel_disc; - $programs[$st]["station_name"] = $crec->name; - $programs[$st]["channel_disc"] = $crec->channel_disc; + $programs[$st]["sid"] = $crec->sid; + $programs[$st]["ch_hash"] = md5($channel_disc); $reca = $prec->fetch_array( "channel_disc", $channel_disc, "endtime > '".toDatetime($top_time)."' ".
--- a/templates/index.html Tue Mar 16 12:46:37 2010 +0900 +++ b/templates/index.html Tue Mar 16 23:08:59 2010 +0900 @@ -79,21 +79,46 @@ ); } var PRG = { - chdialog:function(disc){ + chdialog:function(chash){ $('#channelDialog').dialog('close'); - $.get('channelInfo.php', { channel_disc: disc },function(data) { - if(data.match(/^error/i)){ - alert(data); - } - else { - var str = data; - str += '<div style="margin:2em 0 1em 0;text-align:center;"><a href="javascript:PRG.chupdate()" class="ui-state-default ui-corner-all ui-dialog-buttonpane button">贋</a></div>'; - $('#channelDialog').html(str); - $('#channelDialog').dialog('open', 'center'); - - } - }); + var skip = $('#ch_title_'+chash+' .ch_skip').html(); + var st_name = $('#ch_title_'+chash+' .ch_name').html(); + var sid = $('#ch_title_'+chash+' .ch_sid').html(); + var disc = $('#ch_title_'+chash+' .ch_disc').html(); + var str = '<div class="prg_title">'; + str += st_name; + str += '</div>'; + str += '<form method="post" action="setChannelInfo.php">'; + // 鴻 + str += '<div class="prg_channel"><span class="labelLeft">荀眼鐚</span>'; + if( skip == 1 ) { + str += '<input type="checkbox" name="n_skip_name" id="id_ch_skip" value="'+skip+'" checked />'; + } + else { + str += '<input type="checkbox" name="n_skip_name" id="id_ch_skip" value="'+skip+'" />'; + } + str += '</div>'; + // 泣若ID + str += '<div class="prg_channel"><span class="labelLeft">泣若ID鐚</span>'; + str += '<span><input type="text" name="n_sid" size="20" id="id_sid" value="'; + str += sid; + str += '" /></span></div>'; + + str += '<input type="hidden" name="n_channel_disc" id="id_disc" value="'; + str += disc; + str += '" />'; + str += '<input type="hidden" name="n_channel_hash" id="id_hash" value="'; + str += chash; + str += '" />'; + + + str += '</form>'; + + str += '<div style="margin:2em 0 1em 0;text-align:center;"><a href="javascript:PRG.chupdate()" class="ui-state-default ui-corner-all ui-dialog-buttonpane button">贋</a></div>'; + + $('#channelDialog').html(str); + $('#channelDialog').dialog('open', 'center'); }, chupdate:function() { var v_sid = $('#id_sid').val(); @@ -404,6 +429,12 @@ #tvtable div.ch_title {padding:8px 0px;background-color:#333;color:#DDD;font-weight:bold;text-align:center} .ch_title_skip {display: none;} +.ch_disc {display :none;} +.ch_skip {display :none;} +.ch_sid {display :none;} +.ch_name {display :none;} +.ch_hash {display :none;} + #tvtable div.prg { overflow:hidden; color:#444; @@ -558,8 +589,13 @@ <div id="ch_title_bar" style="position:absolute;bottom:0;"> <div class="tvtimeDM" style="float:left;"> </div> {foreach from=$programs item=program } - <div id="ch_title_{$program.channel_disc}" class="ch_title{if $program.skip == 1 } ch_title_skip{/if}" > - <div style="cursor: pointer" onClick="javascript:PRG.chdialog('{$program.channel_disc}')" >{$program.station_name}</div> + <div id="ch_title_{$program.ch_hash}" class="ch_title{if $program.skip == 1 } ch_title_skip{/if}" > + <div class="ch_hash">{$program.ch_hash}</div> + <div class="ch_disc">{$program.channel_disc}</div> + <div class="ch_skip">{$program.skip}</div> + <div class="ch_sid">{$program.sid}</div> + <div class="ch_name">{$program.station_name}</div> + <div style="cursor: pointer" onClick="javascript:PRG.chdialog('{$program.ch_hash}')" >{$program.station_name}</div> </div> {/foreach} </div> @@ -581,7 +617,7 @@ <div id="tv_chs" style="width: {$chs_width}px" > {foreach from=$programs item=program } - <div id="tv_chs_{$program.channel_disc}" class="ch_set{if $program.skip == 1 } ch_set_skip{/if}" > + <div id="tv_chs_{$program.ch_hash}" class="ch_set{if $program.skip == 1 } ch_set_skip{/if}" > <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;">