<function name="rpcf_add_house" id="0x2811"> <input> <integer name="house_id" /> <integer name="connect_date" /> <string name="post_code" /> <string name="country" /> <string name="region" /> <string name="city" /> <string name="street" /> <string name="number" /> <string name="building" /> <integer name="count" default="size(ipzone_id)"/> <for name="i" from="0" count="size(ipzone_id)"> <integer name="ipzone_id" array_index="i" /> </for> </input> <output/> </function>
function rpcf_add_house($house) { //0x2811 if (!$this->connection->urfa_call(0x2811)) { print "Error calling function ". __FUNCTION__ ."\n"; return FALSE; } $packet = $this->connection->getPacket(); $packet->DataSetInt(isset($house['house_id']) ? $house['house_id'] : 0); $packet->DataSetInt(isset($house['connect_date']) ? $house['connect_date'] : time()); foreach (array('post_code','country','region', 'city','street','number','building') as $var) $packet->DataSetString(isset($house[$var]) ? $house[$var] : ""); if (isset($house['ipzones'])) { $packet->DataSetInt(count($house['ipzones'])); # count foreach ($house['ipzones'] as $zone) { $packet->DataSetInt($zone); } }else { $packet->DataSetInt(1); # count $packet->DataSetInt(1); # zone } $this->connection->urfa_send_param($packet); $this->connection->urfa_get_data(); return 0; }