Example #1
0
function displayViewTable($uid, $gid, $tid, $selection)
{
    global $keep_shard, $keep_server, $keep_service, $display_view;
    // 1. create views tree
    buildVariableEnv($uid, $gid, $tid, $vardisp, $bounds, $privilege, $tree, $condensed, $autoDisplay);
    if ($autoDisplay || $display_view) {
        // 2. select branches
        if (count($selection) > 0) {
            foreach ($selection as $sel) {
                if ($sel != "") {
                    $selarray = expandQuery($sel);
                    foreach ($selarray as $sel) {
                        $address = explode(".", $sel);
                        //echo "select address ".$sel."<br>\n";
                        addToSelectNode($tree, $address, 0);
                    }
                }
            }
        }
        // 3. remove unselected branches
        clearupNode($tree);
        // 4. build and factorize query
        $query = factorizeQuery(buildQuery($tree));
        if ($numsteps == 5) {
            echo "Unsupported entity request now<br>\n";
            return;
        }
        $bef = microtime();
        $qstate = nel_query($query, $result);
        $aft = microtime();
        list($usec, $sec) = explode(" ", $bef);
        $bef = (double) $sec + (double) $usec;
        list($usec, $sec) = explode(" ", $aft);
        $aft = (double) $sec + (double) $usec;
        $tm = (int) (($aft - $bef) * 1000.0);
        if (!$qstate) {
            echo "<b>{$result}</b>\n";
        }
    }
    displayResult($result, $vardisp, $bounds, $privilege, $condensed, $autoDisplay);
    return "Executed query '{$query}'<br>{$tm} milliseconds computation time<br>\n";
}
Example #2
0
#!/usr/bin/env php
<?php 
// Looks for and reports any missing translation in the EasyAdmin bundle
// translation files (it uses the English translation as the reference because
// it's always complete).
// Configuration options
// ----------------------------------------------------------------------------
$translationsDir = __DIR__ . '/../vendor/javiereguiluz/easyadmin-bundle/Resources/translations';
// Don't change anything below this line
// ----------------------------------------------------------------------------
$englishTranslations = array('EasyAdminBundle' => getTranslationKeys($translationsDir . '/EasyAdminBundle.en.xlf'), 'messages' => getTranslationKeys($translationsDir . '/messages.en.xlf'));
$missingTranslations = findMissingTranslations($englishTranslations, $translationsDir);
displayResult($missingTranslations);
function findMissingTranslations($referenceTranslation, $translationsDir)
{
    $missingTranslations = array();
    foreach (array('EasyAdminBundle', 'messages') as $domain) {
        $availableTranslations = glob(sprintf('%s/%s.*.xlf', $translationsDir, $domain));
        foreach ($availableTranslations as $translationFile) {
            $extension = ltrim(strstr(basename($translationFile), '.'), '.');
            if ('en.xlf' === $extension) {
                continue;
            }
            $translatedKeys = getTranslationKeys($translationFile);
            $missingTranslationKeys = array_diff($referenceTranslation[$domain], $translatedKeys);
            if (!empty($missingTranslationKeys)) {
                $locale = substr($extension, 0, 2);
                $missingTranslations[$locale][$domain] = $missingTranslationKeys;
            }
        }
    }
Example #3
0
} else {
    if (isset($executeQuery)) {
        $bef = microtime();
        $qstate = nel_query($executeQuery, $updateResult);
        $aft = microtime();
        list($usec, $sec) = explode(" ", $bef);
        $bef = (double) $sec + (double) $usec;
        list($usec, $sec) = explode(" ", $aft);
        $aft = (double) $sec + (double) $usec;
        $tm = (int) (($aft - $bef) * 1000.0);
        $queryResult = "Executed {$executeQuery}<br>{$tm} milliseconds computation time<br>\n";
    }
}
if ($updateResult) {
    buildVariableEnv($uid, $gid, $tid, $vardisp, $bounds, $privilege, $tree, $condensed, $autoDisplay);
    displayResult($updateResult, $vardisp, $bounds, $privilege);
} else {
    // send select request
    if (count($sel) > 0) {
        $sel = array_unique($sel);
    }
    if (count($sel) == 1 && $sel[0] == "") {
        unset($sel);
    }
    $queryResult = displayViewTable($uid, $gid, $tid, $sel);
}
echo "<input type=hidden name='current_tid' value='{$tid}'>\n";
$i = 0;
if (count($sel) > 0) {
    foreach ($sel as $selec) {
        echo "<input type=hidden name='current_select_" . $i++ . "' value='{$selec}'>\n";
Example #4
0
    $getsearchword = $_POST["keyword"];
    if ($getsearchword == "") {
        foreach (range('a', 'z') as $letter) {
            $sort = TRUE;
            $results = $dal->get_models($letter, $sort);
            $totalResul = count($results);
            displayResult($results);
            if ($results >= 0) {
                break;
            }
        }
        // end foreach
    } else {
        $sort = FALSE;
        $results = $dal->get_models($getsearchword, $sort);
        displayResult($results);
    }
}
?>
                                                                                                                                                          
	<?php 
function displayResult($results)
{
    ?>

	<div id="intrates_div">                                      
	
	<table cellspacing="0" cellpadding="0" border="0" id="intrates">
			<?php 
    if ($results) {
        foreach ($results as $model) {
function outputResults($propertyResults)
{
    global $resultType;
    global $resultImage;
    global $resultPrice;
    global $resultPrice2;
    global $resultLocation;
    global $resultReference;
    global $resultDescription;
    global $resultBeds;
    global $resultBaths;
    global $resultTerrace;
    global $resultPlot;
    global $urlRewrite;
    global $searchResultType;
    global $rewritePatternUrl;
    global $queryInfo;
    global $built;
    global $languageArr;
    global $featureSearchArr;
    global $resultTypeVal;
    $_SESSION['isFSearch'] = 0;
    $resultText = '';
    if ($propertyResults !== NULL) {
        foreach ($propertyResults as $property) {
            if ($_SESSION["SearchType"] == 'Resale') {
                $resultPrice = (string) $property->Price;
                $resultPrice2 = '';
            } else {
                $resultPrice = (string) $property->RentalPrice1;
                $resultPrice2 = (string) $property->RentalPrice2;
            }
            $resultType = (string) $property->Type;
            $resultTypeVal = (string) $property->TypeVal;
            $resultImage = (string) $property->MainImage;
            $resultLocation = (string) $property->Location;
            $resultReference = (string) $property->Reference;
            $resultDescription = (string) $property->Description;
            $resultBeds = (string) $property->Bedrooms;
            $resultBaths = (string) $property->Bathrooms;
            $resultTerrace = (string) $property->Terrace;
            $resultPlot = (string) $property->GardenPlot;
            $built = (string) $property->Built;
            $area = (string) $property->Area;
            $arr = array();
            foreach ($property->PropertyFeatures as $feature) {
                foreach ($feature->Category as $item) {
                    $categoryName = (string) $item->attributes()->Name;
                    $categoryType = (string) $item->attributes()->Type;
                    $tmpArr = array();
                    foreach ($item->Feature as $data) {
                        $feValue = (string) $data->Value;
                        $feName = (string) $data->Name;
                        $tmpArr[$feValue] = array('CategoryType' => $categoryType, 'FeatureValue' => $feValue, 'FeatureName' => $feName);
                    }
                    $arr[$categoryName] = $tmpArr;
                }
            }
            $featureSearchArr = $arr;
            //Rewrite url with pattern config from roWebKit
            //option: beds, baths, type, location, refid, area, search_type, subtype
            $arrayTmp = array('beds' => $resultBeds, 'baths' => $resultBaths, 'location' => $resultLocation, 'refid' => $resultReference, 'search_type' => $_SESSION["SearchType"], 'type' => $resultType, 'area' => $area);
            $data = array();
            $patterns = explode("-", $rewritePatternUrl);
            foreach ($patterns as $item) {
                if ($item == 'type') {
                    if ($arrayTmp[$item] != '') {
                        $data[] = str_replace('-', ' ', $arrayTmp[$item]);
                    }
                } else {
                    if ($arrayTmp[$item] != '' && !in_array($item, array('refid', 'location', 'type', 'search_type', 'area', 'subtype'))) {
                        $data[] = $arrayTmp[$item] . $item;
                    } else {
                        $data[] = $arrayTmp[$item];
                    }
                }
            }
            $urlRewrite = implode('-', $data);
            $resultText .= displayResult();
        }
    } else {
        $resultText .= "<br /><br />" . $languageArr['results_Headings']['no_Result'];
    }
    echo $resultText;
    if ($propertyResults != NULL) {
        outputResultPagination($queryInfo);
    }
    createHiddenParam();
}
Example #6
0
function search()
{
    $requestURL = "http://sandbox.api.ebaycommercenetwork.com/publisher/3.0/rest/GeneralSearch?apiKey=78b0db8a-0ee1-4939-a2f9-d3cd95ec0fcc&trackingId=7000610&";
    if (isset($_GET["search"]) && isset($_GET["category"])) {
        $requestURL = $requestURL . 'categoryId=' . $_GET["category"] . '&keyword=' . urlencode($_GET["search"]) . '&numItems=20';
        if (strlen($_GET['search']) > 0) {
            $xmlstr = file_get_contents($requestURL);
            if (isset($xmlstr)) {
                $xmlData = new SimpleXMLElement($xmlstr);
                displayResult($xmlData);
            }
        }
    }
}
$result = mysql_query($sql);
if (!checkConn($db)) {
    echo 'Lost connection...please reconnect.';
    exit;
} else {
    //echo 'Connection established!';
    mysql_free_result($result);
    if (isset($_POST['query'])) {
        switch ($_POST['query']) {
            case "0":
                echo 'Please select a query from the dropdown box in the previous page.';
                exit;
                break;
            case "1":
                displayReport1("SELECT educal, count(id) FROM hpq_mem \n\t\t\t\t\t\tWHERE memno=1 AND jobind = 2 AND entrepind = 2 GROUP BY educal ORDER BY educal");
                break;
            case "2":
                displayReport2("SELECT count(id) FROM hpq_hh WHERE calam1 = 1 AND calam1_aid = 2 AND disas_prep = 2 UNION\n\t\t\t\t\t\tSELECT count(id) FROM hpq_hh WHERE calam2 = 1 AND calam2_aid = 2 AND disas_prep = 2 UNION\n\t\t\t\t\t\tSELECT count(id) FROM hpq_hh WHERE calam3 = 1 AND calam3_aid = 2 AND disas_prep = 2 UNION\n\t\t\t\t\t\tSELECT count(id) FROM hpq_hh WHERE calam4= 1 AND calam4_aid = 2 AND disas_prep = 2 UNION\n\t\t\t\t\t\tSELECT count(id) FROM hpq_hh WHERE calam5 = 1 AND calam5_aid = 2 AND disas_prep = 2 UNION\n\t\t\t\t\t\tSELECT count(id) FROM hpq_hh WHERE calam6 = 1 AND calam6_aid = 2 AND disas_prep = 2 UNION\n\t\t\t\t\t\tSELECT count(id) FROM hpq_hh WHERE calam7 = 1 AND calam7_aid = 2 AND disas_prep = 2 UNION\n\t\t\t\t\t\tSELECT count(id) FROM hpq_hh WHERE calam8 = 1 AND calam8_aid = 2 AND disas_prep = 2 UNION\n\t\t\t\t\t\tSELECT count(id) FROM hpq_hh WHERE calam9 = 1 AND calam9_aid = 2 AND disas_prep = 2 UNION\n\t\t\t\t\t\tSELECT count(id) FROM hpq_hh WHERE calam10 = 1 AND calam10_aid = 2 AND disas_prep = 2", "SELECT count(id) FROM hpq_hh \n\t\t\t\t\t\t\tWHERE calam11 = 1 AND calam11_aid = '2' AND disas_prep = 2");
                break;
        }
    } else {
        if (isset($_POST['queryenter'])) {
            if ($_POST['queryenter'] != '') {
                displayResult($_POST['queryenter']);
            } else {
                echo ' Please enter a valid query.';
                exit;
            }
        }
    }
}