コード例 #1
0
<?php

include_once "./commonlib.php";
$conn = getConnection("ibabymall");
$word = $_GET['name'] ? $_GET['name'] : "";
$showpage = (int) $_GET['page'] ? (int) $_GET['page'] : 1;
$total = getProductTotalBySearch($conn, $word);
$each_page_count = 50;
$page_max = ceil($total / $each_page_count);
$showpage = max(1, min($showpage, $page_max));
$start = ($showpage - 1) * $each_page_count;
$ary = getProductListBySearch($conn, $word, $start, $each_page_count);
$result = [];
for ($i = 0; $i < sizeof($ary); $i++) {
    $result['items'][$i]["url"] = $ary[$i]["url"];
    $result['items'][$i]["photo"] = $ary[$i]["photo"];
    $result['items'][$i]["title"] = $ary[$i]["title"];
    $result['items'][$i]["recommend_price"] = $ary[$i]["recommend_price"];
    $result['items'][$i]["current_price"] = $ary[$i]["current_price"];
}
$result['data']['total'] = $total;
echo json_encode($result);
コード例 #2
0
<?php

include_once "./header.php";
include_once "./commonlib.php";
?>

<?php 
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $people = $_POST["people"];
    $age = $_POST["age"];
    $conn = getConnection("ibabymall");
    $ary = getProductListBySearch2($conn, $people, $age, 0, 50);
    $ary1 = getProductListBySearch($conn, $people, 0, 10);
    $ary2 = getProductListBySearch($conn, $age, 0, 10);
    $count1 = getProductCountBySearch($conn, $people);
    $count2 = getProductCountBySearch($conn, $age);
} else {
    $ary = array();
}
$myquery = "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>PREFIX owl: <http://www.w3.org/2002/07/owl#>PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>PREFIX db: <http://db#> SELECT ?about WHERE ";
$queryErr = "";
?>

<div class="container">
    <blockquote>
        <h1>Demo Page</h1>
        <footer>Show the difference between our powerful Ontology and original query.</footer>
    </blockquote>
    <br>

    <div class="panel panel-primary">