<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
<link rel="stylesheet" type="text/css" href="{$vd['sc']}css/main.css"/>
</head>
<body>
<div id="titleDiv">
<div style="float:left"><a href="index.php?a=home"><img src="{$vd['sc']}images/home.png" style="vertical-align:middle" border="0"/></a></div><div style="float:left;padding-top:8px;padding-left:3px;"><a href="index.php?a=home" title="回到后台首页"><font color="#000">桌面</font></a> <span style="font-size:7px;">>></span> <span style="font-size:12px;">页面广告管理</span></div>
<div style="float:right;"><a href="index.php?m=mod_home&a=Help&t=admin_b2b_ad_index" onFocus="this.blur()" title="查看页面广告相关相关帮助"><img src="{$vd['sc']}images/help.gif" style="vertical-align:middle" border="0"/></a></div>
</div>
<div id="contentTip" style="display:none;"></div>
<div id="content" class="cwarpper">
<div class="cbodyHead"></div>
<div class="cwarpper1">
<div class="ctitle">
  <div style="padding-left:5px;padding-bottom:8px;" >
    请选择广告类型：
    <select name="cat" onchange="javascript:location.href='index.php?m=mod_b2b&c=Ad&pos=' + this.options[selectedIndex].value;" class="ubselect">
    {#option($vd['adtype'], $vd['pos'])}
    </select>
    <strong onmouseover="showhide(this);" onmouseout="showhide(this);" style="cursor:pointer">[?]</strong><p style="display:none">
      本系统包括友情链接，各类广告图片都是基于广告系统，请选择对应的项进入
    </p>
  </div>
</div>
<!--if($vd['pos'] > 0){-->
<form method="post" action="index.php?m=mod_b2b&c=Ad&a=Save" name="cform" id="cform">
<table border="1" id="ctable1" class="ctable" bordercolor="#86B9D6">
  <tr>
    <td align="center" height="35" colspan="2" class="listhead" style="text-align:left;font-weight:bold;padding-left:10px;color:#ff0000">
      <img src="{$vd['sc']}images/add.gif" style="vertical-align:middle" border="0"/> 添加
    </td>
  </tr>
  <tr> 
    <td width="15%" align="right" height="46">图片<b></b></td>
    <td width="85%" style="padding-left: 10px" height="47">
    <br/><input type="text" id="ubzpic200" name="ubzpic" value="" size="34"/> 
    </td>
  </tr>
  <tr>
    <td width="15%" align="right" height="46">链接文字</td>
    <td width="85%" style="padding-left: 10px" height="47">
    <input type="text" name="ubztext" value="" size="34"/> 
    文字颜色：
    <input type="text" id="textcolor200" name="ubztextcolor" value="" size="15" onkeyup="setcolor(this,200)"/> 
    <input id="colorexample200" type="text" size="1" readonly style="background:#6c6c6c">
    <img src="{$vd['sc']}images/16.gif" onclick="pickcolor(200)" align="absmiddle" style="cursor:pointer;"/>
    </td>
  </tr>
  <tr>
    <td width="15%" align="right" height="46">显示类型</td>
    <td width="85%" style="padding-left: 10px" height="47">
    <input type="radio" name="ispic" value="0" class="checkbox" onFocus="this.blur()"/> 显示文字
    <input type="radio" name="ispic" value="1" class="checkbox" onFocus="this.blur()" checked/> 显示图片
    </td>
  </tr>
  <tr>
    <td width="15%" align="right" height="46">链接网址</td>
    <td width="85%" style="padding-left: 10px" height="47">
    <input type="text" name="ubzurl" value="" size="34"/> 
    </td>
  </tr>
  <tr> 
    <td width="15%" align="right" height="46">上传图片<b></b></td>
    <td width="85%" style="padding-left: 10px" height="47">
    <iframe name="uploader" src="index.php?m=com_fs&c=Fs&imgid=ad200&fun=imginfo200&inputid=ubzpic200&d=2" frameBorder="0" marginHeight="1" marginWidth="1" scrolling="no" style="height:30px;width:100%; background-color:#ffffff"></iframe>
    </td>
  </tr>
  <tr>
    <td width="15%" align="right" height="46">操作</td>
    <td width="85%" style="padding-left: 10px" height="47">
    <input type="hidden" name="pos" value="{$vd['pos']}"/>
    <input type="submit" value=" 提 交 &gt;&gt;" name="B1" class="button"/>
    </td>
  </tr>
  <tr> 
    <td width="15%" align="right" height="46">图片预览<b></b></td>
    <td width="85%" style="padding-left: 10px" height="47">
    <div id="ad200"></div><div id="logoinfo200"></div></td>
  </tr>
  
</table>
</form>
<script type="text/javascript">

function imginfo200(imgsrc)
{
  document.getElementById("logoinfo200").innerHTML = "高 x 宽：" + imgsrc.height + " x " + imgsrc.width + "<br/>图片大小：" + imgsrc.fileSize + " 字节"; 
}

</script>
<br/>
<!--}-->
<!--$i=0;foreach($vd['items'] as $item) {-->
<form method="post" action="index.php?m=mod_b2b&c=Ad&a=Save" name="myform">
<table border="1" id="ctable1" class="ctable" bordercolor="#86B9D6">
  <tr>
    <td align="center" height="35" colspan="2" class="listhead" style="text-align:left;font-weight:bold;padding-left:10px;color:#ff0000">
      <span style="float:right;"><a href="index.php?m=mod_b2b&c=Ad&a=Del&id={$item['id']}&pos={$vd['pos']}" onclick="return confirm('您确定进行删除操作吗？')">
        <img src="{$vd['sc']}images/icon_trash.gif" border="0"/>
      </a>
      </span>
      {$i+1}
    </td>
  </tr>
  <tr> 
    <td width="15%" align="right" height="46">图片<b></b></td>
    <td width="85%" style="padding-left: 10px" height="47">
    <!--$endpath=strtolower(end( explode( ".", $item['pic'] ) ));if( $endpath == 'swf' ){-->
    <object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="180"><param name="movie" value="{$vd['root']}content/mod_shared/skins/upload/{$item['pic']}"><param name="quality" value="high"><embed src="{$vd['root']}content/mod_shared/skins/upload/{$item['pic']}" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash" type="application/x-shockwave-flash" width="480" height="180"></embed></object>
    <!--}else{-->
    <img src="{$vd['root']}content/mod_shared/skins/upload/{$item['pic']}" border="0" onload="resizeImg(this,600,216)"/>
    <!--}-->
    <br/><input type="text" id="ubzpic{$i}" name="ubzpic" value="{$item['pic']}" size="34"/> 
    </td>
  </tr>
  <tr>
    <td width="15%" align="right" height="46">链接文字</td>
    <td width="85%" style="padding-left: 10px" height="47">
    <input type="text" name="ubztext" value="{$item['text']}" size="34"/> 
    文字颜色：
    <input type="text" id="textcolor{$i}" name="ubztextcolor" value="{$item['textcolor']}" size="15" onkeyup="setcolor(this,{$i})"/> 
    <input id="colorexample{$i}" type="text" size="1" readonly style="background:<!--echo $item['textcolor']==''?'#6c6c6c' : $item['textcolor']-->">
    <img src="{$vd['sc']}images/16.gif" onclick="pickcolor({$i})" align="absmiddle" style="cursor:pointer;"/>
    </td>
  </tr>
  <tr>
    <td width="15%" align="right" height="46">显示类型</td>
    <td width="85%" style="padding-left: 10px" height="47">
    <input type="radio" name="ispic" value="0" class="checkbox" onFocus="this.blur()" <!--if($item['ispic']==0){-->checked<!--}-->/> 显示文字
    <input type="radio" name="ispic" value="1" class="checkbox" onFocus="this.blur()" <!--if($item['ispic']==1){-->checked<!--}-->/> 显示图片
    </td>
  </tr>
  <tr>
    <td width="15%" align="right" height="46">链接网址</td>
    <td width="85%" style="padding-left: 10px" height="47">
    <input type="text" name="ubzurl" value="{$item['url']}" size="34"/> 
    </td>
  </tr>
  <tr> 
    <td width="15%" align="right" height="46">上传图片<b></b></td>
    <td width="85%" style="padding-left: 10px" height="47">
    <iframe name="uploader" src="index.php?m=com_fs&c=fs&imgid=ad{$i}&fun=imginfo{$i}&inputid=ubzpic{$i}&d=2" frameBorder="0" marginHeight="1" marginWidth="1" scrolling="no" style="height:30px;width:100%; background-color:#EEF7FD"></iframe>
    </td>
  </tr>
  <tr>
    <td width="15%" align="right" height="46">操作</td>
    <td width="85%" style="padding-left: 10px" height="47">
    <input type="hidden" name="id" value="{$item['id']}"/>
    <input type="hidden" name="pos" value="{$vd['pos']}"/>
    <input type="submit" value=" 提 交 &gt;&gt;" name="B1" class="button"/>
    </td>
  </tr>
  <tr> 
    <td width="15%" align="right" height="46">图片预览<b></b></td>
    <td width="85%" style="padding-left: 10px" height="47">
    <div id="ad{$i}"></div><div id="logoinfo{$i}"></div></td>
  </tr>
</table>
</form>
<br/>
<script type="text/javascript">  
function imginfo{$i}(imgsrc)
{
  document.getElementById("logoinfo" + {$i}).innerHTML = "高 x 宽：" + imgsrc.height + " x " + imgsrc.width + "<br/>图片大小：" + imgsrc.fileSize + " 字节"; 
}
</script>
<!--$i++;}-->
</div>
<div class="cbodyFoot"></div>
</div>
<div id="opcontent" style="display:none">
  <div class="optxt">
  </div>
</div>
<script type="text/javascript">
  var ctablenum = 2;
</script>
<script src="{$vd['sc']}js/content.js" type="text/javascript"></script>
<script type="text/JavaScript">
function pickcolor(id) 
{
  var color = showModalDialog("{$vd['sc']}tools/colorselect.htm", "", "font-family:Verdana; font-size:12; status:no; dialogWidth:21em; dialogHeight:21em");
  if (color != null) 
  {
    $("colorexample"+id).style.backgroundColor = color;
    $("textcolor"+id).value = color;
  }
}
function setcolor(obj,id)
{
  if(obj.value.length == 7)
  {
    $("colorexample"+id).style.backgroundColor = obj.value;
  }
}

function resizeImg(obj,w,h)
{
  var imgHeight = obj.height;
  var imgWidth  = obj.width;
  
  if(imgHeight < imgWidth)
  {
    if(imgWidth > w)
    {
      obj.style.width = w + "px";
    }
  }
  else
  {
    if(imgHeight > h)
    {
      obj.style.height = h + "px";
    }
  }
}
</script>
</body>
</html>
