Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<pre><code>&lt;?php include_once("lib/xmlrpc.inc"); class OpenERPXmlrpc { private $user, $password, $database, $services, $client, $res, $msg, $id; function __construct($usr, $pass, $db, $server) { $this-&gt;user = $usr; $this-&gt;password = $pass; $this-&gt;database = $db; $this-&gt;services = $server; $this-&gt;client = new xmlrpc_client($this-&gt;services.'common'); $this-&gt;msg = new xmlrpcmsg('login'); $this-&gt;msg-&gt;addParam(new xmlrpcval($this-&gt;database, "string")); $this-&gt;msg-&gt;addParam(new xmlrpcval($this-&gt;user, "string")); $this-&gt;msg-&gt;addParam(new xmlrpcval($this-&gt;password, "string")); $this-&gt;res = &amp;$this-&gt;client-&gt;send($this-&gt;msg); if(!$this-&gt;res-&gt;faultCode()){ $this-&gt;id = $this-&gt;res-&gt;value()-&gt;scalarval(); } else { echo "Unable to login ".$this-&gt;res-&gt;faultString(); exit; } } function read($post = null) { $this-&gt;client = new xmlrpc_client($this-&gt;services.'object'); if(empty($post)) { $ids_read = array(new xmlrpcval('1', 'int'), new xmlrpcval('2', 'int')); $key = array(new xmlrpcval('id','integer') , new xmlrpcval('name', 'string')); $this-&gt;msg = new xmlrpcmsg('execute'); $this-&gt;msg-&gt;addParam(new xmlrpcval($this-&gt;database, "string")); $this-&gt;msg-&gt;addParam(new xmlrpcval(1, "int")); $this-&gt;msg-&gt;addParam(new xmlrpcval($this-&gt;password, "string")); $this-&gt;msg-&gt;addParam(new xmlrpcval("res.partner","string")); $this-&gt;msg-&gt;addParam(new xmlrpcval("read", "string")); $this-&gt;msg-&gt;addParam(new xmlrpcval($ids_read, "array")); $this-&gt;msg-&gt;addParam(new xmlrpcval($key, "array")); $this-&gt;res = &amp;$this-&gt;client-&gt;send($this-&gt;msg); if(!$this-&gt;res-&gt;faultCode()) { $read_html = '&lt;table width="20%" border="0" cellpadding="4" cellspacing="4" align="center"&gt; &lt;tr&gt; &lt;th&gt;Id&lt;/th&gt; &lt;th&gt;Name&lt;/th&gt; &lt;/tr&gt; '; $scalval = $this-&gt;res-&gt;value()-&gt;scalarval(); foreach ($scalval as $keys =&gt; $values) { $value = $values-&gt;scalarval(); $read_html .= ' &lt;tr&gt; &lt;td&gt;'.$value['id']-&gt;scalarval().'&lt;/td&gt; &lt;td&gt;'.$value['name']-&gt;scalarval().'&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;&lt;td colspan="2"&gt;&lt;/td&gt;&lt;/tr&gt; '; } $read_html .= ' &lt;/table&gt; '; return $read_html; } else { return "Not read recode from partner table &lt;br /&gt;".$this-&gt;res-&gt;faultString(); } } } } $cnt = new OpenERPXmlrpc('admin', 'a', 'test_6_1', 'http://localhost:8069/xmlrpc/'); echo $cnt-&gt;read(); ?&gt; </code></pre> <p>solved ;)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload