<?php
require_once("../check.php");
require_once("../../config.php");
isset($_GET['danhao'])?$danhao=$_GET['danhao']:$danhao=null;
$dansql = "select * from dunling_renwu where danhao = '$danhao'";
$gao = mysql_query($dansql,$config);
$g = mysql_fetch_array($gao);

$minpaysql = "select jinbivsrmb from dunling_config where id='1'";
$minpayery = mysql_query($minpaysql,$config);
$pay = mysql_fetch_array($minpayery);
$duihuanbili = $pay['jinbivsrmb'];


mysql_close($config);
?>
<!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>
</head>
<body>
<link rel="stylesheet" href="../../kindeditor/themes/default/default.css" />
<script src="../../kindeditor/kindeditor-all-min.js"></script>
<script>
KindEditor.ready(function(K) {
var uploadbutton = K.uploadbutton({
button : K('#uploadButton')[0],
fieldName : 'imgFile',
url : '../../kindeditor/php/upload_json.php?dir=image',
afterUpload : function(data) {
if (data.error === 0) {
var url = K.formatUrl(data.url, 'absolute');
K('#url').val(url);
} else {
alert(data.message);
}
},
afterError : function(str) {
alert('自定义错误信息: ' + str);
}
});
uploadbutton.fileBox.change(function(e) {
uploadbutton.submit();
});
});

$(function(){
   $("#form").click(function(){

    var danhao = $("#danhao").val();
    var beizhu = $("#beizhu").val();
    
        if(beizhu==""){
            alert('请在备注内容里录入任务完成情况或根据雇主要求录入审核要素!');
            return false; 
    }
    


    $.post("php/jiaogao.php",{
        danhao:danhao,
        beizhu:beizhu,
        url:'http://www.dunling.com/images/logo.jpg'
        
    },function(ab,ba){
    if(ab=="ok"){
        alert('您的稿件已提交,请等待雇主审核!');
        location.href='rwzq.php';
        return false;
    }
    });
    
    
   }); 
    
});
</script>
<style>
#renwu{
    margin-bottom:100px;
    display:none;
    margin-top:15px;
    width:1000px;
    height:auto;
    display:table;
    margin-left:auto;
    margin-right:auto;
    font-family:微软雅黑;
    border:1px solid #616161;
    border-radius: 5px;
    padding-bottom:25px;
}

#renwu .title{
    width:1000px;
    height:40px;
    line-height:40px;
    text-align:center;
    font-size:18px;
    background-color:#616161;
    color:#FFF;
}
#renwu .W100{
    width:100px;
    height:40px;
    line-height:40px;
    text-align:center;
}
#renwu .W880{
    width:880px;
    height:auto;
    line-height:30px;
    text-align:left;
    color: #4D4D4D;
}
#renwu input.button{
    width:200px;
    height:30px;
    line-height:30px;
}
#beizhu{
    width:650px;
    height:90px;
    resize:none;
    font-size:16px;
    line-height:30px;
    color: #4D4D4D;
}

</style>
<div id="renwu">
<div class="title">任务编号:<?php echo $g['danhao'];?></div>
<input id="danhao" value="<?php echo $g['danhao'];?>" type="hidden" />
<input id="img" value="<?php echo $g['img'];?>" type="hidden" />
<table>
<tr><td class="W100">任务编号:</td><td class="W880"><?php echo $g['danhao'];?></td></tr>
<tr><td class="W100">任务拥金:</td><td class="W880"><span style="color: #00C431;font-size:24px;"><?php echo $g['danjia'];?></span><span style="font-size: 12px;">金币</span>&nbsp;&nbsp;<span style="color: red;font-size:14px;">&asymp;<?php $rmb = $g['danjia']/$duihuanbili;echo round($rmb,2); ?>元人民币</span></td></tr>
<tr><td class="W100" style="vertical-align:top;line-height:30px;">任务说明:</td><td class="W880"><?php echo $g['content'];?></td></tr>
<tr><td class="W100" style="vertical-align:top;line-height:30px;">备注内容:</td><td class="W880"><textarea maxlength="100" id="beizhu"></textarea></td></tr>

<tr><td class="W100"></td><td class="W880"><input class="button" id="form" type="button" value="完成任务并交稿审核" /></td></tr>
</table>

</div>


</body>
</html>