예제 #1
0
$criterion = quickGet("criterion");
$search = quickGet("data");
$extracriterion = quickGet("extracriterion");
$field = quickGet("field");
if (!$search) {
    $search = '';
}
$res = array();
if (strlen($search) >= 2) {
    //TODO: the limit should be passed as an argument, moreover it is already partly controlled by 'min keyword length' in autocomplete.php
    if (strlen($extracriterion)) {
        if (in_array('inventory', $_SESSION['modulesList'])) {
            $criterion = $field == 'Qsoftware' ? 'Software/Company:ProductName' : $criterion;
            $res = getPossiblesValuesForCriterionInModuleFuzzyWhere($module, $criterion, $extracriterion, $search);
        } else {
            $res = getPossiblesValuesForCriterionInModuleFuzzyWhere($module, $criterion, $search, $extracriterion);
        }
    } else {
        $res = getPossiblesValuesForCriterionInModuleFuzzy($module, $criterion, $search);
    }
}
header("Content-type: application/json");
$output = array_combine($res, $res);
print json_encode($output);
return;
print '<ul>';
foreach ($res as $items) {
    ?>
 <li><?php 
    echo $items;
    ?>
예제 #2
0
 */
require_once "modules/dyngroup/includes/xmlrpc.php";
require_once "modules/pulse2/includes/utilities.php";
# for quickGet method
ob_end_clean();
$module = quickGet("modulename");
$criterion = quickGet("criterion");
$search = quickGet("data");
if (!$search) {
    $search = '';
}
$value1 = quickGet("value1");
$res = array();
if (strlen($search) > 2) {
    if (strlen($value1)) {
        $res = getPossiblesValuesForCriterionInModuleFuzzyWhere($module, $criterion, $value1, $search);
    } else {
        $res = getPossiblesValuesForCriterionInModuleFuzzy($module, $criterion, $search);
    }
}
header("Content-type: application/json");
$output = array_combine($res, $res);
print json_encode($output);
return;
print '<ul>';
foreach ($res as $items) {
    ?>
 <li><?php 
    echo $items;
    ?>
</li> <?php