$act["active"] = 6; } else { $act["pass"] = 6; $act["active"] = 7; } $tpl->act = $act; $tpl->data = $data; include_once "../library/Table/Coupon.class.php"; $coupon = new Coupon(); $getcoupon = $coupon->getByRandCoupon(); $tpl->getcoupon = $getcoupon; include_once "../library/Table/Lottery.class.php"; $lottery = new Lottery(); //以下是計算USER有無領過獎 // date_default_timezone_set("Asia/Taipei"); // $today = date("Y-m-d"); // $today = (str)$today; // print_r($today); $lotteryfail = $lottery->getByLotteryFbId($_SESSION['fbId']); $tpl->lotteryfail = $lotteryfail; //以下是計算USER當日有無在被領100次以外 //countLotteryByDate $todaylotteryfailtimes = $lottery->countLotteryByDate($today); $tpl->todaylotteryfailtimes = $todaylotteryfailtimes; //判斷該FB_ID有沒有填寫過表單,有填寫過的話則直接導頁 $ishavedata = $lottery->countLotteryFbid($_SESSION['fbId']); $tpl->ishavedata = $ishavedata; //print_r($ishavedata); //取出該FB_ID的EMAIL $getEmail = $lottery->getByLotteryEmail($_SESSION['fbId']); $tpl->getemail = $getEmail;