Example #1
0
<?php

// No direct access
defined('_JEXEC') or die('Restricted access');
if (!empty($FIELD_VALUE) || $FIELD_VALUE != 0) {
    $REL_QUERY = $this->views[(int) $FIELD_PARAMS["queryId"]]["query"];
    $ROW_KEY = "id";
    if (!empty($REL_QUERY["key"])) {
        $ROW_KEY = $REL_QUERY["key"];
    }
    // FILTER FIELD VALUE
    if (!is_numeric($FIELD_VALUE)) {
        $value = $ROW_KEY . " = '" . $FIELD_VALUE . "'";
    } else {
        $value = $ROW_KEY . " = " . $FIELD_VALUE;
    }
    $REL_QUERY["having"]["current_key"] = $value;
    $ROWS = AvcModelAvc::execQuery($REL_QUERY);
    $REL_FIELDS_CONFIG = $this->views[(int) $FIELD_PARAMS["queryId"]]["fields_config"];
    $REL_VALUE = array();
    if (!empty($REL_FIELDS_CONFIG)) {
        foreach ($REL_FIELDS_CONFIG as $REL_FIELD_KEY => $REL_FIELD_PARAMS) {
            $REL_VALUE[] = $ROWS[0][$REL_FIELD_KEY];
        }
    }
    echo "<i>" . implode(", ", $REL_VALUE) . "</i>";
}
Example #2
0
</div>

<div class="fltrt">

    <input type="hidden" name="filter_filter_value" id="filter_filter_value" value="<?php 
echo JRequest::getVar('filter_filter_value');
?>
" />

<?php 
$FILTER_VALUES = explode(" AND ", JRequest::getVar('filter_filter_value'));
if (!empty($this->views[$this->curr_view_id]["filters_config"])) {
    foreach ($this->views[$this->curr_view_id]["filters_config"] as $FILTER_KEY => $FILTER_PARAMS) {
        if (!empty($FILTER_PARAMS["query"])) {
            $ROWS = AvcModelAvc::execQuery($FILTER_PARAMS["query"]);
        }
        if (!empty($FILTER_PARAMS["custom"])) {
            $ROWS = $FILTER_PARAMS["custom"];
        }
        if (!empty($ROWS)) {
            echo '<select onchange="AVC_FILTER_UPDATE();document.adminForm.submit();" class="AVC_FILTERS">';
            echo '<option value="">' . JText::_($FILTER_PARAMS["label"]) . '</option>';
            foreach ($ROWS as $ROW) {
                $selected = NULL;
                if (in_array($FILTER_KEY . ' = ' . $ROW["value"], $FILTER_VALUES)) {
                    $selected = ' selected="selected"';
                }
                echo '<option value="' . $FILTER_KEY . ' = ' . $ROW["value"] . '"' . $selected . '>' . JText::_($ROW["label"]) . '</option>';
            }
            echo '</select>';