本文整理汇总了PHP中orsee_db_save_array函数的典型用法代码示例。如果您正苦于以下问题:PHP orsee_db_save_array函数的具体用法?PHP orsee_db_save_array怎么用?PHP orsee_db_save_array使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了orsee_db_save_array函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lang__insert_to_lang
function lang__insert_to_lang($item)
{
$pars = array(':content_type' => $item['content_type']);
$query = "SELECT max(lang_id) as lcount\n FROM " . table('lang') . "\n WHERE content_type= :content_type";
$line = orsee_query($query, $pars);
$maxid = $line['lcount'];
$reorganize = false;
$newmax = false;
$newmin = false;
// if there is no item under this content_type
if ($maxid == NULL) {
$newmax = true;
$reorganize = true;
$newmin = false;
} else {
$newid = $maxid + 1;
$pars = array(':newid' => $newid);
$query = "SELECT * FROM " . table('lang') . " WHERE lang_id= :newid";
$line = orsee_query($query, $pars);
if (isset($line['lang_id'])) {
$reorganize = true;
$newmax = true;
$newmin = true;
}
}
if ($newmax) {
$query = "SELECT max(lang_id) as maxid, min(lang_id) as minid FROM " . table('lang');
$line = orsee_query($query);
$newid = $line['maxid'] + 1;
$steps = $line['minid'];
if ($newmin) {
$steps = $steps * 10;
}
}
$done1 = orsee_db_save_array($item, "lang", $newid, "lang_id");
if ($reorganize) {
$done2 = lang__reorganize_lang_table($steps);
}
return $newid;
}
示例2: message
message(lang('session_time_changed'));
}
} else {
$time_changed = false;
}
if (!isset($_REQUEST['addit'])) {
if ($_REQUEST['registration_end_hours'] != $edit['registration_end_hours'] || $time_changed) {
$_REQUEST['reg_notice_sent'] = "n";
message(lang('reg_time_extended_but_notice_sent'));
}
if (($_REQUEST['session_reminder_hours'] != $edit['session_reminder_hours'] || $time_changed) && isset($edit['session_reminder_sent']) && $edit['session_reminder_sent'] == "y") {
message(lang('session_reminder_changed_but_notice_sent'));
}
}
$edit = $_REQUEST;
$done = orsee_db_save_array($edit, "sessions", $edit['session_id'], "session_id");
if ($done) {
log__admin("session_edit", "session:" . session__build_name($edit, $settings['admin_standard_language']) . "\nsession_id:" . $edit['session_id']);
message(lang('changes_saved'));
redirect('admin/session_edit.php?session_id=' . $edit['session_id']);
} else {
lang('database_error');
redirect('admin/session_edit.php?session_id=' . $edit['session_id']);
}
}
}
if ($proceed) {
// form
if (isset($_REQUEST['copy']) && $_REQUEST['copy']) {
$session_id = "";
}
示例3: max
$query = "SELECT max(budget_id)+1 as new_budget_id FROM " . table('budgets');
$line = orsee_query($query);
if (isset($line['new_budget_id'])) {
$budget_id = $line['new_budget_id'];
} else {
$budget_id = 1;
}
} else {
$new = false;
}
$budget = $_REQUEST;
$budget['budget_id'] = $budget_id;
if (!$budget['budget_limit']) {
$budget['budget_limit'] = NULL;
}
$done = orsee_db_save_array($budget, "budgets", $budget_id, "budget_id");
message(lang('changes_saved'));
log__admin("payments_budget_edit", "budget_id:" . $budget['budget_id']);
//redirect ("admin/payments_budget_edit.php?budget_id=".$budget_id);
} else {
$budget = $_REQUEST;
}
}
}
if ($proceed) {
// form
echo '<CENTER>';
show_message();
echo '
<FORM action="payments_budget_edit.php">';
if (isset($budget_id)) {
示例4: implode
if ($value) {
$trights[] = $key;
}
}
$type['rights'] = implode(",", $trights);
} else {
$type['rights'] = "";
}
if ($continue) {
if (!$type_id) {
$pars = array(':type_name' => $type['type_name'], ':rights' => $type['rights']);
$query = "INSERT INTO " . table('admin_types') . " \n\t\t\t\t\tSET type_name= :type_name,\n\t\t\t\t\trights= :rights";
$done = or_query($query, $pars);
$type_id = pdo_insert_id();
} else {
$done = orsee_db_save_array($type, "admin_types", $type_id, "type_id");
}
if ($done) {
message(lang('changes_saved'));
redirect("admin/admin_type_edit.php?type_id=" . $type_id);
$proceed = false;
} else {
message(lang('database_error'));
}
}
}
}
if ($proceed) {
$rights = array();
if (isset($type['rights']) && $type['rights']) {
$trights = explode(",", $type['rights']);
示例5: time
if (!$id) {
$new = true;
} else {
$new = false;
}
if ($new && $new_id == "time") {
$sitem['content_name'] = time();
}
if ($new_id == "content_shortcut") {
$sitem['content_name'] = trim($_REQUEST['content_shortcut']);
}
if ($new) {
$id = lang__insert_to_lang($sitem);
$done = true;
} else {
$done = orsee_db_save_array($sitem, "lang", $id, "lang_id");
}
if (!$new && $new_id == "time") {
$sitem['content_name'] = trim($_REQUEST['content_shortcut']);
}
if ($done) {
log__admin($item . "_edit", "lang_id:" . $sitem['content_type'] . ',' . $sitem['content_name']);
message(lang('changes_saved'));
if ($new) {
redirect('admin/lang_item_main.php?&item=' . $item);
} else {
redirect('admin/lang_item_edit.php?id=' . $id . '&item=' . $item);
}
} else {
message(lang('database_error'));
redirect('admin/lang_item_edit.php?id=' . $id . '&item=' . $item);
示例6: check_allow
}
$allow = check_allow('events_edit', 'calendar_main.php');
}
if ($proceed) {
if (isset($_REQUEST['edit']) && $_REQUEST['edit']) {
$_REQUEST['experimenter'] = id_array_to_db_string(multipicker_json_to_array($_REQUEST['experimenter']));
$_REQUEST['event_start'] = ortime__array_to_sesstime($_REQUEST, 'event_start_');
$_REQUEST['event_stop'] = ortime__array_to_sesstime($_REQUEST, 'event_stop_');
$edit = $_REQUEST;
$continue = true;
if ($edit['event_start'] >= $edit['event_stop']) {
message(lang('start_time_must_be_earlier_than_stop_time'));
$continue = false;
}
if ($continue) {
$done = orsee_db_save_array($edit, "events", $edit['event_id'], "event_id");
if ($done) {
log__admin("events_edit", "event_id:" . $event_id);
message(lang('changes_saved'));
redirect('admin/events_edit.php?event_id=' . $edit['event_id']);
} else {
lang('database_error');
redirect('admin/events_edit.php?event_id=' . $edit['event_id']);
}
}
}
}
if ($proceed) {
if ($event_id) {
$edit = orsee_db_load_array("events", $event_id, "event_id");
if (!isset($edit['event_id'])) {
示例7: check_allow
} else {
$lang_id = "";
}
if ($lang_id) {
$allow = check_allow('lang_symbol_edit', 'lang_main.php');
} else {
$allow = check_allow('lang_symbol_add', 'lang_main.php');
}
}
if ($proceed) {
$languages = get_languages();
if (isset($_REQUEST['save']) && $_REQUEST['save']) {
$continue = true;
$_REQUEST['content_type'] = "lang";
if ($lang_id) {
$done = orsee_db_save_array($_REQUEST, "lang", $lang_id, "lang_id");
} else {
$lang_id = lang__insert_to_lang($_REQUEST);
}
message(lang('changes_saved'));
log__admin("language_symbol_edit", "lang_id:lang," . $_REQUEST['content_name']);
redirect("admin/lang_symbol_edit.php?lang_id=" . $lang_id);
}
}
if ($proceed) {
// if lang id given, load data
if ($lang_id) {
$content = orsee_db_load_array("lang", $lang_id, "lang_id");
} else {
$content = array('content_name' => '');
}
示例8: unset
unset($_SESSION['captcha_string']);
$new_id = participant__create_participant_id($participant);
$participant['participant_id'] = $new_id['participant_id'];
$participant['participant_id_crypt'] = $new_id['participant_id_crypt'];
if ($settings['subject_authentication'] != 'token') {
$participant['password_crypted'] = unix_crypt($participant['password']);
}
$participant['confirmation_token'] = create_random_token(get_entropy($participant));
$participant['creation_time'] = time();
$participant['last_profile_update'] = $participant['creation_time'];
$participant['status_id'] = 0;
$participant['subpool_id'] = $_SESSION['subpool_id'];
if (!isset($participant['language']) || !$participant['language']) {
$participant['language'] = $settings['public_standard_language'];
}
$done = orsee_db_save_array($participant, "participants", $participant['participant_id'], "participant_id");
if ($done) {
log__participant("subscribe", $participant['lname'] . ', ' . $participant['fname']);
$proceed = false;
$done = experimentmail__confirmation_mail($participant);
message(lang('successfully_registered'));
redirect("public/");
} else {
message(lang('database_error'));
}
}
}
}
if ($proceed) {
echo '<CENTER>
<TABLE class="or_formtable" style="width: auto;"><TR><TD>';
示例9: orsee_db_save_array
$done = orsee_db_save_array($status_error_lang, "lang", $status_error_lang['lang_id'], "lang_id");
}
}
if ($not_unconfirmed) {
$status = $_REQUEST;
$status['status_id'] = $status_id;
$pars = array(':status_id' => $status_id);
if ($status['is_default_active'] == "y") {
$query = "UPDATE " . table('participant_statuses') . "\n\t\t\t\t\t\t\tSET is_default_active='n'\n\t\t\t\t\t\t\tWHERE status_id!= :status_id";
$done = or_query($query, $pars);
}
if ($status['is_default_inactive'] == "y") {
$query = "UPDATE " . table('participant_statuses') . "\n\t\t\t\t\t\t\tSET is_default_inactive='n'\n\t\t\t\t\t\t\tWHERE status_id!= :status_id";
$done = or_query($query, $pars);
}
$done = orsee_db_save_array($status, "participant_statuses", $status_id, "status_id");
}
message(lang('changes_saved'));
log__admin("participant_status_edit", "status_id:" . $status['status_id']);
redirect("admin/participant_status_edit.php?status_id=" . $status_id);
} else {
$status = $_REQUEST;
}
}
}
if ($proceed) {
// form
echo ' <CENTER>';
show_message();
echo '
<FORM action="participant_status_edit.php">';
示例10: trim
$_REQUEST[$k][$tk] = trim($tv);
} else {
unset($_REQUEST[$k][$tk]);
}
}
$prop_array[$k] = implode(',', $_REQUEST[$k]);
} else {
$prop_array[$k] = trim($_REQUEST[$k]);
}
} else {
$prop_array[$k] = $field[$k];
}
}
}
$pform_field['properties'] = property_array_to_db_string($prop_array);
$done = orsee_db_save_array($pform_field, "profile_fields", $field_name, "mysql_column_name");
message(lang('changes_saved'));
redirect('admin/' . thisdoc() . '?mysql_column_name=' . $field_name);
}
}
if ($proceed) {
echo '<center>';
javascript__tooltip_prepare();
echo '<FORM action="' . thisdoc() . '" method="POST">';
echo '<INPUT type="hidden" name="mysql_column_name" value="' . $field_name . '">';
echo '<TABLE class="or_formtable">
<TR><TD colspan="2">
<TABLE width="100%" border=0 class="or_panel_title"><TR>
<TD style="background: ' . $color['panel_title_background'] . '; color: ' . $color['panel_title_textcolor'] . '" align="center">
' . lang('configure_participant_profile_field') . ' ' . $field_name . '
</TD>
示例11: message
$continue = false;
message(lang('error_username_exists'));
}
}
if ($continue) {
if ($_REQUEST['password']) {
// no password strength checks when account created by super-admin?
$_REQUEST['password_crypt'] = unix_crypt($_REQUEST['password']);
message(lang('password_changed'));
} else {
unset($_REQUEST['password']);
}
if (!$admin_id) {
$admin_id = time();
}
$done = orsee_db_save_array($_REQUEST, "admin", $admin_id, "admin_id");
message(lang('changes_saved'));
log__admin("admin_edit", $_REQUEST['adminname']);
if ($admin_id == $expadmindata['admin_id']) {
$nl = "&new_language=" . $_REQUEST['language'];
} else {
$nl = "";
}
redirect("admin/admin_edit.php?admin_id=" . $admin_id . $nl);
$proceed = false;
}
if ($proceed) {
foreach ($admin as $k => $v) {
if (isset($_REQUEST[$k])) {
$admin[$k] = $_REQUEST[$k];
}
示例12: explode
$_REQUEST['experiment_finished'] = "n";
}
if (!isset($_REQUEST['hide_in_stats']) || !$_REQUEST['hide_in_stats']) {
$_REQUEST['hide_in_stats'] = "n";
}
if (!isset($_REQUEST['hide_in_cal']) || !$_REQUEST['hide_in_cal']) {
$_REQUEST['hide_in_cal'] = "n";
}
if (!isset($_REQUEST['access_restricted']) || !$_REQUEST['access_restricted']) {
$_REQUEST['access_restricted'] = "n";
}
$exptypes = explode(",", $_REQUEST['experiment_show_type']);
$_REQUEST['experiment_type'] = trim($exptypes[0]);
$_REQUEST['experiment_ext_type'] = trim($exptypes[1]);
$edit = $_REQUEST;
$done = orsee_db_save_array($edit, "experiments", $edit['experiment_id'], "experiment_id");
if ($done) {
message(lang('changes_saved'));
redirect("admin/experiment_edit.php?experiment_id=" . $edit['experiment_id']);
} else {
message(lang('database_error'));
redirect("admin/experiment_edit.php?experiment_id=" . $edit['experiment_id']);
}
}
$edit = $_REQUEST;
}
}
if ($proceed) {
// form
// initialize if empty
if (!isset($edit)) {
示例13: foreach
}
foreach ($languages as $language) {
$pstatus_internal_name_lang[$language] = $pstatus_internal_name[$language];
$pstatus_display_name_lang[$language] = $pstatus_display_name[$language];
}
if ($new) {
$pstatus_internal_name['lang_id'] = lang__insert_to_lang($pstatus_internal_name_lang);
$pstatus_display_name['lang_id'] = lang__insert_to_lang($pstatus_display_name_lang);
} else {
$done = orsee_db_save_array($pstatus_internal_name_lang, "lang", $pstatus_internal_name_lang['lang_id'], "lang_id");
$done = orsee_db_save_array($pstatus_display_name_lang, "lang", $pstatus_display_name_lang['lang_id'], "lang_id");
}
if ($not_assigned) {
$pstatus = $_REQUEST;
$pstatus['pstatus_id'] = $pstatus_id;
$done = orsee_db_save_array($pstatus, "participation_statuses", $pstatus_id, "pstatus_id");
}
message(lang('changes_saved'));
log__admin("participation_status_edit", "pstatus_id:" . $pstatus['pstatus_id']);
redirect("admin/participation_status_edit.php?pstatus_id=" . $pstatus_id);
} else {
$pstatus = $_REQUEST;
}
}
}
if ($proceed) {
// form
echo ' <CENTER>';
show_message();
echo '
<FORM action="participation_status_edit.php">';
示例14: copy_table
function copy_table($table, $idvar, $cond = "", $delete = true)
{
global $do_delete, $do_insert, $new_db_name, $old_db_name;
$dquery = "DELETE FROM " . $new_db_name . "." . table($table) . "";
if ($do_delete && $delete) {
$done = or_query($dquery);
}
$squery = "SELECT * FROM " . $old_db_name . "." . table($table);
if ($cond) {
$squery .= ' ' . $cond;
}
$result = or_query($squery);
while ($line = pdo_fetch_assoc($result)) {
$line = convert_array_to_UTF8($line);
if ($do_insert) {
$done = orsee_db_save_array($line, $table, $line[$idvar], $idvar);
}
}
}
示例15: array
} else {
$new = false;
$pars = array(':subpool_id' => $subpool_id);
$query = "SELECT * from " . table('lang') . " \n\t\t\t\t\t\tWHERE content_type='subjectpool' \n\t\t\t\t\t\tAND content_name= :subpool_id";
$lsub = orsee_query($query, $pars);
}
$subpool = $_REQUEST;
$subpool['experiment_types'] = id_array_to_db_string($exptype_ids);
foreach ($languages as $language) {
$lsub[$language] = $selfdesc[$language];
}
$done = orsee_db_save_array($subpool, "subpools", $subpool_id, "subpool_id");
if ($new) {
$lsub['lang_id'] = lang__insert_to_lang($lsub);
} else {
$done = orsee_db_save_array($lsub, "lang", $lsub['lang_id'], "lang_id");
}
message(lang('changes_saved'));
log__admin("subjectpool_edit", "subjectpool:" . $subpool['subpool_name'] . "\nsubpool_id:" . $subpool['subpool_id']);
redirect("admin/subpool_edit.php?subpool_id=" . $subpool_id);
} else {
$subpool = $_REQUEST;
$subpool['exptypes'] = array();
foreach ($exptype_ids as $exptype_id) {
$subpool['exptypes'][$exptype_id] = $exptype_id;
}
}
}
}
if ($proceed) {
// form