<?php
/*
	[Office 515158] (C) 2009-2014 天生创想 Inc.
	$Id: mod_knowledge mobile $
*/
(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
empty($do) && $do = 'list';
$type_name='知识管理';	
if ($do == 'list') {
	$num = $db->result("SELECT COUNT(*) AS num FROM ".DB_TABLEPRE."knowledge where type ='2' or uid =".$_USER->id." order by id desc");
    $sql = "SELECT * FROM ".DB_TABLEPRE."knowledge where type ='2' or uid =".$_USER->id." ORDER BY id desc LIMIT 0,100";
	$result = $db->fetch_all($sql);
	include_once('template/knowledge.php');

}elseif ($do == 'views') {
	$id = getGP('id','G','int');
	if($id!=''){
		$row = $db->fetch_one_array("SELECT * FROM ".DB_TABLEPRE."knowledge  WHERE id = '".$id."'");
	}
	include_once('template/knowledge_view.php');
}
?>