本文整理汇总了PHP中FormValidator::add_timewindow方法的典型用法代码示例。如果您正苦于以下问题:PHP FormValidator::add_timewindow方法的具体用法?PHP FormValidator::add_timewindow怎么用?PHP FormValidator::add_timewindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormValidator
的用法示例。
在下文中一共展示了FormValidator::add_timewindow方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
echo '<div class="label">' . get_lang('ResourceType') . ': </div>';
echo '<div class="formw">';
echo '<select name="cat_id" onchange="this.form.submit();">';
echo '<option value="0"> </option>';
foreach ($cats as $catid => $cat) {
echo '<option value="' . $catid . '"' . ($catid == $categori[0] ? ' selected="selected"' : '') . '>' . $cat . '</option>';
}
echo '</select></div>';
echo '</div>';
echo '</form>';
$itemlist = Rsys::get_cat_r_items($categori[0]);
$form = new FormValidator('reservation', 'post', 'm_reservation.php?action=edit&id=' . $Reservation_id);
$choices[] = $form->createElement('radio', 'forever', '', get_lang('NoPeriod'), '0', array('onclick' => 'javascript:timewindow_hide(\'forever_timewindow\')'));
$choices[] = $form->createElement('radio', 'forever', '', get_lang('FixedPeriod'), '1', array('onclick' => 'javascript:timewindow_show(\'forever_timewindow\')'));
$form->addElement('select', 'item_id', get_lang('Resource'), $itemlist);
$form->add_timewindow('start', 'end', get_lang('StartDate'), get_lang('EndDate'));
$form->addElement('html', '<div class="row"><div class="label"></div><div class="formw">' . get_lang('TimePickerLimitation') . '</div></div><br />');
$form->addElement('text', 'maxuser', get_lang('MaxUsers'));
$form->addGroup($choices, null, get_lang('SubscriptionPeriod'), '<br />', false);
$form->addElement('html', '<div style="margin-left:25px;display:block;" id="forever_timewindow">');
$form->add_timewindow('subscribe_from', 'subscribe_until', '', '');
$form->addElement('html', '</div>');
$form->addElement('html', "<script type=\"text/javascript\">\n\t\t\t\t\t\t\t\t\t\t\t\t/* <![CDATA[ */\n\t\t\t\t\t\t\t\t\t\t\t\t" . ($reservation[0][7] == '0000-00-00 00:00:00' && $reservation[0][8] == '0000-00-00 00:00:00' ? "timewindow_hide('forever_timewindow');" : "") . "\n\t\t\t\t\t\t\t\t\t\t\t\tfunction timewindow_show(item) {\n\t\t\t\t\t\t\t\t\t\t\t\tel = document.getElementById(item);\n\t\t\t\t\t\t\t\t\t\t\t\tel.style.display='';\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tfunction timewindow_hide(item) {\n\t\t\t\t\t\t\t\t\t\t\t\tel = document.getElementById(item);\n\t\t\t\t\t\t\t\t\t\t\t\tel.style.display='none';\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t/* ]]> */\n\t\t\t\t\t\t\t\t\t\t\t\t</script>\n");
$form->addElement('checkbox', 'auto_accept', get_lang('AutoAccept'));
$form->addElement('checkbox', 'timepicker', get_lang('TimePicker'), '', array('disabled' => 'disabled'));
$form->addElement('textarea', 'notes', get_lang('Notes'), array('cols' => 40, 'rows' => 4));
$form->addElement('style_submit_button', 'submit', get_lang('EditNewBookingPeriod'), 'class="save"');
$form->addElement('hidden', 'id', $Reservation_id);
$form->addElement('hidden', 'timepicker2');
$form->addElement('hidden', 'period', $reservation[0][7] == '0000-00-00 00:00:00' && $reservation[0][8] == '0000-00-00 00:00:00' ? 0 : 1);
if ($categori[0] == $tijdelijke_cat) {
示例2: array
}
$time_start = Rsys :: mysql_datetime_to_timestamp($array["end_at"]);
$end_time_last_block = $array["end_at"];
}
if ((Rsys :: mysql_datetime_to_timestamp($res_end_at) - Rsys :: mysql_datetime_to_timestamp($end_time_last_block)) >= ($min_timepicker*60))
{
$start_end .= "<li>".$end_time_last_block." en ".$res_end_at."</li>";
}
$start_end .= "</ul>";
} else {
$start_end = " ".Rsys :: timestamp_to_datetime($time_start)." en ".$res_end_at;
}
//$form->addElement('html', "timestart:".$time_start."-".Rsys :: mysql_datetime_to_timestamp($res_start_at));
$form->addElement('html', "<p>".str_replace('#start_end',$start_end,str_replace('#from_till', $from_till,str_replace('#name#', "<b>".$item[3]."</b>",str_replace('#start#', "<b>".$reservation[0][5]."</b>", str_replace('#end#', "<b>".$reservation[0][6]."</b>", get_lang("SubscribeTimePickerInformation"))))))." </p>");
$form->add_timewindow('startpicker', 'endpicker', get_lang('StartDate'), get_lang('EndDate'));
$form->addElement('hidden', 'min', $reservation[0][12]);
$form->addElement('hidden', 'max', $reservation[0][13]);
$datum = $_GET['timestart'];
$defaultvalues['startpicker'] = Rsys :: timestamp_to_datetime($datum);
//$defaultvalues['endpicker'] = Rsys :: timestamp_to_datetime($datum +900);
$defaultvalues['endpicker'] = Rsys :: timestamp_to_datetime($datum +($min_timepicker*60));
$form->setDefaults($defaultvalues);
} else {
$form->addElement('html', "<p> * ".str_replace('#name#', "<b>".$item[3]."</b>",str_replace('#start#', "<b>".$reservation[0][5]."</b>", str_replace('#end#', "<b>".$reservation[0][6]."</b>", get_lang('SubscribeInformation'))))." *</p>");
}
$buttons[] = $form->createElement('submit', 'submit', get_lang('Ok'));
$buttons[] = $form->createElement('button', 'cancel', get_lang('Cancel'), array ('onclick' => 'location.href="reservation.php?cat='.$item[1].'&item='.$item[0].'"'));
$form->addGroup($buttons, null, '', '', false);
$buffer = ob_get_contents();
示例3: FormValidator
$form = new FormValidator('system_announcement');
$form->addElement('header', '', $form_title);
$form->add_textfield('title', get_lang('Title'), true, array('class' => 'span4'));
$language_list = api_get_languages();
$language_list_with_keys = array();
$language_list_with_keys['all'] = get_lang('All');
for ($i = 0; $i < count($language_list['name']); $i++) {
$language_list_with_keys[$language_list['folder'][$i]] = $language_list['name'][$i];
}
$form->addElement('select', 'lang', get_lang('Language'), $language_list_with_keys);
if (api_get_setting('wcag_anysurfer_public_pages') == 'true') {
$form->addElement('textarea', 'content', get_lang('Content'));
} else {
$form->add_html_editor('content', get_lang('Content'), true, false, array('ToolbarSet' => 'PortalNews', 'Width' => '100%', 'Height' => '300'));
}
$form->add_timewindow('start', 'end', get_lang('StartTimeWindow'), get_lang('EndTimeWindow'));
$group = array();
$group[] = $form->createElement('checkbox', 'visible_teacher', null, get_lang('Teacher'));
$group[] = $form->createElement('checkbox', 'visible_student', null, get_lang('Student'));
$group[] = $form->createElement('checkbox', 'visible_guest', null, get_lang('Guest'));
$form->addGroup($group, null, get_lang('Visible'), '');
$form->addElement('hidden', 'id');
$group_list = $usergroup->get_groups_list();
$group_list[0] = get_lang('All');
$form->addElement('select', 'group', get_lang('AnnouncementForGroup'), $group_list);
$values['group'] = isset($values['group']) ? $values['group'] : '0';
$form->addElement('checkbox', 'send_mail', null, get_lang('SendMail'));
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'add') {
$form->addElement('checkbox', 'add_to_calendar', null, get_lang('AddToCalendar'));
$text = get_lang('AddNews');
$class = 'add';