  <!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=gbk"/>
<title>管理中心 - Powered By phpleft.com</title>
<script src="<?=PL_URL?>js/win/artDialog.js?skin=default"></script>
<script src="<?=PL_URL?>js/win/plugins/iframeTools.js"></script>
 <script type="text/javascript" src="<?=PL_URL?>js/common.js"></script>
  <link href="<?=PL_URL?>css/page.css" type="text/css" rel="stylesheet" />
 <link href="css/main.css" type="text/css" rel="stylesheet">
<script>
function checkall(f, t) {
	var t = t ? t : 1;
	for(var i = 0; i < f.elements.length; i++) {
		var e = f.elements[i];
		if(e.type != 'checkbox') continue;
		if(t == 0) e.checked = false;
		if(t == 1) e.checked = e.checked ? false : true;
		if(t == 2) e.checked = true;	
	}
}
</script>
</head>
<body bottommargin="0" leftmargin="0" topmargin="0" rightmargin="0">
<div class="tpis"><img src="images/icos.gif" align="absmiddle"/>当前位置：扩展插件 > 友情链接</div>

<? include inTemplate(menu);?> 
<? if ($show=='add' or $show=='bj'){?>
<?php 
  $add = $id ? sql_show("table=$in&where=id=$id"):'';
?>
<form id="form" action="phpleft.php?file=plugins_set&in=<?=$in;?>&post=<?=$show;?>" method="post">
<input name="table_name" type="hidden" value="<?=$in;?>" />
<input name="id" type="hidden" value="<?=$id;?>" />
<table class="usertableborder" cellspacing="1" cellpadding="3" width="100%" align="center"
        border="0">
        <tr>
            <th colspan="3">
                添加标签</th>
        </tr>
        </table>
    <table class="usertableborder bb" cellspacing="1" cellpadding="3" width="100%" align="center"
        border="0">
 <tr>
            <td width="131" height="30" class="text" style="padding-right:10px; text-align:right"><strong>链接名称</strong></td>
            <td width="562" height="30"><input name="set[name]" type="text" id="name" value="<?=$add['name'];?>" size="30">
            </td>
            <td width="298" height="30"></td>
        </tr>
         <tr>
            <td width="131" height="30" class="text" style="padding-right:10px; text-align:right"><strong>链接地址</strong></td>
            <td width="562" height="30"><input name="set[url]" type="text" id="url" value="<?=$add['url'];?>" size="30">
            </td>
            <td width="298" height="30"></td>
        </tr>
 <tr>
            <td width="131" height="30" class="text" style="padding-right:10px; text-align:right"><strong>链接图片</strong></td>
            <td width="562" height="30"><input name="set[images]" type="text" id="images" value="<?=$add['images'];?>" size="30"><a onclick="art.dialog.open('phpleft.php?file=upfile&w=80&h=30&id=images', {title: '上传图片'}, false);" href="#"><img border=0 src=<?=PL_URL?>ico/upcoming-work.png>上传</a>
            </td>
            <td width="298" height="30"></td>
        </tr>


 <tr>
            <td width="131" height="30" class="text" style="padding-right:10px; text-align:right"><strong>是否通过审核</strong></td>
            <td width="562" height="30">   <?
            $is_ors[1][0] = '1';
			$is_ors[1][1] = '是';
			$is_ors[2][0] = '0';
			$is_ors[2][1] = '否';
			$add['is_or']=$add['is_or']?$add['is_or']:'1';
			?>
            <?=add_radio($is_ors, $add['is_or'], '' ,'set[is_or]')?>
            </td>
            <td width="298" height="30"></td>
        </tr>
                  <tr>
            <td width="131" height="30" class="text" style="padding-right:10px; text-align:right"><strong>链接介绍</strong></td>
            <td width="562" height="30"><textarea name="set[content]" cols="50" rows="10" id="content"><?=$add['content'];?></textarea>
            </td>
            <td width="298" height="30"></td>
        </tr>
          
         <tr>
          <td height="30" class="text" style="padding-right:10px; text-align:right"></td>
            <td height="30"><input type="submit" name="button" id="button" value=" 确 认 " class="ok"></td>
            <td height="30">&nbsp;</td>
        </tr>
        </table>
        </form>
      
 
<? }else if ($show=='set'){?>
<?php $set=cache_read('cache.inc.php',PL_ROOT.'plugins/'.$in.'/');?>
<form id="form" action="phpleft.php?file=plugins_set&in=<?=$in;?>&post=set" method="post">
<input name="table_name" type="hidden" value="<?=$in;?>" />
<table class="usertableborder bb" cellspacing="1" cellpadding="3" width="100%" align="center"
        border="0">
        <tr>
            <th colspan="3">
                网站设置</th>
        </tr>
      
        <tr class="list1">
            <td width="135" height="30" class="text" style="padding-right:10px; text-align:right"><strong>开启审核</strong></td>
            <td width="367" height="30">
            <?
            $is_ors[1][0] = '1';
			$is_ors[1][1] = '是';
			$is_ors[2][0] = '0';
			$is_ors[2][1] = '否';
			?>
            <?=add_radio($is_ors, $set['is_or'], '' ,'set[is_or]')?>
           </td>
            <td width="472" height="30"></td>
        </tr>
       
        <tr>
          <td height="30" class="text" style="padding-right:10px; text-align:right"></td>
            <td height="30"><input type="submit" name="button" id="button" value=" 确 认 " class="ok"></td>
            <td height="30">&nbsp;</td>
        </tr>
       
    </table>
</form>
<? }else{?>
<form id="form2" name="form2" method="post" action="phpleft.php?file=plugins_set&in=<?=$in;?>&post=list">
<input name="table_name" type="hidden" value="<?=$in;?>" />
 <table class="usertableborder input" cellspacing="1" cellpadding="3" width="100%" align="center"
        border="0">
      <tr>
            <th>
        信息列表</th>
        </tr>
</table>
    <table class="usertableborder bb" cellspacing="0" cellpadding="3" width="100%" align="center"
        border="0">

        <tr align="center" class="list1">
        <td width="42" height="30" align="left"><input type="checkbox" onClick="checkall(this.form);"/></td>
          <td widtd="100" height="30" valign="top">
          名称
          </td>
          <td widtd="85" height="30">地址</td>
         
            <td widtd="93" height="30">图片</td>
           
             <td widtd="102" height="30">状态</td>
             <td widtd="249" height="30">介绍</td>
             <td widtd="249" height="30">编辑</td>
              <td width="129" height="30" widtd="263">&nbsp;</td>
             
        </tr>
       <?php $list=sql_list("table=$in&page=".$page."&pagesize=13&pageoff=1&order=id desc"); ?>
       <?php if($list) {?>
       <?php foreach($list as $i=>$t) { ?>
                 <tr align="center" class="list<?php if($i%2==1) echo '1'?>">
                 <td height="30" style="padding-right:20px;" align="left"><input type="checkbox" name="tab[]" value="<?=$t['id']?>"/></td>
          <td width="68" height="30" align="left"><?=$t['name']?>          </td>
        <td width="108" height="30"><a href="<?=$t['url']?>" target="_blank"><?=$t['url']?></a></td>
             <td width="112" height="30"><? if ($t['images']){?><img src="<?=$t['images']?>" /><? }?></td>
             <td width="108" height="30"><? if ($t['is_or']=='0'){?><span style="color:#F00">未审核</span><? }else{?>通过<? }?></td>
             <td width="323" height="30"><?=$t['content']?>
               </td>
               <td width="78" height="30"><a href="phpleft.php?file=plugins_set&in=<?=$in;?>&show=bj&id=<?=$t['id'];?>"><img src="<?=PL_URL?>ico/edit.png" alt="编辑" border="0"></a></td>
               
              <td height="30">&nbsp;</td>
      </tr>
      <? }?>
      <? }else {?>
      <tr align="center" class="list">
        <td height="30" colspan="8" align="left">
        暂无信息
        </td>
        </tr>
      <? }?>
           </table>
            <table class="usertableborder input" cellspacing="1" cellpadding="3" width="100%" align="center"
        border="0">
<tr>
  <td height="30" class="usertablerow1"><input type="submit" name="button" id="button" value=" 删 除 " class="ok"> <select name="is_or" onChange="this.form.action='phpleft.php?file=plugins_set&in=<?=$in;?>&post=is_or';this.form.submit();"><option value="0">批量审核</option><option value="0">取消</option><option value="1">通过</option></td>
            <td height="30" class="usertablerow1">&nbsp;</td>
        </tr>
       
    </table>
           </form>
           <div class="pager" style="margin-top:10px;"><?php echo $pagenav;?></div>
 <? }?>
</body>
</html>
