<?php
require_once("../check.php");
require_once("../../config.php");

$m="10";//每页显示的记录数
isset($_GET['page'])?$page=$_GET['page']:$page="1";//当前页数
$numsql = "select * from dunling_renwu where smoney>'0' and  not exists (select * from dunling_renwu_log where danhao=dunling_renwu.danhao and user='$username')";
$numery = mysql_query($numsql,$config);
$zongjilushu = mysql_num_rows($numery);//总记录数
$zy = (int)(($zongjilushu-1)/$m)+1;//总页数
$one = (int)($page-1)*$m;//当前页的首条记录
$listsql = "select * from dunling_renwu where smoney>'0' and not exists (select * from dunling_renwu_log where danhao=dunling_renwu.danhao and user='$username') order by danjia desc limit $one,$m";
$listery = mysql_query($listsql,$config);

$zsql = "select * from dunling_renwu_log where username='$username'";
$zery = mysql_query($zsql,$config);
$znum = mysql_num_rows($zery);

mysql_close();
?>
<!DOCTYPE HTML>
<html>
<head>
<title>任务赚钱</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script src="../js/jquery-1.11.1.min.js"></script>
<link rel="stylesheet" type="text/css" href="../style/template.css" />
</head>
<body>
<div id="bg"></div>
<div id="windows">
<div class="Otime"></div>
<div class="text">
<div class="t1"></div>
</div>
<div class="Wclose">关</div>
</div>

<?php
if($zongjilushu<"1"){
    exit;
}

?>

<div id="table">
<div class="W150"><strong>编号</strong></div>
<div class="W500"><strong>任务标题</strong></div>
<div class="W100"><strong>悬赏单价</strong></div>
<div class="W100"><strong>上传截图</strong></div>
<div class="W100"><strong>稿件需求量</strong></div>
<div class="W100"><strong>剩余需求量</strong></div>
<div class="W100"><strong>操作</strong></div>
</div>
<?php
while($list = mysql_fetch_array($listery)){
$danhao = $list['danhao'];
$title = $list['title'];
$zxq = $list['zmoney'];
$sxq = $list['smoney'];
$xuanshang = $list['danjia'];
$img = $list['img'];

?>
<div id="table">
<div class="W150"><?php echo $danhao;?></div>
<div class="W500"><?php echo $title;?></div>
<div class="W100"><?php echo $xuanshang;?></div>
<div class="W100"><?php if($img=="1"){echo "是";}else{echo "否";}?></div>
<div class="W100"><?php echo $zxq;?></div>
<div class="W100"><?php echo $sxq;?></div>
<div class="W100"><input onclick="location.href='jiaogao.php?danhao=<?php echo $danhao;?>'" type="button" value="接受任务" style="width: 100px;height:25px;font-size:12px;color: #505050;" /></div>
</div>
<?php
}
?>
<?php require_once("page.php");?>
</body>
</html>