Advertisement
Guest User

Untitled

a guest
Jan 11th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. <?php
  2. defined('_JEXEC') or die;
  3.  
  4. class DQClient
  5. {
  6. var $dqserver=null;
  7. var $user=null;
  8. var $pass=null;
  9. var $destination=null;
  10. private $client=null;
  11.  
  12. public function __construct($server,$destination)
  13. {
  14. $this->user='yyy';
  15. $this->pass='yyy';
  16. $this->dqserver=$server;
  17. $this->destination=$destination;
  18.  
  19. $this->client=new SoapClient($server,array('encoding'=>'UTF-8'));
  20.  
  21.  
  22. }
  23.  
  24. public function search($searchterm)
  25. {
  26.  
  27. $result=$this->client->SearchRecords(array(
  28. "Username"=>$this->user,"Password"=>$this->pass,
  29. "FACTFinderDataDestinationName"=>$this->destination,
  30. "SearchString"=>$searchterm));
  31.  
  32. $keys=$result->SearchRecordsResult->ArrayOfString[0]->string;
  33. array_shift($result->SearchRecordsResult->ArrayOfString);
  34. $finalres=Array();
  35.  
  36. if (count($result->SearchRecordsResult->ArrayOfString)){
  37. foreach($result->SearchRecordsResult->ArrayOfString as $r){
  38. $finalres[]=array_combine($keys,$r->string);
  39. }
  40. }
  41. return $finalres;
  42.  
  43. }
  44.  
  45.  
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement