<?php
 /**
 *      [XCECP] (C) Colorful Network Inc.
 *      This is NOT a freeware, use is subject to license terms
 */

class SiteModel extends baseModel{
	function getInfo(){
		global $siteConf;
		$sql = "select * from qk_site where id='".$siteConf['id']."' order by id asc limit 1";
		return $this->db->getRow($sql);
	}
	function edit($param){
		$id = $param['id'];
		$siteName = $param['siteName'];
		$shortName = $param['shortName'];
		$comName = $param['comName'];
		$comAddr = $param['comAddr'];
		$comZip = $param['comZip'];
		$icprNo = $param['icprNo'];
		$comTel = $param['comTel'];
		$comFax = $param['comFax'];
		$comEmail = $param['comEmail'];
		$comQQ = $param['comQQ'];
		$announcement = $param['announcement'];
		$title = $param['title'];
		$keywords = $param['keywords'];
		$description = $param['description'];
		$logoImage = $param['logoImage'];
		$logoWidth = $param['logoWidth'];
		$template = $param['template'];
		$theme = $param['theme'];

		if($id && settype($id,"integer") && $siteName){
			$siteDomain = $param['siteDomain'];
			$siteUrl = $param['siteUrl'];
			$siteHost = $param['siteHost'];
			$sitePath = $param['sitePath'];
			$sql = "update qk_site set siteName='$siteName',siteUrl='$siteUrl',sitePath='$sitePath',comName='$comName',icprNo='$icprNo',comAddr='$comAddr',siteDomain='$siteDomain',comFax='$comFax',comTel='$comTel',comEmail='$comEmail',announcement='$announcement',comQQ='$comQQ',siteHost='$siteHost',title='$title',keywords='$keywords',description='$description',shortName='$shortName',logoImage='$logoImage',logoWidth='$logoWidth',logoHeight='$logoHeight',template='$template',theme='$theme',comZip='$comZip' where id='$id'";
			
			if($this->db->query($sql)){
				return true;
			}
		}
		return false;
	}
}

?>