<?php
/**
 * @version        Somao_Search X1.0 9:23 2012-1-1 Somao $
 * @package        Somao_Search.Site
 * @copyright      Copyright (c) 2009 - 2012, Somao, Inc.
 * @license        http://www.somao123.com/
 * @link           http://www.somao.cc/
 */
require_once("global.php");
is_login();
$urlid=intval($_GET['urlid']);
$id=intval($_GET['id']);
?>
<!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" />
<title>得到联盟代码</title>
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<link href="../css/union.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/union.js"></script>
</head>
<body>
<?php
if($id==""){
?>
<div id="body">
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#39867B">
  <tr>
    <td class="title">获取联盟代码</td>
  </tr>
  <tr>
    <td bgcolor="#EFEFEF"><table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="22" colspan="2">&nbsp;</td>
        </tr>
        
        <tr>
          <td width="15%" style="line-height:25px;font-size:13px;">搜索框 → </td>
          <td width="61%" height="25" style="line-height:25px;font-size:13px;"></td>
        </tr>
   <?php
  $query=$db->query("select * from ve123_webunion_code where type='搜索框' order by cid desc ");
  while($link=$db->fetch_array($query)){
  ?>
        <tr>
          <td width="15%" style="line-height:25px;font-size:13px;"></td>
          <td height="25" style="line-height:25px;font-size:13px;"><a href="union_code.php?id=<?php echo $link["cid"];?>&urlid=<?php echo $urlid;?>"><?php echo $link["names"];?></a></td>
        </tr>
  <?php  } ?>
        <tr>
          <td height="25" style="line-height:25px;font-size:13px;">&nbsp;</td>
          <td height="25" style="line-height:25px;font-size:13px;">&nbsp;</td>
        </tr>
        <tr>
          <td rowspan="2" style="line-height:25px;font-size:13px;">文字链接 →</td>
          <td height="25" style="line-height:25px;font-size:13px;"></td>
        </tr>
   <?php
  $query=$db->query("select * from ve123_webunion_code where type='文字链接' order by cid desc ");
  while($link=$db->fetch_array($query)){
  ?>
        <tr>
          <td width="15%" style="line-height:25px;font-size:13px;"></td>
          <td height="25" style="line-height:25px;font-size:13px;"><a href="union_code.php?id=<?php echo $link["cid"];?>&urlid=<?php echo $urlid;?>"><?php echo $link["names"];?></a></td>
        </tr>
  <?php  } ?>
        <tr>
          <td height="25" style="line-height:25px;font-size:13px;">&nbsp;</td>
          <td style="line-height:25px;font-size:13px;">&nbsp;</td>
        </tr>
        <tr>
          <td style="line-height:25px;font-size:13px;">自定义 →</td>
          <td height="25" style="line-height:25px;font-size:13px;"></td>
        </tr>
   <?php
  $query=$db->query("select * from ve123_webunion_code where type='自定义' order by cid desc ");
  while($link=$db->fetch_array($query)){
  ?>
        <tr>
          <td width="15%" style="line-height:25px;font-size:13px;"></td>
          <td height="25" style="line-height:25px;font-size:13px;"><a href="union_code.php?id=<?php echo $link["cid"];?>&urlid=<?php echo $urlid;?>"><?php echo $link["names"];?></a></td>
        </tr>
  <?php  } ?>
        <tr>
          <td height="22" colspan="2" style="line-height:22px;">&nbsp;</td>
        </tr>
      </table></td>
  </tr>
</table>

</div>
<?php }elseif($id!=""){
$urlid=intval($_GET['urlid']);
$row=$db->get_one("select * from ve123_webunion_code where cid='".$id."' ");
?>
<div id="body">
<form name="ctl00" method="post" action="union_codeinfo.php?id=<?php echo $id;?>&urlid=<?php echo $urlid;?>&type=2">
<input name="show"  type="hidden" value="down">
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#39867B">
  <tr>
    <td class="title">获取联盟代码</td>
  </tr>
  <tr>
    <td bgcolor="#EFEFEF"><table  style="margin:20px 0px 20px 0px;" width="80%" border="0" align="left" cellpadding="4" cellspacing="3">
        <tr>
          <td height="25" bgcolor="#efefef" align="right" width="120">代码标题：</td>
          <td bgcolor="#efefef"><?php echo $row["names"];?></td>
        </tr>
        <tr>
          <td height="25" bgcolor="#efefef"><div align="right">代码类型：</div></td>
          <td bgcolor="#efefef"><?php echo $row["type"];?></td>
        </tr>
        <tr>
          <td height="25" bgcolor="#efefef"><div align="right">代码描述：</div></td>
          <td bgcolor="#efefef"><?php echo $row["info"];?></td>
        </tr>
        
        <tr>
          <td height="25" bgcolor="#efefef"><div align="right">代码预览： </div></td>
          <td bgcolor="#efefef" st>
		  <iframe src="union_codeinfo.php?id=<?php echo $id;?>&urlid=<?php echo $urlid;?>&type=1" frameborder="0" width="100%" align="center" height="120"></iframe></td>
        </tr>
        <tr>
          <td height="25" bgcolor="#efefef" align="right"> </td>
          <td bgcolor="#efefef"><input type="submit" name="xiazai" value="下载JS源码" id="xiazai" class="button" /></td>
        </tr>
        <tr>
          <td height="37" colspan="2" bgcolor="#efefef"><div align="center"><a href="union.php">返回上一页</a></div></td>
          </tr>
      </table></td>
  </tr>
</table>
</form>
</div>
<?php }?>
<?php foothtml(); ?>