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


PHP utility::item_load_by_id方法代码示例

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


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

示例1: simbio_dbop

    $sql_op = new simbio_dbop($dbs);
    // check if the item still on loan
    $loan_q = $dbs->query('SELECT DISTINCT l.item_code, b.title FROM loan AS l
    LEFT JOIN item AS i ON l.item_code=i.item_code
    LEFT JOIN biblio AS b ON i.biblio_id=b.biblio_id
    WHERE i.item_id=' . $id . ' AND l.is_lent=1 AND l.is_return=0');
    $loan_d = $loan_q->fetch_row();
    // send an alert if the member cant be deleted
    if ($loan_q->num_rows > 0) {
        echo '<script type="text/javascript">';
        echo 'alert(\'' . __('Item data can not be deleted because still on hold by members') . '\');';
        echo 'self.location.href = \'iframe_item_list.php?biblioID=' . $bid . '\';';
        echo '</script>';
    } else {
        $collection = utility::collection_load($dbs, $bid);
        $item = utility::item_load_by_id($dbs, $id);
        if ($sql_op->delete('item', 'item_id=' . $id)) {
            utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'bibliography', $_SESSION['realname'] . ' DELETE item data (' . $item['item_code'] . ') with title (' . $collection['title'] . ')');
            echo '<script type="text/javascript">';
            echo 'alert(\'' . __('Item succesfully removed!') . '\');';
            echo 'self.location.href = \'iframe_item_list.php?biblioID=' . $bid . '\';';
            echo '</script>';
        } else {
            echo '<script type="text/javascript">';
            echo 'alert(\'' . __('Item FAILED to removed!') . '\');';
            echo 'self.location.href = \'iframe_item_list.php?biblioID=' . $bid . '\';';
            echo '</script>';
        }
    }
}
// if biblio ID is set
开发者ID:kailIII,项目名称:slims7_cendana,代码行数:31,代码来源:iframe_item_list.php


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