Exemple #1
0
<?php

require_once 'filter.php';
require_once 'shake.php';
$action = $_GET['a'];
$shake = new Shake();
switch ($action) {
    case "prize_change":
        header("Content-type:text/html;charset=utf-8");
        if ("xjcbd321654" != $_POST['change_pass']) {
            echo "<script>window.alert('商家兑换密码输入有误!');" . "window.location.href='http://weilink.huaxi100.com/spe/weixin-shake/my_coupons.php';</script>";
            exit;
        }
        $ids = $_POST['ids'];
        $success = $shake->change($ids);
        if ($success) {
            echo "<script>window.alert('兑换成功!');" . "window.location.href='http://weilink.huaxi100.com/spe/weixin-shake/my_coupons.php';</script>";
            exit;
        } else {
            echo "<script>window.alert('兑换失败!');" . "window.location.href='http://weilink.huaxi100.com/spe/weixin-shake/my_coupons.php';</script>";
            exit;
        }
        break;
    case "shake":
        $id = $_GET['id'];
        $shake->record_shake_time($id);
        break;
    case "contact":
        $id = $_POST['id'];
        $name = $_POST['name'];
        $phone = $_POST['phone'];