XML

    <function name="rpcf_user5_get_services_info" id="-0x4024">
      <input>
         <integer name="slink_id" />
      </input>
      <output>
            <integer name="service_type" />
	    <integer name="service_id" />
	    <string name="service_name" />
	    <integer name="tariff_id" />
	    <double name="discounted_in_curr_period" />
	    <double name="cost" />
	    <if variable="service_type" value="3" condition="eq"> <!-- iptraffic  -->
	      <integer name="bytes_in_mbyte" />
	      <integer name="iptsl_downloaded_size" />
	      <for name="i" from="0" count="iptsl_downloaded_size">
	        <string name="tclass" array_index="i" />
		<long name="downloaded" array_index="i" />
	      </for>
	      <integer name="iptsl_old_prepaid_size" />
	      <for name="i" from="0" count="iptsl_old_prepaid_size">
	        <string name="tclass" array_index="i" />
		<long name="prepaid" array_index="i" />
	      </for>
	      <integer name="ipgroup_size" />
	      <for name="i" from="0" count="ipgroup_size">
	        <integer name="item_id" array_index="i" />
		<ip_address name="ip" array_index="i" />
		<ip_address name="mask" array_index="i" />
		<string name="login" array_index="i" />
	      </for>
	      <integer name="iptsd_borders_size" />
	      <for name="i" from="0" count="iptsd_borders_size">
	        <string name="tclass_name" array_index="i" />
		<long name="bytes" array_index="i" />
		<double name="cost1" array_index="i" /> 
		<integer name="group_type" array_index="i" />
	      </for>
	      <integer name="iptsd_prepaid_size" />
	      <for name="i" from="0" count="iptsd_prepaid_size">
	        <string name="tclass_name_p" array_index="i" />
		<long name="prepaid_p" array_index="i" />
	      </for>
	    </if>
	    <if variable="service_type" value="6" condition="eq"> <!-- telefony  -->
	      <integer name="tsl_numbers_size" />
	      <for name="i" from="0" count="tsl_numbers_size">
	        <string name="number" array_index="i" />
		<string name="login" array_index="i" />
		<string name="allowed_cid" array_index="i" />
		<integer name="item_id" array_index="i" />
	      </for>
	    </if>
	    <if variable="service_type" value="3" condition="ne">
	      <if variable="service_type" value="6" condition="ne">
	        <integer name="null_param" />
	      </if>
	    </if>
      </output>
    </function>

PHP

	function rpcf_user5_get_services_info($slink_id) { //-0x4024
		$ret=array(); 
		if (!$this->connection->urfa_call(-0x4024)) { 
			print "Error calling function ". __FUNCTION__ ."\n"; 
			return FALSE; 
		} 
		$packet = $this->connection->getPacket(); 
		$packet->DataSetInt($slink_id); 
		$this->connection->urfa_send_param($packet); 
		$x = $this->connection->urfa_get_data(); 
		$ret['service_type']=$x->DataGetInt(); 
		$ret['service_id']=$x->DataGetInt(); 
		$ret['service_name']=$x->DataGetString(); 
		$ret['tariff_id']=$x->DataGetInt(); 
		$ret['discounted_in_curr_period']=$x->DataGetDouble(); 
		$ret['cost']=$x->DataGetDouble(); 
//		$x = $this->connection->urfa_get_data(); 
		switch ($ret['service_type']){ 
			case "3": 
				$ret['bytes_in_mbyte']=$x->DataGetInt(); 
				$ret['iptsl_downloaded_size']=$x->DataGetInt(); 
				for ($i=0;$i<=$ret['iptsl_downloaded_size']-1;$i++){ 
//					$x = $this->connection->urfa_get_data(); 
					$ret['iptsl_downloaded_size_list'][$i]['tclass']=$x->DataGetString(); 
					$ret['iptsl_downloaded_size_list'][$i]['downloaded']=$x->DataGetLong(); 
				} 
//				$x = $this->connection->urfa_get_data(); 
				$ret['iptsl_old_prepaid_size']=$x->DataGetInt(); 
				for ($i=0;$i<=$ret['iptsl_old_prepaid_size']-1;$i++){ 
//					$x = $this->connection->urfa_get_data(); 
					$ret['iptsl_old_prepaid_size_list'][$i]['tclass']=$x->DataGetString(); 
					$ret['iptsl_old_prepaid_size_list'][$i]['downloaded']=$x->DataGetLong(); 
				} 
//				$x = $this->connection->urfa_get_data(); 
				$ret['ipgroup_size']=$x->DataGetInt(); 
				for ($i=0;$i<=$ret['ipgroup_size']-1;$i++){ 
//					$x = $this->connection->urfa_get_data(); 
					$ret['ipgroup_size_list'][$i]['item_id']=$x->DataGetInt(); 
					$ret['ipgroup_size_list'][$i]['ip']=$x->DataGetIPAddress(); 
					$ret['ipgroup_size_list'][$i]['mask']=$x->DataGetIPAddress(); 
					$ret['ipgroup_size_list'][$i]['login']=$x->DataGetString(); 
				} 
//				$x = $this->connection->urfa_get_data(); 
				$ret['iptsd_borders_size']=$x->DataGetInt(); 
				for ($i=0;$i<=$ret['iptsd_borders_size']-1;$i++){ 
//					$x = $this->connection->urfa_get_data(); 
					$ret['iptsd_borders_size_list'][$i]['tclass_name']=$x->DataGetString(); 
					$ret['iptsd_borders_size_list'][$i]['bytes']=$x->DataGetLong(); 
					$ret['iptsd_borders_size_list'][$i]['cost1']=$x->DataGetDouble(); 
					$ret['iptsd_borders_size_list'][$i]['group_type']=$x->DataGetInt(); 
				} 
//				$x = $this->connection->urfa_get_data(); 
				$ret['iptsd_prepaid_size']=$x->DataGetInt(); 
				for ($i=0;$i<=$ret['iptsd_prepaid_size']-1;$i++){ 
//					$x = $this->connection->urfa_get_data(); 
					$ret['iptsd_prepaid_size_list'][$i]['tclass_name_p']=$x->DataGetString(); 
					$ret['iptsd_prepaid_size_list'][$i]['prepaid_p']=$x->DataGetLong(); 
				} 
			   break; 
			case "6": 
				$ret['tsl_numbers_size']=$x->DataGetInt(); 
				for ($i=0;$i<=$ret['tsl_numbers_size']-1;$i++){ 
//					$x = $this->connection->urfa_get_data(); 
					$ret['tsl_numbers_size_list'][$i]['number']=$x->DataGetString(); 
					$ret['tsl_numbers_size_list'][$i]['login']=$x->DataGetString(); 
					$ret['tsl_numbers_size_list'][$i]['allowed_cid']=$x->DataGetString(); 
					$ret['tsl_numbers_size_list'][$i]['item_id']=$x->DataGetInt(); 
				} 
				break; 
			default: 
				$ret['null_param']=$x->DataGetInt(); 
				break; 
		} 
//		$this->connection->urfa_get_data(); 
		return $ret; 
	}
 
/home/u18456/wiki.flintnet.ru/www/data/pages/function_user5/function_name_rpcf_user5_get_services_info_id_-0x4024.txt · Последние изменения: 2009/07/24 11:06 От swibl
 
За исключением случаев, когда указано иное, содержимое этой вики предоставляется на условиях следующей лицензии:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki