Mercurial > hg > extraction-interface
annotate develop/classes/basemodel.php @ 42:c245d54eab9f extractapp
config lg server url, without port
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Thu, 12 Mar 2015 17:33:30 +0100 |
parents | 4b3da4802998 |
children | 807d3bb33da7 |
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; |
42
c245d54eab9f
config lg server url, without port
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
38
diff
changeset
|
5 protected $systemNAME, $lgserver_url; |
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 |
42
c245d54eab9f
config lg server url, without port
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
38
diff
changeset
|
7 protected $get_text_from_fileId_url = $this->lgserver_url."rest/text/getFileText?fileId="; |
c245d54eab9f
config lg server url, without port
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
38
diff
changeset
|
8 protected $get_text_from_sectionId_url = $this->lgserver_url."rest/text/getSectionText?sectionId="; |
c245d54eab9f
config lg server url, without port
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
38
diff
changeset
|
9 protected $save_to_LGService_url = $this->lgserver_url."rest/text/save"; |
c245d54eab9f
config lg server url, without port
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
38
diff
changeset
|
10 protected $save_new_to_LGService_url = $this->lgserver_url."rest/text/saveNew"; |
c245d54eab9f
config lg server url, without port
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
38
diff
changeset
|
11 |
35
04736430d961
config for localgazetteers-dev
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
14
diff
changeset
|
12 |
04736430d961
config for localgazetteers-dev
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
14
diff
changeset
|
13 /* |
42
c245d54eab9f
config lg server url, without port
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
38
diff
changeset
|
14 protected $get_text_from_fileId_url = "http://localgazetteers-dev/LGServer/rest/text/getFileText?fileId="; |
c245d54eab9f
config lg server url, without port
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
38
diff
changeset
|
15 protected $get_text_from_sectionId_url = "http://localgazetteers-dev/LGServer/rest/text/getSectionText?sectionId="; |
c245d54eab9f
config lg server url, without port
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
38
diff
changeset
|
16 protected $save_to_LGService_url = "http://localgazetteers-dev/LGServer/rest/text/save"; |
c245d54eab9f
config lg server url, without port
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
38
diff
changeset
|
17 protected $save_new_to_LGService_url = "http://localgazetteers-dev/LGServer/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() { |
42
c245d54eab9f
config lg server url, without port
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
38
diff
changeset
|
22 global $mysql_database, $mysql_server, $mysql_user, $mysql_password, $systemNAME, $lgserver_url; |
6
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
23 $this->systemNAME = $systemNAME; |
42
c245d54eab9f
config lg server url, without port
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
38
diff
changeset
|
24 $this->lgserver_url = $lgserver_url; |
6
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
25 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
26 // $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
|
27 set_time_limit(0); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
28 ini_set('memory_limit', '-1'); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
29 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
30 $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
|
31 mysql_query("SET NAMES utf8"); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
32 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
33 if (!$link_mysql) { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
34 die('Could not connect: ' . mysql_error()); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
35 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
36 $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
|
37 if (!$db_selected) { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
38 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
39 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
|
40 } |
10
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
6
diff
changeset
|
41 $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
|
42 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
43 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
44 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
|
45 $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
|
46 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
47 $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
|
48 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
49 switch ($theType) { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
50 case "text": |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
51 $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
52 break; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
53 case "long": |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
54 case "int": |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
55 $theValue = ($theValue != "") ? intval($theValue) : "NULL"; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
56 break; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
57 case "double": |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
58 $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
59 break; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
60 case "date": |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
61 $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
62 break; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
63 case "defined": |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
64 $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
65 break; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
66 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
67 return $theValue; |
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 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
70 protected function GetWordlist() { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
71 $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
|
72 $result = mysql_query($query); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
73 if (!$result){ |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
74 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
|
75 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
76 return $result; |
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 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
79 protected function GetSectionsByID($section_id) { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
80 $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
|
81 $result = mysql_query($query); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
82 if (!$result){ |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
83 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
|
84 return; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
85 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
86 return $result; |
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 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
89 protected function GetTaglist() { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
90 $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
|
91 $result = mysql_query($query); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
92 if (!$result) { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
93 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
|
94 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
95 return $result; |
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 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
98 protected function GetBooksByID($bookId) { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
99 $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
|
100 $result = mysql_query($query); |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
101 if (!$result) { |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
102 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
|
103 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
104 return $result; |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
105 } |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
106 |
10
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
6
diff
changeset
|
107 protected function GetTopiclist() { |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
6
diff
changeset
|
108 $query = sprintf("SELECT * FROM `topics`"); |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
6
diff
changeset
|
109 $result = mysql_query($query); |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
6
diff
changeset
|
110 if (!$result) { |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
6
diff
changeset
|
111 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
|
112 } |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
6
diff
changeset
|
113 return $result; |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
6
diff
changeset
|
114 } |
54a235d43694
add topic choosing in the TaggingText page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
6
diff
changeset
|
115 |
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
|
116 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
|
117 $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
|
118 $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
|
119 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
|
120 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
|
121 } |
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 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
|
123 } |
6
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 |
63e08b98032f
rewrite extraction interface into PHP MVC architecture.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
128 ?> |