<?
@header("content-Type:text/html; charset=utf-8");
error_reporting(0);
if(file_exists("install/lock.php"))
{
	echo("程序未安装,请点击安装程序,<a href='install/index.php'>安装</a>");
	exit();
}
include("global.php");

$title="PHPWEB管理系统";
$mysql->query("select * from news order by id desc limit 0,6");


//获取新闻列表
while($arr=$mysql->fetcharray())
{
	$newslist[]=$arr["id"]."$".cutstring($arr["title"],20)."$".cutstring($arr["time"],10);
}

foreach($newslist as $id=>$value)
{
	
	$newslist[$id]=explode("$",$value);
	
}
//print_r($newslist);

//获取公司简介
$mysql->query("select * from news where id=9");
$arr=$mysql->fetcharray();
$info=$arr["content"];
$info=str_replace("<p>","",$info);
$info=str_replace("</p>","",$info);

//获取幻灯片
$mysql->query("select * from attachment order by id desc limit 0,4");
while($arr=$mysql->fetcharray())
{
	$huandeng[]=$arr['attach'];
}

$tpl->assign("title",$title);
$tpl->assign("huandeng",$huandeng);
$tpl->assign("info",$info);
$tpl->assign("newslist",$newslist);
$tpl->display("index.tpl");
?>