<?php
require_once('common.php');
// $start=microtime(true);
$load->model('Plugs_model');
$plugs=$load->plugs_model->getPlugs(1);
$openid=$_GET['rentopenid'];
$isopen=false;
foreach($plugs as $item){
	if($item['name']=='shuqian'){
		$isopen=true;
	}
}
if(!$isopen){
	header('location:qiandao.php?rentopenid='.$openid);
}

$load->model('Shuqian_model');
$shuqian_config=$load->shuqian_model->getCurrentConfig();

//模版页面相关内容
require_once('../smarty/Smarty.class.php');
$smarty = new Smarty;
$smarty->debugging = false;
$smarty->caching = false;
$smarty->compile_dir =COMPILEPATH;
$smarty->assign('title','数钱');
$smarty->assign('openid',$openid);
$returnmsg=$load->shuqian_model->joingame($openid);
$smarty->assign('erweima',$weixin_config['erweima']);
$smarty->assign('shuqian_config',json_encode($shuqian_config));
$smarty->assign('joingame',json_encode($returnmsg));
$smarty->assign('plugs',$plugs);

$smarty->display('template/app_header.html');
$smarty->display('template/app_shuqian.html');
$smarty->display('template/app_footer.html');
// echo microtime(true)-$start;