XML

<function name="rpcf_search_cards" id="0x1201">
  <input>
    <integer name="select_type" />
    <integer name="patterns_count" default="size(what_id)"/>
    <for name="i" from="0" count="size(what_id)">
      <integer name="what_id" array_index="i" />                        <!--  WHAT_ID     -->
      <integer name="criteria_id" array_index="i" />                    <!--  CRITERIA_ID -->
      <string name="pattern" array_index="i" />
    </for>
  </input>
  <output>
    <integer name="cards_size" />
    <for name="i" from="0" count="cards_size">
      <integer name="card_id"  array_index="i" />
      <integer name="pool_id"  array_index="i" />
      <string name="secret"  array_index="i" />
      <double name="balance"  array_index="i" />
      <integer name="currency"  array_index="i" />
      <integer name="expire"  array_index="i" />
      <integer name="days"  array_index="i" />
      <integer name="is_used"  array_index="i" />
      <integer name="tp_id" array_index="i" />
    </for>
  </output>
</function>

PHP

В текущей реализации поиск производится только по card_id. Для поиска по другим критериям код требуется дорабатывать.

function rpcf_search_cards($card_id) { //0x1201
	$ret=array();
	if (!$this->connection->urfa_call(0x1201)) {
			print "Error calling function ". __FUNCTION__ ."\n";
			return FALSE;
	}
	$packet = $this->connection->getPacket();
	$packet->DataSetInt(1); //select type
	$packet->DataSetInt(1); //patterns count
	$packet->DataSetInt(1); //what_id 'id'
	$packet->DataSetInt(3); //criteria_id '='
	$packet->DataSetString($card_id); //card_id
	$this->connection->urfa_send_param($packet);
	if ($x = $this->connection->urfa_get_data()) {
			$count=$x->DataGetInt();
			$ret['count']=$count;
			for($i=0; $i<$count;$i++) {
					//$x = $this->connection->urfa_get_data();
					$card['card_id'] = $x->DataGetInt();
					$card['pool_id'] = $x->DataGetInt();
					$card['secret']  = $x->DataGetString();
					$card['balance'] = $x->DataGetDouble();
					$card['currency']= $x->DataGetInt();
					$card['expire']  = $x->DataGetInt();
					$card['days']    = $x->DataGetInt();
					$card['is_used'] = $x->DataGetInt();
					$card['tp_id']   = $x->DataGetInt();
					$ret['cards'][]  = $card;
			}
			//$this->connection->urfa_get_data();
	}
	return $ret;
}
RPCF_SEARCH_CARDS FUNCTION DESCRIPTION
__________________________________________
"criteria_id" can get the following values:
1  :   LIKE
3  :   =
4  :   <>
7  :   >
8  :   <
9  :   >=
10  :   <=
11  :   NOT LIKE
_______________________________________
"what_id" can get the following values:
1: id
2: pool_id
3: secret
4: balance
5: currency
6: expiration
7: service_id
8: is_used
 
/home/u18456/wiki.flintnet.ru/www/data/pages/function_admin/function_name_rpcf_search_cards_id_0x1201.txt · Последние изменения: 2011/08/15 15:00 От 178.215.114.229
 
За исключением случаев, когда указано иное, содержимое этой вики предоставляется на условиях следующей лицензии: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