Mercurial > hg > extraction-interface
annotate develop/classes/basemodel.php @ 38:4b3da4802998 extractapp
config for localgazetteers-dev
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Fri, 06 Mar 2015 17:56:48 +0100 |
parents | 04736430d961 |
children | c245d54eab9f |
rev | line source |
---|---|
6
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
1 <?php |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
2 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
3 abstract class BaseModel { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
4 // protected $database; |
10
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
6
diff
changeset
|
5 protected $systemNAME, $topic; |
13
cc36a20a68ab
automatically decide which rows (what data) should be shown in the exporting table based on the topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
12
diff
changeset
|
6 |
35
04736430d961
config for localgazetteers-dev
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
14
diff
changeset
|
7 protected $get_text_from_fileId_url = "http://localgazetteers-dev:8080/LGServer/rest/text/getFileText?fileId="; |
38
4b3da4802998
config for localgazetteers-dev
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
35
diff
changeset
|
8 protected $get_text_from_sectionId_url = "http://localgazetteers-dev:8080/LGServer/rest/text/getSectionText?sectionId="; |
35
04736430d961
config for localgazetteers-dev
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
14
diff
changeset
|
9 protected $save_to_LGService_url = "http://localgazetteers-dev:8080/LGServer/rest/text/save"; |
04736430d961
config for localgazetteers-dev
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
14
diff
changeset
|
10 protected $save_new_to_LGService_url = "http://localgazetteers-dev:8080/LGServer/rest/text/saveNew"; |
04736430d961
config for localgazetteers-dev
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
14
diff
changeset
|
11 |
04736430d961
config for localgazetteers-dev
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
14
diff
changeset
|
12 /* |
12
e82ca7375e93
Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
11
diff
changeset
|
13 // protected $lg_server_url = "http://141.14.239.226:8080/gazetteer-server/rest/text/"; |
e82ca7375e93
Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
11
diff
changeset
|
14 protected $get_text_from_fileId_url = "http://141.14.239.226:8080/gazetteer-server/rest/text/getFileText?fileId="; |
e82ca7375e93
Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
11
diff
changeset
|
15 protected $get_text_from_sectionId_url = "http://141.14.239.226:8080/gazetteer-server/rest/text/getSectionText?sectionId="; |
e82ca7375e93
Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
11
diff
changeset
|
16 protected $save_to_LGService_url = "http://141.14.239.226:8080/gazetteer-server/rest/text/save"; |
e82ca7375e93
Integration with LocalGazetteerService (LGService), getting text from LGService and saving text to LGService. Adjust the control flow (controller).
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
11
diff
changeset
|
17 protected $save_new_to_LGService_url = "http://141.14.239.226:8080/gazetteer-server/rest/text/saveNew"; |
35
04736430d961
config for localgazetteers-dev
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
14
diff
changeset
|
18 */ |
14
ac77748bb813
- Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
13
diff
changeset
|
19 |
ac77748bb813
- Load regex files based on current topic. Only show the regex in this topic.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
13
diff
changeset
|
20 |
6
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
21 public function __construct() { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
22 global $mysql_database, $mysql_server, $mysql_user, $mysql_password, $systemNAME; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
23 $this->systemNAME = $systemNAME; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
24 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
25 // $this->database = new PDO("mysql:host=localhost;dbname=test", "username", "password"); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
26 set_time_limit(0); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
27 ini_set('memory_limit', '-1'); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
28 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
29 $link_mysql = mysql_connect($mysql_server, $mysql_user, $mysql_password); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
30 mysql_query("SET NAMES utf8"); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
31 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
32 if (!$link_mysql) { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
33 die('Could not connect: ' . mysql_error()); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
34 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
35 $db_selected = mysql_select_db($mysql_database, $link_mysql); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
36 if (!$db_selected) { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
37 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
38 die ('Can\'t use foo : ' . mysql_error()); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
39 } |
10
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
6
diff
changeset
|
40 $this->topic = 1; // set the default topic to person (人物) |
6
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
41 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
42 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
43 protected function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
44 $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
45 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
46 $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
47 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
48 switch ($theType) { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
49 case "text": |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
50 $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
51 break; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
52 case "long": |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
53 case "int": |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
54 $theValue = ($theValue != "") ? intval($theValue) : "NULL"; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
55 break; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
56 case "double": |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
57 $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
58 break; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
59 case "date": |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
60 $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
61 break; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
62 case "defined": |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
63 $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
64 break; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
65 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
66 return $theValue; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
67 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
68 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
69 protected function GetWordlist() { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
70 $query = sprintf("SELECT * FROM `wordlist` WHERE `systemName`='%s' ORDER BY `name` ASC", $this->systemNAME); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
71 $result = mysql_query($query); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
72 if (!$result){ |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
73 return json_encode("Failed during selecting wordlist table.");; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
74 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
75 return $result; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
76 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
77 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
78 protected function GetSectionsByID($section_id) { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
79 $query = sprintf("SELECT * FROM `sections` WHERE `id`=\"%s\"", $section_id); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
80 $result = mysql_query($query); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
81 if (!$result){ |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
82 echo json_encode("Failed during selecting sections table"); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
83 return; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
84 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
85 return $result; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
86 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
87 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
88 protected function GetTaglist() { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
89 $query = sprintf("SELECT * FROM `taglist` WHERE `systemName`='%s' ORDER BY `tag` ASC", $this->systemNAME); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
90 $result = mysql_query($query); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
91 if (!$result) { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
92 return json_encode("Failed during selecting taglist table."); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
93 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
94 return $result; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
95 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
96 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
97 protected function GetBooksByID($bookId) { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
98 $query = sprintf("SELECT * FROM `books` WHERE id=\"%s\"", $bookId); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
99 $result = mysql_query($query); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
100 if (!$result) { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
101 return json_encode("Failed during selecting books table."); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
102 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
103 return $result; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
104 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
105 |
10
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
6
diff
changeset
|
106 protected function GetTopiclist() { |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
6
diff
changeset
|
107 $query = sprintf("SELECT * FROM `topics`"); |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
6
diff
changeset
|
108 $result = mysql_query($query); |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
6
diff
changeset
|
109 if (!$result) { |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
6
diff
changeset
|
110 return json_encode("Failed during selecting topics table."); |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
6
diff
changeset
|
111 } |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
6
diff
changeset
|
112 return $result; |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
6
diff
changeset
|
113 } |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
6
diff
changeset
|
114 |
11
3d6fba07bfbd
implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
10
diff
changeset
|
115 protected function GetTopicByID($topic_id) { |
3d6fba07bfbd
implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
10
diff
changeset
|
116 $query = sprintf("SELECT * FROM `topics` WHERE id=\"%s\"", $topic_id); |
3d6fba07bfbd
implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
10
diff
changeset
|
117 $result = mysql_query($query); |
3d6fba07bfbd
implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
10
diff
changeset
|
118 if (!$result) { |
3d6fba07bfbd
implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
10
diff
changeset
|
119 return json_encode("Failed during selecting topics table."); |
3d6fba07bfbd
implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
10
diff
changeset
|
120 } |
3d6fba07bfbd
implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
10
diff
changeset
|
121 return $result; |
3d6fba07bfbd
implemented for topic tag. tagging with topic tag (main tag) indicating each row when export to html.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
10
diff
changeset
|
122 } |
6
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
123 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
124 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
125 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
126 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
127 ?> |