<div id="user_main">
<div id="left">
<?php require 'left.php'; require '../setting.php'; require '../config.php'; ?>
</div>
<div id="right">
<div id="right_top"><div style="padding-top:5px;padding-left:10px;">后台管理 - 会员投稿管理</div></div>
<div id="right_main" style="color: #000000;overflow: hidden;overflow-x: hidden;">
<script type="text/javascript" src="../lhgdialog/lhgcore.min.js"></script> 
<script type="text/javascript" src="../lhgdialog/lhgdialog.min.js"></script>
<script type="text/javascript">

function shenhe(id)
{
    var DG = new J.dialog({
		page:'shenhe.php?id=' + id,
        title:'稿件审核',
        height:'620',
        width:'780',
        cancelBtn:false,
        resize:false,
        iconTitle:false,
        maxBtn:false,
        btnBar:false,
        onXclick:axoutauto,
        cover:true
	});
	DG.ShowDialog();
}


function caina(id)
{
    var DG = new J.dialog({
		page:'caina.php?id=' + id,
        title:'采纳稿件',  
        height:'150',
        width:'350',
        cancelBtn:false,
        resize:false,
        iconTitle:false,
        maxBtn:false,
        cover:true,
        onXclick:axoutauto
	});
	DG.ShowDialog();
}

function delad(id)
{
    var DG = new J.dialog({
		page:'delgaojian.php?id=' + id,
        title:'删除稿件',  
        height:'150',
        width:'350',
        cancelBtn:false,
        resize:false,
        iconTitle:false,
        maxBtn:false,
        cover:true,
        onXclick:axoutauto
	});
	DG.ShowDialog();
}

function axoutauto(){
history.go(0);
location.href='upad.php';
}
</script>

<?php
$m="13";//每页显示的记录数
$numsql = "select * from axphp_text";
$numery = mysql_query($numsql,$config);
$lognum = mysql_num_rows($numery);//总记录数
$zy = (int)(($lognum-1)/$m)+1;//总页数
isset($_GET['page'])?$page=$_GET['page']:$page="1";//当前页数
$one = (int)($page-1)*$m;//当前页的首条记录


$adsql = "select * from axphp_text order by id desc limit $one,$m ";
$adery = mysql_query($adsql,$config);
echo '<table cellpadding="5" cellspacing="1" width="780"  bgcolor="#3573AB"><tr bgcolor="#E0ECF5" style="color:#173046"; ><th align="center" width="300">稿件标题</th><th align="center">提交时间</th><th align="center">发放金额</th><th align="center">审核状态</th><th align="center">采纳状态</th></tr>';
while($ad=mysql_fetch_array($adery))
{
    $title = $ad['title'];
    $title =  mb_substr($title, 0, 20, 'GBK');
echo '<tr bgcolor="#E7E7E7" >';
echo '<td>';

echo '<a onclick="shenhe(this.id);" id="'.$ad['id'].'" >';;
echo $title;
echo '</a></td>';
echo '<td align="center">'.$ad['datetime'].'</td>';

echo '<td align="center">'.$ad['money'].'</td>';
echo '<td align="center">';

if($ad['shenhe']=="0"){
    echo "<span style='color:#009726;'>审核中</span>";
    }
    elseif($ad['shenhe']=="1")
    {
    echo "<span style='color:#FF0000;'>已通过</span>";
    }else{
    echo "<span style='color:#000000;'>未通过</span>";
    }

echo '</td>';
echo '<td align="center">';

if($ad['caina']=="0")
{
echo '<button style="line-height: 22px;width: 45px;height:23px;background-color: #FFFFFF;border:#004A6F solid 1px;font-size:12px;color: #FF0000;" class="runcode" value="1" 

id="'.$ad['id'].'" onclick="if(confirm(\'是否确定采纳?\'))caina(this.id);">采纳</button>'.'&nbsp;';

echo '<button style="line-height: 22px;width: 45px;height:23px;background-color: #FFFFFF;border:#004A6F solid 1px;font-size:12px;color: #004A6F;" class="runcode" value="1" id="'.$ad['id'].'" onclick="if(window.confirm(\'删除后不可恢复,是否确定删除?\'))delad(this.id);">删除</button>';
}
else
{
    echo "<span style='color:blue;font-size:12px;'>已采纳</span>";
}

echo '</td>';


echo '</tr>';
}

?>
</table>
<?php
if($lognum=="0")
{
    echo "<p>暂时没有会员投稿记录！</p>";
}
?>

 <style type="text/css">
 .pagelink
 {
float: right;
width:555px;
 
 }
.pagelink a
{
 color: #18344E;
}
.pagelink a:hover
{
 color: #BF0000;

}
 </style>
 <div style="padding-top: 10px;">
 <div style="float: left;">Page:<span style="color: #FF0000;"><?php echo $page;?></span>/<span style="color: #FF0000;"><?php echo $zy;?></span> | Record:<span style="color: #FF0000;"><?php echo $lognum;?></span></div>
 <div class="pagelink">
<?php
if($page > "1")
{
    echo '<a href=?page=1>首页</a>';
    echo "&nbsp;";
    echo '<a href=?page='.($page-1).'>上一页</a>';
}

if($zy>$page)
{
    echo "&nbsp;";
    echo '<a href=?page='.($page+1).'>下一页</a>';
    echo "&nbsp;";
    echo '<a href=?page='.($zy).'>尾页</a>';
}


?>

</div>

 
 </div>

</div></div></div>