<!--#
##
#	Project: PHPDISK File Storage Solution
#	This is NOT a freeware, use is subject to license terms.
#
#	Site: http://www.phpdisk.com
#
#	$Id: advertisement.tpl.html 25 2011-03-04 07:36:51Z along $
#
#	Copyright (C) 2008-2011 PHPDisk Team. All Rights Reserved.
#
##
#-->
<!--#
if($action =='add_adv' || $action =='modify_adv'){
#-->
<div id="container">
<!--#if($action =='add_adv'){#-->
<h1>{$L['add_advs_title']}</h1>
<!--#}else{#-->
<h1>{$L['modify_advs_title']}</h1>
<!--#}#-->
<div>
<div class="tips_box"><img class="img_light" src="images/light.gif" align="absmiddle" /> <b>{$L['tips']}: </b>
<span class="txtgray">{$L['adv_manage_tips']}</span>
</div>
<form action="{#urr("admincp","item=advertisement")#}" method="post" onsubmit="return dosubmit(this);">
<input type="hidden" name="action" value="{$action}" />
<input type="hidden" name="task" value="{$action}" />
<input type="hidden" name="advid" value="{$advid}" />
<input type="hidden" name="formhash" value="{$formhash}" />
<table align="center" width="100%" cellpadding="4" cellspacing="0" border="0" class="td_line">
<tr>
	<td width="40%"><b>{$L['adv_position']}:</b><br /><span class="txtgray">{$L['adv_position_tips']}</span></td>
	<td><select name="adv_position" onchange="chg_img(this.options[this.selectedIndex].value);">
	<option value="adv_top" {#ifselected('adv_top',$adv_position,'str')#}>{$L['adv_top']}</option>
	<option value="adv_right" {#ifselected('adv_right',$adv_position,'str')#}>{$L['adv_right']}</option>
	<option value="adv_viewfile_right" {#ifselected('adv_viewfile_right',$adv_position,'str')#}>{$L['adv_viewfile_right']}</option>
	<option value="adv_viewfile_hits_bottom" {#ifselected('adv_viewfile_hits_bottom',$adv_position,'str')#}>{$L['adv_viewfile_hits_bottom']}</option>
	<option value="adv_viewfile_download_top" {#ifselected('adv_viewfile_download_top',$adv_position,'str')#}>{$L['adv_viewfile_download_top']}</option>
	<option value="adv_viewfile_download_bottom" {#ifselected('adv_viewfile_download_bottom',$adv_position,'str')#}>{$L['adv_viewfile_download_bottom']}</option>
	<option value="adv_bottom" {#ifselected('adv_bottom',$adv_position,'str')#}>{$L['adv_bottom']}</option>
</select>
</td>
</tr>
<tr>
	<td><b>{$L['position_view']}:</b><br /><span class="txtgray">{$L['position_view_tips']}</span></td>
	<td><img id="adv_img" src="" align="absmiddle" border="0"/></td>
</tr>
<tr>
	<td><b>{$L['adv_scope']}:</b><br /><span class="txtgray">{$L['adv_scope_tips']}</span></td>
	<td><select name="adv_scope[]" multiple="multiple" style="width:120px" size="5">
	<option value="all" style="color:#0000FF" {#multi_selected('all',$adv_scope)#}>{$L['adv_scope_all']}</option>
	<option value="index" {#multi_selected('index',$adv_scope)#}>{$L['adv_scope_index']}</option>
	<option value="viewfile" {#multi_selected('viewfile',$adv_scope)#}>{$L['adv_scope_viewfile']}</option>
	<option value="space" {#multi_selected('space',$adv_scope)#}>{$L['adv_scope_space']}</option>
	<option value="search" {#multi_selected('search',$adv_scope)#}>{$L['adv_scope_search']}</option>
	<option value="public" {#multi_selected('public',$adv_scope)#}>{$L['adv_scope_public']}</option>
	<option value="extract" {#multi_selected('extract',$adv_scope)#}>{$L['adv_scope_extract']}</option>
	<option value="tag" {#multi_selected('tag',$adv_scope)#}>{$L['adv_scope_tag']}</option>
	</select></td>
</tr>
<tr>
	<td><b>{$L['adv_title']}:</b><br /><span class="txtgray">{$L['adv_title_tips']}</span></td>
	<td><input type="text" name="adv_title" size="50" value="{$adv_title}" maxlength="100" /></td>
</tr>
<tr>
	<td><b>{$L['adv_starttime']}({$L['optional']}):</b><br /><span class="txtgray">{$L['adv_starttime_tips']}</span></td>
	<td><input type="text" name="adv_starttime" value="{$adv_starttime}" maxlength="10" /> ({$L['time_format']})</td>
</tr>
<tr>
	<td><b>{$L['adv_endtime']}({$L['optional']}):</b><br /><span class="txtgray">{$L['adv_endtime_tips']}</span></td>
	<td><input type="text" name="adv_endtime" value="{$adv_endtime}" maxlength="10" /> ({$L['time_format']})</td>
</tr>
<tr>
	<td><b>{$L['adv_type']}:</b><br /><span class="txtgray">{$L['adv_type_tips']}</span></td>
	<td>
	<select id="adv_type" name="adv_type" onchange="chg_adv_type(this.options[this.selectedIndex].value);">
		<option value="adv_img" {#ifselected('adv_img',$adv_type,'str')#}>{$L['adv_img']}</option>
		<option value="adv_code" {#ifselected('adv_code',$adv_type,'str')#}>{$L['adv_code']}</option>
		<option value="adv_text" {#ifselected('adv_text',$adv_type,'str')#}>{$L['adv_text']}</option>
		<option value="adv_flash" {#ifselected('adv_flash',$adv_type,'str')#}>{$L['adv_flash']}</option>
	</select>&nbsp;
	</td>
</tr>
</table>
<table align="center" width="100%" cellpadding="4" cellspacing="0" border="0" class="td_line">
<tbody id="adv_1" style="display:none">
<tr>
	<td colspan="2" class="bold">{$L['adv_img']}{$L['adv']}:</td>
</tr>
<tr>
	<td width="40%"><b>{$L['adv_img_src']}:</b><br /><span class="txtgray">{$L['adv_img_src_tips']}</span></td>
	<td><input type="text" name="adv_img_src" size="50" value="{$adv_img_src}" maxlength="255" /></td>
</tr>
<tr>
	<td><b>{$L['adv_img_url']}:</b><br /><span class="txtgray">{$L['adv_img_url_tips']}</span></td>
	<td><input type="text" name="adv_img_url" size="50" value="{$adv_img_url}" maxlength="255" /></td>
</tr>
<tr>
	<td><b>{$L['adv_img_width']}({$L['optional']}):</b><br /><span class="txtgray">{$L['adv_img_width_tips']}</span></td>
	<td><input type="text" name="adv_img_width" size="50" value="{$adv_img_width}" maxlength="255" /></td>
</tr>
<tr>
	<td><b>{$L['adv_img_height']}({$L['optional']}):</b><br /><span class="txtgray">{$L['adv_img_height_tips']}</span></td>
	<td><input type="text" name="adv_img_height" size="50" value="{$adv_img_height}" maxlength="255" /></td>
</tr>
<tr>
	<td><b>{$L['adv_img_alt']}({$L['optional']}):</b><br /><span class="txtgray">{$L['adv_img_alt_tips']}</span></td>
	<td><input type="text" name="adv_img_alt" size="50" value="{$adv_img_alt}" maxlength="255" /></td>
</tr>
</tbody>
<tbody id="adv_2" style="display:none">
<tr>
	<td colspan="2" class="bold">{$L['adv_code']}{$L['adv']}:</td>
</tr>
<tr>
	<td width="40%"><b>{$L['adv_html_code']}:</b><br /><span class="txtgray">{$L['adv_html_code_tips']}</span></td>
	<td><textarea id="adv_html_code" name="adv_html_code" style="width:350px;height:100px">{$adv_html_code}</textarea><br />
	<a href="javascript:void(0);" onclick="resize_textarea('adv_html_code','plus');">[+]</a> <a href="javascript:void(0);" onclick="resize_textarea('adv_html_code','sub');">[-]</a></td>
</tr>
</tbody>
<tbody id="adv_3" style="display:none">
<tr>
	<td colspan="2" class="bold">{$L['adv_text']}{$L['adv']}:</td>
</tr>
<tr>
	<td width="40%"><b>{$L['adv_txt_title']}:</b><br /><span class="txtgray">{$L['adv_txt_title_tips']}</span></td>
	<td><input type="text" name="adv_txt_title" size="50" value="{$adv_txt_title}" maxlength="255" /></td>
</tr>
<tr>
	<td><b>{$L['adv_txt_url']}:</b><br /><span class="txtgray">{$L['adv_txt_url_tips']}</span></td>
	<td><input type="text" name="adv_txt_url" size="50" value="{$adv_txt_url}" maxlength="255" /></td>
</tr>
<tr>
	<td><b>{$L['adv_txt_size']}({$L['optional']}):</b><br /><span class="txtgray">{$L['adv_txt_size_tips']}</span></td>
	<td><input type="text" name="adv_txt_size" size="50" value="{$adv_txt_size}" maxlength="255" /></td>
</tr>
<tr>
	<td><b>{$L['adv_txt_color']}({$L['optional']}):</b><br /><span class="txtgray">{$L['adv_txt_color_tips']}</span></td>
	<td><input type="text" name="adv_txt_color" size="50" value="{$adv_txt_color}" maxlength="255" /></td>
</tr>
</tbody>
<tbody id="adv_4" style="display:none">
<tr>
	<td colspan="2" class="bold">{$L['adv_flash']}{$L['adv']}:</td>
</tr>
<tr>
	<td width="40%"><b>{$L['adv_flash_src']}:</b><br /><span class="txtgray">{$L['adv_flash_src_tips']}</span></td>
	<td><input type="text" name="adv_flash_src" size="50" value="{$adv_flash_src}" maxlength="255" /></td>
</tr>
<tr>
	<td><b>{$L['adv_flash_width']}:</b><br /><span class="txtgray">{$L['adv_flash_width_tips']}</span></td>
	<td><input type="text" name="adv_flash_width" size="50" value="{$adv_flash_width}" maxlength="255" /></td>
</tr>
<tr>
	<td><b>{$L['adv_flash_height']}:</b><br /><span class="txtgray">{$L['adv_flash_height_tips']}</span></td>
	<td><input type="text" name="adv_flash_height" size="50" value="{$adv_flash_height}" maxlength="255" /></td>
</tr>
</tbody>
<tr>
	<td width="40%">&nbsp;</td>
	<td><input type="submit" class="btn" value="{$L['btn_submit']}"/>&nbsp;&nbsp;<input type="button" class="btn" value="{$L['btn_back']}" onclick="javascript:history.back();" /></td>
</tr>
</table>
</form>
</div>
</div>
<script language="javascript">
function chg_adv_type(adv_type){
	if(adv_type == 'adv_code'){
		var j = 2;
	}else if(adv_type =='adv_text'){
		var j = 3;
	}else if(adv_type =='adv_flash'){
		var j = 4;
	}else{
		var j =1;
	}
	for(var i=1;i<=4;i++){
		getId('adv_'+i).style.display = 'none';
	}
	getId('adv_'+j).style.display = '';
}
function chg_img(val){
	getId('adv_img').src = "{$admin_tpl_dir}images/adv_snapshot/"+val+".jpg";
}
function dosubmit(o){
	if(o.adv_title.value.strtrim().length <1){
		alert("{$L['adv_title_error']}");
		o.adv_title.focus();
		return false;
	}
	var st = o.adv_starttime.value.strtrim();
	var et = o.adv_endtime.value.strtrim();
	if(st !=''){
		if(st.length !=10 || st.indexOf('-') !=4 ){
			alert("{$L['time_format_error']}");
			o.adv_starttime.focus();
			return false;
		}
	}
	if(et != ''){
		if(et.length !=10 || et.indexOf('-') !=4 ){
			alert("{$L['time_format_error']}");
			o.adv_endtime.focus();
			return false;
		}
	}
}
chg_adv_type('{$adv_type}');
chg_img('{$adv_position}');
</script>
<!--#
}else{
#-->
<div id="container">
<h1>{$L['adv_manage']}<!--#sitemap_tag($L['adv_manage']);#--></h1>
<div>
<div class="tips_box"><img class="img_light" src="images/light.gif" align="absmiddle" /> <b>{$L['tips']}: </b>
<span class="txtgray">{$L['adv_manage_tips']}</span>
</div>
<div style=" padding:8px"><b>{$L['add_advs_title']}: </b>
<select id="adv_type">
	<option value="adv_img">{$L['adv_img']}</option>
	<option value="adv_code">{$L['adv_code']}</option>
	<option value="adv_text">{$L['adv_text']}</option>
	<option value="adv_flash">{$L['adv_flash']}</option>
</select>&nbsp;
<select id="adv_position" onchange="chg_adv_position();">
	<option value="0" class="txtgreen">{$L['please_select']}</option>
	<option value="adv_top">{$L['adv_top']}</option>
	<option value="adv_right">{$L['adv_right']}</option>
	<option value="adv_viewfile_right">{$L['adv_viewfile_right']}</option>
	<option value="adv_viewfile_hits_bottom">{$L['adv_viewfile_hits_bottom']}</option>
	<option value="adv_viewfile_download_top">{$L['adv_viewfile_download_top']}</option>
	<option value="adv_viewfile_download_bottom">{$L['adv_viewfile_download_bottom']}</option>
	<option value="adv_bottom">{$L['adv_bottom']}</option>
</select>
</div>
<br />
<form name="adv_form" action="{#urr("admincp","item=advertisement")#}" method="post">
<input type="hidden" name="task" value="update" />
<input type="hidden" name="formhash" value="{$formhash}" />
<table align="center" width="100%" cellpadding="4" cellspacing="0" border="0" class="td_line">
<!--#
if(count($advs)){
#-->
<tr>
	<td width="30" align="center" class="bold">{$L['show_order']}</td>
	<td width="30" align="center" class="bold">{$L['is_hidden']}</td>
	<td class="bold">{$L['adv_title']}</td>
	<td class="bold">{$L['adv_position']}</td>
	<td class="bold">{$L['adv_type']}</td>
	<td class="bold">{$L['adv_starttime']}</td>
	<td class="bold">{$L['adv_endtime']}</td>
	<td class="bold">{$L['operation']}</td>
</tr>
<!--#
	foreach($advs as $k => $v){
#-->
<tr>
	<td>
	<input type="text" name="show_order[]" value="{$v['show_order']}" style="width:20px; text-align:center" maxlength="2" />
	<input type="hidden" name="advids[]" value="{$v['advid']}" />
	</td>
	<td><input type="checkbox" name="is_hidden[{$v['advid']}]" value="1" {#ifchecked($v['is_hidden'],1)#}/></td>
	<td><input type="text" name="adv_titles[]" value="{$v['title']}" size="30" /></td>
	<td>{#$L[$v['adv_position']]#}</td>
	<td align="center">{#$L[$v['adv_type']]#}</td>
	<td>{$v['adv_starttime']}</td>
	<td>{$v['adv_endtime']}</td>
	<td><a href="{$v['a_modify_adv']}" id="p_{$k}"><img src="images/menu_edit.gif" align="absmiddle" border="0" /></a>
	<div id="c_{$k}" class="menu_box2 menu_common">
	<a href="{$v['a_modify_adv']}">{$L['modify']}</a>
	<a href="{$v['a_delete_adv']}" onclick="return confirm('{$L['advs_delete_confirm']}');">{$L['delete']}</a>
	</div>
	{$v['status']}
	<script type="text/javascript">on_menu('p_{$k}','c_{$k}','-x','');</script>
	</td>
</tr>
<!--#
	}
	unset($advs);
#-->
<tr>
	<td align="center" colspan="8"> <input type="submit" class="btn" value="{$L['btn_update']}"/></td>
</tr>
<!--#
}else{
#-->
<tr>
	<td colspan="8" align="center">{$L['advs_not_found']}</td>
</tr>
<!--#
}
#-->
</table>
</form>
</div>
</div>
<script language="javascript">
function chg_adv_position(){
	var adv_position = getId('adv_position').value;
	var adv_type = getId('adv_type').value;
	if(adv_position != 0){
		document.location.href = '{#urr("admincp","item=advertisement&action=add_adv&adv_type='+adv_type+'&adv_position='+adv_position+'")#}';
	}
}
</script>
<!--#}#-->
