<?php
    $conf_basedir	= "../../";	//相对主目录的位置
    $conf_where		= "admin";	//选择调用相应模块
    $directory		= basename(dirname(__FILE__));	//定义当前所在的目录，引入模块公用函数
    include_once($conf_basedir."base.inc.php");
    checkAuth('23');	//判断登录和权限

    $tbl='esf_20131230_new_year_prize';

    $id = intval($id);
    if(time()<strtotime("2014-01-31")){
        $result = array('success'=>0,'error'=>-3);
        echo json_encode($result);
        exit;
    }
    if($id) {
        $sql = "update $tbl set send=1 where id=$id and send=0";
        $db->execute($sql);
        if(mysql_affected_rows()==1) {
            $result = array('success'=>1,'error'=>0);
            
        }else {
            $result = array('success'=>0,'error'=>-1);
        }
        
    } else {
        $result = array('success'=>0,'error'=>-2);
    }

    echo json_encode($result);
