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

$load->model('Pashu_model');

$pashu_config=$load->pashu_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->pashu_model->joingame($openid);
// $weixin_config=getWeixinConf();
$smarty->assign('erweima',$weixin_config['erweima']);
$smarty->assign('pashu_config',json_encode($pashu_config));
$smarty->assign('joingame',json_encode($returnmsg));
$smarty->assign('plugs',$plugs);
$smarty->display('template/app_header.html');
$smarty->display('template/app_pashu.html');
$smarty->display('template/app_footer.html');