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


PHP item::set_id方法代码示例

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


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

示例1: count

     $db->query($query);
     if ($db->next_record()) {
         alloc_redirect($TPL["url_alloc_item"] . "itemID=" . $db->f("itemID"));
     }
 } else {
     //open the index
     $index = new Zend_Search_Lucene(ATTACHMENTS_DIR . 'search/item');
     $query = Zend_Search_Lucene_Search_QueryParser::parse($needle);
     $hits = $index->find($needle);
     $TPL["index_count"] = $index->count();
     $TPL["hits_count"] = count($hits);
     $p =& get_cached_table("person");
     foreach ($hits as $hit) {
         $d = $hit->getDocument();
         $item = new item();
         $item->set_id($d->getFieldValue('id'));
         $item->select();
         $row = array();
         $row["idx"] = $hit->id;
         $author = $item->get_value("itemAuthor");
         $author and $author = " by " . $author;
         $row["title"] = $item->get_id() . " " . $item->get_link() . $author;
         $row["score"] = sprintf('%d%%', $hit->score * 100);
         $row["desc"] = page::htmlentities($d->getFieldValue('desc'));
         // get availability of loan
         $db2 = new db_alloc();
         $query = prepare("SELECT * FROM loan WHERE itemID = %d AND dateReturned='0000-00-00'", $item->get_id());
         $db2->query($query);
         if ($db2->next_record()) {
             $loan = new loan();
             $loan->read_db_record($db2);
开发者ID:cjbayliss,项目名称:alloc,代码行数:31,代码来源:search.php

示例2: meta

}
//so that the user can edit the item later
$TPL["personID"] = $current_user->get_id();
// item types
$itemType = new meta("itemType");
$TPL["itemTypes"] = page::select_options($itemType->get_assoc_array("itemTypeID", "itemTypeID"), $item->get_value("itemType"));
// setup item list (for removals)
$item_list = array();
$db = new db_alloc();
$db->query("SELECT * FROM item ORDER BY itemName");
while ($db->next_record()) {
    $item = new item();
    $item->read_db_record($db);
    $item_list[$item->get_id()] = $item->get_value('itemName');
}
$TPL["item_list"] = page::select_options($item_list, "");
if ($_POST["edit_items"]) {
    $item = new item();
    $item->set_id($_POST["itemID"][0]);
    $item->select();
    if (count($_POST["itemID"]) < 1) {
        alloc_error("You Must Select An Item");
    } else {
        if (count($_POST["itemID"]) > 1) {
            alloc_error("Can Only Edit 1 Item At A Time");
        }
        $TPL["edit_options"] = "<table><tr>\n" . "  <td>Name: </td>\n" . "  <td colspan=\"2\"><input size=\"40\" type=\"text\" name=\"update_itemName\" value=\"" . $item->get_value("itemName") . "\"></td>\n" . "</tr><tr>\n" . "  <td>Notes: </td>\n" . "  <td colspan=\"2\"><input size=\"40\" type=\"text\" name=\"update_itemNotes\" value=\"" . $item->get_value("itemNotes") . "\"></td>\n" . "</tr><tr>\n" . "  <td>Type: </td>\n" . "  <td><select name=\"update_itemType\" value=\"" . $item->get_value("itemType") . "\">" . page::select_options($itemType->get_assoc_array("itemTypeID", "itemTypeID"), $item->get_value("itemType")) . "       </select>" . "    <input type=\"hidden\" name=\"update_itemID\" value=\"" . $item->get_id() . "\"></td>" . "  <td align=\"right\">" . '    <button type="submit" name="update_item" value="1" class="save_button">Save Changes<i class="icon-ok-sign"></i></button>' . " </td>\n" . "</tr><td colspan=\"3\"><hr></td></tr>\n" . "</tr></table>\n";
    }
}
$TPL["main_alloc_title"] = "Edit Items - " . APPLICATION_NAME;
include_template("templates/addItemM.tpl");
开发者ID:cjbayliss,项目名称:alloc,代码行数:31,代码来源:addItem.php


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