當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Store::search方法代碼示例

本文整理匯總了PHP中Store::search方法的典型用法代碼示例。如果您正苦於以下問題:PHP Store::search方法的具體用法?PHP Store::search怎麽用?PHP Store::search使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Store的用法示例。


在下文中一共展示了Store::search方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: foreach

             $html .= "<tr>";
             $html .= "  <td><img src='" . $item->picture . "' height='40' width='40'/></td>";
             $html .= "  <td>" . $item->username . "</td>";
             $html .= "  <td>" . $item->get_full_name() . "</td>";
             $html .= "  <td><a class='btn btn-primary' href='updateuser.php?id=" . $item->id . "'>Update</a></td>";
             $html .= "  <td><button class='btn btn-danger btndelete'>Delete <span hidden>" . $item->id . "</span></button></td>";
             $html .= "</tr>";
         }
         $filename = 0;
         echo $html;
     } else {
         echo "no data";
     }
 } else {
     if ($_GET['itemtype'] == "store") {
         $items = Store::search($input);
         if (count($items) > 0) {
             foreach ($items as $item) {
                 $filename++;
                 $random = rand(0, 1);
                 file_put_contents("images/" . $filename . "x" . $random . ".jpg", base64_decode($item->picture));
                 $item->picture = HOST . "includes/webservices/images/" . $filename . "x" . $random . ".jpg";
                 $html .= "<tr>";
                 $html .= "  <td><img src='" . $item->picture . "' height='40' width='40'/></td>";
                 $html .= "  <td>" . $item->name . "</td>";
                 $html .= "  <td>" . $item->branchname . "</td>";
                 $html .= "  <td><a class='btn btn-primary' href='updatestore.php?id=" . $item->id . "'>Update</a></td>";
                 $html .= "  <td><button class='btn btn-danger btndelete'>Delete <span hidden>" . $item->id . "</span></button></td>";
                 $html .= "</tr>";
             }
             $filename = 0;
開發者ID:NemOry,項目名稱:EpicueWebPanel,代碼行數:31,代碼來源:gettable.php

示例2: json_encode

include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Store.php';
$action = "";
$store = new Store();
$response = array();
if (!empty($_GET['action'])) {
    $action = strip_tags($_GET['action']);
}
switch ($action) {
    case "login":
        $data = $store->login();
        break;
    case "logout":
        $data = $store->logout();
        break;
    case "add":
        $data = $store->add();
        break;
    case "delete":
        $data = $store->delete();
        break;
    case "edit":
        $data = $store->edit();
        break;
    case "search":
        $data = $store->search();
        break;
    default:
        $data = array('success' => false, 'data' => array(), 'error' => array('warning' => 'Invalid action'));
        break;
}
echo json_encode($data);
開發者ID:mayurtakawale88,項目名稱:store,代碼行數:31,代碼來源:index.php

示例3: array

            if ($_GET['itemtype'] == "product") {
                $products = Product::search($input);
            } else {
                if ($_GET['itemtype'] == "traffic") {
                    $traffics = Traffic::search($input);
                } else {
                    if ($_GET['itemtype'] == "review") {
                        $reviews = Review::search($input);
                    }
                }
            }
        }
    }
} else {
    $users = User::search($input);
    $stores = Store::search($input);
    $products = Product::search($input);
    $traffics = Traffic::search($input);
    $reviews = Review::search($input);
}
$tables = array();
if ($users != null) {
    $table = new Table("users", $users);
    array_push($tables, $table);
}
if ($stores != null) {
    $table = new Table("stores", $stores);
    array_push($tables, $table);
}
if ($products != null) {
    $table = new Table("products", $products);
開發者ID:NemOry,項目名稱:EpicueWebPanel,代碼行數:31,代碼來源:search.php


注:本文中的Store::search方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。