<?php
#=============================================================#
#                                                             #
#           Powered by Dvbbs.PHP 2.0.0                        #
#           function  主页右侧广告                            #
#           author    copy from IvanSky                       #
#           date      2007-9-17                               #
#                                                             #
#=============================================================#
if( !defined('ISDVBBS') ){
	header('HTTP/1.0 404 Not Found');
	printFooter();
	exit;
}
?>

<script language=javascript> 
function ad_winOpen(strUrl,strWid,strHei)
{ 
	window.open(strUrl,"","height="+strHei+",width="+strWid+",status=no,location=no,toolbar=no,directories=no,menubar=no,scrollbars=no");
} 
</script> 
<? if (empty($do_action) or !isset($do_action)) { ?> 
<table border="0" cellspacing="0" cellpadding="0"  align="center" class="indextableborder1">
<tr> 
<td class="tdtit" colspan="6"><?=$lang['str.info11']?></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="0"  align="center" class="tableborder">
<form name="f_name" method="post" action="" > 

<tr>
<td colspan="8">
	<table cellpadding="0" cellspacing="0" width="100%">
	<tr class="forumrow2">
		<td width="18%" align="center"><?=$lang['str.info8']?></td>
		<td width="20%" align="center"><?=$lang['str.info1']?></td>
		<td width="16%" align="center"><?=$lang['str.info2']?></td>
		<td width="16%" align="center"><?=$lang['str.info3']?></td>
		<td width="12%" align="center"><?=$lang['str.info4']?></td>
		<td width="8%" align="center"><?=$lang['str.info5']?></td>
		<td width="5%" align="center"><?=$lang['str.info6']?></td>
		<td width="5%" align="center"><b><?=$lang['ad.preview']?></b></td>
		</tr>
	</table>
</td>
</tr>
<?
	if(!empty($arrIndex_Ads))
	{
		if(is_array($arrIndex_Ads))
		{
			foreach($arrIndex_Ads as $k => $vv)
			{
?>
	<tr style="padding:1px;height:25px;">
	<td width="20%" class="forumrow"><?=$vv['DB_name']?></td>
	<td width="20%" class="forumrow">
		<select name="DB_boardid" style="border:1px;">
			<option value='1' <?=($vv['DB_boardid']=='1')?'selected="selected"':''?>>右上</option>
			<option value='2' <?=($vv['DB_boardid']=='2')?'selected="selected"':''?>>右中</option>
			<option value='3' <?=($vv['DB_boardid']=='3')?'selected="selected"':''?>>右下</option>
		</select>
	</td>
	<td width="16%" class="forumrow"><?=$vv['DB_width']?></td>
	<td width="16%" class="forumrow"><?=$vv['DB_height']?></td>
	<td width="8%" class="forumrow"><?=$vv['DB_File_type']?></td>
	<td width="10%" class="forumrow"><A HREF="?do_action=startclose&setDB_Close=<?=$vv['DB_close']?>&setDB_id=<?=$vv['DB_id']?>" title="<?$DB_close=($vv['DB_close']==1)?$lang['str.add.info17']:$lang['str.add.info16'];echo $DB_close; ?>"><?$DB_close=($vv['DB_close']==1)?$lang['str.add.info12']:$lang['str.add.info13'];echo $DB_close; ?></A></td>
	<td width="5%"  class="forumrow"> <input type="checkbox" name="selected_id[]" value="<?=$vv['DB_id']?>"></td>
	<td width="5%" class="forumrow"><input name="preview" type="button" id="preview" value=" <?=$lang['ad.preview']?> " class="button"   onclick="ad_winOpen('../index_right_ads_preview.php?getDB_id=<?=$vv['DB_id']?>','<?=$vv['DB_width']?>','<?=$vv['DB_height']?>')" ></td>
	</tr>
<?

			}
		}
	}
?>
<tr><td colspan="8" height="1" bgcolor="#0000ff"></td></tr>
<tr><td colspan="8" align="left" style="height:30px;" class="forumrow1"><?=$lang['template.info1']?>
<input name="select_all" type="checkbox" id="select_all"  value="Y" onclick="allun(this)">&nbsp;
<input name="del_sel" class="button" onclick="f_del('?do_action=del')" type="button" id="del_sel" value=" <?=$lang['ad.del']?> ">&nbsp;&nbsp;&nbsp;
<input name="edit_sel" class="button" onclick="f_edit('?do_action=edit')" type="button" id="del_sel" value=" <?=$lang['ad.edit']?> ">
</td></tr>
</table>
</td>
</tr>
  </form>
 </table>



 <?}elseif ($do_action == "add"){
	$start_time = gmdate('Y-m-d H:i', time()+getUserTimeZoneOffset());
	$end_time = gmdate('Y-m-d H:i', time()+(24*3600*7)+getUserTimeZoneOffset());
	 
	 ?> 
<table border="0" cellspacing="0" cellpadding="0"  align="center" class="indextableborder1">
<tr> 
<td class="tdtit" colspan="6"><?=$lang['str.info10']?></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="0"  align="center" class="tableborder">
<form name="DB_form" method="post" action="?do_action=save" enctype="multipart/form-data"> 
<input type="hidden" name="do_action" value="save">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
  <tr >
  <td class="forumrow"><?=$lang['str.add.info14']?></td>
  <td class="forumrow"><input type="text" size="38" name="DB_name" id="DB_name" style="border:1px;"   maxLength=100></td>
  </tr>
  <tr >
  <td class="forumrow"><?=$lang['str.add.info15']?></td>
  <td class="forumrow"><input type="text" size="38" name="DB_linkurl" id="DB_linkurl" style="border:1px;"   maxLength=200>&nbsp;<?=$lang['str.add.info18']?></td>
  </tr>
  <tr >
  <td width="30%" class="forumrow"><?=$lang['str.add.info1']?></td>
  <td width="70%" class="forumrow">
	<select name="DB_boardid" style="border:1px;">
		<option value='1'>右上</option>
		<option value='2'>右中</option>
		<option value='3'>右下</option>
	</select>
  </td>
  </tr>
  <tr >
  <td class="forumrow"><?=$lang['str.add.info2']?></td>
  <td class="forumrow"><input type="file" size="38" name="DB_File" id="DB_File" class="button"></td>
  </tr>
  <tr >
  <td class="forumrow"><?=$lang['str.add.info3']?></td>
  <td class="forumrow"><input type="text" size="10" name="DB_width" id="DB_width" style="border:1px;" onkeyup="this.value=this.value.replace(/[^0-9.]/g,'')" value="240"  maxLength=4>&nbsp;<?=$lang['str.add.info10']?></td>
  </tr>
  <tr >
  <td class="forumrow"><?=$lang['str.add.info4']?></td>
  <td class="forumrow"><input type="text" size="10" name="DB_height" id="DB_height" style="border:1px;" onkeyup="this.value=this.value.replace(/[^0-9.]/g,'')" value="80"  maxLength=4>&nbsp;<?=$lang['str.add.info10']?></td>
  </tr>
  <tr >
  <td class="forumrow"><?=$lang['str.add.info9']?></td>
  <td class="forumrow"><input type="radio" name="DB_close" value="1" checked="checked" class="radio"/> <?=$lang['str.add.info12']?>&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="DB_close" value="2" class="radio"/> <?=$lang['str.add.info13']?></td>
  </tr>
  <tr><td colspan="6" style="height:30px;text-align:center;" class="forumrow1">
  <input class="button" type="submit" name="submit" id="save" value=" <?=$lang['ad.save']?> " >
  </td>

   </tr>
   </form>
</table>

 <?}elseif ($do_action == "edit"){

	 
	 ?> 

<table width="100%" border="0" cellspacing="1" cellpadding="1"  align="center" class="tableborder">
<form name="DB_form_edit" method="post" action="?do_action=edit" enctype="multipart/form-data"> 
<input type="hidden" name="do_action" value="edit">
<input type="hidden" name="self_action" value="saveedit">
<input type="hidden" name="strDB_id" value="<?=$GetArrDB['DB_id']?>">
<input type="hidden" name="DB_dot" value="<?=$GetArrDB['DB_dot']?>">
<input type="hidden" name="selected_id" value="<?=$selected_id?>">
<input type="hidden" name="oldDB_File" value="<?=$GetArrDB['DB_File']?>">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">

  <tr>
  <td class="tit1" colspan="6">
    </td>
  </tr>
  <tr >
  <td class="forumrow"><?=$lang['str.add.info14']?></td>
  <td class="forumrow"><input type="text" size="38" name="DB_name" id="DB_name" value="<?=$GetArrDB[DB_name]?>" style="border:1px;"   maxLength=100></td>
  </tr>
  <tr >
  <td class="forumrow"><?=$lang['str.add.info15']?></td>
  <td class="forumrow"><input type="text" size="38" name="DB_linkurl" id="DB_linkurl" value="<?=$GetArrDB[DB_linkurl]?>" style="border:1px;"   maxLength=200>&nbsp;<?=$lang['str.add.info18']?></td>
  </tr>

  <tr >
  <td width="30%" class="forumrow"><?=$lang['str.add.info1']?></td>
  <td width="70%" class="forumrow">
	<select name="DB_boardid" style="border:1px;">
		<option value='1' <?=($GetArrDB['DB_boardid']=='1')?'selected="selected"':''?>>右上</option>
		<option value='2' <?=($GetArrDB['DB_boardid']=='2')?'selected="selected"':''?>>右中</option>
		<option value='3' <?=($GetArrDB['DB_boardid']=='3')?'selected="selected"':''?>>右下</option>
	</select>
  </td>
  </tr>
  <tr >
  <td class="forumrow"><?=$lang['str.add.info2']?></td>
  <td class="forumrow"><input type="file" size="38" name="DB_File" id="DB_File" class="button"></td>
  </tr>
  <tr >
  <td class="forumrow"><?=$lang['str.add.info3']?></td>
  <td class="forumrow"><input type="text" size="10" name="DB_width" value="<?=$GetArrDB[DB_width]?>" id="DB_width" style="border:1px;" onkeyup="this.value=this.value.replace(/[^0-9.]/g,'')"  maxLength=4>&nbsp;<?=$lang['str.add.info10']?></td>
  </tr>
  <tr >
  <td class="forumrow"><?=$lang['str.add.info4']?></td>
  <td class="forumrow"><input type="text" size="10" name="DB_height" value="<?=$GetArrDB[DB_height]?>"  id="DB_height" style="border:1px;" onkeyup="this.value=this.value.replace(/[^0-9.]/g,'')"  maxLength=4>&nbsp;<?=$lang['str.add.info10']?></td>
  </tr>
  <tr >
  <td class="forumrow"><?=$lang['str.add.info9']?></td>
  <td class="forumrow"><input type="radio" name="DB_close" value="1" <?if ($GetArrDB[DB_close]==1)echo 'checked="checked"';?> class="radio"/> <?=$lang['str.add.info12']?>&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="DB_close" <?if ($GetArrDB[DB_close]==2)echo 'checked="checked"';?> value="2" class="radio"/> <?=$lang['str.add.info13']?></td>
  </tr>
  <tr><td colspan="6" align="center" height="30" class="forumrowc">
  <input class="button" type="submit" name="submit" id="edit" value=" <?=$lang['ad.saveedit']?> " >
  </td>

   </tr>
   </form>
</table>
 <?}?> 






