Mercurial > hg > extraction-interface
annotate classes/basemodel.php @ 122:a36bb5a48af4 extractapp tip
1. remove redundancy server side code.
2. All pop up sub-windows are made with dialog component of bootstrap v3.3.2
author | Calvin Yeh <cyeh@mpiwg-berlin.mpg.de> |
---|---|
date | Thu, 28 Sep 2017 22:26:48 +0200 |
parents | c1bb174a22f3 |
children |
rev | line source |
---|---|
47
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
1 <?php |
81 | 2 /* basemodel.php |
3 * This file is part of Extraction-interface. | |
4 * | |
5 * Extraction-interface is free software: you can redistribute it and/or modify | |
6 * it under the terms of the GNU General Public License as published by | |
7 * the Free Software Foundation, either version 3 of the License, or | |
8 * (at your option) any later version. | |
9 * | |
10 * Extraction-interface is distributed in the hope that it will be useful, | |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 * GNU General Public License for more details. | |
14 * | |
15 * You should have received a copy of the GNU General Public License | |
16 * along with Extraction-interface. If not, see <http://www.gnu.org/licenses/>. | |
17 */ | |
18 | |
77
97c1e5102a22
New: export table for a file from LGService
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
67
diff
changeset
|
19 /** |
81 | 20 * A model is notified by its associate controllers when there has been a change in its state, |
21 * and produces the output/data to corresponding views. | |
22 * | |
23 * (http://en.wikipedia.org/wiki/Model–view–controller) | |
24 * | |
25 * There are general methods/functions. | |
26 * For example, setting related to outside services, connecting to database, get information from database, etc. | |
27 * For other methods that are more related to each application, are defined in the files under "models/" folder. | |
28 * | |
77
97c1e5102a22
New: export table for a file from LGService
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
67
diff
changeset
|
29 */ |
47
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
30 |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
31 abstract class BaseModel { |
77
97c1e5102a22
New: export table for a file from LGService
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
67
diff
changeset
|
32 |
47
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
33 protected $get_text_from_fileId_url, $get_text_from_sectionId_url, $save_to_LGService_url, $save_new_to_LGService_url; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
34 |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
35 public function __construct() { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
36 global $mysql_database, $mysql_server, $mysql_user, $mysql_password, $systemNAME, $lgserver_url; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
37 $this->systemNAME = $systemNAME; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
38 |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
39 $this->get_text_from_fileId_url = $lgserver_url."rest/text/getFileText?fileId="; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
40 $this->get_text_from_sectionId_url = $lgserver_url."rest/text/getSectionText?sectionId="; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
41 $this->save_to_LGService_url = $lgserver_url."rest/text/save"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
42 $this->save_new_to_LGService_url = $lgserver_url."rest/text/saveNew"; |
67
3ada9334ebfc
New: check taglist is deprecated or not
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
43 $this->get_section_metadata_by_sectionId_url = $lgserver_url."rest/text/getSectionMetadata?sectionId="; |
47
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
44 |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
45 set_time_limit(0); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
46 ini_set('memory_limit', '-1'); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
47 |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
48 $link_mysql = mysql_connect($mysql_server, $mysql_user, $mysql_password); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
49 mysql_query("SET NAMES utf8"); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
50 |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
51 if (!$link_mysql) { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
52 die('Could not connect: ' . mysql_error()); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
53 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
54 $db_selected = mysql_select_db($mysql_database, $link_mysql); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
55 if (!$db_selected) { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
56 |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
57 die ('Can\'t use foo : ' . mysql_error()); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
58 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
59 $this->topic = 2; // set the default topic to product_name (物產) |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
60 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
61 |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
62 protected function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
63 $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
64 |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
65 $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
66 |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
67 switch ($theType) { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
68 case "text": |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
69 $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
70 break; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
71 case "long": |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
72 case "int": |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
73 $theValue = ($theValue != "") ? intval($theValue) : "NULL"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
74 break; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
75 case "double": |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
76 $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
77 break; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
78 case "date": |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
79 $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
80 break; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
81 case "defined": |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
82 $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
83 break; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
84 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
85 return $theValue; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
86 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
87 |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
88 protected function GetWordlist() { |
97
c1bb174a22f3
Topic synchronization with LGServices. Adaption for moving table from Gazetteer to LGService.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
81
diff
changeset
|
89 $query = sprintf("SELECT * FROM `Wordlist` ORDER BY `name` ASC"); |
47
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
90 $result = mysql_query($query); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
91 if (!$result){ |
97
c1bb174a22f3
Topic synchronization with LGServices. Adaption for moving table from Gazetteer to LGService.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
81
diff
changeset
|
92 return json_encode("Failed during selecting Wordlist table.");; |
47
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
93 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
94 return $result; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
95 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
96 |
97
c1bb174a22f3
Topic synchronization with LGServices. Adaption for moving table from Gazetteer to LGService.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
81
diff
changeset
|
97 /* |
78
960ba96efce1
Update: click to popup remove-tag-window; select to popup tag-window
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
77
diff
changeset
|
98 protected function GetSectionsById($section_id) { |
51
840cdb52f476
add book_meta into file
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
47
diff
changeset
|
99 $query = sprintf("SELECT * FROM `sections_index` WHERE `id`=\"%s\"", $section_id); |
47
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
100 $result = mysql_query($query); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
101 if (!$result){ |
51
840cdb52f476
add book_meta into file
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
47
diff
changeset
|
102 echo json_encode("Failed during selecting sections_index table"); |
47
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
103 return; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
104 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
105 return $result; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
106 } |
97
c1bb174a22f3
Topic synchronization with LGServices. Adaption for moving table from Gazetteer to LGService.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
81
diff
changeset
|
107 */ |
47
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
108 |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
109 protected function GetTaglist() { |
97
c1bb174a22f3
Topic synchronization with LGServices. Adaption for moving table from Gazetteer to LGService.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
81
diff
changeset
|
110 //$query = sprintf("SELECT * FROM `Taglist` WHERE `systemName`='%s' ORDER BY `tag` ASC", $this->systemNAME); |
c1bb174a22f3
Topic synchronization with LGServices. Adaption for moving table from Gazetteer to LGService.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
81
diff
changeset
|
111 $query = sprintf("SELECT * FROM `Taglist` ORDER BY `tag` ASC"); |
47
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
112 $result = mysql_query($query); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
113 if (!$result) { |
97
c1bb174a22f3
Topic synchronization with LGServices. Adaption for moving table from Gazetteer to LGService.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
81
diff
changeset
|
114 return json_encode("Failed during selecting Taglist table."); |
47
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
115 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
116 return $result; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
117 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
118 |
97
c1bb174a22f3
Topic synchronization with LGServices. Adaption for moving table from Gazetteer to LGService.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
81
diff
changeset
|
119 /* |
78
960ba96efce1
Update: click to popup remove-tag-window; select to popup tag-window
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
77
diff
changeset
|
120 protected function GetBooksById($bookId) { |
47
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
121 $query = sprintf("SELECT * FROM `books` WHERE id=\"%s\"", $bookId); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
122 $result = mysql_query($query); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
123 if (!$result) { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
124 return json_encode("Failed during selecting books table."); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
125 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
126 return $result; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
127 } |
97
c1bb174a22f3
Topic synchronization with LGServices. Adaption for moving table from Gazetteer to LGService.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
81
diff
changeset
|
128 */ |
c1bb174a22f3
Topic synchronization with LGServices. Adaption for moving table from Gazetteer to LGService.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
81
diff
changeset
|
129 |
c1bb174a22f3
Topic synchronization with LGServices. Adaption for moving table from Gazetteer to LGService.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
81
diff
changeset
|
130 protected function GetTagIdByTag($tag) { |
c1bb174a22f3
Topic synchronization with LGServices. Adaption for moving table from Gazetteer to LGService.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
81
diff
changeset
|
131 $query = sprintf("SELECT * FROM `Taglist` WHERE `tag`='%s'", $tag); |
c1bb174a22f3
Topic synchronization with LGServices. Adaption for moving table from Gazetteer to LGService.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
81
diff
changeset
|
132 $result = mysql_query($query); |
c1bb174a22f3
Topic synchronization with LGServices. Adaption for moving table from Gazetteer to LGService.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
81
diff
changeset
|
133 if (!$result) { |
c1bb174a22f3
Topic synchronization with LGServices. Adaption for moving table from Gazetteer to LGService.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
81
diff
changeset
|
134 return json_encode("Failed during selecting Taglist table."); |
c1bb174a22f3
Topic synchronization with LGServices. Adaption for moving table from Gazetteer to LGService.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
81
diff
changeset
|
135 } |
c1bb174a22f3
Topic synchronization with LGServices. Adaption for moving table from Gazetteer to LGService.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
81
diff
changeset
|
136 return $result["id"]; |
c1bb174a22f3
Topic synchronization with LGServices. Adaption for moving table from Gazetteer to LGService.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
81
diff
changeset
|
137 } |
47
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
138 |
78
960ba96efce1
Update: click to popup remove-tag-window; select to popup tag-window
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
77
diff
changeset
|
139 protected function GetTopicList() { |
97
c1bb174a22f3
Topic synchronization with LGServices. Adaption for moving table from Gazetteer to LGService.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
81
diff
changeset
|
140 //$query = sprintf("SELECT * FROM `topics`"); |
c1bb174a22f3
Topic synchronization with LGServices. Adaption for moving table from Gazetteer to LGService.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
81
diff
changeset
|
141 $query = sprintf("SELECT * FROM `Topic`"); |
47
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
142 $result = mysql_query($query); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
143 if (!$result) { |
97
c1bb174a22f3
Topic synchronization with LGServices. Adaption for moving table from Gazetteer to LGService.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
81
diff
changeset
|
144 return json_encode("Failed during selecting Topic table."); |
47
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
145 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
146 return $result; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
147 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
148 |
78
960ba96efce1
Update: click to popup remove-tag-window; select to popup tag-window
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
77
diff
changeset
|
149 protected function GetTopicById($topic_id) { |
97
c1bb174a22f3
Topic synchronization with LGServices. Adaption for moving table from Gazetteer to LGService.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
81
diff
changeset
|
150 //$query = sprintf("SELECT * FROM `topics` WHERE id=\"%s\"", $topic_id); |
c1bb174a22f3
Topic synchronization with LGServices. Adaption for moving table from Gazetteer to LGService.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
81
diff
changeset
|
151 $query = sprintf("SELECT * FROM `Topic` WHERE id=\"%s\"", $topic_id); |
47
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
152 $result = mysql_query($query); |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
153 if (!$result) { |
97
c1bb174a22f3
Topic synchronization with LGServices. Adaption for moving table from Gazetteer to LGService.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
81
diff
changeset
|
154 return json_encode("Failed during selecting Topic table."); |
47
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
155 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
156 return $result; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
157 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
158 |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
159 |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
160 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
161 |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
162 ?> |