예제 #1
0
파일: Help.php 프로젝트: Auwibana/babesk
 public function execute($dataContainer)
 {
     //No direct access
     defined('_WEXEC') or die("Access denied");
     $smarty = $dataContainer->getSmarty();
     require_once PATH_ACCESS . '/GlobalSettingsManager.php';
     require_once PATH_ACCESS . '/CardManager.php';
     require_once PATH_ACCESS . '/UserManager.php';
     $cm = new CardManager();
     $um = new UserManager();
     $gsManager = new GlobalSettingsManager();
     try {
         $help_str = $gsManager->getHelpText();
     } catch (Exception $e) {
         die('Ein Fehler ist aufgetreten:' . $e->getMessage());
     }
     if ($dataContainer->getAcl()->moduleGet('root/web/Babesk')) {
         // set {cardid} in helptext administration to replace it with the cardnumber
         $help_str = str_replace("{cardid}", $cm->getCardnumberByUserID($_SESSION['uid']), $help_str);
     }
     //set {login} in helptext administration to replace it with the login name
     $help_str = str_replace("{login}", $um->getUsername($_SESSION['uid']), $help_str);
     $smarty->assign('help_str', $help_str);
     $smarty->display($this->smartyPath . "help.tpl");
 }
예제 #2
0
파일: Quiz.php 프로젝트: Auwibana/babesk
 public function execute($dataContainer)
 {
     //No direct access
     defined('_WEXEC') or die("Access denied");
     $smarty = $dataContainer->getSmarty();
     require_once PATH_ACCESS . '/GlobalSettingsManager.php';
     require_once PATH_ACCESS . '/FitsManager.php';
     $gsm = new GlobalSettingsManager();
     $fm = new FitsManager();
     $has_Fits = false;
     if (isset($_POST['fits_key'])) {
         try {
             if ($_POST['fits_key'] == $gsm->getFitsKey()) {
                 $has_Fits = true;
                 $fm->setFits($_SESSION['uid'], true, $gsm->getFitsYear());
             } else {
                 $smarty->display($this->smartyPath . 'quiz_error.tpl');
             }
         } catch (Exception $e) {
         }
     }
     $smarty->assign('uid', $_SESSION['uid']);
     if ($has_Fits) {
         $smarty->display($this->smartyPath . 'quiz_success.tpl');
     } else {
         $smarty->display($this->smartyPath . 'quiz.tpl');
     }
 }
 /**
  * Save the Fits settings
  */
 function SaveSettings($password, $schoolyear, $class, $allClasses)
 {
     $gsManager = new GlobalSettingsManager();
     try {
         $gsManager->setFitsKey($password);
     } catch (Exception $e) {
         $this->groupInterface->dieError($this->msg['err_key'] . $e->getMessage());
     }
     try {
         $gsManager->setFitsYear($schoolyear);
     } catch (Exception $e) {
         $this->groupInterface->dieError($this->msg['err_schoolyear'] . $e->getMessage());
     }
     try {
         $gsManager->setFitsClass($class);
     } catch (Exception $e) {
         $this->groupInterface->dieError($this->msg['err_class'] . $e->getMessage());
     }
     try {
         $gsManager->setFitsAllClasses($allClasses);
     } catch (Exception $e) {
         $this->groupInterface->dieError($this->msg['err_all_classes'] . $e->getMessage());
     }
     $this->fitsInterface->FinEditSettings();
 }
