コード例 #1
0
ファイル: api.php プロジェクト: hebaihe55/kerry
function UserEdit()
{
    $username = $_POST["username"];
    $mobile = $_POST["mobile"];
    $openid = $_POST["openid"];
    $ext1 = "";
    $ext2 = "";
    $flag = 0;
    $ticket = array();
    $ticket = kerry::TicketUnused();
    if (count($ticket) > 0) {
        if ($ticket["begintime"] < date("Y-m-d H:m:s") && $ticket["endtime"] > date("Y-m-d H:m:s")) {
            $ext1 = $ticket['brand'];
            $ext2 = $ticket["mid"];
            $flag = 1;
        } else {
            $ext1 = "";
            $ext2 = $ticket["mid"];
            $flag = 1;
        }
    }
    $userlog = kerry::Userlogin($openid);
    if ($userlog == null) {
        kerry::UserEdit($openid, $username, $mobile, $ext1, $ext2);
        kerry::TicketEdit($ext2);
    }
    header("Location:../discount.php?flag=" . $ext1);
    exit;
}