<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo SYS_CHARSET ?>">
<title>article list</title>
<link href="<?php echo SYS_ADMIN_STYLE_PATH ?>style/common.css" rel="stylesheet" type="text/css">
<script language="javascript" src="<?php echo SYS_ADMIN_STYLE_PATH ?>js/common.js"></script>
<script language="javascript">
var search_field = '<?php echo $layout['search_field'] ?>';
var order_field = '<?php echo $layout['order_field'] ?>';
var order_type = '<?php echo $layout['order_type'] ?>';

function init()
{
	showElementSelect('search_field',search_field);
	showElementSelect('order_field',order_field);
	showElementSelect('order_type',order_type);
}

</script>
</head>

<body onload="init()">
<table class="nav_table" cellpadding="0" cellspacing="0">	
	<tr>
		<td class="nav_td"><?php echo $layout['menu_nav'] ?></td>
	</tr>	
</table>
<table class="toolbar_table" cellpadding="0" cellspacing="0">
	<tr>
		<td width="200">
		</td>
		<td class="toolbar_td"><?php echo $layout['toolbar'] ?></td>
	</tr>
	
</table>

<div class="line_space"><img src="<?php echo SYS_ADMIN_STYLE_PATH ?>images/blank.gif"></div>
<form name="searchForm" method="post" action="" >
<table class="search_table" cellpadding="0" cellspacing="0">	
	<tr>
		<td class="search_td">
			<span id="search_advanced" style="display:none">
			<select name="order_field" id="order_field" class="input_select" >
			<option value='' >---排序字段---</option>
			<option value='id'>ID</option>
			<option value='ordernum' >顺序号</option>
			<option value='issuetime' >发布时间</option>
			<option value='title' >标题</option>
			</select>
			<select name="order_type" id="order_type" class="input_select">
			<option value='' >---排序方式---</option>
			<option value='asc' >升序</option>
			<option value='desc' >降序</option>
			</select>	
			<select name="search_field" id="search_field" class="input_select" >
			<option value='' >---搜索字段---</option>
			<option value='id' >ID</option>
			<option value='title' >标题</option>
			<option value='intro' >介绍</option>
			<option value='content' >内容</option>
			</select>
            <?php echo $layout['list_flag']; echo $layout['list_status']; echo $layout['list_channel'] ?>
			<input type="text" name="layout_id_show" id="layout_id_show" class="input_text" size="15" value="<?php echo $layout['layout_title'] ?>" onclick="openSelectWin('../mod_template/template_layout_select.php?act=select')" >
			<input type="hidden" name="layout_id" id="layout_id" value="<?php echo $layout['layout_id'] ?>">
			<input type="text" name="username" id="username" class="input_text" size="15" value="<?php echo $layout['username'] ?>" onclick="openSelectWin('../mod_user/user_select.php')">
			<input type="hidden" name="uid" id="uid" value="<?php echo $layout['uid'] ?>">
		    </span><br>
			<input type="text" name="search_keyword" id="search_keyword" class="input_text_search" value="">
			<input type="submit" name="btn_search" class="btn_search" value="go">
			&nbsp;<input type="checkbox" name="chk_switchsearch" id="chk_switchsearch" value="1" onclick="showDisplayHidden('chk_switchsearch','search_advanced')">高级搜索
		</td>
	</tr>	

</table>
</form>
<form name="editForm" method="post" action="">
<input type="hidden" name="selectValue" id="selectValue" value="">
<table class="list_tb" cellpadding="0" cellspacing="0">
<tr class="list_title_tr_bg">
<td width="50" class="list_title_td">编号</td>
<td width="50" class="list_title_td" title="选择"><input type="checkbox" name="select_all" id="select_all" value="1" class="input_checkbox_all" onclick="selectAll('select_all','selectid')"></td>
<td class="list_title_td">文章标题</td>
<td width="50" class="list_title_td">排序</td>
<td width="60" class="list_title_td">浏览数</td>
<td width="150" class="list_title_td" title="发布时间/结束时间">发布时间</td>
<td width="50" class="list_title_td">状态</td>
<td width="50" class="list_title_td">标记</td>
<td width="80" class="list_title_td"  align="center">操作</td>
</tr>
<?php
$num=0; 
foreach($layout['eifr_pages']['list'] as $row):
$num++;
$pfile = $clComArticle -> getEditProgramFile($row['type']);
$show_link = "<a href='$pfile?act=edit_base&selectid=" . $row['id'] . "' title='" . $lang['edit'] . "'><img src='" . SYS_ADMIN_STYLE_PATH . "images/edit.png' border='0' alt='" . $lang['edit'] . "'></a>";
switch ($row['type']) {
    case $cfgarr_article_type['subject']:
        $show_link .= "&nbsp;<a href='$pfile?act=edit_subject_list&article_id=" . $row['id'] . "&template_id=" . $row['template_id'] . "' title='" . $lang['edit_articlelist'] . "'><img src='" . SYS_ADMIN_STYLE_PATH . "images/detailed.png' border='0' alt='" . $lang['edit_articlelist'] . "'></a>";
        break;
    case $cfgarr_article_type['info']:
        $show_link .= "&nbsp;<a href='$pfile?act=edit_content&selectid=" . $row['id'] . "' title='" . $lang['edit_content'] . "'><img src='" . SYS_ADMIN_STYLE_PATH . "images/text.png' border='0' alt='" . $lang['edit_content'] . "'></a>";
        break;
    case $cfgarr_article_type['pic']:
        $show_link .= "&nbsp;<a href='$pfile?act=edit_content&selectid=" . $row['id'] . "' title='" . $lang['edit_pictures'] . "'><img src='" . SYS_ADMIN_STYLE_PATH . "images/pictures.png' border='0' alt='" . $lang['edit_pictures'] . "'></a>";
        break;
} 
?>
<tr class="list_sub_tr_bg" onMouseOver="this.className='list_mouseover_tr_bg'" onMouseOut="this.className='list_sub_tr_bg'" >
    <td><?php echo $num ?></td>
    <td title="ID=<?php echo $row['id'] ?>"><input type="checkbox" name="selectid" value="<?php echo $row['id'] ?>" class="input_checkbox" ></td>
    <td><a href="article_view.php?selectid=<?php echo $row['id'] ?>" target="_blank"><?php echo $row['title'] ?></a></td>
    <td>
    <?php if($layout['is_manage']): ?>
    <input type='text' name='ordernum_<?php echo $row['id'] ?>' size='3' class='input_text' value='<?php echo $row['ordernum'] ?>'>
    <?php else:
    echo $row['ordernum'];
    endif; ?>
    </td>
    <td title="comment=<?php echo $row['commentnum'] ?>"><?php echo $row['viewnum'] ?></td>
    <td title="结束时间:<?php echo getDateTimeMk($row['endtime']) ?>"><?php echo getDateTimeMk($row['issuetime']) ?></td>
    <td ><?php echo Common::createStatusTxt($row['status']) ?></td>
    <td><?php echo Common::createFlagShow($row['flag']) ?></td>
    <td>
    <?php echo $show_link ?>
    </td>
</tr>
<?php endforeach; ?>
</table>   
</form>            
<div class="pagenext_div"><?php echo $layout['eifr_pages']['page'] ?></div>
</body>
</html>
