From: Michele Silva Date: Fri, 6 Jan 2012 19:01:27 +0000 (-0200) Subject: Updated ws to use siap configurations. X-Git-Url: http://200.18.67.61/gitweb/?a=commitdiff_plain;h=29f1ed3cd226b519febf914c00e572f359ba2d68;p=siap.git Updated ws to use siap configurations. --- diff --git a/ws/siacc_wsclient.php b/ws/siacc_wsclient.php index 46cee23..4fa67cc 100644 --- a/ws/siacc_wsclient.php +++ b/ws/siacc_wsclient.php @@ -46,6 +46,7 @@ header('Content-type: text/html; charset=ISO-8859-1'); $client = create_soap_client(); +// Obtem os tipos de busca existentes (procedencia, sistema, patologia...) $search_types = call_soap_method($client, 'get_search_types', array()); if ($search_types) { echo '

Tipos de busca para Imagem

';
@@ -53,7 +54,8 @@ if ($search_types) {
     echo '
'; } -foreach ($search_types as &$search_type) { +// Obtem as palavras chaves para cada um dos tipos de busca. +foreach ($search_types as $search_type) { $result = call_soap_method($client, 'get_search_type_keywords', array('search_type' => $search_type['id'])); if ($result) { echo '

Palavras-chave para '.$search_type['nome'].':

';
@@ -62,7 +64,8 @@ foreach ($search_types as &$search_type) {
     }	
 }
 
-
+// Realiza uma busca por palavra chave.
+// Obs: sistema, procedencia e patologia DEVEM SER PASSADOS POR ID (string vazia quando nao estiver selecionado)
 $search_results = call_soap_method($client, 'search', array('search_request' => array(
                 'palavra'=>'abscesso', 'sistema'=>8, 'procedencia'=>15, 'patologia'=>'')));
 
diff --git a/ws/siap_ws_utils.php b/ws/siap_ws_utils.php
index ee3475c..e53ab52 100644
--- a/ws/siap_ws_utils.php
+++ b/ws/siap_ws_utils.php
@@ -4,10 +4,10 @@ $cfg = array();
 function connect_to_database(){
     define("IS_LOCAL", false);
     include("../_config/config.php");
-    $dbhost = "200.18.67.60";
-    $dbuser = "frazaoproject";
-    $dbpass = "myN3MbassW0rd";
-    $dbname = "frazaoproject";
+    $dbhost = $cfg["database_server"][0];
+    $dbuser = $cfg["database_user"][0];
+    $dbpass = $cfg["database_password"][0];
+    $dbname = $cfg["database_database"][0];
     $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
     $db = mysql_select_db($dbname);
 }