<?php
/****************************************/
/*                                      */
/*  百信卡盟平台联系QQ:84945491         */
/*  淘宝店 http://shop70674652.taobao.com  */
/*  百信卡盟 http://www.caipiaobus.com  */
/*                                      */
/****************************************/

echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\"/>\r\n<link rel=\"stylesheet\" type=\"text/css\" href=\"";
echo $vd['sc'];
echo "css/main.css\"/>\r\n</head>\r\n<body>\r\n<div id=\"titleDiv\">\r\n<div style=\"float:left\"><a href=\"index.php?a=home\"><img src=\"";
echo $vd['sc'];
echo "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> ";
echo "<s";
echo "pan style=\"font-size:7px;\">>></span> ";
echo "<s";
echo "pan style=\"font-size:12px;\">页面广告管理</span></div>\r\n<div style=\"float:right;\"><a href=\"index.php?m=mod_home&a=Help&t=admin_b2b_ad_index\" onFocus=\"this.blur()\" title=\"查看页面广告相关相关帮助\"><img src=\"";
echo $vd['sc'];
echo "images/help.gif\" style=\"vertical-align:middle\" border=\"0\"/></a></div>\r\n</div>\r\n<div id=\"contentTip\" style=\"display:none;\"></div>\r\n<div id=\"content\" class=\"cwarpper\">\r\n<div class=\"cbodyHead\"></div>\r\n<div class=\"cwarpper1\">\r\n<div class=\"ctitle\">\r\n  <div style=\"padding-left:5px;padding-bottom:8px;\" >\r\n    请选择广告类型：\r\n    ";
echo "<s";
echo "elect name=\"cat\" onchange=\"javascript:location.href='index.php?m=mod_b2b&c=Ad&pos=' + this.options[selectedIndex].value;\" class=\"ubselect\">\r\n    ";
option( $vd['adtype'], $vd['pos'] );
echo "    </select>\r\n    ";
echo "<s";
echo "trong onmouseover=\"showhide(this);\" onmouseout=\"showhide(this);\" style=\"cursor:pointer\">[?]</strong><p style=\"display:none\">\r\n      本系统包括友情链接，各类广告图片都是基于广告系统，请选择对应的项进入\r\n    </p>\r\n  </div>\r\n</div>\r\n";
if ( 0 < $vd['pos'] )
{
				echo "<form method=\"post\" action=\"index.php?m=mod_b2b&c=Ad&a=Save\" name=\"cform\" id=\"cform\">\r\n<table border=\"1\" id=\"ctable1\" class=\"ctable\" bordercolor=\"#86B9D6\">\r\n  <tr>\r\n    <td align=\"center\" height=\"35\" colspan=\"2\" class=\"listhead\" style=\"text-align:left;font-weight:bold;padding-left:10px;color:#ff0000\">\r\n      <img src=\"";
				echo $vd['sc'];
				echo "images/add.gif\" style=\"vertical-align:middle\" border=\"0\"/> 添加\r\n    </td>\r\n  </tr>\r\n  <tr> \r\n    <td width=\"15%\" align=\"right\" height=\"46\">图片<b></b></td>\r\n    <td width=\"85%\" style=\"padding-left: 10px\" height=\"47\">\r\n    <br/><input type=\"text\" id=\"ubzpic200\" name=\"ubzpic\" value=\"\" size=\"34\"/> \r\n    </td>\r\n  </tr>\r\n  <tr>\r\n    <td width=\"15%\" align=\"right\" height=\"46\">链接文字</td>\r\n    <td width=\"85%\" style=\"p";
				echo "adding-left: 10px\" height=\"47\">\r\n    <input type=\"text\" name=\"ubztext\" value=\"\" size=\"34\"/> \r\n    文字颜色：\r\n    <input type=\"text\" id=\"textcolor200\" name=\"ubztextcolor\" value=\"\" size=\"15\" onkeyup=\"setcolor(this,200)\"/> \r\n    <input id=\"colorexample200\" type=\"text\" size=\"1\" readonly style=\"background:#6c6c6c\">\r\n    <img src=\"";
				echo $vd['sc'];
				echo "images/16.gif\" onclick=\"pickcolor(200)\" align=\"absmiddle\" style=\"cursor:pointer;\"/>\r\n    </td>\r\n  </tr>\r\n  <tr>\r\n    <td width=\"15%\" align=\"right\" height=\"46\">显示类型</td>\r\n    <td width=\"85%\" style=\"padding-left: 10px\" height=\"47\">\r\n    <input type=\"radio\" name=\"ispic\" value=\"0\" class=\"checkbox\" onFocus=\"this.blur()\"/> 显示文字\r\n    <input type=\"radio\" name=\"ispic\" value=\"1\" class=\"checkbox\" onFocus=\"th";
				echo "is.blur()\" checked/> 显示图片\r\n    </td>\r\n  </tr>\r\n  <tr>\r\n    <td width=\"15%\" align=\"right\" height=\"46\">链接网址</td>\r\n    <td width=\"85%\" style=\"padding-left: 10px\" height=\"47\">\r\n    <input type=\"text\" name=\"ubzurl\" value=\"\" size=\"34\"/> \r\n    </td>\r\n  </tr>\r\n  <tr> \r\n    <td width=\"15%\" align=\"right\" height=\"46\">上传图片<b></b></td>\r\n    <td width=\"85%\" style=\"padding-left: 10px\" height=\"47\">\r\n    <iframe name=";
				echo "\"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>\r\n    </td>\r\n  </tr>\r\n  <tr>\r\n    <td width=\"15%\" align=\"right\" height=\"46\">操作</td>\r\n    <td width=\"85%\" style=\"padding-left: 10px\" height=\"47\">\r\n    <input type=\"hidden\" name=\"pos\" valu";
				echo "e=\"";
				echo $vd['pos'];
				echo "\"/>\r\n    <input type=\"submit\" value=\" 提 交 &gt;&gt;\" name=\"B1\" class=\"button\"/>\r\n    </td>\r\n  </tr>\r\n  <tr> \r\n    <td width=\"15%\" align=\"right\" height=\"46\">图片预览<b></b></td>\r\n    <td width=\"85%\" style=\"padding-left: 10px\" height=\"47\">\r\n    <div id=\"ad200\"></div><div id=\"logoinfo200\"></div></td>\r\n  </tr>\r\n  \r\n</table>\r\n</form>\r\n";
				echo "<s";
				echo "cript type=\"text/javascript\">\r\n\r\nfunction imginfo200(imgsrc)\r\n{\r\n  document.getElementById(\"logoinfo200\").innerHTML = \"高 x 宽：\" + imgsrc.height + \" x \" + imgsrc.width + \"<br/>图片大小：\" + imgsrc.fileSize + \" 字节\"; \r\n}\r\n\r\n</script>\r\n<br/>\r\n";
}
$i = 0;
foreach ( $vd['items'] as $item )
{
				echo "<form method=\"post\" action=\"index.php?m=mod_b2b&c=Ad&a=Save\" name=\"myform\">\r\n<table border=\"1\" id=\"ctable1\" class=\"ctable\" bordercolor=\"#86B9D6\">\r\n  <tr>\r\n    <td align=\"center\" height=\"35\" colspan=\"2\" class=\"listhead\" style=\"text-align:left;font-weight:bold;padding-left:10px;color:#ff0000\">\r\n      ";
				echo "<s";
				echo "pan style=\"float:right;\"><a href=\"index.php?m=mod_b2b&c=Ad&a=Del&id=";
				echo $item['id'];
				echo "&pos=";
				echo $vd['pos'];
				echo "\" onclick=\"return confirm('您确定进行删除操作吗？')\">\r\n        <img src=\"";
				echo $vd['sc'];
				echo "images/icon_trash.gif\" border=\"0\"/>\r\n      </a>\r\n      </span>\r\n      ";
				echo $i + 1;
				echo "    </td>\r\n  </tr>\r\n  <tr> \r\n    <td width=\"15%\" align=\"right\" height=\"46\">图片<b></b></td>\r\n    <td width=\"85%\" style=\"padding-left: 10px\" height=\"47\">\r\n    ";
				$endpath = strtolower( end( explode( ".", $item['pic'] ) ) );
				if ( $endpath == "swf" )
				{
								echo "    <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=\"";
								echo $vd['root'];
								echo "content/mod_shared/skins/upload/";
								echo $item['pic'];
								echo "\"><param name=\"quality\" value=\"high\"><embed src=\"";
								echo $vd['root'];
								echo "content/mod_shared/skins/upload/";
								echo $item['pic'];
								echo "\" 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>\r\n    ";
				}
				else
				{
								echo "    <img src=\"";
								echo $vd['root'];
								echo "content/mod_shared/skins/upload/";
								echo $item['pic'];
								echo "\" border=\"0\" onload=\"resizeImg(this,600,216)\"/>\r\n    ";
				}
				echo "    <br/><input type=\"text\" id=\"ubzpic";
				echo $i;
				echo "\" name=\"ubzpic\" value=\"";
				echo $item['pic'];
				echo "\" size=\"34\"/> \r\n    </td>\r\n  </tr>\r\n  <tr>\r\n    <td width=\"15%\" align=\"right\" height=\"46\">链接文字</td>\r\n    <td width=\"85%\" style=\"padding-left: 10px\" height=\"47\">\r\n    <input type=\"text\" name=\"ubztext\" value=\"";
				echo $item['text'];
				echo "\" size=\"34\"/> \r\n    文字颜色：\r\n    <input type=\"text\" id=\"textcolor";
				echo $i;
				echo "\" name=\"ubztextcolor\" value=\"";
				echo $item['textcolor'];
				echo "\" size=\"15\" onkeyup=\"setcolor(this,";
				echo $i;
				echo ")\"/> \r\n    <input id=\"colorexample";
				echo $i;
				echo "\" type=\"text\" size=\"1\" readonly style=\"background:";
				echo $item['textcolor'] == "" ? "#6c6c6c" : $item['textcolor'];
				echo "\">\r\n    <img src=\"";
				echo $vd['sc'];
				echo "images/16.gif\" onclick=\"pickcolor(";
				echo $i;
				echo ")\" align=\"absmiddle\" style=\"cursor:pointer;\"/>\r\n    </td>\r\n  </tr>\r\n  <tr>\r\n    <td width=\"15%\" align=\"right\" height=\"46\">显示类型</td>\r\n    <td width=\"85%\" style=\"padding-left: 10px\" height=\"47\">\r\n    <input type=\"radio\" name=\"ispic\" value=\"0\" class=\"checkbox\" onFocus=\"this.blur()\" ";
				if ( $item['ispic'] == 0 )
				{
								echo "checked";
				}
				echo "/> 显示文字\r\n    <input type=\"radio\" name=\"ispic\" value=\"1\" class=\"checkbox\" onFocus=\"this.blur()\" ";
				if ( $item['ispic'] == 1 )
				{
								echo "checked";
				}
				echo "/> 显示图片\r\n    </td>\r\n  </tr>\r\n  <tr>\r\n    <td width=\"15%\" align=\"right\" height=\"46\">链接网址</td>\r\n    <td width=\"85%\" style=\"padding-left: 10px\" height=\"47\">\r\n    <input type=\"text\" name=\"ubzurl\" value=\"";
				echo $item['url'];
				echo "\" size=\"34\"/> \r\n    </td>\r\n  </tr>\r\n  <tr> \r\n    <td width=\"15%\" align=\"right\" height=\"46\">上传图片<b></b></td>\r\n    <td width=\"85%\" style=\"padding-left: 10px\" height=\"47\">\r\n    <iframe name=\"uploader\" src=\"index.php?m=com_fs&c=fs&imgid=ad";
				echo $i;
				echo "&fun=imginfo";
				echo $i;
				echo "&inputid=ubzpic";
				echo $i;
				echo "&d=2\" frameBorder=\"0\" marginHeight=\"1\" marginWidth=\"1\" scrolling=\"no\" style=\"height:30px;width:100%; background-color:#EEF7FD\"></iframe>\r\n    </td>\r\n  </tr>\r\n  <tr>\r\n    <td width=\"15%\" align=\"right\" height=\"46\">操作</td>\r\n    <td width=\"85%\" style=\"padding-left: 10px\" height=\"47\">\r\n    <input type=\"hidden\" name=\"id\" value=\"";
				echo $item['id'];
				echo "\"/>\r\n    <input type=\"hidden\" name=\"pos\" value=\"";
				echo $vd['pos'];
				echo "\"/>\r\n    <input type=\"submit\" value=\" 提 交 &gt;&gt;\" name=\"B1\" class=\"button\"/>\r\n    </td>\r\n  </tr>\r\n  <tr> \r\n    <td width=\"15%\" align=\"right\" height=\"46\">图片预览<b></b></td>\r\n    <td width=\"85%\" style=\"padding-left: 10px\" height=\"47\">\r\n    <div id=\"ad";
				echo $i;
				echo "\"></div><div id=\"logoinfo";
				echo $i;
				echo "\"></div></td>\r\n  </tr>\r\n</table>\r\n</form>\r\n<br/>\r\n";
				echo "<s";
				echo "cript type=\"text/javascript\">  \r\nfunction imginfo";
				echo $i;
				echo "(imgsrc)\r\n{\r\n  document.getElementById(\"logoinfo\" + ";
				echo $i;
				echo ").innerHTML = \"高 x 宽：\" + imgsrc.height + \" x \" + imgsrc.width + \"<br/>图片大小：\" + imgsrc.fileSize + \" 字节\"; \r\n}\r\n</script>\r\n";
				++$i;
}
echo "</div>\r\n<div class=\"cbodyFoot\"></div>\r\n</div>\r\n<div id=\"opcontent\" style=\"display:none\">\r\n  <div class=\"optxt\">\r\n  </div>\r\n</div>\r\n";
echo "<s";
echo "cript type=\"text/javascript\">\r\n  var ctablenum = 2;\r\n</script>\r\n";
echo "<s";
echo "cript src=\"";
echo $vd['sc'];
echo "js/content.js\" type=\"text/javascript\"></script>\r\n";
echo "<s";
echo "cript type=\"text/JavaScript\">\r\nfunction pickcolor(id) \r\n{\r\n  var color = showModalDialog(\"";
echo $vd['sc'];
echo "tools/colorselect.htm\", \"\", \"font-family:Verdana; font-size:12; status:no; dialogWidth:21em; dialogHeight:21em\");\r\n  if (color != null) \r\n  {\r\n    \$(\"colorexample\"+id).style.backgroundColor = color;\r\n    \$(\"textcolor\"+id).value = color;\r\n  }\r\n}\r\nfunction setcolor(obj,id)\r\n{\r\n  if(obj.value.length == 7)\r\n  {\r\n    \$(\"colorexample\"+id).style.backgroundColor = obj.value;\r\n  }\r\n}\r\n\r\nfunction resizeImg(";
echo "obj,w,h)\r\n{\r\n  var imgHeight = obj.height;\r\n  var imgWidth  = obj.width;\r\n  \r\n  if(imgHeight < imgWidth)\r\n  {\r\n    if(imgWidth > w)\r\n    {\r\n      obj.style.width = w + \"px\";\r\n    }\r\n  }\r\n  else\r\n  {\r\n    if(imgHeight > h)\r\n    {\r\n      obj.style.height = h + \"px\";\r\n    }\r\n  }\r\n}\r\n</script>\r\n</body>\r\n</html>\r\n";
?>
