本文整理汇总了PHP中simbio_dbop::update方法的典型用法代码示例。如果您正苦于以下问题:PHP simbio_dbop::update方法的具体用法?PHP simbio_dbop::update怎么用?PHP simbio_dbop::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类simbio_dbop
的用法示例。
在下文中一共展示了simbio_dbop::update方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: date
exit;
} else {
$data['name'] = $dbs->escape_string($server_name);
$data['uri'] = $dbs->escape_string($server_uri);
$data['server_type'] = $dbs->escape_string($_POST['serverType']);
$data['input_date'] = date('Y-m-d H:i:s');
$data['last_update'] = date('Y-m-d H:i:s');
// create sql op object
$sql_op = new simbio_dbop($dbs);
if (isset($_POST['updateRecordID'])) {
// remove input date
unset($data['input_date']);
// filter update record ID
$updateRecordID = $dbs->escape_string(trim($_POST['updateRecordID']));
// update the data
$update = $sql_op->update('mst_servers', $data, 'server_id=' . $updateRecordID);
if ($update) {
utility::jsAlert(__('Server Data Successfully Updated'));
echo '<script type="text/javascript">parent.jQuery(\'#mainContent\').simbioAJAX(parent.jQuery.ajaxHistory[0].url);</script>';
} else {
utility::jsAlert(__('Server Data FAILED to Updated. Please Contact System Administrator') . "\nDEBUG : " . $sql_op->error);
}
exit;
} else {
// insert the data
if ($sql_op->insert('mst_servers', $data)) {
utility::jsAlert(__('New Server Data Successfully Saved'));
echo '<script type="text/javascript">parent.jQuery(\'#mainContent\').simbioAJAX(\'' . $_SERVER['PHP_SELF'] . '\');</script>';
} else {
utility::jsAlert(__('Server Data FAILED to Save. Please Contact System Administrator') . "\nDEBUG : " . $sql_op->error);
}
示例2: date
utility::jsAlert(__('Group name can\'t be empty'));
//mfc
} else {
$data['group_name'] = $dbs->escape_string($groupName);
$data['input_date'] = date('Y-m-d');
$data['last_update'] = date('Y-m-d');
// create sql op object
$sql_op = new simbio_dbop($dbs);
if (isset($_POST['updateRecordID'])) {
/* UPDATE RECORD MODE */
// remove input date
unset($data['input_date']);
// filter update record ID
$updateRecordID = (int) $_POST['updateRecordID'];
// update the data
$update = $sql_op->update('user_group', $data, 'group_id=' . $updateRecordID);
if ($update) {
$dbs->query('DELETE FROM group_access WHERE group_id=' . $updateRecordID);
// set group privileges
if (isset($_POST['read'])) {
foreach ($_POST['read'] as $module) {
// check write privileges
$is_write = 0;
if (isset($_POST['write'])) {
foreach ($_POST['write'] as $module_write) {
if ($module_write == $module) {
$is_write = 1;
}
}
}
$dbs->query("INSERT INTO group_access VALUES ({$updateRecordID}, {$module}, 1, {$is_write})");
示例3: unset
}
// password confirmation
if ($mpasswd1 and $mpasswd2 and $mpasswd1 === $mpasswd2) {
$data['mpasswd'] = 'literal{MD5(\'' . $mpasswd2 . '\')}';
}
// create sql op object
$sql_op = new simbio_dbop($dbs);
if (isset($_POST['updateRecordID'])) {
/* UPDATE RECORD MODE */
// remove input date
unset($data['input_date']);
// filter update record ID
$updateRecordID = $dbs->escape_string(trim($_POST['updateRecordID']));
$old_member_ID = $updateRecordID;
// update the data
$update = $sql_op->update('member', $data, "member_id='{$updateRecordID}'");
if ($update) {
// update other tables contain this member ID
@$dbs->query('UPDATE loan SET member_id=\'' . $data['member_id'] . '\' WHERE member_id=\'' . $old_member_ID . '\'');
@$dbs->query('UPDATE fines SET member_id=\'' . $data['member_id'] . '\' WHERE member_id=\'' . $old_member_ID . '\'');
utility::jsAlert(__('Member Data Successfully Updated'));
// upload status alert
if (isset($upload_status)) {
if ($upload_status == UPLOAD_SUCCESS) {
// write log
utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'membership', $_SESSION['realname'] . ' upload image file ' . $upload->new_filename);
utility::jsAlert(__('Image Uploaded Successfully'));
} else {
// write log
utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'membership', 'ERROR : ' . $_SESSION['realname'] . ' FAILED TO upload image file ' . $upload->new_filename . ', with error (' . $upload->error . ')');
utility::jsAlert(__('Image FAILED to upload'));
示例4: error
} else {
// write log
utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'bibliography', 'ERROR : ' . $_SESSION['realname'] . ' FAILED TO upload image file ' . $image_upload->new_filename . ', with error (' . $image_upload->error . ')');
utility::jsAlert(__('Image Uploaded Successfully'));
}
}
// create sql op object
$sql_op = new simbio_dbop($dbs);
if (isset($_POST['updateRecordID'])) {
/* UPDATE RECORD MODE */
// remove input date
unset($data['input_date']);
// filter update record ID
$updateRecordID = (int) $_POST['updateRecordID'];
// update data
$update = $sql_op->update('biblio', $data, 'biblio_id=' . $updateRecordID);
// send an alert
if ($update) {
// update custom data
if (isset($custom_data)) {
// check if custom data for this record exists
$_sql_check_custom_q = sprintf('SELECT biblio_id FROM biblio_custom WHERE biblio_id=%d', $updateRecordID);
$check_custom_q = $dbs->query($_sql_check_custom_q);
if ($check_custom_q->num_rows) {
$update2 = @$sql_op->update('biblio_custom', $custom_data, 'biblio_id=' . $updateRecordID);
} else {
$custom_data['biblio_id'] = $updateRecordID;
@$sql_op->insert('biblio_custom', $custom_data);
}
}
if ($sysconf['bibliography_update_notification']) {
示例5: date
}
}
}
}
$data['input_date'] = date('Y-m-d');
$data['last_update'] = date('Y-m-d');
// create sql op object
$sql_op = new simbio_dbop($dbs);
if (isset($_POST['updateRecordID'])) {
/* UPDATE RECORD MODE */
// remove input date
unset($data['input_date']);
// filter update record ID
$updateRecordID = $dbs->escape_string(trim($_POST['updateRecordID']));
// update the data
$update = $sql_op->update('mst_item_status', $data, 'item_status_id=\'' . $updateRecordID . '\'');
if ($update) {
utility::jsAlert(__('Item Status Data Successfully Updated'));
// update item status ID in item table to keep data integrity
$sql_op->update('item', array('item_status_id' => $data['item_status_id']), 'item_status_id=\'' . $updateRecordID . '\'');
echo '<script type="text/javascript">parent.setContent(\'mainContent\', parent.getPreviousAJAXurl(), \'post\');</script>';
} else {
utility::jsAlert(__('Item Status Data FAILED to Updated. Please Contact System Administrator') . "\nDEBUG : " . $sql_op->error);
}
exit;
} else {
/* INSERT RECORD MODE */
// insert the data
$insert = $sql_op->insert('mst_item_status', $data);
if ($insert) {
utility::jsAlert(__('New Item Status Data Successfully Saved'));
示例6: date
//mfc
exit;
} else {
$data['place_name'] = $dbs->escape_string($placeName);
$data['input_date'] = date('Y-m-d');
$data['last_update'] = date('Y-m-d');
// create sql op object
$sql_op = new simbio_dbop($dbs);
if (isset($_POST['updateRecordID'])) {
/* UPDATE RECORD MODE */
// remove input date
unset($data['input_date']);
// filter update record ID
$updateRecordID = (int) $_POST['updateRecordID'];
// update the data
$update = $sql_op->update('mst_place', $data, 'place_id=' . $updateRecordID);
if ($update) {
utility::jsAlert(__('Place Data Successfully Updated'));
echo '<script type="text/javascript">parent.jQuery(\'#mainContent\').simbioAJAX(parent.jQuery.ajaxHistory[0].url);</script>';
} else {
utility::jsAlert(__('Place Data FAILED to Updated. Please Contact System Administrator') . "\nDEBUG : " . $sql_op->error);
}
exit;
} else {
/* INSERT RECORD MODE */
// insert the data
$insert = $sql_op->insert('mst_place', $data);
if ($insert) {
utility::jsAlert(__('New Place Data Successfully Saved'));
echo '<script type="text/javascript">parent.jQuery(\'#mainContent\').simbioAJAX(\'' . $_SERVER['PHP_SELF'] . '\');</script>';
} else {
示例7: trim
} else {
$data['author_name'] = $dbs->escape_string($authorName);
$data['authority_type'] = trim($dbs->escape_string(strip_tags($_POST['authorityType'])));
$data['auth_list'] = trim($dbs->escape_string(strip_tags($_POST['authList'])));
$data['input_date'] = date('Y-m-d');
$data['last_update'] = date('Y-m-d');
// create sql op object
$sql_op = new simbio_dbop($dbs);
if (isset($_POST['updateRecordID'])) {
/* UPDATE RECORD MODE */
// remove input date
unset($data['input_date']);
// filter update record ID
$updateRecordID = (int) $_POST['updateRecordID'];
// update the data
$update = $sql_op->update('mst_author', $data, 'author_id=' . $updateRecordID);
if ($update) {
utility::jsAlert(lang_mod_masterfile_author_alert_update_ok);
echo '<script type="text/javascript">parent.setContent(\'mainContent\', parent.getPreviousAJAXurl(), \'post\');</script>';
} else {
utility::jsAlert(lang_mod_masterfile_author_alert_update_fail . "\nDEBUG : " . $sql_op->error);
}
exit;
} else {
/* INSERT RECORD MODE */
// insert the data
$insert = $sql_op->insert('mst_author', $data);
if ($insert) {
utility::jsAlert(lang_mod_masterfile_author_alert_new_add_ok);
echo '<script type="text/javascript">parent.setContent(\'mainContent\', \'' . $_SERVER['PHP_SELF'] . '\', \'post\');</script>';
} else {
示例8: trim
$data['biblio_id'] = $biblioID;
$data['date_start'] = $dateStart;
// $data['date_end'] = $dateEnd;
$data['period'] = $period;
$data['notes'] = trim($_POST['notes']) == '' ? 'literal{NULL}' : trim($dbs->escape_string(strip_tags($_POST['notes'])));
$data['input_date'] = date('Y-m-d');
$data['last_update'] = date('Y-m-d');
$sql_op = new simbio_dbop($dbs);
if (isset($_POST['updateRecordID'])) {
/* UPDATE RECORD MODE */
// remove input date
unset($data['input_date']);
// filter update record ID
$updateRecordID = (int) $_POST['updateRecordID'];
// update the data
$update = $sql_op->update('serial', $data, 'serial_id=' . $updateRecordID);
if ($update) {
utility::jsAlert(__('Subscription Data Successfully Updated'));
utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'serial_control', $_SESSION['realname'] . ' update subcription(' . $updateRecordID . ') ' . $period);
} else {
utility::jsAlert(__('Subscription Data FAILED to Updated. Please Contact System Administrator') . "\nDEBUG : " . $sql_op->error);
}
echo '<script type="text/javascript">self.location.href = \'' . MODULES_WEB_ROOT_DIR . 'serial_control/subscription.php?biblioID=' . $biblioID . '\';</script>';
exit;
} else {
/* INSERT RECORD MODE */
// insert the data
$insert = $sql_op->insert('serial', $data);
$serial_id = $sql_op->insert_id;
if ($insert) {
$exemplar = (int) $_POST['exemplar'];
示例9: date
$data['member_periode'] = $_POST['memberPeriode'];
$data['reborrow_limit'] = $_POST['reborrowLimit'];
$data['fine_each_day'] = $_POST['fineEachDay'];
$data['grace_periode'] = $_POST['gracePeriode'];
$data['input_date'] = date('Y-m-d');
$data['last_update'] = date('Y-m-d');
// create sql op object
$sql_op = new simbio_dbop($dbs);
if (isset($_POST['updateRecordID'])) {
/* UPDATE RECORD MODE */
// remove input date
unset($data['input_date']);
// filter update record ID
$updateRecordID = (int) $_POST['updateRecordID'];
// update the data
$update = $sql_op->update('mst_member_type', $data, 'member_type_id=' . $updateRecordID);
if ($update) {
utility::jsAlert(__('Member Type Successfully Updated'));
// update all member expire date
@$dbs->query('UPDATE member AS m SET expire_date=DATE_ADD(register_date,INTERVAL ' . $data['member_periode'] . ' DAY)
WHERE member_type_id=' . $updateRecordID);
echo '<script type="text/javascript">parent.$(\'#mainContent\').simbioAJAX(\'' . $_SERVER['PHP_SELF'] . '\');</script>';
} else {
utility::jsAlert(__('Member Type Data FAILED to Save/Update. Please Contact System Administrator') . "\nDEBUG : " . $sql_op->error);
}
exit;
} else {
/* INSERT RECORD MODE */
// insert the data
if ($sql_op->insert('mst_member_type', $data)) {
utility::jsAlert(__('New Member Type Successfully Saved'));
示例10: date
exit;
} else {
$data['location_id'] = $dbs->escape_string($locationID);
$data['location_name'] = $dbs->escape_string($locationName);
$data['input_date'] = date('Y-m-d');
$data['last_update'] = date('Y-m-d');
// create sql op object
$sql_op = new simbio_dbop($dbs);
if (isset($_POST['updateRecordID'])) {
/* UPDATE RECORD MODE */
// remove input date
unset($data['input_date']);
// filter update record ID
$updateRecordID = $dbs->escape_string(trim($_POST['updateRecordID']));
// update the data
$update = $sql_op->update('mst_location', $data, 'location_id=\'' . $updateRecordID . '\'');
if ($update) {
utility::jsAlert(__('Location Data Successfully Updated'));
// update location ID in item table to keep data integrity
$sql_op->update('item', array('location_id' => $data['location_id']), 'location_id=\'' . $updateRecordID . '\'');
echo '<script type="text/javascript">parent.setContent(\'mainContent\', parent.getPreviousAJAXurl(), \'post\');</script>';
} else {
utility::jsAlert(__('Location Data FAILED to Updated. Please Contact System Administrator') . "\nDEBUG : " . $sql_op->error);
}
exit;
} else {
/* INSERT RECORD MODE */
// insert the data
$insert = $sql_op->insert('mst_location', $data);
if ($insert) {
utility::jsAlert(__('New Location Data Successfully Saved'));
示例11: count
}
if ($relatedterm === 'UF') {
$_data['rt_id'] = 'U';
}
if ($relatedterm === 'RT') {
$_data['rt_id'] = 'RT';
}
if ($relatedterm === 'BT') {
$_data['rt_id'] = 'NT';
}
if ($relatedterm === 'NT') {
$_data['rt_id'] = 'BT';
}
// update mode
if (isset($_POST['saveData'])) {
$update = $sql_op->update('mst_voc_ctrl', $data, 'vocabolary_id=' . $vocID);
if ($update) {
$alert_update = '<script type="text/javascript">';
$alert_update .= 'alert(\'' . __('Vocabulary update!') . '\');';
$alert_update .= 'parent.setIframeContent(\'itemIframe\', \'' . MWB . 'master_file/iframe_vocabolary_control.php?itemID=' . $itemID . '\');';
$alert_update .= 'top.jQuery.colorbox.close();';
$alert_update .= '</script>';
echo $alert_update;
} else {
utility::jsAlert(__('Subject FAILED to Add. Please Contact System Administrator') . "\n" . $sql_op->error);
}
} else {
// checking if already added
$check_vc = $dbs->query('SELECT count(topic_id) FROM mst_voc_ctrl WHERE topic_id=' . $data['topic_id'] . ' AND related_topic_id=' . $data['related_topic_id']);
$check_dc = $check_vc->fetch_row();
if ($check_dc[0] > 0) {
示例12: error
utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'bibliography', 'ERROR : ' . $_SESSION['realname'] . ' FAILED TO upload label image file ' . $image_upload->new_filename . ', with error (' . $image_upload->error . ')');
utility::jsAlert('FAILED to upload label image! Please see System Log for more detailed information');
}
}
$data['input_date'] = date('Y-m-d');
$data['last_update'] = date('Y-m-d');
// create sql op object
$sql_op = new simbio_dbop($dbs);
if (isset($_POST['updateRecordID'])) {
/* UPDATE RECORD MODE */
// remove input date
unset($data['input_date']);
// filter update record ID
$updateRecordID = $dbs->escape_string(trim($_POST['updateRecordID']));
// update the data
$update = $sql_op->update('mst_label', $data, 'label_id=' . $updateRecordID);
if ($update) {
utility::jsAlert(__('Label Data Successfully Updated'));
echo '<script type="text/javascript">parent.jQuery(\'#mainContent\').simbioAJAX(parent.jQuery.ajaxHistory[0].url);</script>';
} else {
utility::jsAlert(__('Label Data FAILED to Updated. Please Contact System Administrator') . "\nDEBUG : " . $sql_op->error);
}
exit;
} else {
/* INSERT RECORD MODE */
// insert the data
if ($sql_op->insert('mst_label', $data)) {
utility::jsAlert(__('New Label Data Successfully Saved'));
echo '<script type="text/javascript">parent.jQuery(\'#mainContent\').simbioAJAX(\'' . $_SERVER['PHP_SELF'] . '\');</script>';
} else {
utility::jsAlert(__('Label Data FAILED to Save. Please Contact System Administrator') . "\nDEBUG : " . $sql_op->error);
示例13: date
utility::jsAlert(__('Collection type name can\'t be empty'));
exit;
} else {
$data['coll_type_name'] = $dbs->escape_string($collTypeName);
$data['input_date'] = date('Y-m-d');
$data['last_update'] = date('Y-m-d');
// create sql op object
$sql_op = new simbio_dbop($dbs);
if (isset($_POST['updateRecordID'])) {
/* UPDATE RECORD MODE */
// remove input date
unset($data['input_date']);
// filter update record ID
$updateRecordID = (int) $_POST['updateRecordID'];
// update the data
$update = $sql_op->update('mst_coll_type', $data, 'coll_type_id=' . $updateRecordID);
if ($update) {
utility::jsAlert(__('Colllection Type Data Successfully Updated'));
echo '<script type="text/javascript">parent.jQuery(\'#mainContent\').simbioAJAX(parent.jQuery.ajaxHistory[0].url);</script>';
} else {
utility::jsAlert(__('Colllection Type Data FAILED to Updated. Please Contact System Administrator') . "\nDEBUG : " . $sql_op->error);
}
exit;
} else {
/* INSERT RECORD MODE */
// insert the data
$insert = $sql_op->insert('mst_coll_type', $data);
if ($insert) {
utility::jsAlert(__('New Colllection Type Data Successfully Saved'));
echo '<script type="text/javascript">parent.jQuery(\'#mainContent\').simbioAJAX(\'' . $_SERVER['PHP_SELF'] . '\');</script>';
} else {
示例14: date
} else {
$data[$type . '_type'] = $dbs->escape_string($name);
$data['code'] = $dbs->escape_string($code);
$data['code2'] = $dbs->escape_string($code2);
$data['input_date'] = date('Y-m-d');
$data['last_update'] = date('Y-m-d');
// create sql op object
$sql_op = new simbio_dbop($dbs);
if (isset($_POST['updateRecordID'])) {
/* UPDATE RECORD MODE */
// remove input date
unset($data['input_date']);
// filter update record ID
$updateRecordID = $dbs->escape_string(trim($_POST['updateRecordID']));
// update the data
$update = $sql_op->update('mst_' . $type . '_type', $data, 'id=' . $updateRecordID);
if ($update) {
utility::jsAlert(__('Data Successfully Updated'));
echo '<script type="text/javascript">parent.jQuery(\'#mainContent\').simbioAJAX(parent.jQuery.ajaxHistory[0].url);</script>';
} else {
utility::jsAlert(__('Data FAILED to Updated. Please Contact System Administrator') . "\nDEBUG : " . $sql_op->error);
}
exit;
} else {
/* INSERT RECORD MODE */
// insert the data
if ($sql_op->insert('mst_' . $type . '_type', $data)) {
utility::jsAlert(__('New Data Successfully Saved'));
echo '<script type="text/javascript">parent.jQuery(\'#mainContent\').simbioAJAX(\'' . $_SERVER['PHP_SELF'] . '\');</script>';
} else {
utility::jsAlert(__('Data FAILED to Save. Please Contact System Administrator') . "\nDEBUG : " . $sql_op->error);
示例15: trim
$holDesc = trim($dbs->escape_string(strip_tags($_POST['holDesc'])));
if (empty($holDesc)) {
utility::jsAlert('Holiday description can\'t be empty!');
exit;
} else {
$data['holiday_date'] = trim(preg_replace('@\\s[0-9]{2}:[0-9]{2}:[0-9]{2}$@i', '', $_POST['holDate']));
$holiday_start_date = $data['holiday_date'];
$data['holiday_dayname'] = date('D', strtotime($data['holiday_date']));
$data['description'] = $holDesc;
// create sql op object
$sql_op = new simbio_dbop($dbs);
if (isset($_POST['updateRecordID'])) {
/* UPDATE RECORD MODE */
// filter update record ID
$updateRecordID = (int) $_POST['updateRecordID'];
if ($sql_op->update('holiday', $data, 'holiday_id=' . $updateRecordID)) {
utility::jsAlert(__('Holiday Data Successfully updated'));
// update holiday_dayname session
$_SESSION['holiday_date'][$data['holiday_date']] = $data['holiday_date'];
echo '<script type="text/javascript">parent.$(\'#mainContent\').simbioAJAX(parent.$.ajaxHistory[0].url);</script>';
exit;
} else {
utility::jsAlert(__('Holiday FAILED to update. Please Contact System Administrator') . "\n" . $sql_op->error);
}
} else {
/* INSERT RECORD MODE */
// insert the data
if ($sql_op->insert('holiday', $data)) {
utility::jsAlert(__('New Holiday Successfully Saved'));
// update holiday_dayname session
$_SESSION['holiday_date'][$data['holiday_date']] = $data['holiday_date'];