<?php /* Smarty version 2.6.19, created on 2014-03-07 03:37:35
         compiled from site_list.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'db_fetchpage', 'site_list.tpl', 33, false),array('function', 'db_fetchpagecount', 'site_list.tpl', 56, false),array('function', 'paginator', 'site_list.tpl', 57, false),array('function', 'db_fetchrow', 'site_list.tpl', 59, false),array('modifier', 'date_format', 'site_list.tpl', 46, false),)), $this); ?>
﻿<!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>
<script type="text/javascript" src="../common/common.js"></script>
<link href="common/main.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="formSearch" name="formSearch" method="get" action="" onSubmit="return notEmpty(q, '请输入关键词。')">
<table border="0" cellspacing="0" cellpadding="2">
  <tr>
    <td>网站名称或网址：</td>
    <td><input type="text" name="q" id="q" value="<?php echo $this->_tpl_vars['keyword']; ?>
" /></td>
    <td><input type="hidden" name="cId" value="<?php echo $this->_tpl_vars['categoryId']; ?>
"/><input type="submit" name="button" id="button" value=" 搜索 " /></td>
  </tr>
</table>
</form>
<table width="100%" border="0" cellspacing="0" cellpadding="2">
  <tr>
    <td class="borderBottom bgFleet">网站</td>
    <td class="borderBottom bgFleet">网址</td>
    <td class="borderBottom bgFleet" align="center">所属分类</td>
    <td class="borderBottom bgFleet" align="center">推荐</td>
    <td class="borderBottom bgFleet" align="center">顺序</td>
    <td class="borderBottom bgFleet" align="center">过期时间</td>
    <td class="borderBottom bgFleet" align="center"><a href="?p=1&cId=<?php echo $this->_tpl_vars['categoryId']; ?>
&o=f_clickIn DESC&q=<?php echo $this->_tpl_vars['keyword']; ?>
">点入</a></td>
    <td class="borderBottom bgFleet" align="center"><a href="?p=1&cId=<?php echo $this->_tpl_vars['categoryId']; ?>
&o=f_clickOut DESC&q=<?php echo $this->_tpl_vars['keyword']; ?>
">点出</a></td>
    <td class="borderBottom bgFleet" align="center"><a href="?p=1&cId=<?php echo $this->_tpl_vars['categoryId']; ?>
&o=f_clickScore DESC&q=<?php echo $this->_tpl_vars['keyword']; ?>
">积分</a></td>
    <td class="borderBottom bgFleet" align="center">访问</td>
    <td class="borderBottom bgFleet" align="center">操作</td>
  </tr>
  <?php echo smarty_function_db_fetchpage(array('table' => 'sites','items' => "*",'condition' => ($this->_tpl_vars['condition']),'orderby' => ($this->_tpl_vars['orderby']),'page' => ($this->_tpl_vars['page']),'pagesize' => '20','varname' => 'arr'), $this);?>

  <?php unset($this->_sections['loop']);
$this->_sections['loop']['name'] = 'loop';
$this->_sections['loop']['loop'] = is_array($_loop=$this->_tpl_vars['arr']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['loop']['show'] = true;
$this->_sections['loop']['max'] = $this->_sections['loop']['loop'];
$this->_sections['loop']['step'] = 1;
$this->_sections['loop']['start'] = $this->_sections['loop']['step'] > 0 ? 0 : $this->_sections['loop']['loop']-1;
if ($this->_sections['loop']['show']) {
    $this->_sections['loop']['total'] = $this->_sections['loop']['loop'];
    if ($this->_sections['loop']['total'] == 0)
        $this->_sections['loop']['show'] = false;
} else
    $this->_sections['loop']['total'] = 0;
if ($this->_sections['loop']['show']):

            for ($this->_sections['loop']['index'] = $this->_sections['loop']['start'], $this->_sections['loop']['iteration'] = 1;
                 $this->_sections['loop']['iteration'] <= $this->_sections['loop']['total'];
                 $this->_sections['loop']['index'] += $this->_sections['loop']['step'], $this->_sections['loop']['iteration']++):
$this->_sections['loop']['rownum'] = $this->_sections['loop']['iteration'];
$this->_sections['loop']['index_prev'] = $this->_sections['loop']['index'] - $this->_sections['loop']['step'];
$this->_sections['loop']['index_next'] = $this->_sections['loop']['index'] + $this->_sections['loop']['step'];
$this->_sections['loop']['first']      = ($this->_sections['loop']['iteration'] == 1);
$this->_sections['loop']['last']       = ($this->_sections['loop']['iteration'] == $this->_sections['loop']['total']);
?>
  <?php if ($this->_sections['loop']['index']%2): ?>
  <?php $this->assign('rowClass', " class='bgFleet'"); ?>
  <?php else: ?>
  <?php $this->assign('rowClass', ""); ?>
  <?php endif; ?>
  <tr>
    <td <?php echo $this->_tpl_vars['rowClass']; ?>
><?php if ($this->_tpl_vars['arr'][$this->_sections['loop']['index']]['f_color']): ?><span style="color:<?php echo $this->_tpl_vars['arr'][$this->_sections['loop']['index']]['f_color']; ?>
"><?php echo $this->_tpl_vars['arr'][$this->_sections['loop']['index']]['f_name']; ?>
</span><?php else: ?><?php echo $this->_tpl_vars['arr'][$this->_sections['loop']['index']]['f_name']; ?>
<?php endif; ?>&nbsp;</td>
    <td <?php echo $this->_tpl_vars['rowClass']; ?>
><?php echo $this->_tpl_vars['arr'][$this->_sections['loop']['index']]['f_url']; ?>
</td>
    <td <?php echo $this->_tpl_vars['rowClass']; ?>
 align="center"><a href="../<?php echo $this->_tpl_vars['categoryDir']; ?>
/<?php echo $this->_tpl_vars['arr'][$this->_sections['loop']['index']]['f_categoryId']; ?>
.html" target="_blank"><?php echo $this->_tpl_vars['arr'][$this->_sections['loop']['index']]['f_categoryId']; ?>
</a></td>
    <td <?php echo $this->_tpl_vars['rowClass']; ?>
 align="center"><?php echo $this->_tpl_vars['arr'][$this->_sections['loop']['index']]['f_isRecommend']; ?>
</td>
    <td <?php echo $this->_tpl_vars['rowClass']; ?>
 align="center"><?php echo $this->_tpl_vars['arr'][$this->_sections['loop']['index']]['f_order']; ?>
</td>
    <td <?php echo $this->_tpl_vars['rowClass']; ?>
 align="center"><?php if ($this->_tpl_vars['arr'][$this->_sections['loop']['index']]['f_expireTime']): ?><?php echo ((is_array($_tmp=$this->_tpl_vars['arr'][$this->_sections['loop']['index']]['f_expireTime'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d") : smarty_modifier_date_format($_tmp, "%Y-%m-%d")); ?>
<?php else: ?> 0 <?php endif; ?></td>
    <td <?php echo $this->_tpl_vars['rowClass']; ?>
 align="center"><?php echo $this->_tpl_vars['arr'][$this->_sections['loop']['index']]['f_clickIn']; ?>
</td>
    <td <?php echo $this->_tpl_vars['rowClass']; ?>
 align="center"><?php echo $this->_tpl_vars['arr'][$this->_sections['loop']['index']]['f_clickOut']; ?>
</td>
    <td <?php echo $this->_tpl_vars['rowClass']; ?>
 align="center"><?php echo $this->_tpl_vars['arr'][$this->_sections['loop']['index']]['f_clickScore']; ?>
</td>
    <td <?php echo $this->_tpl_vars['rowClass']; ?>
 align="center"><a href="<?php echo $this->_tpl_vars['arr'][$this->_sections['loop']['index']]['f_url']; ?>
" target="_blank">访问</a></td>
    <td <?php echo $this->_tpl_vars['rowClass']; ?>
 align="center"><a href="site_modify.php?sId=<?php echo $this->_tpl_vars['arr'][$this->_sections['loop']['index']]['f_id']; ?>
&back=<?php echo $this->_tpl_vars['backUrl']; ?>
">修改</a> | <a href="site_delete.php?sId=<?php echo $this->_tpl_vars['arr'][$this->_sections['loop']['index']]['f_id']; ?>
&back=<?php echo $this->_tpl_vars['backUrl']; ?>
" onClick="return confirm('确实要删除这个网址吗？')">删除</a></td>
  </tr>
  <?php endfor; endif; ?>
</table>
<br>
<?php echo smarty_function_db_fetchpagecount(array('table' => 'sites','condition' => ($this->_tpl_vars['condition']),'pagesize' => '20','varname' => 'pageCount'), $this);?>

<?php echo smarty_function_paginator(array('page' => ($this->_tpl_vars['page']),'pagecount' => ($this->_tpl_vars['pageCount']),'url' => "?p=PAGENUMBER&cId=".($this->_tpl_vars['categoryId'])."&o=".($this->_tpl_vars['orderby'])."&q=".($this->_tpl_vars['keyword'])), $this);?>

  <p>
  <?php echo smarty_function_db_fetchrow(array('table' => 'categories','items' => '*','condition' => "f_id='".($this->_tpl_vars['categoryId'])."'",'varname' => 'categoryInfo'), $this);?>

  <?php if ($this->_tpl_vars['categoryInfo']['f_parentId'] != 0): ?>
  >> <a href="site_add.php?cId=<?php echo $this->_tpl_vars['categoryId']; ?>
&back=<?php echo $this->_tpl_vars['backUrl']; ?>
">在本分类下添加网址</a><br>
  >> <a href="category_list.php?pId=<?php echo $this->_tpl_vars['categoryInfo']['f_parentId']; ?>
">返回上级</a>
  <?php endif; ?>
</body>
</html>