annotate Keyword.class.php @ 130:290a05fd7331

mod: 半角英数で検索しても全角英数がヒットするように変更
author Sushi-k <epgrec@park.mda.or.jp>
date Thu, 18 Mar 2010 17:50:01 +0900
parents 7a64d5e3baee
children 9c5e597ef6c6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1 <?php
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
2 include_once('config.php');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
3 include_once( INSTALL_PATH . "/DBRecord.class.php" );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
4 include_once( INSTALL_PATH . "/reclib.php" );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
5 include_once( INSTALL_PATH . "/Reservation.class.php" );
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 1
diff changeset
6 include_once( INSTALL_PATH . '/Settings.class.php' );
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
7
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
8 class Keyword extends DBRecord {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
9
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
10 public function __construct($property = null, $value = null ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
11 try {
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 1
diff changeset
12 parent::__construct(KEYWORD_TBL, $property, $value );
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
13 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
14 catch( Exception $e ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
15 throw $e;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
16 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
17 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
18
115
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
19 static public function search( $keyword = "",
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
20 $use_regexp = false,
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
21 $type = "*",
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
22 $category_id = 0,
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
23 $channel_id = 0,
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
24 $weekofday = 7,
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
25 $prgtime = 24,
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
26 $limit = 300 ) {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
27 $sts = Settings::factory();
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
28
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
29 $dbh = @mysql_connect($sts->db_host, $sts->db_user, $sts->db_pass );
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
30
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
31 // <c罎膣≪
115
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
32 $options = " WHERE starttime > '".date("Y-m-d H:i:s", time() + $sts->padding_time + 60 )."'";
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
33
115
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
34 if( $keyword != "" ) {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
35 if( $use_regexp ) {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
36 $options .= " AND CONCAT(title,description) REGEXP '".mysql_real_escape_string($keyword)."'";
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
37 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
38 else {
130
290a05fd7331 mod: 半角英数で検索しても全角英数がヒットするように変更
Sushi-k <epgrec@park.mda.or.jp>
parents: 115
diff changeset
39 // 茹茹
290a05fd7331 mod: 半角英数で検索しても全角英数がヒットするように変更
Sushi-k <epgrec@park.mda.or.jp>
parents: 115
diff changeset
40 // 翫絲上
290a05fd7331 mod: 半角英数で検索しても全角英数がヒットするように変更
Sushi-k <epgrec@park.mda.or.jp>
parents: 115
diff changeset
41 $f_zennum = preg_match('/[0-9]/u', $keyword );
290a05fd7331 mod: 半角英数で検索しても全角英数がヒットするように変更
Sushi-k <epgrec@park.mda.or.jp>
parents: 115
diff changeset
42 $f_zenal = preg_match('/[a-zA-Z]/u', $keyword );
290a05fd7331 mod: 半角英数で検索しても全角英数がヒットするように変更
Sushi-k <epgrec@park.mda.or.jp>
parents: 115
diff changeset
43
290a05fd7331 mod: 半角英数で検索しても全角英数がヒットするように変更
Sushi-k <epgrec@park.mda.or.jp>
parents: 115
diff changeset
44 $options .= " AND ( CONCAT(title,' ',description) like '%".mysql_real_escape_string($keyword)."%'";
290a05fd7331 mod: 半角英数で検索しても全角英数がヒットするように変更
Sushi-k <epgrec@park.mda.or.jp>
parents: 115
diff changeset
45
290a05fd7331 mod: 半角英数で検索しても全角英数がヒットするように変更
Sushi-k <epgrec@park.mda.or.jp>
parents: 115
diff changeset
46 if( $f_zennum ) {
290a05fd7331 mod: 半角英数で検索しても全角英数がヒットするように変更
Sushi-k <epgrec@park.mda.or.jp>
parents: 115
diff changeset
47 $options .= " OR CONCAT(title,' ',description) like '%".mysql_real_escape_string(mb_convert_kana( $keyword, 'KVN' ))."%'";
290a05fd7331 mod: 半角英数で検索しても全角英数がヒットするように変更
Sushi-k <epgrec@park.mda.or.jp>
parents: 115
diff changeset
48 }
290a05fd7331 mod: 半角英数で検索しても全角英数がヒットするように変更
Sushi-k <epgrec@park.mda.or.jp>
parents: 115
diff changeset
49 if( $f_zenal ) {
290a05fd7331 mod: 半角英数で検索しても全角英数がヒットするように変更
Sushi-k <epgrec@park.mda.or.jp>
parents: 115
diff changeset
50 $options .= " OR CONCAT(title,' ',description) like '%".mysql_real_escape_string(mb_convert_kana( $keyword, 'KVR' ))."%'";
290a05fd7331 mod: 半角英数で検索しても全角英数がヒットするように変更
Sushi-k <epgrec@park.mda.or.jp>
parents: 115
diff changeset
51 }
290a05fd7331 mod: 半角英数で検索しても全角英数がヒットするように変更
Sushi-k <epgrec@park.mda.or.jp>
parents: 115
diff changeset
52 if( $f_zenal && $f_zennum ) {
290a05fd7331 mod: 半角英数で検索しても全角英数がヒットするように変更
Sushi-k <epgrec@park.mda.or.jp>
parents: 115
diff changeset
53 $options .= " OR CONCAT(title,' ',description) like '%".mysql_real_escape_string(mb_convert_kana( $keyword, 'KVRN' ))."%'";
290a05fd7331 mod: 半角英数で検索しても全角英数がヒットするように変更
Sushi-k <epgrec@park.mda.or.jp>
parents: 115
diff changeset
54 }
290a05fd7331 mod: 半角英数で検索しても全角英数がヒットするように変更
Sushi-k <epgrec@park.mda.or.jp>
parents: 115
diff changeset
55 $options .= ") ";
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
56 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
57 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
58
115
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
59 if( $type != "*" ) {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
60 $options .= " AND type = '".$type."'";
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
61 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
62
115
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
63 if( $category_id != 0 ) {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
64 $options .= " AND category_id = '".$category_id."'";
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
65 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
66
115
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
67 if( $channel_id != 0 ) {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
68 $options .= " AND channel_id = '".$channel_id."'";
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
69 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
70
115
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
71 if( $weekofday != 7 ) {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
72 $options .= " AND WEEKDAY(starttime) = '".$weekofday."'";
77
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 66
diff changeset
73 }
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 66
diff changeset
74
115
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
75 if( $prgtime != 24 ) {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
76 $options .= " AND time(starttime) BETWEEN cast('".sprintf( "%02d:00:00", $prgtime)."' as time) AND cast('".sprintf("%02d:59:59", $prgtime)."' as time)";
106
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
77 }
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
78
115
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
79 $options .= " ORDER BY starttime ASC LIMIT ".$limit ;
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
80
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
81 $recs = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
82 try {
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 1
diff changeset
83 $recs = DBRecord::createRecords( PROGRAM_TBL, $options );
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
84 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
85 catch( Exception $e ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
86 throw $e;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
87 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
88 return $recs;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
89 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
90
115
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
91 private function getPrograms() {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
92 if( $this->id == 0 ) return false;
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
93 $recs = array();
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
94 try {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
95 $recs = self::search( trim($this->keyword), $this->use_regexp, $this->type, $this->category_id, $this->channel_id, $this->weekofday, $this->prgtime );
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
96 }
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
97 catch( Exception $e ) {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
98 throw $e;
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
99 }
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
100 return $recs;
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
101 }
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
102
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
103 public function reservation() {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
104 if( $this->id == 0 ) return;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
105
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
106 $precs = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
107 try {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
108 $precs = $this->getPrograms();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
109 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
110 catch( Exception $e ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
111 throw $e;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
112 }
115
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
113 // 筝羂牙私膣
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
114 foreach( $precs as $rec ) {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
115 try {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
116 if( $rec->autorec ) {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
117 Reservation::simple( $rec->id, $this->id, $this->autorec_mode );
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
118 usleep( 100 ); // 障腥冴?
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
119 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
120 }
115
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
121 catch( Exception $e ) {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
122 // ∴
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
123 }
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
124 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
125 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
126
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
127 public function delete() {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
128 if( $this->id == 0 ) return;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
129
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
130 $precs = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
131 try {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
132 $precs = $this->getPrograms();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
133 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
134 catch( Exception $e ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
135 throw $e;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
136 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
137 // 筝羂c潟祉
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
138 foreach( $precs as $rec ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
139 try {
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 1
diff changeset
140 $reserve = new DBRecord( RESERVE_TBL, "program_id", $rec->id );
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
141 // 篋膣水
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
142 if( $reserve->autorec ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
143 Reservation::cancel( $reserve->id );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
144 usleep( 100 ); // 障腥冴?
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
145 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
146 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
147 catch( Exception $e ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
148 // ∴
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
149 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
150 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
151 try {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
152 parent::delete();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
153 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
154 catch( Exception $e ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
155 throw $e;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
156 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
157 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
158
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
159 // static<潟激с潟若若ゃс
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
160 static function createKeywords( $options = "" ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
161 $retval = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
162 $arr = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
163 try{
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
164 $tbl = new self();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
165 $sqlstr = "SELECT * FROM ".$tbl->table." " .$options;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
166 $result = $tbl->__query( $sqlstr );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
167 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
168 catch( Exception $e ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
169 throw $e;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
170 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
171 if( $result === false ) throw new exception("潟若絖障");
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
172 while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
173 array_push( $retval, new self('id', $row['id']) );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
174 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
175 return $retval;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
176 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
177
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
178 public function __destruct() {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
179 parent::__destruct();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
180 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
181 }
130
290a05fd7331 mod: 半角英数で検索しても全角英数がヒットするように変更
Sushi-k <epgrec@park.mda.or.jp>
parents: 115
diff changeset
182 ?>