本文整理汇总了PHP中simbio_dbop::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP simbio_dbop::delete方法的具体用法?PHP simbio_dbop::delete怎么用?PHP simbio_dbop::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类simbio_dbop
的用法示例。
在下文中一共展示了simbio_dbop::delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
if (isset($_POST['itemID']) and !empty($_POST['itemID']) and isset($_POST['itemAction'])) {
if (!($can_read and $can_write)) {
die;
}
/* DATA DELETION PROCESS */
$sql_op = new simbio_dbop($dbs);
$failed_array = array();
$error_num = 0;
if (!is_array($_POST['itemID'])) {
// make an array
$_POST['itemID'] = array((int) $_POST['itemID']);
}
// loop array
foreach ($_POST['itemID'] as $itemID) {
$itemID = (int) $itemID;
if (!$sql_op->delete('mst_' . $type . '_type', 'id=' . $itemID)) {
$error_num++;
}
}
// error alerting
if ($error_num == 0) {
utility::jsAlert(__('All Data Successfully Deleted'));
echo '<script type="text/javascript">parent.jQuery(\'#mainContent\').simbioAJAX(\'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\');</script>';
} else {
utility::jsAlert(__('Some or All Data NOT deleted successfully!\\nPlease contact system administrator'));
echo '<script type="text/javascript">parent.jQuery(\'#mainContent\').simbioAJAX(\'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\');</script>';
}
exit;
}
}
/* RECORD OPERATION END */
示例2: array
if (!($can_read and $can_write)) {
die;
}
/* DATA DELETION PROCESS */
// create sql op object
$sql_op = new simbio_dbop($dbs);
$failed_array = array();
$error_num = 0;
if (!is_array($_POST['itemID'])) {
// make an array
$_POST['itemID'] = array((int) $_POST['itemID']);
}
// loop array
foreach ($_POST['itemID'] as $itemID) {
$itemID = (int) $itemID;
if (!$sql_op->delete('mst_topic', 'topic_id=' . $itemID)) {
$error_num++;
}
}
// error alerting
if ($error_num == 0) {
utility::jsAlert(__('All Data Successfully Deleted'));
echo '<script type="text/javascript">parent.jQuery(\'#mainContent\').simbioAJAX(\'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\');</script>';
} else {
utility::jsAlert(__('Some or All Data NOT deleted successfully!\\nPlease contact system administrator'));
echo '<script type="text/javascript">parent.jQuery(\'#mainContent\').simbioAJAX(\'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\');</script>';
}
exit;
}
}
/* RECORD OPERATION END */
示例3: unset
<?php
/* main content */
// topic of removal
if (isset($_GET['removesess'])) {
$idx = $_GET['removesess'];
unset($_SESSION['biblioTopic'][$idx]);
echo '<script type="text/javascript">';
echo 'alert(\'Topic removed!\');';
echo 'location.href = \'iframe_topic.php\';';
echo '</script>';
}
if (isset($_POST['remove'])) {
$id = (int) $_POST['remove'];
$bid = (int) $_POST['bid'];
$sql_op = new simbio_dbop($dbs);
$sql_op->delete('biblio_topic', 'topic_id=' . $id . ' AND biblio_id=' . $bid);
echo '<script type="text/javascript">';
echo 'alert(\'Topic succesfully removed!\');';
echo 'location.href = \'iframe_topic.php?biblioID=' . $bid . '\';';
echo '</script>';
}
// if biblio ID is set
if ($biblioID) {
$table = new simbio_table();
$table->table_attr = 'align="center" style="width: 100%;" cellpadding="2" cellspacing="0"';
// database list
$biblio_topic_q = $dbs->query("SELECT bt.*, t.topic, t.topic_type FROM biblio_topic AS bt\n LEFT JOIN mst_topic AS t ON bt.topic_id=t.topic_id\n WHERE bt.biblio_id={$biblioID} ORDER BY level ASC");
$row = 1;
while ($biblio_topic_d = $biblio_topic_q->fetch_assoc()) {
// alternate the row color
$row_class = $row % 2 == 0 ? 'alterCell' : 'alterCell2';
示例4: array
if (isset($_POST['itemID']) and !empty($_POST['itemID']) and isset($_POST['itemAction'])) {
if (!($can_read and $can_write)) {
die;
}
/* DATA DELETION PROCESS */
$sql_op = new simbio_dbop($dbs);
$failed_array = array();
$error_num = 0;
if (!is_array($_POST['itemID'])) {
// make an array
$_POST['itemID'] = array($dbs->escape_string(trim($_POST['itemID'])));
}
// loop array
foreach ($_POST['itemID'] as $itemID) {
$itemID = $dbs->escape_string(trim($itemID));
if (!$sql_op->delete('mst_item_status', "item_status_id='{$itemID}'")) {
$error_num++;
}
}
// error alerting
if ($error_num == 0) {
utility::jsAlert(__('All Data Successfully Deleted'));
echo '<script type="text/javascript">parent.setContent(\'mainContent\', \'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\', \'post\');</script>';
} else {
utility::jsAlert(__('Some or All Data NOT deleted successfully!\\nPlease contact system administrator'));
echo '<script type="text/javascript">parent.setContent(\'mainContent\', \'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\', \'post\');</script>';
}
exit;
}
}
/* item status update process end */
示例5: array
}
/* DATA DELETION PROCESS */
$sql_op = new simbio_dbop($dbs);
$failed_array = array();
$error_num = 0;
if (!is_array($_POST['itemID'])) {
// make an array
$_POST['itemID'] = array((int) $_POST['itemID']);
}
// loop array
foreach ($_POST['itemID'] as $itemID) {
$itemID = (int) $itemID;
// get content data
$content_q = $dbs->query('SELECT content_title FROM content WHERE content_id=' . $itemID);
$content_d = $content_q->fetch_row();
if (!$sql_op->delete('content', "content_id='{$itemID}'")) {
$error_num++;
} else {
// write log
utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'system', $_SESSION['realname'] . ' DELETE content (' . $content_d[0] . ')');
}
}
// error alerting
if ($error_num == 0) {
utility::jsAlert(__('All Data Successfully Deleted'));
echo '<script type="text/javascript">parent.setContent(\'mainContent\', \'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\', \'post\');</script>';
} else {
utility::jsAlert(__('Some or All Data NOT deleted successfully!\\nPlease contact system administrator'));
echo '<script type="text/javascript">parent.setContent(\'mainContent\', \'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\', \'post\');</script>';
}
exit;
示例6: array
if (!($can_read and $can_write)) {
die;
}
/* DATA DELETION PROCESS */
// create sql op object
$sql_op = new simbio_dbop($dbs);
$failed_array = array();
$error_num = 0;
if (!is_array($_POST['itemID'])) {
// make an array
$_POST['itemID'] = array((int) $_POST['itemID']);
}
// loop array
foreach ($_POST['itemID'] as $itemID) {
$itemID = (int) $itemID;
if (!$sql_op->delete('mst_loan_rules', 'loan_rules_id=' . $itemID)) {
$error_num++;
}
}
// error alerting
if ($error_num == 0) {
utility::jsAlert(__('All Data Successfully Deleted'));
echo '<script language="Javascript">parent.setContent(\'mainContent\', \'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\', \'post\');</script>';
} else {
utility::jsAlert(__('Some or All Data NOT deleted successfully!\\nPlease contact system administrator'));
echo '<script language="Javascript">parent.setContent(\'mainContent\', \'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\', \'post\');</script>';
}
exit;
}
}
/* RECORD OPERATION END */
示例7: array
if (isset($_POST['itemID']) and !empty($_POST['itemID']) and isset($_POST['itemAction'])) {
if (!($can_read and $can_write)) {
die;
}
/* DATA DELETION PROCESS */
$sql_op = new simbio_dbop($dbs);
$failed_array = array();
$error_num = 0;
if (!is_array($_POST['itemID'])) {
// make an array
$_POST['itemID'] = array($dbs->escape_string(trim($_POST['itemID'])));
}
// loop array
foreach ($_POST['itemID'] as $itemID) {
$itemID = $dbs->escape_string(trim($itemID));
if (!$sql_op->delete('mst_language', "language_id='{$itemID}'")) {
$error_num++;
}
}
// error alerting
if ($error_num == 0) {
utility::jsAlert(__('All Data Successfully Deleted'));
echo '<script type="text/javascript">parent.setContent(\'mainContent\', \'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\', \'post\');</script>';
} else {
utility::jsAlert(__('Some or All Data NOT deleted successfully!\\nPlease contact system administrator'));
echo '<script type="text/javascript">parent.setContent(\'mainContent\', \'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\', \'post\');</script>';
}
exit;
}
}
/* language_name update process end */
示例8:
$bid = (int) $_POST['bid'];
$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(\'' . lang_mod_biblio_item_alert_delete_fail_on_loan . '\');';
echo 'self.location.href = \'iframe_item_list.php?biblioID=' . $bid . '\';';
echo '</script>';
} else {
if ($sql_op->delete('item', 'item_id=' . $id)) {
echo '<script type="text/javascript">';
echo 'alert(\'' . lang_mod_biblio_item_alert_remove_success . '\');';
echo 'self.location.href = \'iframe_item_list.php?biblioID=' . $bid . '\';';
echo '</script>';
} else {
echo '<script type="text/javascript">';
echo 'alert(\'' . lang_mod_biblio_item_alert_remove_failed . '\');';
echo 'self.location.href = \'iframe_item_list.php?biblioID=' . $bid . '\';';
echo '</script>';
}
}
}
// if biblio ID is set
if ($biblioID) {
$table = new simbio_table();
示例9: array
if (!is_array($_POST['itemID'])) {
// make an array
$_POST['itemID'] = array((int) $_POST['itemID']);
}
// loop array
foreach ($_POST['itemID'] as $itemID) {
$itemID = (int) $itemID;
// check if the item still on loan
$loan_q = $dbs->query('SELECT i.item_code, b.title, COUNT(l.loan_id) FROM item AS i
LEFT JOIN biblio AS b ON i.biblio_id=b.biblio_id
LEFT JOIN loan AS l ON (i.item_code=l.item_code AND l.is_lent=1 AND l.is_return=0)
WHERE i.item_id=' . $itemID . ' GROUP BY i.item_code');
$loan_d = $loan_q->fetch_row();
// if there is no loan
if ($loan_d[2] < 1) {
if (!$sql_op->delete('item', 'item_id=' . $itemID)) {
$error_num++;
} else {
// write log
utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'bibliography', $_SESSION['realname'] . ' DELETE item data (' . $loan_d[0] . ') with title (' . $loan_d[1] . ')');
}
} else {
$still_on_loan[] = $loan_d[0] . ' - ' . $loan_d[1];
$error_num++;
}
}
if ($still_on_loan) {
$items = '';
foreach ($still_on_loan as $item) {
$items .= $item . "\n";
}
示例10: array
/* DATA DELETION PROCESS */
$sql_op = new simbio_dbop($dbs);
$failed_array = array();
$error_num = 0;
if (!is_array($_POST['itemID'])) {
// make an array
$_POST['itemID'] = array((int) $_POST['itemID']);
}
// get biblio ID for this subcription
$biblio_q = $dbs->query('SELECT biblio_id FROM serial WHERE serial_id=' . (isset($_POST['itemID'][0]) ? $_POST['itemID'][0] : '0') . ' LIMIT 1');
$biblio_d = $biblio_q->fetch_row();
$biblioID = $biblio_d[0];
// loop array
foreach ($_POST['itemID'] as $itemID) {
$itemID = (int) $itemID;
if (!$sql_op->delete('serial', 'serial_id=' . $itemID)) {
$error_num++;
} else {
// also delete kardex data
$sql_op->delete('kardex', 'serial_id=' . $itemID);
}
}
// error alerting
if ($error_num == 0) {
utility::jsAlert(__('Subscription data successfully deleted'));
} else {
utility::jsAlert(__('Subscription data FAILED to deleted!'));
}
}
}
/* RECORD OPERATION END */
示例11: array
if (isset($_POST['itemID']) and !empty($_POST['itemID']) and isset($_POST['itemAction'])) {
if (!($can_read and $can_write)) {
die;
}
/* DATA DELETION PROCESS */
$sql_op = new simbio_dbop($dbs);
$failed_array = array();
$error_num = 0;
if (!is_array($_POST['itemID'])) {
// make an array
$_POST['itemID'] = array((int) $_POST['itemID']);
}
// loop array
foreach ($_POST['itemID'] as $itemID) {
$itemID = (int) $itemID;
if (!$sql_op->delete('mst_member_type', 'member_type_id=' . $itemID)) {
$error_num++;
}
}
// error alerting
if ($error_num == 0) {
utility::jsAlert(__('All Data Successfully Deleted'));
echo '<script type="text/javascript">parent.$(\'#mainContent\').simbioAJAX(\'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\');</script>';
} else {
utility::jsAlert(__('Some or All Data NOT deleted successfully!\\nPlease contact system administrator'));
echo '<script type="text/javascript">parent.$(\'#mainContent\').simbioAJAX(\'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\');</script>';
}
exit;
}
}
/* RECORD OPERATION END */
示例12: array
$failed_array = array();
$error_num = 0;
if (!is_array($_POST['itemID'])) {
// make an array
$_POST['itemID'] = array($dbs->escape_string(trim($_POST['itemID'])));
}
// loop array
foreach ($_POST['itemID'] as $itemID) {
$itemID = $dbs->escape_string(trim($itemID));
// check if this item data still have an item
$item_q = $dbs->query('SELECT loc.location_name, COUNT(item_id) FROM item AS i
LEFT JOIN mst_location AS loc ON i.location_id=loc.location_id
WHERE i.location_id=\'' . $itemID . '\' GROUP BY i.location_id');
$item_d = $item_q->fetch_row();
if ($item_d[1] < 1) {
if (!$sql_op->delete('mst_location', "location_id='{$itemID}'")) {
$error_num++;
}
} else {
$msg = str_replace('{item_name}', $item_d[0], __('Location ({item_name}) still used by {number_items} item(s)'));
//mfc
$msg = str_replace('{number_items}', $item_d[1], $msg);
$still_have_item[] = $msg;
$error_num++;
}
}
if ($still_have_item) {
$undeleted_locations = '';
foreach ($still_have_item as $location) {
$undeleted_locations .= $location . "\n";
}
示例13: array
$failed_array = array();
$error_num = 0;
if (!is_array($_POST['itemID'])) {
// make an array
$_POST['itemID'] = array((int) $_POST['itemID']);
}
// loop array
foreach ($_POST['itemID'] as $itemID) {
$itemID = (int) $itemID;
// check if this item data still have an item
$item_q = $dbs->query('SELECT ct.coll_type_name, COUNT(item_id) FROM item AS i
LEFT JOIN mst_coll_type AS ct ON i.coll_type_id=ct.coll_type_id
WHERE i.coll_type_id=' . $itemID . ' GROUP BY i.coll_type_id');
$item_d = $item_q->fetch_row();
if ($item_d[1] < 1) {
if (!$sql_op->delete('mst_coll_type', "coll_type_id={$itemID}")) {
$error_num++;
}
} else {
$msg = str_replace('{item_name}', $item_d[0], __('Location ({item_name}) still used by {number_items} item(s)'));
//mfc
$msg = str_replace('{number_items}', $item_d[1], $msg);
$still_have_item[] = $msg;
$error_num++;
}
}
if ($still_have_item) {
$undeleted_coll_types = '';
foreach ($still_have_item as $coll_type) {
$undeleted_coll_types .= $coll_type . "\n";
}
示例14: array
if (isset($_POST['itemID']) and !empty($_POST['itemID']) and isset($_POST['itemAction'])) {
if (!($can_read and $can_write)) {
die;
}
/* DATA DELETION PROCESS */
$sql_op = new simbio_dbop($dbs);
$failed_array = array();
$error_num = 0;
if (!is_array($_POST['itemID'])) {
// make an array
$_POST['itemID'] = array((int) $_POST['itemID']);
}
// loop array
foreach ($_POST['itemID'] as $itemID) {
$itemID = (int) $itemID;
if (!$sql_op->delete('mst_supplier', 'supplier_id=' . $itemID)) {
$error_num++;
}
}
// error alerting
if ($error_num == 0) {
utility::jsAlert(__('All Data Successfully Deleted'));
echo '<script type="text/javascript">parent.setContent(\'mainContent\', \'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\', \'post\');</script>';
} else {
utility::jsAlert(__('Some or All Data NOT deleted successfully!\\nPlease contact system administrator'));
echo '<script type="text/javascript">parent.setContent(\'mainContent\', \'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\', \'post\');</script>';
}
exit;
}
}
/* RECORD OPERATION END */
示例15: isset
$itemID = (int) isset($_GET['itemID']) ? $_GET['itemID'] : 0;
if (isset($_POST['save'])) {
$data['topic_id'] = (int) $_POST['topic_id'];
$data['scope'] = trim($dbs->escape_string(strip_tags($_POST['scope'])));
# create new sql op object
$sql_op = new simbio_dbop($dbs);
if (!empty($_POST['vocabolary_id'])) {
// do update
$save = $sql_op->update('mst_voc_ctrl', $data, 'vocabolary_id=' . $_POST['vocabolary_id']);
} else {
// insert
$save = $sql_op->insert('mst_voc_ctrl', $data);
}
if (isset($_POST['delete'])) {
# create new sql op object
$save = $sql_op->delete('mst_voc_ctrl', 'vocabolary_id=' . $_POST['vocabolary_id']);
}
if ($save) {
$alert_save = '<script type="text/javascript">';
$alert_save .= 'alert(\'' . __('Data saved!') . '\');';
$alert_save .= 'parent.setIframeContent(\'itemIframe\', \'' . MWB . 'master_file/iframe_vocabolary_control.php?itemID=' . $data['topic_id'] . '\');';
$alert_save .= 'top.jQuery.colorbox.close();';
$alert_save .= '</script>';
echo $alert_save;
} else {
utility::jsAlert('Failed save data!');
}
}
// start buffer
ob_start();
// query scope