<!--<?php
include_once PrintEot('left');
print <<<EOT
-->
<table width=98% align=center cellspacing=1 cellpadding=3 class=i_table>
<tr><td class=head colspan=2>{#guide}</td></tr>
<tr><td class=b>{#advert_info}</td></tr>
</table>
<br>
<table width=98% align=center cellspacing=1 cellpadding=3 class=i_table>
	<tr>
		<td class=b>
			[<a href="$basename&action=advert">{#advert_admin}</a>]
			[<a href="$basename&action=advert&job=add">{#advert_addnew}</a>]
		</td>
	</tr>
</table>
<br>
<!--
EOT;
if(!$job){print <<<EOT
-->
<form method=post action="$basename&action=advert&job=del&">
<table width=98% align="center" cellpadding=5 cellspacing=1 class=i_table>
	<tr><td colspan="11" class=head>{#advert_admin}</td></tr>
	<tr align="center">
		<td class=head_2 width="5%">{#apply}</td>
		<td class=head_2 width="5%">{#order}</td>
		<td class=head_2 width="15%">{#advert_type}</td>
		<td class=head_2 width="25%">{#advert_title}</td>
		<td class=head_2 width="12%">{#endtime}</td>
		<td class=head_2>{#c_module_adarea}</td>
		<td class=head_2 width="5%">{#edit}</td>
		<td class=head_2 width="5%">{#del}</td>
	</tr>
<!--
EOT;
foreach($moduledb as $key=>$value){
	$state = $value[state] ? 'checked' : '';
	$area='';
	foreach($value[fid] as $k=>$v){
		if($v=='-4'){
			$area .= '{#advert_all} ';
		}elseif($v=='-3'){
			$area .= '{#advert_read} ';
		}elseif($v=='-2'){
			$area .= '{#advert_thread} ';
		}elseif($v=='-1'){
			$area .= '{#advert_index} ';
		}elseif(is_numeric($v)){
			$area .= $forum[$v][name].' ';
		}
	}
print <<<EOT
-->
	<tr align="center">
		<td class=b><input type="checkbox" name="applyid[]" value="$value[id]" $state></td>
		<td class=b>$value[vieworder]</td>
		<td class=b>$value[title]</td>
		<td class=b>$value[adtitle]</td>
		<td class=b>$value[endtime]</td>
		<td class=b>$area</td>
		<td class=b><a href="$basename&action=advert&job=edit&id=$value[id]">{#edit}</a></td>
		<td class=b><input type="checkbox" name="selid[]" value="$value[id]"></td>
	</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<br>
<center><input type="submit" value="{#submit}"></center>
</form>
<br>
<!--
EOT;
}elseif($job=='add' || $job=='edit'){print <<<EOT
-->
<form method=post action="$basename&action=advert&job=$job&">
<input type="hidden" name="step" value="2">
<input type="hidden" name="id" value="$id">
<table width=98% align="center" cellpadding=3 cellspacing=1 class=i_table>
	<tr><td colspan="2" class=head>{#advert_addnew}</td></tr>
	<tr>
		<td class=b width="30%"><b>{#order}</b></td>
		<td class=b><input type=text name="vieworder" value="$rt[vieworder]" size="5"></td>
	</tr>
	<tr>
		<td class=b>{#advert_varname}</td>
		<td class=b>
			<select onchange="this.form.varname.value=this.value">
				<option></option>
				<option value="header">{#advert_header}</option>
				<option value="footer">{#advert_footer}</option>
				<option value="text">{#advert_text}</option>
				<option value="article">{#advert_article}</option>
<!--
EOT;
foreach($adtype as $key=>$val){print <<<EOT
-->
				<option value="$val[varname]">$val[title]</option>
<!--
EOT;
}print <<<EOT
-->
			</select>
			<br>
			<input type=text size="20" name="varname" value="$rt[varname]">
		</td>
	</tr>
	<tr>
		<td class=b>{#advert_titleadd}</td>
		<td class=b><input type=text size="40" name="title" value="$rt[title]"></td>
	</tr>
	<tr>
		<td class=b>{#c_module_starttime}</td>
		<td class=b><input type=text size="40" name="module[starttime]" value="$config[starttime]"></td>
	</tr>
	<tr>
		<td class=b>{#c_module_endtime}</td>
		<td class=b><input type=text size="40" name="module[endtime]" value="$config[endtime]"></td>
	</tr>
	<tr>
		<td class=b><b>{#c_module_style}</b></td>
		<td class=b>
			<select name="module[style]" onchange="showcode(this.options[this.selectedIndex].value)">
				<option value="code" $style_code>{#c_module_code}</option>
				<option value="txt" $style_txt>{#c_module_txt}</option>
				<option value="img" $style_img>{#c_module_img}</option>
				<option value="flash" $style_flash>flash</option>
			</select>
		</td>
	</tr>
	<tr>
		<td colspan="2" class=b>
		<div id='advert'></div>
		</td>
	</tr>
	<tr>
		<td class=b><b>{#c_module_adarea}</b></td>
		<td class=b>
			<table style="TABLE-LAYOUT:fixed;WORD-WRAP:break-word;">
			<tr><td valign="top">
			</td></tr>
				<tr>
					<td valign="top" colspan="4">
						<input type="checkbox" name="selids[]" value='-4' $selids_04> {#advert_all}
						<input type="checkbox" name="selids[]" value='-1' $selids_01> {#advert_index}
						<input type="checkbox" name="selids[]" value='-2' $selids_02> {#advert_thread}
						<input type="checkbox" name="selids[]" value='-3' $selids_03> {#advert_read}
					</td>
				</tr>
				<tr><td valign="top"><b>{#c_module_bbs}</b></td></tr>
				<tr>

<!--
EOT;
$num=0;
foreach($forum as $value){
if($value[type]!='category' && !$value[cms]){
$ifcheck=${'selids_'.$value[fid]};
$num++;
print <<<EOT
-->
					<td valign="top">
						<input type="checkbox" name="selids[]" value='$value[fid]' $ifcheck>$value[name]
					</td>
<!--
EOT;
if($num==4){
$num=0;
print <<<EOT
-->
				</tr>
				<tr>
<!--
EOT;
}}}print <<<EOT
-->
				</tr>
			</table>

		</td>
	</tr>
</table>
<div id="code" style="display:none;" disabled>
	<table width="100%" cellpadding=3 cellspacing=1 class=i_table>
		<tr><td class="head" colspan="2">{#c_module_code}</td></tr>
		<tr>
			<td class=b width="30%">{#code_info}</td>
			<td class=b><textarea name="module[htmlcode]" rows="5" cols="50">$config[htmlcode]</textarea></td>
		</tr>
	</table>
</div>
<div id="txt" style="display:none;" disabled>
	<table width="100%" cellpadding=3 cellspacing=1 class=i_table>
		<tr><td class="head" colspan="2">{#c_module_txt}</td></tr>
		<tr>
			<td class=b width="30%"><b>{#txt_content}*</b></td>
			<td class=b><input type="text" size="40" name="module[title]" value="$config[title]"></td>
		</tr>
		<tr>
			<td class=b><b>{#txt_link}*</b></td>
			<td class=b><input type="text" size="40" name="module[link]" value="$config[link]"></td>
		</tr>
		<tr>
			<td class=b><b>{#txt_color}</b></td>
			<td class=b><input type="text" size="10" name="module[color]" value="$config[color]"></td>
		</tr>
		<tr>
			<td class=b><b>{#txt_size}</b></td>
			<td class=b><input type="text" size="10" name="module[size]" value="$config[size]"></td>
		</tr>
	</table>
</div>
<div id="img" style="display:none;" disabled>
	<table width="100%" cellpadding=3 cellspacing=1 class=i_table>
		<tr><td class="head" colspan="2">{#c_module_img}</td></tr>
		<tr>
			<td class=b width="30%"><b>{#img_url}*</b></td>
			<td class=b><input type="text" size="40" name="module[url]" value="$config[url]"></td>
		</tr>
		<tr>
			<td class=b><b>{#img_link}*</b></td>
			<td class=b><input type="text" size="40" name="module[link]" value="$config[link]"></td>
		</tr>
		<tr>
			<td class=b><b>{#img_width}</b></td>
			<td class=b><input type="text" size="10" name="module[width]" value="$config[width]"></td>
		</tr>
		<tr>
			<td class=b><b>{#img_height}</b></td>
			<td class=b><input type="text" size="10" name="module[height]" value="$config[height]"></td>
		</tr>
		<tr>
			<td class=b><b>{#img_descrip}</b></td>
			<td class=b><input type="text" size="40" name="module[descrip]" value="$config[descrip]"></td>
		</tr>
	</table>
</div>
<div id="flash" style="display:none;" disabled>
	<table width="100%" cellpadding=3 cellspacing=1 class=i_table>
		<tr><td class="head" colspan="2">flash</td></tr>
		<tr>
			<td class=b width="30%"><b>{#flash_link}</b></td>
			<td class=b><input type="text" size="40" name="module[link]" value="$config[link]"></td>
		</tr>
		<tr>
			<td class=b><b>{#flash_width}</b></td>
			<td class=b><input type="text" size="40" name="module[width]" value="$config[width]"></td>
		</tr>
		<tr>
			<td class=b><b>{#flash_height}</b></td>
			<td class=b><input type="text" size="40" name="module[height]" value="$config[height]"></td>
		</tr>
	</table>
</div>
<br>
<center>
<input type="submit" value="{#submit}">
</center>
</form>
<br>
<script language="JavaScript">
function getObj(id) {
	return document.getElementById(id);
}
function showcode(idName){
	obj = getObj("advert");
	obj2 = getObj(idName);
	obj.innerHTML	= obj2.innerHTML;
}
showcode('$style');
</script>
<!--
EOT;
}include_once PrintEot('adminbottom');
?>-->