<?php
/* versionbeta:name
 * versionbeta:number
 * versionbeta:site
 * versionbeta:pubtime
 */
class ctl_act_lottery extends mod_act_lottery{
	function act_default(){
		$id = (int)fun_get::get("id");
		$this->award_log = $this->get_award_log($id);
		$this->lottery_info = $this->get_lottery($id);
		$obj_one = cls_obj::db()->get_one("select log_tel,log_name,log_address from " . cls_config::DB_PRE . "act_lottery_log where log_user_id='" . cls_obj::get("cls_user")->uid . "' and log_name!='' order by log_id desc");
		if(!empty($obj_one)) {
			$obj_info = array("tel" => $obj_one['log_tel'] , "name" => $obj_one['log_name'] , "address" => $obj_one['log_address']);
		} else {
			$obj_info = array("tel" => "" , "name" => "" , "address" => "");
		}
		$this->uinfo = $obj_info;
		if($this->lottery_info['lottery_type'] == 0) {
			return $this->get_view('ggk');//
		} else if($this->lottery_info['lottery_type'] == 1) {
			return $this->get_view('rotate');//
		} else if($this->lottery_info['lottery_type'] == 2) {
			return $this->get_view('yao');//
		} else if($this->lottery_info['lottery_type'] == 3) {
			return $this->get_view('grid');//
		}
	}

	function act_lottery() {
		$arr_return = $this->get_award();
		return fun_format::json($arr_return);
	}
	function act_award(){
		$arr_list = $this->get_lottery_award();
		if(fun_get::get("app_ajax") == 1) {
			return fun_format::json($arr_list);
		} else {
			$this->arr_list = $arr_list;
			return $this->get_view();
		}
	}
	function act_address_save() {
		$arr_msg = $this->on_address_save();
		return fun_format::json($arr_msg);
	}
	function act_getred() {
		$arr_msg = $this->get_red();
		return fun_format::json($arr_msg);
	}
}