4function getJavaSort($field)
8 if (isset($_GET[
'flag'])) {
9 if ($_GET[
'flag'] ==
"ASC") {
13 if (isset($_GET[
'tags'])) {
14 $addr =
"index.php?tags=" . $_GET[
'tags'] .
"&flag=" . $flag;
16 $addr =
"index.php?flag=" . $flag;
18 $addr = $addr .
"&orderby=" . $field;
19 return "<td onclick=\"window.location='" . $addr .
"'\">";
25 $stmt =
"SELECT * FROM Files";
26 if (isset($_GET[
'tags'])) {
27 if ($_GET[
'tags'] !=
"") {
30 preg_match_all(
'("([^"]|"")*")', $que, $sentences);
31 foreach ($sentences[0] as $value) {
32 $que = str_replace($value,
" ", $que);
34 $que = preg_replace(
'/\s+/',
' ', $que);
35 $arr = preg_split(
'/[\s]+/', $que);
39 $array_tags = array();
40 $array_comment = array();
41 foreach ($arr as $value) {
42 if (strlen($value) == 0)
44 if ($value[0] ==
'#') {
45 $value = substr($value, 1);
46 array_push($array_tags, $value);
48 array_push($array_comment, $value);
53 if (count($array_tags) > 0 || count($array_comment) > 0 || count($sentences[0]) > 0) {
54 $stmt = $stmt .
" WHERE ";
56 if (count($array_tags) > 0) {
57 $question_tag =
"Tags LIKE ";
58 foreach ($array_tags as $value) {
59 $question_tag = $question_tag .
":name" . ($name_id ++) .
" AND Tags LIKE";
61 $question_tag = substr($question_tag, 0, - 13);
62 $question_tag = $question_tag .
"";
65 if (count($array_comment) > 0 || count($sentences[0]) > 0) {
66 $question_word =
"Comment LIKE ";
67 foreach ($array_comment as $value) {
68 $question_word = $question_word .
":name" . ($name_id ++) .
" AND Comment LIKE";
70 foreach ($sentences[0] as $value) {
71 $question_word = $question_word .
":name" . ($name_id ++) .
" AND Comment LIKE";
73 $question_word = substr($question_word, 0, - 16);
74 $question_word = $question_word .
"";
77 if (strlen($question_tag) > 0 && strlen($question_word) > 0) {
78 $stmt = $stmt .
"(" . $question_tag .
") AND (" . $question_word .
")";
79 }
else if (strlen($question_tag) > 0) {
80 $stmt = $stmt .
" " . $question_tag;
82 $stmt = $stmt .
" " . $question_word;
84 $statement = $db->prepare($stmt);
86 foreach ($array_tags as $val) {
87 $val =
'%' . $val .
'%';
88 $parname =
":name" . $count ++;
89 $statement->bindParam($parname, $val);
91 foreach ($array_comment as $val) {
92 $val =
"%" . $val .
"%";
93 $parname =
":name" . $count ++;
94 $statement->bindParam($parname, $val);
96 foreach ($sentences[0] as $val) {
97 $val =
"%" . $val .
"%";
98 $parname =
":name" . $count ++;
99 $statement->bindParam($parname, $val);
102 $xx = $statement->execute();
107 if (isset($_GET[
'flag']) && isset($_GET[
'orderby'])) {
108 $stmt = $stmt .
" ORDER BY " . $_GET[
'orderby'] .
" " . $_GET[
'flag'];
109 return $db->query($stmt);
111 return $db->query($stmt);
115function getGoogleRec($row)
117 echo
"<a href=\"html_rep/html_" . $row[
'FILE_ID'] .
"/index.html?task_id=" . $row[
'TASK_ID'] .
"\">" . $row[
'ID'] .
". " . $row[
'Comment'] .
"</a></br>" . PHP_EOL;
118 echo
"<font color=\"green\">Tags : " . $row[
'Tags'] .
"</font></br>" . PHP_EOL;
119 echo
"File path: " . $row[
'PathFile'] .
"</br>" . PHP_EOL;
120 echo
"Analysis name: " . $row[
'AnaName'] .
"</br>" . PHP_EOL;
121 echo
"Input file: " . $row[
'InputFile'] .
"</br>" . PHP_EOL;
122 echo
"Data format: " . $row[
'DataType'] .
"</br>" . PHP_EOL;
123 echo
"Processed events: " . $row[
'ProcessedEvents'] .
"</br>" . PHP_EOL;
124 echo
"Software ver: " . $row[
'SoftVer'] .
"</br>" . PHP_EOL;
128function getTableRec($row)
130 echo
"<tr><td>" . $row[
'ID'] .
"</td><td>" . $row[
'Comment'] .
"</td><td>" . $row[
'InputFile'] .
"</td><td>" . $row[
'AnaName'] .
"</td><td>" . $row[
'PathFile'] .
"</td><td><a href=\"html_rep/html_" . $row[
'FILE_ID'] .
"/index.html?task_id=" . $row[
"TASK_ID"] .
"\">Link</a></td><td>" . $row[
'Tags'] .
"</td></tr>" . PHP_EOL;
134function showTable($result)
136 echo
"</td></tr></table>" . PHP_EOL;
137 echo
"<div class=\"CSSTableGenerator\">" . PHP_EOL;
138 echo
"<table class=\"sortable\">" . PHP_EOL;
139 echo
"<tr><td>No</td>" . getJavaSort(
"Comment") .
"Comment</td>" . getJavaSort(
"InputFile") .
"InputFile</td>" . getJavaSort(
"AnaName") .
"AnaName</td>" . getJavaSort(
"PathFile") .
"Full Path</td>" . getJavaSort(
"ID") .
"Link</td>" . getJavaSort(
"Tags") .
"Tags</td><tr>" . PHP_EOL;
140 while ($row = $result->fetchArray(SQLITE3_ASSOC)) {
143 echo
"</table>" . PHP_EOL;
144 echo
"</div>" . PHP_EOL;
148function showGoogle($result)
150 while ($row = $result->fetchArray(SQLITE3_ASSOC)) {
153 echo
"</table>" . PHP_EOL;