<!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=utf-8" />
<title></title>
<link href="source/admin/template/style/admin.css" rel="stylesheet" type="text/css" />
<script src="include/js/jsmain.js" type="text/javascript"></script>
</head>

<body>
<div class="maintop">当前位置：<?php echo $toptxt ?></div>
<?php if($Gets=='tadd' || $Gets=='tedit'){ ?>
    <div class="main"><div class="oper"><?php echo $opers ?></div>
        <div class="info">
        <form action="?c=a_links&a=<?php echo $postgo ?>&run=1" method="post">
        <input name="taid" type="hidden" value="<?php echo $d['taid'] ?>" />
        <dl><dt>链接分类名称：</dt><dd><input name="name" type="text" class="int" value="<?php echo $d['name'] ?>" /></dd></dl>
        <dl><dt>&nbsp;</dt><dd><input type="submit" value="提 交" class="btnbig" /></dd></dl>
        </form>
        </div>
    </div>
<?php } ?>
<?php if($Gets==''){ ?>
    <div class="main"><div class="oper"><?php echo $opers ?></div>
    <table width="100%" class="tablist">
      <tr class="trbg">
        <td width="40">ID</td>
        <td width="150">操作</td>
        <td>链接分类名称</td>
        <td width="220">链接分类操作</td>
      </tr>
    <?php foreach($lists as $v){ ?>
      <tr>
        <td><?php echo $v['taid']; ?></td>
        <td><a href="?c=a_links&a=add&taid=<?php echo $v['taid']; ?>">添加链接</a>&nbsp;&nbsp;<a href="?c=a_links&a=adlist&taid=<?php echo $v['taid']; ?>">链接管理</a></td>
        <td class="tdleft"><a href="?c=a_links&a=adlist&taid=<?php echo $v['taid']; ?>"><?php echo $v['name']; ?></a></td>
        <td><a href="?c=a_links&a=tedit&taid=<?php echo $v['taid']; ?>">编辑</a>&nbsp;&nbsp;<a href="?c=a_links&a=tdel&taid=<?php echo $v['taid']; ?>">删除</a></td>
      </tr>
    <?php } ?>
    </table>
    </div>
<?php } ?>
<?php if($Gets=='add' || $Gets=='edit'){ ?>
    <div class="main"><div class="oper"><?php echo $opers ?></div>
        <div class="info">
        <form action="?c=a_links&a=<?php echo $postgo ?>&run=1" method="post">
        <input name="id" type="hidden" value="<?php echo $d['id'] ?>" />
        <dl><dt>链接分类：</dt><dd><select name="taid">
          <option>选择所属链接分类</option>
          <?php foreach($linkstype as $v){ ?>
          <option value="<?php echo $v['taid'] ?>"<?php if($d['taid']==$v['taid']||$ctaid==$v['taid'])echo ' selected="selected"'; ?>><?php echo $v['name'] ?></option>
          <?php } ?>
        </select></dd></dl>
        <dl><dt>链接名称：</dt><dd><input name="name" type="text" class="int" value="<?php echo $d['name'] ?>" /></dd></dl>
        <dl><dt>图片：</dt><dd><input name="image" id="image" type="text" class="int" value="<?php echo $d['image'] ?>" /></dd><dd><iframe frameborder="0" width="300" height="26" scrolling="No" name="image" src="?c=uploads&a=loadup&inputid=image&fileExt=*.jpg;*.jpeg;*.gif;*.png&fileover=1"></iframe></dd></dl>
        <dl id="gourl"><dt>链接地址：</dt><dd><input name="gourl" type="text" class="int" value="<?php echo $d['gourl'] ?>" /></dd></dl>
        <dl><dt>排序：</dt><dd><input name="orders" type="text" class="int" style="width:30px;" value="<?php if($d!=''){echo $d['orders'];}else{echo '0';} ?>" /></dd><dd class="t">越大越靠前</dd></dl>
        <dl><dt>状态：</dt><dd><input name="isshow" type="radio" value="1"<?php if($d['isshow']==1||$Gets=='add')echo ' checked="checked"'; ?> />显示&nbsp;<input name="isshow" type="radio" value="0"<?php if($d['isshow']==0 && $Gets=='edit')echo ' checked="checked"'; ?> />关闭</dd></dl>
        <dl><dt>&nbsp;</dt><dd><input type="submit" value="提 交" class="btnbig" /></dd></dl>
        </form>
        </div>
    </div>
<?php } ?>
<?php if($Gets=='adlist'){ ?>
    <div class="main"><div class="oper"><?php echo $opers ?></div>
    <table width="100%" class="tablist">
      <tr class="trbg">
        <td width="40">ID</td>
        <td width="150">链接分类</td>
        <td width="150">图片</td>
        <td width="200">链接名称</td>
        <td>地址</td>
        <td width="120">操作</td>
      </tr>
    <?php foreach($lists as $v){ ?>
      <tr>
        <td><?php echo $v['id']; ?></td>
        <td><?php echo linktype($v['taid']); ?></td>
        <td><?php if($v['image']!=''){ ?><a href="?c=a_links&a=edit&id=<?php echo $v['id']; ?>"><img src="<?php echo $v['image']; ?>" height="32" /></a><?php } ?></td>
        <td class="tdleft"><a href="?c=a_links&a=edit&id=<?php echo $v['id']; ?>"><?php echo $v['name']; ?></a></td>
        <td class="tdleft"><?php echo $v['gourl']; ?></td>
        <td><a href="?c=a_links&a=edit&id=<?php echo $v['id']; ?>">编辑</a>&nbsp;&nbsp;<a href="?c=a_links&a=del&id=<?php echo $v['id']; ?>">删除</a></td>
      </tr>
    <?php } ?>
    </table>
    </div>
<?php } ?>
</body>
</html>
