Example #1
0
 function editclassroom($load = false)
 {
     //checkPerm('mod');
     require_once _base_ . '/lib/lib.form.php';
     require_once $GLOBALS["where_lms"] . "/lib/lib.classlocation.php";
     $lang =& DoceboLanguage::createInstance('admin_classroom', 'lms');
     $form = new Form();
     $out =& $GLOBALS['page'];
     $out->setWorkingZone('content');
     $idClassroom = importVar('idClassroom', true, 0);
     $all_languages = Docebo::langManager()->getAllLangCode();
     if ($load) {
         $query_classroom = "\r\n\t\t\tSELECT name, description , location_id , room , street, city, state , zip_code,\r\n\t\t\tphone,fax, capacity, disposition, instrument, available_instrument,note,responsable\r\n\t\t\tFROM " . $GLOBALS['prefix_lms'] . "_classroom\r\n\t\t\tWHERE idClassroom = '" . $idClassroom . "'";
         list($name, $descr, $location_id, $room, $street, $city, $state, $zip_code, $phone, $fax, $capacity, $disposition, $instrument, $available_instrument, $note, $responsable) = sql_fetch_row(sql_query($query_classroom));
     } else {
         $name = $lang->def('_NO_NAME');
         $descr = '';
         $impo = 0;
         $lang_sel = getLanguage();
         $location_id = FALSE;
         $room = "";
         $street = "";
         $city = "";
         $state = "";
         $zip_code = "";
         $phone = "";
         $fax = "";
         $capacity = "";
         $disposition = "";
         $instrument = "";
         $available_instrument = "";
         $note = "";
         $responsable = "";
     }
     $page_title = array('index.php?modname=classroom&op=classroom' => $lang->def('_TITLE_CLASSROOM'), $load ? $lang->def('_MOD_CLASSROOM') : $lang->def('_NEW_CLASSROOM'));
     $out->add(getTitleArea($page_title, 'classroom', $lang->def('_ALT_TITLE_CLASSROOMS')) . '<div class="std_block">' . getBackUi('index.php?modname=reservation&amp;op=classroom', $lang->def('_BACK')) . $form->openForm('adviceform', 'index.php?modname=reservation&amp;op=saveclassroom'));
     if ($load) {
         $out->add($form->getHidden('idClassroom', 'idClassroom', $idClassroom) . $form->getHidden('load', 'load', 1));
     }
     $clm = new ClassLocationManager();
     $location_arr = $clm->getClassLocationArray();
     $out->add($form->openElementSpace() . $form->getTextfield($lang->def('_NAME'), 'name', 'name', 255, $name) . $form->getTextarea($lang->def('_DESCRIPTION'), 'descr', 'descr', $descr) . $form->getHidden('location_id', 'location_id', 0) . $form->getTextfield($lang->def('_BUILDING_ROOM'), 'room', 'room', 255, $room) . $form->getTextfield($lang->def('_CAPACITY'), 'capacity', 'capacity', 255, $capacity) . $form->getTextfield($lang->def('_RESPONSABLE'), 'responsable', 'responsable', 255, $responsable) . $form->getTextfield($lang->def('_STREET'), 'street', 'street', 255, $street) . $form->getTextfield($lang->def('_CITY'), 'city', 'city', 255, $city) . $form->getTextfield($lang->def('_STATE'), 'state', 'state', 255, $state) . $form->getTextfield($lang->def('_ZIP_CODE'), 'zip_code', 'zip_code', 255, $zip_code) . $form->getTextfield($lang->def('_PHONE'), 'phone', 'phone', 255, $phone) . $form->getTextfield($lang->def('_FAX'), 'fax', 'fax', 255, $fax) . $form->getTextarea($lang->def('_DISPOSITION'), 'disposition', 'disposition', $disposition) . $form->getTextarea($lang->def('_INSTRUMENT'), 'instrument', 'instrument', $instrument) . $form->getTextarea($lang->def('_AVAILABLE_INSTRUMENT'), 'available_instrument', 'available_instrument', $available_instrument) . $form->getTextarea($lang->def('_NOTES'), 'note', 'note', $note) . $form->closeElementSpace() . $form->openButtonSpace() . $form->getButton('classroom', 'classroom', $load ? $lang->def('_SAVE') : $lang->def('_INSERT')) . $form->getButton('undo', 'undo', $lang->def('_UNDO')) . $form->closeButtonSpace() . $form->closeForm() . '</div>');
 }
Example #2
0
 function loadClassroomInfo($id)
 {
     $res = array();
     require_once $GLOBALS["where_lms"] . "/lib/lib.classlocation.php";
     $clm = new ClassLocationManager();
     $qtxt = " SELECT * " . " FROM " . $this->_getMainTable() . " as t1, " . $clm->getClassLocationTable() . " as t2 " . " WHERE t1.location_id = t2.location_id " . "\tAND t1.idClassroom='" . (int) $id . "' ";
     $qtxt .= "ORDER BY t1.name ";
     $q = $this->_executeQuery($qtxt);
     if ($q && mysql_num_rows($q) > 0) {
         $res = mysql_fetch_array($q);
     }
     return $res;
 }