ApiStatic.php 3.06 KB
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/ApiBase.php" ;?>
<?
if (! class_exists("ApiStatic")){
	class ApiStatic extends ApiBase{
		
		function __construct($req)
		{
			parent::__construct($req);
		}
		
		//회사소개
		function getKCSpecialVehicleInfo(){
			$sql="
				SELECT *
				FROM tblKCSpecialVehicleInfo
				ORDER BY infoNo DESC
				LIMIT 1
			";
			$list = $this->getRow($sql);
			return $this->makeResultJson("1", "", $list);
		}
		
		//기관인증
		function getListOfOrganizationCert(){
			$sql="
				SELECT *
				FROM tblOrganizationCert
				ORDER BY certNo DESC
			";
			$list=$this->getArray($sql);
			return $this->makeResultJson("1", "", $list);
		}
		
		function getInfoOfOrganizationCert(){
			$certNo=$this->req["certNo"];
			$sql="
				SELECT *
				FROM tblOrganizationCert
				WHERE certNo='{$certNo}'
				LIMIT 1
			";
			$list=$this->getRow($sql);
			return $this->makeResultJson("1", "", $list)
		}
		
		//메인 페이지 정보
		function getMain(){
			$sql="
				SELECT imgPathMain, phrase1, phrase2, imgPathBuiltIn, imgPathInsulation, imgPathFreezerV, imgPathSpecial, imgPathPowerGate, imgPathWingBody, imgPathFreezerC
				FROM tblMain
				LIMIT 1
			";
			$result=$this->getRow($sql);
			return $this->makeResultJson("1", "", $result);
		}

		//메인페이지 공지사항
		function getLatestNotice(){
			$sql="
				SELECT title
				FROM tblNotice
				ORDER BY noticeNo DESC
				LIMIT 1
			";
			$result=$this->getRow($sql);
			return $this->makeResultJson("1", "", $result);
		}
		
		//메인페이지 이벤트
		function getLatestEvent(){
			$sql="
				SELECT title
				FROM tblEvent
				ORDER BY eventNo DESC
				LIMIT 1
			";
			$result=$this->getRow($sql);
			return $this->makeResultJson("1", "", $result);
		}
		
		//메인 페이지 회사정보 
		function getKCBriefInfo(){
			$sql="
				SELECT address, telephone, fax, eMail
				FROM tblKCSpecialVehicleInfo
			";
		}
		
		//탑차 분류별 리스트
		function getListOfVehicle(){
			$vehicleType=$this->req["vehicleType"];
			
			$sql="
				SELECT vehicleNo, name, imgPathVehicle
				FROM tblVehicle
				WHERE vehicleType='{$vehicleType}' AND status=1
				ORDER BY regDate DESC
			";
			$result=$this->getArray($sql);
			return $this->makeResultJson("1", "", $result);
		}
		
		//탑차 정보
		function getInfoOfVehicle(){
			$vehicleNo=$this->req["vehicleNo"];
			
			$sql="
				SELECT *
				FROM tblVehicle
				WHERE vehicleNo='{$vehicleNo}'
			";
			$reusult=$this->getRow($sql);
			return $this->makeResultJson("1", "", $result);
		}
		
		//도 리스트
		function getListOfProvince(){
			$sql="
				SELECT `provinceNumber`, `desc`, `abbreviation`
				FROM tblZipProvince
				ORDER BY provinceNumber ASC
			";	
			$result=$this->getArray($sql);
			return $this->makeResultJson("1", "", $result);
		}
		
		//시 리스트
		function getListOfCity(){
			$provinceNumber=$this->req["provinceNumber"];
			
			$sql="
				SELECT `cityNumber`, `desc`, `abbreviation`
				FROM tblZipCity
				ORDER BY cityNumber ASC
			";
			$result=$this->getArray($sql);
			return $this->makeResultJson("1", "", $result);
		}
		

	}
}

?>