<?php
require_once("../check.php");
require_once("../core/setting.php");
$qiandaomoney = $setting['qiandao'];
    ini_set("date.timezone","PRC");
    $date = date("Ymd");
    $time = time();
    
    $chasql = "select * from dunling_qiandao where username='$username' and date='$date'";
    $chaery = mysql_query($chasql,$config);
    $chanum = mysql_num_rows($chaery);
    if($chanum == '0'){
        //未签到动作

    $qiandaosql = "insert into dunling_qiandao (username,date) values ('$username','$date')";
    $menber_money_upsql = "update dunling_menber set moneypay = moneypay+'$qiandaomoney',money=money+'$qiandaomoney' where username='$username'";
    
    //录入明细
    
    $mingxi = "insert into dunling_share (uid,time,title,leixing,danjia) values ('$uid','$time','签到奖励','qiandao','$qiandaomoney')";
    mysql_query($mingxi,$config);
    mysql_query($qiandaosql,$config);
    mysql_query($menber_money_upsql,$config);
    mysql_close();
    echo '1';
    exit;
    
        
    }else{
        echo '0';
    }
    
    
    

?>