$options .= " AND channel_id = '".$this->channel_id."'";
}
+ if( $this->weekofday != 7 ) {
+ $options .= " AND WEEKDAY(starttime) = '".$this->weekofday."'";
+ }
+
$options .= " ORDER BY starttime ASC";
$recs = array();
foreach( $precs as $rec ) {
try {
if( $rec->autorec ) {
- Reservation::simple( $rec->id, $this->id, $this->settings->autorec_mode );
+ Reservation::simple( $rec->id, $this->id, $this->autorec_mode );
usleep( 100 ); // あんまり時間を空けないのもどう?
}
}
"complete boolean not null default '0',". // 完了フラグ
"reserve_disc varchar(128) not null default 'none',". // 識別用hash
"autorec integer not null default '0',". // キーワードID
- "mode integer not null default '0'" //録画モード
+ "mode integer not null default '0',". //録画モード
+ "index reserve_idx (channel_disc, starttime)" // インデックス
);
"starttime datetime not null default '1970-01-01 00:00:00',". // 開始時刻
"endtime datetime not null default '1970-01-01 00:00:00',". // 終了時刻
"program_disc varchar(128) not null default 'none',". // 識別用hash
- "autorec boolean not null default '1'" // 自動録画有効無効
+ "autorec boolean not null default '1',". // 自動録画有効無効
+ "index program_idx (channel_disc, starttime)" // インデックス
+
);
"channel_id integer not null default '0',". // channel ID
"category_id integer not null default '0',". // カテゴリID
"use_regexp boolean not null default '0',". // 正規表現を使用するなら1
- "autorec_mode integer not null defult '0'" // 自動録画のモード02/23/2010追加
+ "autorec_mode integer not null default '0',". // 自動録画のモード02/23/2010追加
+ "weekofday enum ('0','1','2','3','4','5','6','7' ) default '7'" // 曜日
);
?>
\ No newline at end of file
try {
$crec = new DBRecord( CHANNEL_TBL, "channel_disc", $channel_disc );
$programs[$st]["station_name"] = $crec->name;
+ $programs[$st]["channel_disc"] = $crec->channel_disc;
$reca = $prec->fetch_array( "channel_disc", $channel_disc,
"endtime > '".toDatetime($top_time)."' ".
if( !file_exists( "/usr/local/bin/grscan" ) ) {
-include_once( INSTALL_PATH."/settings/gr_channel.php" );
-
echo "<p><b>地上デジタルチャンネルの設定確認</b></p>";
echo "<div>現在、config.phpでは以下のチャンネルの受信が設定されています。受信不可能なチャンネルが混ざっていると番組表が表示できません。</div>";
include_once( INSTALL_PATH . "/Keyword.class.php" );
// include_once( INSTALL_PATH . "/Settings.class.php" );
+
+$weekofdays = array( "月", "火", "水", "木", "金", "土", "日", "なし" );
+
// 新規キーワードがポストされた
+
if( isset($_POST["add_keyword"]) ) {
if( $_POST["add_keyword"] == 1 ) {
try {
$rec->category_id = $_POST['k_category'];
$rec->channel_id = $_POST['k_station'];
$rec->use_regexp = $_POST['k_use_regexp'];
+ $rec->weekofday = $_POST['k_weekofday'];
+ $rec->autorec_mode = $_POST['autorec_mode'];
// 録画予約実行
$rec->reservation();
$arr['use_regexp'] = $rec->use_regexp;
+ $arr['weekofday'] = $weekofdays["$rec->weekofday"];
+
+ $arr['autorec_mode'] = $RECORD_MODE[(int)$rec->autorec_mode]['name'];
+
array_push( $keywords, $arr );
}
}
$settings = Settings::factory();
-
$options = " WHERE starttime > '".date("Y-m-d H:i:s", time() + 300 )."'";
+// 曜日
+$weekofdays = array(
+ array( "name" => "月", "id" => 0, "selected" => "" ),
+ array( "name" => "火", "id" => 1, "selected" => "" ),
+ array( "name" => "水", "id" => 2, "selected" => "" ),
+ array( "name" => "木", "id" => 3, "selected" => "" ),
+ array( "name" => "金", "id" => 4, "selected" => "" ),
+ array( "name" => "土", "id" => 5, "selected" => "" ),
+ array( "name" => "日", "id" => 6, "selected" => "" ),
+ array( "name" => "なし", "id" => 7, "selected" => "" ),
+);
+
+$autorec_modes = $RECORD_MODE;
+$autorec_modes[(int)($settings->autorec_mode)]['selected'] = "selected";
+
+$weekofday = 7;
$search = "";
$use_regexp = 0;
$type = "*";
$options .= " AND channel_id = '".$_POST['station']."'";
}
}
+ if( isset($_POST['weekofday']) ) {
+ $weekofday = $_POST['weekofday'];
+ if( $weekofday != 7 ) {
+ $options .= " AND WEEKDAY(starttime) = '".$weekofday."'";
+ }
+ }
}
$options .= " ORDER BY starttime ASC LIMIT 300";
$do_keyword = 0;
}
$k_category_name = "";
- $crecs = DBRecord::createRecords(CATEGORY_TBL );
+ $crecs = DBRecord::createRecords(CATEGORY_TBL);
$cats = array();
$cats[0]['id'] = 0;
$cats[0]['name'] = "すべて";
if( $station == $c->id ) $k_station_name = $c->name;
array_push( $stations, $arr );
}
+ $weekofdays["$weekofday"]["selected"] = "selected" ;
$smarty = new Smarty();
$smarty->assign("sitetitle","番組検索");
$smarty->assign( "stations", $stations );
$smarty->assign( "k_station", $station );
$smarty->assign( "k_station_name", $k_station_name );
+ $smarty->assign( "weekofday", $weekofday );
+ $smarty->assign( "k_weekofday", $weekofdays["$weekofday"]["name"] );
+ $smarty->assign( "weekofday", $weekofday );
+ $smarty->assign( "weekofdays", $weekofdays );
+ $smarty->assign( "autorec_modes", $autorec_modes );
$smarty->display("programTable.html");
}
catch( exception $e ) {
include_once( INSTALL_PATH . "/DBRecord.class.php" );
include_once( INSTALL_PATH . "/Reservation.class.php" );
include_once( INSTALL_PATH . "/reclib.php" );
+include_once( INSTALL_PATH . "/Settings.class.php" );
if( ! isset( $_GET['program_id'] ) ) exit("Error: 番組が指定されていません" );
$program_id = $_GET['program_id'];
+$settings = Settings::factory();
+
try {
- Reservation::simple( $program_id );
+ Reservation::simple( $program_id , 0, $settings->autorec_mode);
}
catch( Exception $e ) {
exit( "Error:". $e->getMessage() );
);
}
var PRG = {
+ chdialog:function(disc){
+ $('#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');
+
+ }
+ });
+
+ },
+ chupdate:function() {
+ var v_sid = $('#id_sid').val();
+ var v_channel_disc = $('#id_disc').val();
+ $.post('channelSetSID.php', { channel_disc: v_channel_disc,
+ sid: v_sid }, function(data) {
+
+ $('#channelDialog').dialog('close');
+ });
+ },
rec:function(id){
$.get(INISet.prgRecordURL, { program_id: id } ,function(data){
if(data.match(/^error/i)){
var DG = $('#floatBox4Dialog');
DG.dialog({title:'録画予約',width:600});
DG.dialog('close');
+
+ var DG2 = $('#channelDialog');
+ DG2.dialog({title:'チャンネル情報',width:600});
+ DG2.dialog('close');
+
nowBar.INI();
CTG.INI();
MDA.SCR.INI(); // 番組表の位置保存
#floatBox4Dialog .prg_rec_cfg{background:#EEE;padding:1em 2em;margin:0.4em 0;}
#floatBox4Dialog .labelLeft {width:8em;float:left;text-align:right;}
#floatBox4Dialog .button {padding:0.4em 1em;}
+
+#channelDialog .prg_title{font-size:120%;font-weight:bold;padding:0.4em 0;text-align:center;}
+#channelDialog .prg_rec_cfg{background:#EEE;padding:1em 2em;margin:0.4em 0;}
+#channelDialog .labelLeft {width:8em;float:left;text-align:right;}
+#channelDialog .button {padding:0.4em 1em;}
+
-->
</style>
<div style="position:absolute;bottom:0;">
<div class="tvtimeDM" style="float:left;"> </div>
{foreach from=$programs item=program }
- <div class="ch_title"><div>{$program.station_name}</div></div>
+ <div class="ch_title" ><div style="cursor: pointer" onClick="javascript:PRG.chdialog('{$program.channel_disc}')" >{$program.station_name}</div></div>
{/foreach}
</div>
<br style="clear:left;" />
<div id="floatBox4Dialog">jQuery UI Dialog</div>
+<div id="channelDialog">jQuery UI Dialog</div>
{literal}
<script type="text/javascript">
<th>種別</th>
<th>局</th>
<th>カテゴリ</th>
+ <th>曜日</th>
+ <th>録画モード</th>
<th>削除</th>
</tr>
<td>{$keyword.type}</td>
<td>{$keyword.channel}</td>
<td>{$keyword.category}</td>
+ <td>{$keyword.weekofday}</td>
+ <td>{$keyword.autorec_mode}</td>
<td><input type="button" value="削除" onClick="javascript:PRG.delkey('{$keyword.id}')" /></td>
</tr>
{/foreach}
{foreach from=$cats item=cat}
<option value="{$cat.id}" {$cat.selected}>{$cat.name}</option>
{/foreach}
+ </select>
+曜日<select name='weekofday'>
+ {foreach from=$weekofdays item=day}
+ <option value="{$day.id}" {$day.selected}>{$day.name}</option>
+ {/foreach}
</select>
<input type="submit" value="絞り込む" />
</form>
<b>種別:</b>{if $k_type == "*"}すべて{else}{$k_type}{/if}
<b>局:</b>{if $k_station == 0}すべて{else}{$k_station_name}{/if}
<b>カテゴリ:</b>{if $k_category == 0}すべて{else}{$k_category_name}{/if}
+ <b>曜日:</b>{if $weekofday == 7}なし{else}{$k_weekofday}{/if}曜
<b>件数:</b>{$programs|@count}
<input type="hidden" name="add_keyword" value="{$do_keyword}" />
<input type="hidden" name="k_use_regexp" value="{$use_regexp}" />
<input type="hidden" name="k_type" value="{$k_type}" />
<input type="hidden" name="k_category" value="{$k_category}" />
<input type="hidden" name="k_station" value="{$k_station}" />
- <input type="submit" value="この絞り込みを自動録画キーワードに登録" />
+ <input type="hidden" name="k_weekofday" value={$weekofday} />
+ <b>録画モード:</b><select name="autorec_mode" >
+ {foreach from=$autorec_modes item=mode name=recmode }
+ <option value="{$smarty.foreach.recmode.index}" {$mode.selected} >{$mode.name}</option>
+ {/foreach}
+ </select>
+ <br><input type="submit" value="この絞り込みを自動録画キーワードに登録" />
</form>
</div>
{/if}