コード例 #1
0
ファイル: dbUtil.php プロジェクト: sleepyycat/WebFramework
function dbUtil()
{
    reset_db_result();
    $args_arr = func_get_args();
    $type = $args_arr[0];
    try {
        $mongo = new MongoClient('mongodb://nb403:27127/admin:admin');
        $db = $mongo->svnCodeComment;
        if ($type == GetProductList) {
            return getProductList($db);
        } elseif ($type == GetVersionList) {
            $prodName = $args_arr[1];
            return getVersionList($db, $prodName);
        } elseif ($type == CodeSearch) {
            list($prodName, $version, $keyword) = array_slice($args_arr, 1);
            return codeSearch($db, $prodName, $version, $keyword);
        } elseif ($type == CodeSearchDetail) {
            list($prodName, $id) = array_slice($args_arr, 1);
            return codeSearchDetail($db, $prodName, $id);
        } elseif ($type == AddCodeInfo) {
            list($codeSvnPathWithVersion, $version, $prodName, $creator, $diskPath) = array_slice($args_arr, 1);
            return addCodeInfo($db, $codeSvnPathWithVersion, $version, $prodName, $creator, $diskPath);
        } elseif ($type == GetCommentorList) {
            $prodName = $args_arr[1];
            return getCommentorList($db, $prodName);
        } elseif ($type == GetCreator) {
            list($prodName, $version) = array_slice($args_arr, 1);
            return getCreator($db, $prodName, $version);
        } elseif ($type == GetCodeDiskPath) {
            list($prodName, $version) = array_slice($args_arr, 1);
            return getCodeDiskPath($db, $prodName, $version);
        } elseif ($type == GetCodeInfo) {
            list($prodName, $version) = array_slice($args_arr, 1);
            return getCodeInfo($db, $prodName, $version);
        } elseif ($type == GetProdNameMap) {
            return getProdNameMap($db);
        } elseif ($type == SetProdNameMap) {
            list($prodName, $tableName) = array_slice($args_arr, 1);
            return setProdNameMap($db, $prodName, $tableName);
        }
    } catch (MongoConnectionException $e) {
        set_db_result("1", $e->getMessage());
    }
}
コード例 #2
0
ファイル: 3citybox.php プロジェクト: dakusinio/Sale
<?php

include '../api/getProductForPresentation.php';
if ($_GET['kind_name'] === null) {
    $products === null;
} else {
    $kind_name = $_GET['kind_name'];
    $products = getProductList($kind_name);
}
?>

<!doctype html>
<html lang="pl" ng-app="presentation">
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title>3CityBox</title>
    <link rel="stylesheet" href="../bower_components/bootstrap/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="../bower_components/Bootflat/bootflat/css/bootflat.min.css">
    <link rel="stylesheet" href="style.css">
    <script src="../bower_components/angular/angular.min.js"></script>

    <script src="../bower_components/jquery/dist/jquery.min.js"></script>
    <script src="../bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
</head>

<body  ng-controller="PresentationCtrl">
<nav style="border-radius: 0px; background-color: #4FC1E9; border-color:#4FC1E9; " class="navbar navbar-default">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
コード例 #3
0
<?php

include_once 'functions.php';
require $this->template_path . 'config.php';
?>
<section class="site_body">
<?php 
$highest_bidder = getTopBidder();
$totalproduct = getTotalProduct();
if ($totalproduct > 0) {
    $product = getProductList();
    for ($i = 0; $i < $totalproduct; $i++) {
        $pro_id = $product[$i]["pid"];
        $pro_brand = $product[$i]["brand"];
        $pro_model = $product[$i]["model"];
        $pro_mprice = $product[$i]["mprice"];
        $pro_aprice = $product[$i]["aprice"];
        //		$pro_category =$product[$i]["category"];
        //		$pro_availability = $product[$i]["availability"];
        //		$pro_description = $product[$i]["description"];
        $pro_bid = $product[$i]["bid"];
        //		$pro_astart = $product[$i]["astart"];
        $pro_aend = $product[$i]["aend"];
        $auctiontime = $pro_aend - time();
        if ($pro_bid <= 200) {
            $tokenneed = 1;
        }
        if ($pro_bid <= 400 && $pro_bid > 200) {
            $tokenneed = 2;
        }
        if ($pro_bid <= 600 && $pro_bid > 400) {
コード例 #4
0
include_once 'functions.php';
require $this->template_path . 'config.php';
?>
<div id="wrapper">
    <section id="content_container">
		<section class="site_body">
		<?php 
$top_bidder = getTopBidder();
if (isset($_GET['search'])) {
    $search_terms = trim($_GET['search']);
    if (strlen($search_terms) < 3) {
        echo "Search terms must be longer than 3 characters.";
    } else {
        $totalproduct = searchTotalProduct($search_terms);
        $searchproduct = getProductList($search_terms);
        if ($totalproduct > 0) {
            for ($i = 0; $i < $totalproduct; $i++) {
                $productID = $searchproduct[$i]["pid"];
                $Brand = $searchproduct[$i]["brand"];
                $Model = $searchproduct[$i]["model"];
                $Marketprice = $searchproduct[$i]["mprice"];
                $Auctionprice = $searchproduct[$i]["aprice"];
                $auctionend = $searchproduct[$i]["aend"];
                $auctiontime = $auctionend - time();
                $token_needed = $searchproduct[$i]["bid"];
                if ($token_needed <= 200) {
                    $tokenneed = 1;
                }
                if ($token_needed <= 400 && $token_needed > 200) {
                    $tokenneed = 2;