annotate Keyword.class.php @ 148:8f4f74463d08

merged with upstream
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Fri, 26 Mar 2010 15:41:36 +0900
parents 4afd353b4507
children 190a3c46611d
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' );
145
2cb414518ccd mod: キーワード予約のログの位置を変えた
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents: 135
diff changeset
7 include_once( INSTALL_PATH . '/recLog.inc.php' );
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
8
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
9 class Keyword extends DBRecord {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
10
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
11 public function __construct($property = null, $value = null ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
12 try {
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 1
diff changeset
13 parent::__construct(KEYWORD_TBL, $property, $value );
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
14 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
15 catch( Exception $e ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
16 throw $e;
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 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
19
115
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
20 static public function search( $keyword = "",
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
21 $use_regexp = false,
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
22 $type = "*",
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
23 $category_id = 0,
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
24 $channel_id = 0,
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
25 $weekofday = 7,
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
26 $prgtime = 24,
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
27 $limit = 300 ) {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
28 $sts = Settings::factory();
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
29
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
30 $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
31
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
32 // <c罎膣≪
115
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
33 $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
34
115
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
35 if( $keyword != "" ) {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
36 if( $use_regexp ) {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
37 $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
38 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
39 else {
118
db185340a981 utf8 collate try1
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 115
diff changeset
40 $options .= " AND CONCAT(title,description) like _utf8'%".mysql_real_escape_string($keyword)."%' collate utf8_unicode_ci";
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
41 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
42 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
43
115
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
44 if( $type != "*" ) {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
45 $options .= " AND type = '".$type."'";
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
46 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
47
115
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
48 if( $category_id != 0 ) {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
49 $options .= " AND category_id = '".$category_id."'";
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
50 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
51
115
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
52 if( $channel_id != 0 ) {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
53 $options .= " AND channel_id = '".$channel_id."'";
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
54 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
55
115
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
56 if( $weekofday != 7 ) {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
57 $options .= " AND WEEKDAY(starttime) = '".$weekofday."'";
77
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 66
diff changeset
58 }
cb7da56c4198 modified: Keyword.class.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 66
diff changeset
59
115
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
60 if( $prgtime != 24 ) {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
61 $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
62 }
57676bb30f64 add: 時間帯で絞り込みを追加
Sushi-k <epgrec@park.mda.or.jp>
parents: 77
diff changeset
63
115
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
64 $options .= " ORDER BY starttime ASC LIMIT ".$limit ;
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 $recs = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
67 try {
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 1
diff changeset
68 $recs = DBRecord::createRecords( PROGRAM_TBL, $options );
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 catch( Exception $e ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
71 throw $e;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
72 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
73 return $recs;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
74 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
75
115
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
76 private function getPrograms() {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
77 if( $this->id == 0 ) return false;
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
78 $recs = array();
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
79 try {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
80 $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
81 }
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
82 catch( Exception $e ) {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
83 throw $e;
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
84 }
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
85 return $recs;
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
86 }
1
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 public function reservation() {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
89 if( $this->id == 0 ) return;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
90
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
91 $precs = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
92 try {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
93 $precs = $this->getPrograms();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
94 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
95 catch( Exception $e ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
96 throw $e;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
97 }
115
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
98 // 筝羂牙私膣
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
99 foreach( $precs as $rec ) {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
100 try {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
101 if( $rec->autorec ) {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
102 Reservation::simple( $rec->id, $this->id, $this->autorec_mode );
145
2cb414518ccd mod: キーワード予約のログの位置を変えた
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents: 135
diff changeset
103 reclog( "Keyword.class::若若ID".$this->id."牙祉篋膣");
115
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
104 usleep( 100 ); // 障腥冴?
1
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 }
115
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
107 catch( Exception $e ) {
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
108 // ∴
7a64d5e3baee mod: キーワード検索を整理
yoneda <epgrec@park.mda.or.jp>
parents: 106
diff changeset
109 }
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
110 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
111 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
112
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
113 public function delete() {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
114 if( $this->id == 0 ) return;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
115
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
116 $precs = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
117 try {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
118 $precs = $this->getPrograms();
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 catch( Exception $e ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
121 throw $e;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
122 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
123 // 筝羂c潟祉
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
124 foreach( $precs as $rec ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
125 try {
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 1
diff changeset
126 $reserve = new DBRecord( RESERVE_TBL, "program_id", $rec->id );
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
127 // 篋膣水
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
128 if( $reserve->autorec ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
129 Reservation::cancel( $reserve->id );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
130 usleep( 100 ); // 障腥冴?
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
131 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
132 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
133 catch( Exception $e ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
134 // ∴
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
135 }
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 try {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
138 parent::delete();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
139 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
140 catch( Exception $e ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
141 throw $e;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
142 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
143 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
144
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
145 // static<潟激с潟若若ゃс
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
146 static function createKeywords( $options = "" ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
147 $retval = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
148 $arr = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
149 try{
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
150 $tbl = new self();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
151 $sqlstr = "SELECT * FROM ".$tbl->table." " .$options;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
152 $result = $tbl->__query( $sqlstr );
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 if( $result === false ) throw new exception("潟若絖障");
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
158 while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
159 array_push( $retval, new self('id', $row['id']) );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
160 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
161 return $retval;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
162 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
163
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
164 public function __destruct() {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
165 parent::__destruct();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
166 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
167 }
130
290a05fd7331 mod: 半角英数で検索しても全角英数がヒットするように変更
Sushi-k <epgrec@park.mda.or.jp>
parents: 115
diff changeset
168 ?>