diff Keyword.class.php @ 37:e5f9aa34d06f

change: modify all script for web base setting
author yoneda <epgrec@park.mda.or.jp>
date Tue, 28 Jul 2009 00:00:04 +0900
parents f5a9f0eb4858
children 8965ef108821
line wrap: on
line diff
--- a/Keyword.class.php	Mon Jul 27 22:27:54 2009 +0900
+++ b/Keyword.class.php	Tue Jul 28 00:00:04 2009 +0900
@@ -3,12 +3,17 @@
 include_once( INSTALL_PATH . "/DBRecord.class.php" );
 include_once( INSTALL_PATH . "/reclib.php" );
 include_once( INSTALL_PATH . "/Reservation.class.php" );
+include_once( INSTALL_PATH . '/Settings.class.php' );
 
 class Keyword extends DBRecord {
 	
+	protected $settings;
+	
 	public function __construct($property = null, $value = null ) {
+		$this->settings = Settings::factory();
+		
 		try {
-			parent::__construct(TBL_PREFIX.KEYWORD_TBL, $property, $value );
+			parent::__construct(KEYWORD_TBL, $property, $value );
 		}
 		catch( Exception $e ) {
 			throw $e;
@@ -19,7 +24,7 @@
 		if( $this->id == 0 ) return false;
 		
 		// ちょっと先を検索する
-		$options = " WHERE starttime > '".date("Y-m-d H:i:s", time() + PADDING_TIME + 120 )."'";
+		$options = " WHERE starttime > '".date("Y-m-d H:i:s", time() + $this->settings->padding_time + 120 )."'";
 		
 		if( $this->keyword != "" ) {
 			if( $this->use_regexp ) {
@@ -46,7 +51,7 @@
 		
 		$recs = array();
 		try {
-			$recs = DBRecord::createRecords( TBL_PREFIX.PROGRAM_TBL, $options );
+			$recs = DBRecord::createRecords( PROGRAM_TBL, $options );
 		}
 		catch( Exception $e ) {
 			throw $e;
@@ -98,7 +103,7 @@
 		// 一気にキャンセル
 		foreach( $precs as $rec ) {
 			try {
-				$reserve = new DBRecord( TBL_PREFIX.RESERVE_TBL, "program_id", $rec->id );
+				$reserve = new DBRecord( RESERVE_TBL, "program_id", $rec->id );
 				// 自動予約されたもののみ削除
 				if( $reserve->autorec ) {
 					Reservation::cancel( $reserve->id );