예제 #4
0
파일: Fmenu.php 프로젝트: Auwibana/babesk
    public function execute($dataContainer)
    {
        //No direct access
        defined('_WEXEC') or die("Access denied");
        require_once PATH_ACCESS . '/UserManager.php';
        require_once PATH_ACCESS . '/FitsManager.php';
        require_once PATH_ACCESS . '/GlobalSettingsManager.php';
        $this->entryPoint($dataContainer);
        $smarty = $dataContainer->getSmarty();
        $userManager = new UserManager();
        $fitsManager = new FitsManager();
        $gsm = new GlobalSettingsManager();
        $has_Fits = false;
        try {
            $userDetails = TableMng::querySingleEntry(sprintf('SELECT u.*,
				(SELECT CONCAT(g.gradelevel, g.label) AS class
					FROM SystemAttendances uigs
					LEFT JOIN SystemGrades g ON uigs.gradeId = g.ID
					WHERE uigs.userId = u.ID AND
						uigs.schoolyearId = @activeSchoolyear) AS class
				FROM SystemUsers u WHERE `ID` = %s', $_SESSION['uid']), true);
            $userClass = $userDetails['class'];
            $fitsManager->prepUser($_SESSION['uid']);
            $has_Fits = $fitsManager->getFits($_SESSION['uid']);
            $class = $gsm->getFitsClass();
            $allClasses = $gsm->getFitsAllClasses();
        } catch (Exception $e) {
            $this->_logger->log('Error executing Fits: ' . $e->getMessage(), 'Notice', Null, '');
            $this->_interface->dieError('Konnte Fits nicht ausführen.');
        }
        if ($allClasses == true) {
            $userClass = preg_replace('/[^0-9]/i', '', $userClass);
            $class = preg_replace('/[^0-9]/i', '', $class);
        }
        if (isset($userClass) && $userClass == $class && $has_Fits == false) {
            $smarty->assign('showTestlink', true);
        }
        if ($has_Fits == true) {
            $smarty->assign('hasFits', true);
        }
        $smarty->assign('uid', $_SESSION['uid']);
        $smarty->display($this->smartyPath . 'menu.tpl');
    }
예제 #5
0
파일: Help.php 프로젝트: Auwibana/babesk
 public function execute($dataContainer)
 {
     defined('_AEXEC') or die("Access denied");
     require_once 'AdminHelpProcessing.php';
     require_once 'AdminHelpInterface.php';
     require_once PATH_ACCESS . '/GlobalSettingsManager.php';
     $gbManager = new GlobalSettingsManager();
     $helpInterface = new AdminHelpInterface($this->relPath);
     $helpProcessing = new AdminHelpProcessing($helpInterface);
     if ('POST' == $_SERVER['REQUEST_METHOD']) {
         try {
             switch ($_GET['action']) {
                 case 1:
                     //show the Help-Text
                     try {
                         $helptext = $gbManager->getHelpText();
                     } catch (MySQLVoidDataException $e) {
                         $helptext = ' ';
                     }
                     $helpInterface->ShowHelp($helptext);
                     break;
                 case 2:
                     //edit the Help-Text
                     if (isset($_POST['helptext'])) {
                         $helpProcessing->change_help($_POST['helptext']);
                     } else {
                         try {
                             $helptext = $gbManager->getHelpText();
                         } catch (MySQLVoidDataException $e) {
                             $helptext = ' ';
                         }
                         $helpInterface->EditHelp($helptext);
                     }
                     break;
             }
         } catch (Exception $e) {
             die_error($e->getMessage());
         }
     } else {
         $helpInterface->IndexMenu();
     }
 }
예제 #6
0
 /**
  * Change Settings for Solis
  * Enter description here ...
  */
 function ChangeSettings($soli_price)
 {
     require_once PATH_ACCESS . '/GlobalSettingsManager.php';
     require_once PATH_ACCESS . '/PriceClassManager.php';
     $gbManager = new GlobalSettingsManager();
     $pcManager = new PriceClassManager();
     die_error(SOLI_ERR_INP_PRICE);
     if ($soli_price !== NULL) {
         try {
             try {
                 //inputcheck
                 inputcheck($_POST['soli_price'], 'credits');
             } catch (Exception $e) {
                 die_error(SOLI_ERR_INP_PRICE);
                 $this->soliInterface->dieError($this->msg['SOLI_ERR_INP_PRICE']);
             }
             $gbManager->changeSoliPrice($_POST['soli_price']);
         } catch (Exception $e) {
             die_error(SOLI_ERR_CHANGE_PRICE . ':' . $e->getMessage());
             $this->soliInterface->dieError($this->msg['SOLI_ERR_CHANGE_PRICE '] . ':' . $e->getMessage());
         }
         $this->soliInterface->dieMsg($this->msg['SOLI_FIN_CHANGE']);
     } else {
         try {
             $soli_price = $gbManager->getSoliPrice();
             $priceclasses = $pcManager->getTableData();
         } catch (Exception $e) {
             $this->soliInterface->dieError($this->msg['SOLI_ERR_PRICE']);
         }
         $this->soliInterface->ChangeSettings($soli_price, $priceclasses);
     }
 }
예제 #7
0
 /**
  * Allows the user to edit the Last Order time for meals saved in GlobalSettings-table
  */
 function EditLastOrderTime()
 {
     require_once PATH_ACCESS . '/GlobalSettingsManager.php';
     $gsManager = new GlobalSettingsManager();
     $last_order_time = $gsManager->getLastOrderTime();
     if ('POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['Time_Hour'], $_POST['Time_Minute'])) {
         $n_last_order_time = $_POST['Time_Hour'] . ':' . $_POST['Time_Minute'];
         try {
             $gsManager->setLastOrderTime($n_last_order_time);
         } catch (Exception $e) {
             $this->mealInterface->dieError($this->msg['err_edit_lot'] . $e->getMessage());
         }
         $this->mealInterface->dieMsg(sprintf($this->msg['fin_edit_lot'], $n_last_order_time));
     } else {
         $this->mealInterface->EditLastOrderTime($last_order_time);
     }
 }