本文整理汇总了PHP中session__build_name函数的典型用法代码示例。如果您正苦于以下问题:PHP session__build_name函数的具体用法?PHP session__build_name怎么用?PHP session__build_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了session__build_name函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lang
' . lang('to') . ' ' . ortime__format(ortime__sesstime_to_unixtime($max), 'hide_time');
}
echo ' </TD></TR></TABLE>';
echo '</TD></TR><TR><TD>';
echo '<table class="or_orr_section_content">';
$shade = false;
$num_cols = count($pstatuses);
foreach ($sessions as $s) {
if ($shade) {
$rowspec = ' class="or_orr_list_shade_even"';
$shade = false;
} else {
$rowspec = ' class="or_orr_list_shade_odd"';
$shade = true;
}
$session_time = session__build_name($s);
$ssicons = array("planned" => "wrench", "live" => "spinner fa-spin fa-fw", "completed" => "thumbs-o-up", "balanced" => "money");
echo '<tr' . $rowspec . '><td colspan="' . $num_cols . '"><B>' . $session_time;
echo ', ' . $preloaded_laboratories[$s['laboratory_id']]['lab_name'];
echo '</B></td>
<td colspan=3 align="right">' . lang('session_status') . ': <B><span class="session_status_' . $s['session_status'] . '">' . '<i class="fa fa-' . $ssicons[$s['session_status']] . '"></i> ' . $lang['session_status_' . $s['session_status']] . '</span></B>
</td>
</tr>';
echo ' <TR' . $rowspec . '>
<TD>' . lang('subjects') . '</TD>
<TD>' . lang('needed_participants_abbr') . ': ' . $s['part_needed'] . '</TD>
<TD>' . lang('reserve_participants_abbr') . ': ' . $s['part_reserve'] . '</TD>';
foreach ($pstatuses as $pstatus_id => $pstatus) {
echo '<TD>';
if ($pstatus['participated']) {
echo '<B>';
示例2: message
} 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 = "";
}
if (!$session_id) {
$addit = true;
示例3: foreach
$csess_id = '';
foreach ($exp as $sess_id => $sess) {
$cpaytype_id = '';
foreach ($sess as $paytype_id => $paytype) {
foreach ($paytype as $p) {
$pid++;
if ($cexp_id != $exp_id) {
echo '<TR style="background: ' . $color['list_header_background'] . '; color: ' . $color['list_header_textcolor'] . ';">
<TD colspan=8><B>' . $p['experiment_name'] . '</B></TD>
</TR>';
$cexp_id = $exp_id;
}
if ($csess_id != $sess_id) {
echo '<TR bgcolor="' . $color['list_shade1'] . '">
<TD> </TD>
<TD colspan=6>' . session__build_name($p) . '</TD>
<TD style="background: ' . $color['list_header_background'] . '; color: ' . $color['list_header_textcolor'] . ';"> </TD>
</TR>';
$csess_id = $sess_id;
}
if ($cpaytype_id != $paytype_id) {
echo '<TR>
<TD bgcolor="' . $color['list_shade2'] . '"> </TD>
<TD bgcolor="' . $color['list_shade2'] . '"> </TD>
<TD bgcolor="' . $color['list_shade2'] . '" colspan=4>' . $payment_types[$p['payment_type']] . '</TD>
<TD bgcolor="' . $color['list_shade1'] . '"> </TD>
<TD style="background: ' . $color['list_header_background'] . '; color: ' . $color['list_header_textcolor'] . ';"> </TD>
</TR>';
$cpaytype_id = $paytype_id;
}
echo '<TR>
示例4: sessions__get_cancellation_deadline
}
if ($proceed) {
$cancellation_deadline = sessions__get_cancellation_deadline($session);
$now = time();
if ($cancellation_deadline < $now) {
$continue = false;
message(lang('error_enrolment_cancellation_deadline_expired'));
redirect("public/participant_show_mob.php" . $token_string);
}
}
// if all checks are done, cancel ...
if ($continue) {
$done = expregister__cancel($participant, $session);
$done = participant__update_last_enrolment_time($participant_id);
$done = log__participant("cancel_session_enrolment", $participant['participant_id'], "experiment_id:" . $session['experiment_id'] . "\nsession_id:" . $session_id);
message(lang('successfully_canceled_enrolment_xxx') . " " . experiment__get_public_name($session['experiment_id']) . ", " . session__build_name($session_id) . ". " . lang('this_will_be_confirmed_by_an_email'));
redirect("public/participant_show_mob.php" . $token_string);
}
}
}
if ($proceed) {
$labs = laboratories__get_laboratories();
// load the data
// invitations
$invdata = expregister__get_invitations($participant_id);
$invited = $invdata['invited'];
$inv_experiments = $invdata['inv_experiments'];
// registrations
$registered = expregister__get_registrations($participant_id);
// history
$history = expregister__get_history($participant_id);
示例5: lang
echo '<TABLE width=90% border=0><TR><TD align="left">
<A HREF="emails_main.php?mode=inbox">' . lang('mailbox_inbox') . '</A> |
<A HREF="emails_main.php?mode=listmailboxes">' . lang('all_mailboxes') . '</A>';
if (check_allow('emails_trash_empty')) {
echo ' | <A HREF="emails_main.php?mode=trash">' . lang('mailbox_trash') . '</A> ';
}
echo '</TD></TR>
<TR><TD align="center">
<TABLE class="or_page_subtitle" style="width: 100%; background: ' . $color['page_subtitle_background'] . '; color: ' . $color['page_subtitle_textcolor'] . '">
<TR><TD align="center">';
if ($mode == 'inbox') {
echo lang('mailbox_inbox');
} elseif ($mode == 'experiment') {
echo lang('experiment') . ': ' . $experiment['experiment_name'];
} elseif ($mode == 'session') {
echo lang('session') . ': ' . $experiment['experiment_name'] . ', ' . session__build_name($session);
} elseif ($mode == 'participant') {
echo lang('participant') . ': ' . $participant['email'];
} elseif ($mode == 'mailbox') {
echo lang('email_mailbox') . ': ' . $mailboxes[$id];
} elseif ($mode == 'listmailboxes') {
echo lang('all_mailboxes');
} elseif ($mode == 'trash') {
echo lang('mailbox_trash');
if (check_allow('emails_trash_empty')) {
echo button_link(thisdoc() . '?mode=trash&empty_trash=true', lang('email_empty_trash'), 'trash') . '<BR>';
}
}
echo '
</TD></TR></TABLE>
</TD></TR>
示例6: lang
</TD>
</TR>
<TR>
<TD>
' . lang('experiment') . ':
</TD>
<TD>
' . experiment__get_public_name($session['experiment_id']) . '
</TD>
</TR>
<TR>
<TD>
' . lang('date_and_time') . ':
</TD>
<TD>
' . session__build_name($session) . '
</TD>
</TR>
<TR>
<TD>
' . lang('laboratory') . ':
</TD>
<TD>
' . laboratories__get_laboratory_name($session['laboratory_id']) . '
</TD>
</TR>
<TR>
<TD colspan=2> </TD>
</TR>
<TR>
<TD align=center colspan=2>
示例7: email__list_emails
//.........这里部分代码省略.........
// processed - check and background of row
echo '<td></td>';
// view email button
echo '</tr>
</thead><tbody>';
$cols = 7;
$shade = false;
$style_unprocessed = ' style="font-weight: bold;"';
foreach ($emails as $email) {
$second_row = '';
if ($email['thread_id'] == $email['message_id']) {
if ($shade) {
$shade = false;
} else {
$shade = true;
}
$second_row = "";
// experiment or mailbox - not if experiment or session or mailbox
if (!in_array($mode, array('experiment', 'session', 'mailbox'))) {
if ($email['experiment_id']) {
if (isset($related_experiments[$email['experiment_id']])) {
$second_row .= $related_experiments[$email['experiment_id']]['experiment_name'];
}
} elseif ($email['mailbox']) {
$second_row .= '<b>' . lang('email_mailbox') . ':</b> ' . $mailboxes[$email['mailbox']];
}
}
// session - not if session or mailbox
if (!in_array($mode, array('session', 'mailbox'))) {
if ($email['session_id']) {
if ($second_row) {
$second_row .= ', ';
}
$second_row .= session__build_name($related_sessions[$email['session_id']]);
}
}
// assigned to
if ($settings['email_module_allow_assign_emails'] == 'y' && $email['assigned_to']) {
if ($second_row) {
$second_row .= ', ';
}
$second_row .= experiment__list_experimenters($email['assigned_to'], false, true);
}
}
echo '<tr';
if ($shade) {
echo ' bgcolor="' . $color['list_shade1'] . '"';
} else {
echo ' bgcolor="' . $color['list_shade2'] . '"';
}
if (!$email['flag_processed'] && $mode != 'inbox') {
echo $style_unprocessed;
}
echo '>';
// thread head and subject
if ($email['message_id'] == $email['thread_id']) {
echo '<TD colspan=2>';
} else {
echo '<TD></TD><TD>';
}
echo '<A name="' . $email['message_id'] . '"></A>';
$linktext = '';
if ($email['message_type'] == 'reply') {
$linktext .= icon('reply', '', '', ' color: #666666;', 'reply');
} elseif ($email['message_type'] == 'note') {
$linktext .= icon('file-text-o', '', '', ' color: #666666;', 'internal note');
示例8: array
$pars = array(':session_id' => $session_id);
$query = "DELETE FROM " . table('sessions') . " \n \t\tWHERE session_id= :session_id";
$result = or_query($query, $pars);
message(lang('session_deleted'));
log__admin("session_delete", "session:" . session__build_name($session, $settings['admin_standard_language']) . "\n,session_id:" . $session_id);
redirect('admin/experiment_show.php?experiment_id=' . $session['experiment_id']);
}
}
if ($proceed) {
// form
echo ' <CENTER>
<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'] . '">
' . lang('delete_session') . ' ' . session__build_name($session) . '
</TD>
</TR></TABLE>
</TD></TR>
<TR>
<TD colspan=2>
' . lang('really_delete_session') . '
<BR><BR>';
dump_array($session);
echo '
</TD>
</TR>
<TR>
<TD align=left>
' . button_link('session_delete.php?session_id=' . $session_id . '&reallydelete=true', lang('yes_delete'), 'check-square biconred') . '
</TD>
示例9: array
$participants = array();
foreach ($thislist_sessions as $sid => $s) {
foreach ($temp_participants as $p) {
if ($p['session_id'] == $sid) {
$participants[] = $p;
}
}
}
}
unset($temp_participants);
echo '<center>';
echo '<TABLE class="or_page_subtitle" style="background: ' . $color['page_subtitle_background'] . '; color: ' . $color['page_subtitle_textcolor'] . '; width: 95%">
<TR><TD align="center">
' . $experiment['experiment_name'];
if ($session_id) {
echo ', ' . lang('session') . ' ' . session__build_name($session);
}
echo ', ' . $title . '
</TD>';
echo '</TR></TABLE>';
if ($display != 'enrol') {
echo '<P align=right><A class="small" HREF="experiment_participants_show_pdf.php' . $thiscgis . '" target="_blank">' . lang('print_version') . '</A></P>';
}
// show query
//echo ' <P class="small">Query: '.$query.'</P>';
// form
echo '
<FORM name="part_list" method=post action="' . thisdoc() . '">
<BR>
<table class="or_listtable" style="width: 95%"><thead>
示例10: pdfoutput__make_part_list
function pdfoutput__make_part_list($experiment_id, $session_id = "", $pstatus = "", $focus = "", $sort = "", $file = false, $tlang = "")
{
global $settings;
if ($tlang == "") {
global $lang;
} else {
$lang = load_language($tlang);
}
$experiment = orsee_db_load_array("experiments", $experiment_id, "experiment_id");
$pstatuses = expregister__get_participation_statuses();
if ($session_id) {
$clause = "session_id = '" . $session_id . "'";
$title = lang('registered_subjects');
} elseif (isset($pstatuses[$pstatus])) {
$clause = "pstatus_id = '" . $pstatus . "'";
if ($pstatus == 0) {
$clause .= " AND session_id != 0";
}
$title = lang('subjects_in_participation_status') . ' "' . $pstatuses[$pstatus]['internal_name'] . '"';
} elseif ($focus == 'enroled') {
$clause = "session_id != 0";
$title = lang('registered_subjects');
}
$cols = participant__get_result_table_columns('session_participants_list_pdf');
if ($session_id) {
unset($cols['session_id']);
}
// load sessions of this experiment
$pars = array(':experiment_id' => $experiment_id);
$query = "SELECT *\n\t\t\tFROM " . table('sessions') . "\n\t\t\tWHERE experiment_id= :experiment_id\n\t\t\tORDER BY session_start";
$result = or_query($query, $pars);
global $thislist_sessions;
$thislist_sessions = array();
while ($line = pdo_fetch_assoc($result)) {
$thislist_sessions[$line['session_id']] = $line;
}
// load participant data for this session/experiment
$pars = array(':experiment_id' => $experiment_id);
$select_query = "SELECT * FROM " . table('participate_at') . ", " . table('participants') . " \n\t\t\t\t\tWHERE " . table('participate_at') . ".experiment_id= :experiment_id\n\t\t\t\t\tAND " . table('participate_at') . ".participant_id=" . table('participants') . ".participant_id\n\t\t\t\t\tAND (" . $clause . ")";
$order = query__get_sort('session_participants_list_pdf', $sort);
if (!$order) {
$order = table('participants') . ".participant_id";
}
$select_query .= " ORDER BY " . $order;
// get result
$result = or_query($select_query, $pars);
$participants = array();
while ($line = pdo_fetch_assoc($result)) {
$participants[] = $line;
}
$result_count = count($participants);
// load sessions of this experiment
$pars = array(':texperiment_id' => $experiment_id);
$squery = "SELECT *\n FROM " . table('sessions') . "\n\t\t\tWHERE experiment_id= :texperiment_id \n ORDER BY session_start";
$result = or_query($squery, $pars);
$thislist_sessions = array();
while ($line = pdo_fetch_assoc($result)) {
$thislist_sessions[$line['session_id']] = $line;
}
// reorder by session date if ordered by session id
if ($sort == "session_id") {
$temp_participants = $participants;
$participants = array();
foreach ($thislist_sessions as $sid => $s) {
foreach ($temp_participants as $p) {
if ($p['session_id'] == $sid) {
$participants[] = $p;
}
}
}
}
unset($temp_participants);
// determine table title
$table_title = $experiment['experiment_public_name'];
if ($session_id) {
$table_title .= ', ' . lang('session') . ' ' . str_replace(" ", " ", session__build_name($thislist_sessions[$session_id]));
}
$table_title .= ' - ' . $title;
// determine table headings
$table_headings = participant__get_result_table_headcells_pdf($cols);
$table_data = array();
$pnr = 0;
foreach ($participants as $p) {
$pnr++;
$p['order_number'] = $pnr;
$row = participant__get_result_table_row_pdf($cols, $p);
$table_data[] = $row;
}
// prepare pdf
include_once '../tagsets/class.ezpdf.php';
$pdf = new Cezpdf('a4', 'landscape');
$pdf->selectFont('../tagsets/fonts/Times-Roman.afm');
$fontsize = $settings['participant_list_pdf_table_fontsize'] ? $settings['participant_list_pdf_table_fontsize'] : 10;
$titlefontsize = $settings['participant_list_pdf_title_fontsize'] ? $settings['participant_list_pdf_title_fontsize'] : 12;
$y = $pdf->ezTable($table_data, $table_headings, $table_title, array('gridlines' => 31, 'showHeadings' => 1, 'shaded' => 2, 'shadeCol' => array(1, 1, 1), 'shadeCol2' => array(0.9, 0.9, 0.9), 'fontSize' => $fontsize, 'titleFontSize' => $titlefontsize, 'rowGap' => 1, 'colGap' => 3, 'innerLineThickness' => 0.5, 'outerLineThickness' => 1, 'maxWidth' => 800, 'width' => 800, 'protectRows' => 2));
if ($file) {
$pdffilecode = $pdf->output();
return $pdffilecode;
} else {
$pdf->ezStream(array('Content-Disposition' => 'participant_list.pdf', 'Accept-Ranges' => 0, 'compress' => 1));
//.........这里部分代码省略.........
示例11: experimentmail__send_registration_notice
function experimentmail__send_registration_notice($line)
{
global $settings;
$reg = experiment__count_participate_at($line['experiment_id'], $line['session_id']);
$experimenters = db_string_to_id_array($line['experimenter_mail']);
foreach ($experimenters as $experimenter) {
$admin = orsee_db_load_array("admin", $experimenter, "admin_id");
if (isset($admin['admin_id'])) {
$tlang = $admin['language'] ? $admin['language'] : $settings['admin_standard_language'];
$lang = load_language($tlang);
$admin['session_name'] = session__build_name($line, $tlang);
$admin['experiment_name'] = $line['experiment_name'];
$admin['registered'] = $reg;
$admin['status'] = session__get_status($line, $tlang, $reg);
$admin['needed'] = $line['part_needed'];
$admin['reserve'] = $line['part_reserve'];
$subject = load_language_symbol('subject_for_registration_notice', $tlang);
$subject .= ' ' . $admin['experiment_name'] . ', ' . $admin['session_name'];
$recipient = $admin['email'];
$mailtext = load_mail("admin_registration_notice", $tlang) . "\n" . experimentmail__get_admin_footer($tlang, $admin) . "\n";
$message = process_mail_template($mailtext, $admin);
$now = time();
$list_name = lang('participant_list_filename') . ' ' . date("Y-m-d", $now);
$list_filename = str_replace(" ", "_", $list_name) . ".pdf";
$list_file = pdfoutput__make_part_list($line['experiment_id'], $line['session_id'], 'registered', 'lname,fname', true, $tlang);
$done = experimentmail__mail_attach($recipient, $settings['support_mail'], $subject, $message, $list_filename, $list_file);
}
}
// update session table : reg_notice_sent
$pars = array(':session_id' => $line['session_id']);
$query = "UPDATE " . table('sessions') . " SET reg_notice_sent='y' WHERE session_id= :session_id ";
$done2 = or_query($query, $pars);
return $done;
}
示例12: expregister__get_history
function expregister__get_history($participant_id)
{
$pars = array(':participant_id' => $participant_id);
$query = "SELECT * FROM " . table('experiments') . ", \n\t\t" . table('sessions') . ", " . table('participate_at') . "\n \tWHERE " . table('experiments') . ".experiment_id=" . table('sessions') . ".experiment_id\n\t AND " . table('experiments') . ".experiment_id=" . table('participate_at') . ".experiment_id\n \tAND " . table('participate_at') . ".participant_id = :participant_id \n \tAND " . table('sessions') . ".session_id = " . table('participate_at') . ".session_id\n \tAND " . table('participate_at') . ".session_id!=0\n\t\tAND " . table('experiments') . ".experiment_type='laboratory' \n \tORDER BY session_start DESC";
$result = or_query($query, $pars);
$history = array();
while ($varray = pdo_fetch_assoc($result)) {
$varray['session_unixtime'] = ortime__sesstime_to_unixtime($varray['session_start']);
$now = time();
if ($now >= $varray['session_unixtime']) {
$varray['session_name'] = session__build_name($varray);
$history[] = $varray;
}
}
return $history;
}
示例13: participant__get_result_table_row_pdf
function participant__get_result_table_row_pdf($columns, $p)
{
global $settings, $color;
global $thislist_sessions;
$pform_columns = participant__load_all_pform_fields();
$row = array();
foreach ($columns as $k => $arr) {
switch ($k) {
case 'number_noshowup':
$row[] = $p['number_noshowup'] . '/' . $p['number_reg'];
break;
case 'rules_signed':
if ($settings['enable_rules_signed_tracking'] == 'y') {
$row[] = $p['rules_signed'] != 'y' ? "X" : '';
}
break;
case 'subscriptions':
$exptypes = load_external_experiment_types();
$inv_arr = db_string_to_id_array($p[$k]);
$inv_names = array();
foreach ($inv_arr as $inv) {
if (isset($exptypes[$inv]['exptype_name'])) {
$inv_names[] = $exptypes[$inv]['exptype_name'];
} else {
$inv_names[] = 'undefined';
}
}
$row[] = implode(", ", $inv_names);
break;
case 'subpool_id':
$subpools = subpools__get_subpools();
$subpool_name = isset($subpools[$p[$k]]['subpool_name']) ? $subpools[$p[$k]]['subpool_name'] : $p[$k];
$row[] = $subpool_name;
break;
case 'status_id':
$participant_statuses = participant_status__get_statuses();
$pstatus_name = isset($participant_statuses[$p[$k]]['name']) ? $participant_statuses[$p[$k]]['name'] : $p[$k];
$row[] = $pstatus_name;
break;
case 'creation_time':
case 'deletion_time':
case 'last_enrolment':
case 'last_profile_update':
case 'last_activity':
case 'last_login_attempt':
if ($p[$k]) {
$row[] = ortime__format($p[$k], 'hide_second:false');
} else {
$row[] = '-';
}
break;
case 'session_id':
$row[] = session__build_name($thislist_sessions[$p['session_id']]);
break;
case 'payment_budget':
if ($settings['enable_payment_module'] == 'y' && check_allow('payments_view')) {
$payment_budgets = payments__load_budgets();
if (isset($payment_budgets[$p['payment_budget']])) {
$row[] = $payment_budgets[$p['payment_budget']]['budget_name'];
} else {
$row[] = '-';
}
}
break;
case 'payment_type':
if ($settings['enable_payment_module'] == 'y' && check_allow('payments_view')) {
$payment_types = payments__load_paytypes();
if (isset($payment_types[$p['payment_type']])) {
$row[] = $payment_types[$p['payment_type']];
} else {
$row[] = '-';
}
}
break;
case 'payment_amount':
if ($settings['enable_payment_module'] == 'y' && check_allow('payments_view')) {
if ($p['payment_amt'] != '') {
$row[] = $p['payment_amt'];
} else {
$row[] = '-';
}
}
break;
case 'pstatus_id':
$pstatuses = expregister__get_participation_statuses();
$row[] = $pstatuses[$p['pstatus_id']]['internal_name'];
break;
default:
if (isset($pform_columns[$k])) {
if (preg_match("/(radioline|select_list|select_lang|radioline_lang)/", $pform_columns[$k]['type'])) {
if (isset($pform_columns[$k]['lang'][$p[$k]])) {
$row[] = lang($pform_columns[$k]['lang'][$p[$k]]);
} else {
$row[] = $p[$k];
}
} else {
$row[] = $p[$k];
}
} else {
if (isset($p[$k])) {
//.........这里部分代码省略.........
示例14: orsee_db_load_array
if ($line['session_id'] > 0) {
$osession = orsee_db_load_array("sessions", $line['session_id'], "session_id");
message(lang('participant_already_enroled_for_experiment') . ' <A HREF="experiment_participants_show.php?experiment_id=' . $osession['experiment_id'] . '&session_id=' . $osession['session_id'] . '">' . session__build_name($osession) . '</A>.');
} else {
$pars = array(':participant_id' => $participant['participant_id'], ':session_id' => $session['session_id'], ':experiment_id' => $session['experiment_id']);
$query = "UPDATE " . table('participate_at') . " \n\t\t\t\t\t\t\t\t\tSET session_id= :session_id, \n\t\t\t\t\t\t\t\t\tpstatus_id=0 \n\t\t\t\t\t\t\t\t\tWHERE participant_id= :participant_id \n\t\t\t\t\t\t\t\t\tAND experiment_id= :experiment_id";
$done2 = or_query($query, $pars);
}
} else {
$pars = array(':participant_id' => $participant['participant_id'], ':session_id' => $session['session_id'], ':experiment_id' => $session['experiment_id']);
$query = "INSERT into " . table('participate_at') . " \n \t \t\t\t\tSET participant_id= :participant_id,\n \t \t\t\tsession_id= :session_id, \n \t \t\t\texperiment_id= :experiment_id,\n \t \t\t\tpstatus_id=0";
$done2 = or_query($query, $pars);
}
if (isset($done2) && $done2) {
message(lang('registered_participant_for') . '
<A HREF="experiment_participants_show.php?experiment_id=' . $session['experiment_id'] . '&session_id=' . $session['session_id'] . '">' . session__build_name($session) . '</A>.');
}
} else {
message(lang('no_session_selected'), 'message_error');
}
}
if ($done) {
if (isset($_REQUEST['participant_id']) && $_REQUEST['participant_id']) {
log__admin("participant_edit", "participant_id:" . $participant['participant_id']);
} else {
log__admin("participant_create", "participant_id:" . $participant['participant_id']);
}
$form = false;
$addition = "";
if ($hide_header) {
$addition .= "&hide_header=true";
示例15: session__check_lab_time_clash
function session__check_lab_time_clash($entry)
{
global $lang;
if (isset($entry['session_start'])) {
$notice = lang('overlapping_sessions');
$this_start_time = $entry['session_start'];
$this_end_time = ortime__add_hourmin_to_sesstime($this_start_time, $entry['session_duration_hour'], $entry['session_duration_minute']);
} else {
$notice = lang('overlapping_lab_reservation');
$this_start_time = $entry['event_start'];
$this_end_time = $entry['event_stop'];
}
if (!isset($entry['event_id'])) {
$entry['event_id'] = '';
}
if (!isset($entry['session_id'])) {
$entry['session_id'] = '';
}
$pars = array(':this_end_time' => $this_end_time, ':this_start_time' => $this_start_time, ':session_id' => $entry['session_id'], ':laboratory_id' => $entry['laboratory_id']);
$query = "SELECT session_start,\n \t\tdate_format(date_add(session_start*100, \n \t\tINTERVAL concat(session_duration_hour,':',session_duration_minute) HOUR_MINUTE),'%Y%m%d%H%i') \n \t\tas session_stop,\n\t\t\t " . table('experiments') . ".*, " . table('sessions') . ".*\n \t\tFROM " . table('experiments') . ", " . table('sessions') . "\n WHERE " . table('experiments') . ".experiment_id=" . table('sessions') . ".experiment_id\n AND " . table('experiments') . ".experiment_type!='internet'\n AND session_id!=:session_id\n AND laboratory_id=:laboratory_id \n\t\t\tHAVING NOT (session_start >= :this_end_time OR session_stop <= :this_start_time)\n\t\t\tORDER BY session_start";
$result = or_query($query, $pars);
while ($osession = pdo_fetch_assoc($result)) {
message('<UL><LI>' . $notice . ': <A HREF="session_edit.php?session_id=' . $osession['session_id'] . '">' . $osession['experiment_name'] . ' - ' . session__build_name($osession) . '</A></UL>');
}
$pars = array(':this_end_time' => $this_end_time, ':this_start_time' => $this_start_time, ':event_id' => $entry['event_id'], ':laboratory_id' => $entry['laboratory_id']);
$query = "SELECT event_start, event_stop,\n " . table('events') . ".*\n\t\t\tFROM " . table('events') . " \n\t\t\tWHERE laboratory_id=:laboratory_id \n\t\t\tAND event_id!=:event_id \n\t\t\tAND NOT (event_start >= :this_end_time OR event_stop <= :this_start_time)\n\t\t\tORDER BY event_start";
$result = or_query($query);
while ($osession = pdo_fetch_assoc($result)) {
$ostart_string = ortime__format(ortime__sesstime_to_unixtime($osession['event_start']));
$ostop_string = ortime__format(ortime__sesstime_to_unixtime($osession['event_stop']));
message('<UL><LI>' . $notice . ': <A HREF="events_edit.php?event_id=' . $osession['event_id'] . '">' . $ostart_string . ' - ' . $ostop_string . '</A></UL>');
}
}