Esempio n. 1
0
 public function datenLaden($datenbank)
 {
     global $config;
     $letzteSeite = $this->letzteSeitenIdAuslesen();
     $this->neueSeiteLaden($letzteSeite, $datenbank);
     $this->templateVars["imgPath"] = $config["beamerBilderPfadRelativ"];
     parent::datenLaden($datenbank);
 }
Esempio n. 2
0
 public function datenLaden($datenbank)
 {
     parent::datenLaden($datenbank);
     $letzteSeite = $this->letzteSeitenIdAuslesen();
     if ($this->templateVars["alarmAnzeigen"] === "true") {
         $this->templateVars["inhalt"] = $this->templateVars["alarmText"];
     } else {
         $this->neueSeiteLaden($letzteSeite, $datenbank);
     }
 }
Esempio n. 3
0
 public function datenLaden($datenbank)
 {
     parent::datenLaden($datenbank);
     $stationIds = $this->getStationIds();
     $this->templateVars["departures"] = array();
     $resultCount = $this->templateVars["strings"]["vvsdeparture-resultCount"];
     foreach ($stationIds as $id) {
         $data = $this->requestDepartures($id, $resultCount);
         $departures = $this->parseResult($data);
     }
 }
Esempio n. 4
0
 public function datenLaden($datenbank)
 {
     $daten = file_get_contents("http://localhost/kasse/stats.php?format=csv");
     if ($daten !== false) {
         $verkaufe = $this->csvLesen(@mb_convert_encoding($daten, "UTF-8", "Windows-1252 (CP1252)"));
     } else {
         $verkaufe = array();
     }
     $this->templateVars["verkaufe"] = $verkaufe;
     $this->templateVars["limit"] = $this->limitAuslesen("verkaufsstatistikAnzahl");
     parent::datenLaden($datenbank);
 }
Esempio n. 5
0
 public function action_default()
 {
     if (Modul::hasAccess('system') == false) {
         return '<div class="notice error">Sie haben keinen Zugriff</div>';
     }
     $query = $GLOBALS['pdo']->prepare("SELECT count(vmID) AS `vms`, SUM(IF(status=1,1,0)) AS `vms_on` FROM vm");
     $query->execute();
     $data = $query->fetch();
     $query = $GLOBALS['pdo']->prepare("SELECT imageID FROM images");
     $query->execute();
     $images = $query->rowCount();
     $tmp = new RainTPL();
     $tmp->assign('vms', $data['vms']);
     $tmp->assign('vms_on', $data['vms_on']);
     $tmp->assign('images', $images);
     $ram = Server::getRamSettings();
     if ($ram) {
         $ram_usage = FileSystem::formatFileSize($ram['used']) . ' / ' . FileSystem::formatFileSize($ram['all']);
     } else {
         $ram_usage = 'linux only';
     }
     $tmp->assign('ram_usage', $ram_usage);
     $cpu = Server::getCPUusage();
     if ($cpu) {
         $cpu_usage = implode(" ", array_values($cpu));
     } else {
         $cpu_usage = 'linux only';
     }
     $tmp->assign('cpu_usage', $cpu_usage);
     $free = disk_free_space('/');
     $all = disk_total_space('/');
     $tmp->assign('free', FileSystem::formatFileSize($all - $free));
     $tmp->assign('all', FileSystem::formatFileSize($all));
     $qemu_ram = Server::getQemuRamTemp();
     if ($qemu_ram !== false) {
         $tmp->assign('ram_qemu', FileSystem::formatFileSize($qemu_ram));
     } else {
         $tmp->assign('ram_qemu', 'linux only');
     }
     $roles = '';
     $query = $GLOBALS['pdo']->prepare("SELECT * FROM roles");
     $query->execute();
     while ($ds = $query->fetch()) {
         $roles .= '<option value="' . $ds['roleID'] . '">' . $ds['name'] . '</option>';
     }
     $roles = str_replace('value="' . $GLOBALS['config']['default_role'] . '"', 'value="' . $GLOBALS['config']['default_role'] . '" selected="selected"', $roles);
     $tmp->assign('roles', $roles);
     foreach ($GLOBALS['config'] as $key => $value) {
         $tmp->assign($key, $value);
     }
     return $tmp->draw('system', true);
 }
