<function name="rpcf_user5_service_report" id="-0x4011"> <input> <integer name="time_start" /> <integer name="time_end" /> </input> <output> <integer name="aids_size" /> <for name="i" from="0" count="aids_size"> <integer name="asr_size" /> <set dst="asr_size_array" src="asr_size" dst_index="i" /> <for name="j" from="0" count="asr_size"> <integer name="account_id" array_index="i,j" /> <integer name="discount_date" array_index="i,j" /> <double name="discount" array_index="i,j" /> <double name="discount_with_tax" array_index="i,j" /> <string name="service_name" array_index="i,j" /> <integer name="service_type" array_index="i,j" /> <string name="comment" array_index="i,j" /> </for> </for> </output> </function>
function rpcf_user5_service_report($start_date,$end_date) { //-0x4011 $ret=array(); if (!$this->connection->urfa_call(-0x4011)) { print "Error calling function ". __FUNCTION__ ."\n"; return FALSE; } $packet = $this->connection->getPacket(); $packet->DataSetInt($start_date); $packet->DataSetInt($end_date); $this->connection->urfa_send_param($packet); if ($x = $this->connection->urfa_get_data()) { $ret['aids_size'] = $x->DataGetInt(); for ($i=0;$i<$ret['aids_size'];$i++) { // $x = $this->connection->urfa_get_data(); $services['asr_size'] = $x->DataGetInt(); for($j=0;$j<$services['asr_size'];$j++){ // $x = $this->connection->urfa_get_data(); $services['asr_size_array'][$j]['account_id'] = $x->DataGetInt(); $services['asr_size_array'][$j]['discount_date'] = $x->DataGetInt(); $services['asr_size_array'][$j]['discount'] = $x->DataGetDouble(); $services['asr_size_array'][$j]['discount_with_tax'] = $x->DataGetDouble(); $services['asr_size_array'][$j]['service_name'] = $x->DataGetString(); $services['asr_size_array'][$j]['service_type'] = $x->DataGetInt(); $services['asr_size_array'][$j]['comment'] = $x->DataGetString(); } $ret['services'][]=$services; } // $this->connection->urfa_get_data(); } return $ret; }