当前位置: 首页>>代码示例>>PHP>>正文


PHP Item::search方法代码示例

本文整理汇总了PHP中Item::search方法的典型用法代码示例。如果您正苦于以下问题:PHP Item::search方法的具体用法?PHP Item::search怎么用?PHP Item::search使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Item的用法示例。


在下文中一共展示了Item::search方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: search

 public static function search($values = array())
 {
     $result1 = DB::getInstance()->search("category", $values);
     if (count($result1) != 0) {
         $category_data = array("cat_name" => $result1[0]["category_name"], "cat_label" => $result1[0]["category_no"]);
         $new_category = new Category();
         $new_category->set_name($result1[0]["category_name"]);
         $new_category->set_label($result1[0]["category_no"]);
         $itemList = DB::getInstance()->search("item_category", array("category_id" => $result1[0]["category_id"]));
         foreach ($itemList as $item) {
             $new_category->addItem(Item::search(array("item_id" => $item["item_id"])));
         }
         return $new_category;
     } else {
         return null;
     }
 }
开发者ID:NalindaHemanga,项目名称:ELMS,代码行数:17,代码来源:Category.php

示例2: update_item_copy_no

 public function update_item_copy_no($new_num)
 {
     if ($this->no == $new_num) {
         return true;
     } else {
         $parent_item_id = $this->item_id;
         $item_copy_id = $this->id;
         $parent_item = Item::search(array("item_id" => $parent_item_id));
         $copies = $parent_item->get_copies();
         foreach ($copies as $itemCopy) {
             if ($itemCopy->get_no() == $new_num) {
                 return false;
             }
         }
         $sql = "UPDATE  `item_copy` SET  `item_copy_no` =  '{$new_num}' WHERE  `item_copy`.`item_copy_id` ={$item_copy_id};";
         DB::getInstance()->directUpdate($sql);
         echo $sql;
         return true;
     }
 }
开发者ID:NalindaHemanga,项目名称:ELMS,代码行数:20,代码来源:ItemCopy.php

示例3: array

<?php

namespace tatt;
require_once 'tatt/webcommon.php';

//This file allows for searching, and dynamically populates a table based on a search query.

//XXX: Do we want users to be logged in for searching?
//Eric: Eventually, yes
$auth->require_login();

$valid_search_term = false;
if(!(isset($_GET['search']) && $_GET['search'] != "" ) ) {
	//TODO only display search box
}
else {
	$valid_search_term = true;
	$items = Item::search($_GET['search']);
		$items_array = array();
	foreach($items as $item) {
		$items_array[] = $item->to_array();
	}

	$page->assign('items', $items_array);
}
	$page->assign('valid_search_term', $valid_search_term);
	$page->assign('page_title', 'Search Result');
	$page->display('search.tpl');
开发者ID:nicktabick,项目名称:tatt,代码行数:28,代码来源:search.php

示例4:

<?php

require 'core/init.php';
$item_id = $_GET["item_id"];
$cat_label = $_GET["cat_label"];
if (isset($item_id)) {
    $item = Item::search(array("item_id" => $item_id));
}
$itemName = $item->get_name();
$copies = $item->get_copies();
$itemDescription = $item->get_description();
$itemTechDetails = $item->get_technical_details();
$itemReference = $item->get_reference();
$itemType = $item->get_type();
//echo $itemType;
//print_r($item);
$itemPic = $itemName;
$ItemNameReplaced = str_replace(" ", "%19", $itemName);
$itemPic2 = $ItemNameReplaced;
echo "<div style=\"font-family: Georgia, serif;font-size:25px;\"><div style=\"font-size:25px; float:left;\" id=\"ItemName1\">{$itemName}</div>\n\t<div style=\"float:right;\">\n\t\n\t</div>\n\t<br>\n\t\t<ul><li> <div style=\"font-size:20px;\">Description</div><div style=\"font-size:15px;\" id=\"ItemDesc1\">{$itemDescription}</div> </li><br>\n\t\t<li> <div style=\"font-size:20px;\">Technical Details</div><div style=\"font-size:15px;\" id=\"ItemTechDet1\">{$itemTechDetails}</div> </li>\n\t\t<li> <div><img id=\"item_pic\" src=\"img/items/{$itemPic}.png\" height=\"195\" width=\"185\" style=\"border:1px solid #ccc;padding:22px\" /></div> </li>\n\n\t\t<li> <div style=\"font-size:20px;\">Reference</div>";
echo "<div id=\"refLinks\">";
foreach ($itemReference as $link) {
    echo "<div style=\"font-size:15px;\"><a href=\"{$link}\" target=\"_blank\">{$link}</a></div> ";
}
echo "</div></li>";
echo "</ul></div>";
开发者ID:NalindaHemanga,项目名称:ELMS,代码行数:26,代码来源:getItemDetailsRestricted.php