Esempio n. 6
0
 public function datenLaden($datenbank)
 {
     $termine = array();
     $sql = "\n\t\t\tSELECT\n\t\t\t\t*\n\t\t\tFROM \n\t\t\t\t`event` \n\t\t\tWHERE \n\t\t\t\t(Beginn >= NOW() OR \n\t\t\t\t(Beginn <= NOW() AND Ende >= NOW())) AND\n\t\t\t\tKategorie = 2\n\t\t\tORDER BY\n\t\t\t\tBeginn ASC\n\t\t\tLIMIT " . $this->limitAuslesen("zeitplanAnzahl");
     $records = $datenbank->queryDirektArray($sql);
     foreach ($records as $record) {
         $termine[] = $this->eventVerarbeiten($record);
     }
     $this->templateVars["termine"] = $termine;
     $this->templateVars["zeit"] = date("H:i");
     $this->templateVars["limit"] = $this->limitAuslesen("zeitplanAnzahl");
     parent::datenLaden($datenbank);
 }
Esempio n. 7
0
 public function datenLaden($datenbank)
 {
     $now = new DateTime();
     $gesuche = array();
     $sql = "\n\t\t\tSELECT\n\t\t\t\t*\n\t\t\tFROM \n\t\t\t\t`spiel`\n      ORDER BY\n        Zeit DESC\n      LIMIT " . $this->limitAuslesen("spielersucheAnzahl");
     $records = $datenbank->queryDirektArray($sql);
     foreach ($records as $record) {
         $gesuche[] = $this->gesuchVerarbeiten($record);
     }
     $this->templateVars["gesuche"] = $gesuche;
     $this->templateVars["limit"] = $this->limitAuslesen("spielersucheAnzahl");
     parent::datenLaden($datenbank);
 }
Esempio n. 8
0
 public function datenLaden($datenbank)
 {
     $wochentag = $this->wochentage[date("N")];
     $monat = $this->monate[date("n")];
     $tag = date("j");
     $kalenderwoche = date("W");
     $jahr = date("Y");
     $this->templateVars["wochentag"] = $wochentag;
     $this->templateVars["monat"] = $monat;
     $this->templateVars["tag"] = $tag;
     $this->templateVars["kalenderwoche"] = $kalenderwoche;
     $this->templateVars["jahr"] = $jahr;
     parent::datenLaden($datenbank);
 }
Esempio n. 9
0
 public function datenLaden($datenbank)
 {
     try {
         $daten = @file_get_contents("http://pizza.hadiko.de/Aperture_Science_-_We_do_what_we_must_because_we_can") or false;
     } catch (Exception $e) {
         $daten = false;
     }
     // Encoding?
     if ($daten !== false) {
         $verkaufe = $this->csvLesen($daten);
     } else {
         $verkaufe = array();
     }
     $this->templateVars["verkaufe"] = $verkaufe;
     $this->templateVars["limit"] = $this->limitAuslesen("pizzastatistikAnzahl");
     parent::datenLaden($datenbank);
 }
