<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="sr-RS">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<?php


/*
 * Demo: demo_customfilter.php
 * 
 * Primer poziva API funkcije 'customfilter' koja parsira filterski izraz
 *  
 */
 

include_once 'infoapi/infoapi.php';

$m_filter = new iapiFilter ('ADD', 5, new iapiFilter ('ADD', 5, 6));

$miapiHandler = new iapiHandler;
$miapiHandler->APIServerURL = SERVER_URL;

$miapiHandler->DebugLevel = DEBUG_LEVEL;
$miapiHandler->DebugSections = DEBUG_SECTIONS;

// naziv API funkcije koja se poziva
$mAPIFunctionName = 'CUSTOMFILTER';

$mQueryEnvelope = new iapiQueryEnvelope ($mAPIFunctionName);
$mQueryEnvelope->username = USERNAME;
$mQueryEnvelope->password = PASSWORD;


$mQueryEnvelope->data->filter = $m_filter;

$mQuery = $mQueryEnvelope;
$mResponse  = $miapiHandler->Execute($mQuery);

?>
Expression: <?php echo $mResponse->data->expression; ?>
Value: <?php echo $mResponse->data->value; ?>
<?php

if ($mResponse->data->error_state !='ok') {
?>
Greska: <?php echo $mResponse->data->error_state; ?>
<?php
}
?>
<hr />
<?php include_once 'inc_sysinfo.php'; ?>
</pre>
</body>
</html>