<function name="rpcf_get_tps_for_user" id="0x301a"> <!-- Gets the services and service links in the frame of tariff--> <input> <integer name="uid" /> <!--user id--> <integer name="aid" /> <!--account id--> <integer name="tpid" /> <!--tariff plan id--> <integer name="tplink" /> <!--tariff link id--> <integer name="unused" /> </input> <output> <integer name="service_size" /> <for name="i" from="0" count="service_size"> <integer name="sid" array_index="i" /> <string name="service_name" array_index="i" /> <integer name="service_type" array_index="i" /> <string name="comment" array_index="i" /> <integer name="slink" array_index="i" /> <integer name="value" array_index="i" /> </for> </output> </function>
function rpcf_get_tps_for_user($uid,$aid,$tpid,$tplink) { //0x301a if (!$this->connection->urfa_call(0x301a)) { print "Error calling function ". __FUNCTION__ ."\n"; return FALSE; } $packet = $this->connection->getPacket(); $packet->DataSetInt($uid); $packet->DataSetInt($aid); $packet->DataSetInt($tpid); $packet->DataSetInt($tplink); $packet->DataSetInt(''); $this->connection->urfa_send_param($packet); $x = $this->connection->urfa_get_data(); $service_size=$x->DataGetInt(); $ret = array(); for($i = 0;$i < $service_size;$i++){ $ret[$i]['sid'] = $x->DataGetInt(); $ret[$i]['service_name'] = $x->DataGetString(); $ret[$i]['service_type'] = $x->DataGetInt(); $ret[$i]['comment'] = $x->DataGetString(); $ret[$i]['slink'] = $x->DataGetInt(); $ret[$i]['value'] = $x->DataGetInt(); } return $ret; }