Esempio n. 10
0
 public function action_default()
 {
     if (Modul::hasAccess('image_edit', 'image_create', 'image_clone', 'image_remove') == false) {
         return '<div class="notice error">Sie haben keinen Zugriff</div>';
     }
     $tmp2 = new RainTPL();
     $query = $GLOBALS['pdo']->prepare("SELECT i.*,v.status FROM images i LEFT JOIN vm_images t ON t.imageID = i.imageID LEFT JOIN vm v ON v.vmID = t.vmID");
     $query->execute();
     $vms = array();
     if ($query->rowCount()) {
         while ($ds = $query->fetch()) {
             $buttons = '';
             if ($_SESSION['user']->role['image_edit'] == 1) {
                 $buttons .= '<a href="index.php?site=images&action=edit&image=' . $ds['imageID'] . '" class="button small center grey"><span class="icon" data-icon="G"></span>Edit</a>';
             }
             if (Image::isUsed($ds['imageID']) == false && ($ds['owner'] == $_SESSION['user']->id || Modul::hasAccess('image_remove'))) {
                 $buttons .= '<a href="index.php?site=images&action=delete&image=' . $ds['imageID'] . '" class="button small center grey"><span class="icon" data-icon="T"></span>delete</a>';
             }
             if ($ds['status'] == QemuMonitor::SHUTDOWN && $ds['type'] != 'usb') {
                 $buttons .= '<a href="index.php?site=images&action=status&image=' . $ds['imageID'] . '" class="button small center grey"><span class="icon" data-icon="v"></span> Status</a>';
             }
             if ($ds['type'] != 'usb' && is_dir($ds['path']) == false) {
                 $buttons .= '<a href="index.php?site=images&action=clone&image=' . $ds['imageID'] . '" class="button small center grey"><span class="icon" data-icon="R"></span>Clone</a>';
             }
             $obj = array();
             $obj['buttons'] = $buttons;
             $obj['name'] = $ds['name'];
             if ($ds['type'] == "usb") {
                 $obj['path'] = Server::getUsbDeviceName($ds['path']);
                 $obj['type'] = $ds['type'] . " - " . $ds['path'];
             } else {
                 $obj['path'] = $ds['path'];
                 $obj['type'] = $ds['type'];
             }
             $vms[] = $obj;
         }
         $tmp2->assign('vms', $vms);
     } else {
         $tmp2->assign('vms', '<tr><td colspan="4">Kein Image vorhanden</td></tr>');
     }
     return $tmp2->draw('images_main', true);
 }
Esempio n. 11
0
 public function datenLaden($datenbank)
 {
     parent::datenLaden($datenbank);
 }
Esempio n. 12
0
            <?php 
$this->widget('ext.wdueditor.WDueditor', array('model' => $model, 'attribute' => 'materi_topik', 'language' => 'en'));
?>
            <BR>
            <?php 
echo $form->error($model, 'materi_topik');
?>
        </div>
        
        <!--
	<div class="row">
		<?php 
echo $form->labelEx($model, 'id_modul');
?>
		<?php 
echo $form->dropDownList($model, 'id_modul', CHtml::listData(Modul::model()->findAll(), 'id_modul', 'nama_modul'));
?>
		<?php 
echo $form->error($model, 'id_modul');
?>
	</div>
        -->

	<div class="row buttons">
		<?php 
echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save');
?>
	</div>

<?php 
$this->endWidget();
Esempio n. 13
0
 public function deleteModul($modul_id, $lab_id, $praktikum_id)
 {
     $modul = Modul::find($modul_id);
     $modul->modul_status = 0;
     $modul->save();
     return Redirect::route('modulKordas', array('lab_id' => $lab_id, 'praktikum_id' => $praktikum_id));
 }
Esempio n. 14
0
 public function action_default()
 {
     if (Modul::hasAccess('vm_edit', 'vm_create', 'vm_remove') == false) {
         return '<div class="notice error">Sie haben keinen Zugriff</div>';
     }
     $tmp2 = new RainTPL();
     $query = $GLOBALS['pdo']->query("SELECT * FROM vm");
     $query2 = $GLOBALS['pdo']->prepare("SELECT *,i.path,i.type FROM vm_images v JOIN images i ON i.imageID=v.imageID WHERE v.vmID = :vmID");
     $query2->bindParam(':vmID', $vmID, PDO::PARAM_INT);
     if ($query->rowCount()) {
         $vms = array();
         while ($ds = $query->fetch()) {
             $vmID = $ds['vmID'];
             if ($ds['lastrun'] != '0000-00-00 00:00:00') {
                 $lastrun = date("d.m.Y H:i", strtotime($ds['lastrun']));
             } else {
                 $lastrun = '---';
             }
             if ($ds['status'] == QemuMonitor::RUNNING) {
                 $buttons = '<a href="index.php?site=vms&action=stop&vmID=' . $ds['vmID'] . '" class="button red small center "><span class="icon" data-icon="Q"></span>Stop</a>';
                 $buttons .= '<a href="vnc.php?vmID=' . $ds['vmID'] . '"class="button small center grey"><span class="icon" data-icon="0"></span>VNC</a>';
             } else {
                 $buttons = '<a href="index.php?site=vms&action=start&vmID=' . $ds['vmID'] . '" class="button green small center"><span class="icon" data-icon="&nbsp;"></span>Start</a>';
                 $buttons .= '<a href="index.php?site=vms&action=edit&vmID=' . $ds['vmID'] . '" class="button small center grey"><span class="icon" data-icon="G"></span>Edit</a>';
                 $buttons .= '<a href="index.php?site=vms&action=clone&vmID=' . $ds['vmID'] . '" class="button small center grey"><span class="icon" data-icon="R"></span>Clone</a>';
                 $buttons .= '<a href="index.php?site=vms&action=delete&vmID=' . $ds['vmID'] . '" class="button small center grey"><span class="icon" data-icon="T"></span>Delete</a>';
             }
             $vm = array();
             $vm['name'] = $ds['name'];
             $vm['owner'] = User::getUserName($ds['owner']);
             $vm['ram'] = FileSystem::formatFileSize($ds['ram'] * 1024 * 1024, 0);
             $vm['lastrun'] = $lastrun;
             $vm['buttons'] = $buttons;
             $images = array();
             $query2->execute();
             while ($dq = $query2->fetch()) {
                 $images[] = $dq['name'];
             }
             $vm['images'] = implode(", ", $images);
             $vms[] = $vm;
         }
         $tmp2->assign('vms', $vms);
     } else {
         $tmp2->assign('vms', "Es gibt noch keine VMs.");
     }
     return $tmp2->draw('vms_main', true);
 }
