Ejemplo n.º 1
0
 function switchSubscription()
 {
     checkPerm('view');
     require_once _base_ . '/lib/lib.form.php';
     $lang =& DoceboLanguage::createInstance('reservation');
     $out = $GLOBALS['page'];
     $out->setWorkingZone('content');
     $man_res = new Man_Reservation();
     $id_course = importVar('id_course', true, 0);
     $id_event = importVar('id_event', true, 0);
     $id_category = importVar('id_category', true, 0);
     if (isset($_GET['confirm'])) {
         $id_event_del = importVar('id_event_del', true, 0);
         $confirm = importVar('confirm', true, 0);
         if ($confirm && $id_event_del) {
             $result = $man_res->switchSubscription(getLogUserId(), $id_event_del, $id_event);
             Util::jump_to('index.php?modname=reservation&op=reservation');
         }
         Util::jump_to('index.php?modname=reservation&op=reservation');
     }
     $out->add(getTitleArea($lang->def('_SWITCH_REGISTRATION_TITLE'), '', $lang->def('_EVENT')) . '<div class="std_block">');
     $error = importVar('error', false, '');
     $out->add(Form::openForm('form_switch_subscription', 'index.php?modname=reservation&amp;op=switch_subscription&amp;confirm=1') . Form::openElementSpace() . Form::getDropdown($lang->def('_DEL_EVENT_REGISTRATION'), 'id_event_del', 'id_event_del', $man_res->getEventDropDown($id_course, $id_category, getLogUserId())) . Form::getHidden('id_category', 'id_category', $id_category) . Form::getHidden('id_course', 'id_course', $id_course) . Form::getHidden('id_event', 'id_event', $id_event) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('send_event', 'send_event', $lang->def('_SWITCH_REGISTRATION')) . Form::getButton('undo_switch', 'undo_switch', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm());
     $out->add('</div>', 'content');
 }