<?php
defined('PP_PATH') or exit;
class faq_control extends base_control{
	public $_var = array();
	public function index() {
		$_GET['pid'] = (int)R('pid');
		$_GET['id'] = (int)R('id');


		$data = $this->cms_faq->read($_GET['id']);
		$data2 = $this->cms_faq_data->read($_GET['id']);
		if(empty($data['pid']) || $data['pid'] != $_GET['pid']) core::error404();
		
		$data = array_merge($data, $data2);
		//echo $data;
		echo json_encode($data);

		// $this->assign('pp_var', $this->_var);
		// $GLOBALS['run'] = &$this;
		// $GLOBALS['_show'] = &$_show;
		// $_ENV['_theme'] = &$this->_cfg['theme'];
		// $this->display($this->_var['show_tpl']);
	}
}