Esempio n. 15
0
 public function listDetailSoalPraktikum($lab_id, $praktikum_id, $modul_id, $quiz_id)
 {
     $labs = Lab::find($lab_id);
     $praktikum = Praktikum::find($praktikum_id);
     $moduls = Modul::find($modul_id);
     $quizs = Quiz::find($quiz_id);
     $soals = DB::table('tb_soal')->where('quiz_id', '=', $quiz_id)->get();
     return View::make('dashboard.admin.Praktikum.soalDetail')->with('moduls', $moduls)->with('labs', $labs)->with('praktikum', $praktikum)->with('quizs', $quizs)->with('soals', $soals);
 }
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Modul the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Modul::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Esempio n. 17
0
 public function action_default()
 {
     if (Modul::hasAccess('user_edit', 'user_create', 'user_delete') == false) {
         return '<div class="notice error">Sie haben keinen Zugriff</div>';
     }
     $tmp2 = new RainTPL();
     $query = $GLOBALS['pdo']->prepare("SELECT * FROM users");
     $query->execute();
     $query2 = $GLOBALS['pdo']->prepare("SELECT * FROM vm WHERE owner= :user");
     $query2->bindParam(":user", $user, PDO::PARAM_INT);
     if ($query->rowCount() > 0) {
         $users = array();
         while ($ds = $query->fetch()) {
             $buttons = '';
             if ($_SESSION['user']->role['user_edit'] == 1) {
                 $buttons .= '<a href="index.php?site=users&action=edit&user='******'userID'] . '" class="button grey small center"><span class="icon" data-icon="G"></span>Edit</a>';
             }
             if ($_SESSION['user']->role['vm_create'] == 1) {
                 $buttons .= '<a href="index.php?site=users&action=addVM&user='******'userID'] . '" class="button green small center"><span class="icon" data-icon="+"></span>add VM</a>';
             }
             if ($_SESSION['user']->role['user_remove'] == 1) {
                 $buttons .= '<a href="index.php?site=users&action=delete&user='******'userID'] . '" class="button red small center"><span class="icon" data-icon="x"></span>delete</a>';
             }
             $user = $ds['userID'];
             $query2->execute();
             $user_vms = array();
             if ($query2->rowCount()) {
                 while ($vm = $query2->fetch()) {
                     $user_vms[] = '<a href="index.php?site=vms&action=edit&vmID=' . $vm['vmID'] . '">' . $vm['name'] . '</a>';
                 }
                 $user_vms = implode(", ", $user_vms);
             } else {
                 $user_vms = 'Keine zugewiesen';
             }
             $user = array();
             $user['mail'] = $ds['email'];
             $user['role'] = Helper::getRoleName($ds['role']);
             $user['vms'] = $user_vms;
             $user['buttons'] = $buttons;
             $users[] = $user;
         }
         $tmp2->assign('users', $users);
     } else {
         $tmp2->assign('users', '<tr><td colspan="4">Keine Nutzer vorhanden</td></tr>');
     }
     return $tmp2->draw('users_table', true);
 }