<?php
/*
	[Office 515158] (C) 2009-2014 天生创想 Inc.
	$Id: mod_conference mobile $
*/
(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
empty($do) && $do = 'list';
$type=getGP('type','G');
$type_name='会议管理';	
if ($do == 'list') {
	if($type=='1'){
		$wheresql = " where attendance LIKE '%".get_realname($_USER->id)."%'";
	}elseif($type=='2'){
		$wheresql = " where attendance LIKE '%".get_realname($_USER->id)."%' and enddate<='".get_date('Y-m-d H:i:s',PHP_TIME)."'";
	}elseif($type=='3'){
		$wheresql = " where attendance LIKE '%".get_realname($_USER->id)."%' and startdate>='".get_date('Y-m-d H:i:s',PHP_TIME)."'";
	}elseif($type=='4'){
		$wheresql = " where attendance LIKE '%".get_realname($_USER->id)."%' and startdate<='".get_date('Y-m-d H:i:s',PHP_TIME)."'";
	}else{
		$wheresql = " where uid='".$_USER->id."'";
	}
	$num = $db->result("SELECT COUNT(*) AS num FROM ".DB_TABLEPRE."conference ".$wheresql."  order by id desc");
    $sql = "SELECT * FROM ".DB_TABLEPRE."conference ".$wheresql." ORDER BY id desc LIMIT 0,100";
	$result = $db->fetch_all($sql);
	include_once('template/conference.php');

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