示例5: crypt

<?php 
require_once 'core/init.php';
$password = "nalinda";
$hash = crypt($password);
$io = Member::search(["member_nic" => "931390473"]);
print_r($io);
///echo $hash;
if (password_verify("nalinda", $hash)) {
    //echo strlen($hash);
} else {
    echo "invalid";
}
echo "test";
//echo date_format(date_add(DateTime::createFromFormat('d/m/Y', date("d/m/Y")),date_interval_create_from_date_string("5 years")),"d/m/Y");
echo date("d/m/Y");
$a = Item::search(["item_id" => 2]);
print_r($a);
$sql = "UPDATE item_copy SET item_copy_status=1;";
DB::getInstance()->directUpdate($sql);
$data = array("id" => null, "purpose" => "sdasd", "comment" => "asdsdf", "member_id" => 16);
$salt = '5&JDDlwz%Rwh!t2Yg-Igae@QxPzFTSId';
$enc_pass = md5($salt . 'admin');
echo "paswowkjhkfjw";
DB::getInstance()->directUpdate("UPDATE member SET member_password='{$enc_pass}' WHERE member_nic='000000000';");
$t = new Transaction();
$t->create($data);
$t->add();
print_r(DB::getInstance()->search("schedule", ["semester_no" => 2]));
print_r(Schedule::search(["semester_no" => 2]));
echo isset($_SESSION["basket"]);
?>
开发者ID:NalindaHemanga,项目名称:ELMS,代码行数:31,代码来源:test.php

示例6: header

$member_role = $_SESSION['roles'];
if (in_array("Laboratory Administrator", $member_role) || in_array("Related Lecturer", $member_role)) {
} else {
    header('location:restricted_page.php');
}
if (count($_POST) > 0) {
    //print_r($_POST);
    if (isset($_POST["reference"])) {
        $item_data = array("item_id" => $_POST["item_id"], "item_name" => $_POST["item_name"], "item_type" => $_POST["item_type"], "item_technical_details" => $_POST["item_tec_desc"], "item_description" => $_POST["item_desc"]);
    } else {
        $item_data = array("item_id" => $_POST["item_id"], "item_name" => $_POST["item_name"], "item_type" => $_POST["item_type"], "item_technical_details" => $_POST["item_tec_desc"], "item_description" => $_POST["item_desc"]);
    }
    //echo $_POST["itemTechDetEdit"];
    $temp_path = $_FILES["item_picture"]["tmp_name"];
    $img_type = pathinfo($_FILES["item_picture"]["name"], PATHINFO_EXTENSION);
    move_uploaded_file($temp_path, "img/items/" . $_POST["item_name"] . "." . "png");
    //$_SESSION['form_data'] = $item_data;
    $_SESSION['form_data'] = $item_data;
    //header("Location: item_add.php",true,303);
    //die();
    //print_r($item_data);
    $item_to_edit = Item::search(array("item_id" => $_POST["item_id"]));
    if ($item_to_edit->editItem($_SESSION['form_data'])) {
        $message = "You have successfully updated the item !!";
        echo $message;
    } else {
        $message = "The Item update was unsuccessful.";
        echo $message;
    }
    unset($_SESSION["form_data"]);
}
开发者ID:NalindaHemanga,项目名称:ELMS,代码行数:31,代码来源:item_edit.php

