예제 #1
0
 ob_start();
 echo '<form id="cat_form" action="m_reservation.php" method="get">';
 echo '<input type="hidden" name="id" value="' . $Reservation_id . '" />';
 echo '<input type="hidden" name="action" value="edit"/>';
 echo '<div class="row">';
 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">&nbsp;</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));