本文整理匯總了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