示例7: query

 public function query()
 {
     $item = new Item($this->db);
     $loaditems = $item->search($this->f3->get('PARAMS.query'), $this->f3->get('searchlimit'));
     //template
     $this->f3->set('view', 'item/list.htm');
     $this->f3->set('items', $loaditems);
     $this->f3->set('q', $this->f3->get('PARAMS.query'));
     //breadcrumbs
     $this->f3->set('breadcrumb', array(array("url" => NULL, "name" => "Search")));
     $this->f3->set('header', $this->f3->get('PARAMS.query'));
 }
开发者ID:Mumcio,项目名称:bookmark-manager,代码行数:12,代码来源:ItemController.php

示例8: Item

<?php

/**
 * Created by PhpStorm.
 * User: samuel
 * Date: 3/19/2016
 * Time: 1:25 AM
 */
include_once 'Item.php';
//include_once 'Admin.php';
include_once 'render_config.php';
session_start();
//$_SESSION['logged-in'] = false;
$item = new Item();
if (isset($_GET['search'])) {
    $search = $_GET['search'];
    $skirts = $item->search($search);
    $as = $skirts->fetch_all(MYSQLI_ASSOC);
    $allSkirts['skirts'] = $as;
    echo $twig->render('index.twig', ['skirts' => $as]);
} else {
    header('Location: index.php');
}
开发者ID:samuelagyemang2012,项目名称:FinalProjet,代码行数:23,代码来源:search.php

示例9: foreach

<?php 
require 'core/init.php';
if (array_key_exists("item_id", $_GET)) {
    $value = $_GET["item_id"];
    $item = Item::search(array("item_id" => $value));
    $itemName = $item->get_name();
    $copies = $item->get_copies();
    if (count($copies) > 0) {
        echo "<ul>";
        foreach ($copies as $itemCopy) {
            $itemCopyId = $itemCopy->get_id();
            $itemCopyNo = $itemCopy->get_no();
            $itemCopyStatus = $itemCopy->get_status();
            $itemCopyCondition = $itemCopy->get_condition();
            $itemName = $itemCopy->get_item_name();
            //$GLOBALS[$itemCopyNo]="";
            //unset($GLOBALS[$itemCopyNo]);
            if (!in_array($itemCopyNo, $_SESSION["items"]) && $itemCopyStatus == 1) {
                $bgcolour = "#B3F5C2";
                $draggable = "true";
                $status = "Available";
                $type = "button";
            } else {
                $bgcolour = "#F23400";
                $draggable = "false";
                $status = "Not Available";
                $type = "hidden";
            }
            echo "<li class='node'><div id='" . $itemCopyNo . "' draggable=" . $draggable . " ondragstart=\"drag(event);\" style='border:1px solid #000000;padding:10px;background:" . $bgcolour . ";margin-right:30px;margin-top:5px;margin-left:30px'><img src='img/items/" . $itemName . ".png' height='80' width='80' align='left'/><b> Item Copy Name : </b>{$itemName}<br/><b> Item Copy No : </b>{$itemCopyNo}<br/><b> Condition : </b>{$itemCopyCondition}<br/><b>Status : </b>{$status}<br/><input type='" . $type . "' id='" . $itemCopyNo . "' value='Add to Basket' onclick='addToBasket(this.id);'/></div></li>";
        }
开发者ID:NalindaHemanga,项目名称:ELMS,代码行数:30,代码来源:getItemDetailsIssue.php


注:本文中的Item::search方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。