diff --git a/cms/content.php b/cms/content.php new file mode 100644 index 000000000..0bb61188d --- /dev/null +++ b/cms/content.php @@ -0,0 +1,87 @@ +, + * Andreas Oesterreicher and + * Karl Burkhart . + */ +/** + * Laedt den Content und das zugeordnete Template aus der Datenbank und + * zeigt diese an. + */ +require_once('../config/cis.config.inc.php'); +require_once('../include/content.class.php'); +require_once('../include/template.class.php'); +require_once('../include/functions.inc.php'); + +if(isset($_GET['content_id'])) + $content_id = $_GET['content_id']; +else + die('ContentID muss uebergeben werden'); + +$version = (isset($_GET['version'])?$_GET['version']:null); + +if(isset($_SESSION['FHC_SPRACHE'])) +{ + $sprache=$_SESSION['FHC_SPRACHE']; +} + +if(isset($_COOKIE['FHC_SPRACHE'])) +{ + $cookie_sprache=$_COOKIE['FHC_SPRACHE']; + if(!isset($sprache)) + $sprache=$cookie_sprache; +} +if(!isset($sprache)) +{ + $sprache='German'; +} + +if(!isset($cookie_sprache) || $cookie_sprache!=$sprache) +{ + setcookie('FHC_SPRACHE',$sprache,time()+(3600*24*100)); +} +//XML Content laden +$content = new content(); + +if($content->islocked($content_id)) +{ + $uid = manual_basic_auth(); + if(!$content->berechtigt($content_id, $uid)) + die('Sie haben keine Berechtigung fuer diese Seite'); +} + +if(!$content->getContent($content_id, $sprache, $version)) + die($content->errormsg); + +$XML = new DOMDocument(); +$XML->loadXML($content->content); + +//XSLT Vorlage laden +$template = new template(); +if(!$template->load($content->template_kurzbz)) + die($template->errormsg); + +$xsltemplate = new DOMDocument(); +$xsltemplate->loadXML($template->xslt_xhtml); + +//Transformation +$processor = new XSLTProcessor(); +$processor->importStylesheet($xsltemplate); + +echo $processor->transformToXML($XML); +?> \ No newline at end of file diff --git a/include/content.class.php b/include/content.class.php new file mode 100644 index 000000000..5b7c8f123 --- /dev/null +++ b/include/content.class.php @@ -0,0 +1,216 @@ +, + * Andreas Oesterreicher and + * Karl Burkhart . + */ +require_once('basis_db.class.php'); + +class content extends basis_db +{ + public $new; // boolean + public $result = array(); // studiensemester Objekt + + //Tabellenspalten + public $content_id; + public $template_kurzbz; + public $titel; + public $updateamum; + public $updatevon; + public $insertamum; + public $insertvon; + public $oe_kurzbz; + + public $contentsprache_id; + public $sprache; + public $version; + public $sichtbar; + public $content; + public $reviewvon; + public $reviewamum; + + /** + * Konstruktor + * + */ + public function __construct() + { + parent::__construct(); + } + + public function getContent($content_id, $sprache='German', $version=null, $sichtbar=true) + { + if(!is_numeric($content_id)) + { + $this->errormsg='ContentID ist ungueltig'; + return false; + } + $qry = "SELECT + *, + tbl_contentsprache.insertamum, tbl_contentsprache.insertvon, + tbl_contentsprache.updateamum, tbl_contentsprache.updatevon + FROM + campus.tbl_content + JOIN campus.tbl_contentsprache USING(content_id) + WHERE + tbl_content.content_id='".addslashes($content_id)."' + AND tbl_contentsprache.sprache='".addslashes($sprache)."'"; + if($sichtbar) + $qry.=" AND sichtbar=true"; + if(!is_null($version)) + $qry.=" AND tbl_contentsprache.version='".addslashes($version)."'"; + $qry.=" ORDER BY version LIMIT 1"; + + if($result = $this->db_query($qry)) + { + if($row = $this->db_fetch_object($result)) + { + $this->content_id = $row->content_id; + $this->titel = $row->titel; + $this->template_kurzbz = $row->template_kurzbz; + $this->sprache = $row->sprache; + $this->contentsprache_id = $row->contentsprache_id; + $this->version = $row->version; + $this->sichtbar = ($row->sichtbar=='t'?true:false); + $this->content = $row->content; + $this->reviewvon = $row->reviewvon; + $this->reviewamum = $row->reviewamum; + $this->updateamum = $row->updateamum; + $this->updatevon = $row->updatevon; + $this->insertamum = $row->insertamum; + $this->insertvon = $row->insertvon; + return true; + } + else + { + $this->errormsg='Dieser Eintrag wurde nicht gefunden'; + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Laden des Contents'; + return false; + } + } + + /** + * Prueft ob der Zugriff auf den Content eingeschraenkt ist auf + * eine bestimmte Benutzergruppe + * + * @param $content_id + * @return true wenn eingeschraenkt sonst false + */ + public function islocked($content_id) + { + if(!is_numeric($content_id)) + { + $this->errormsg = 'ContentID ist ungueltig'; + return false; + } + + $qry = "SELECT count(*) as anzahl FROM campus.tbl_contentgruppe WHERE content_id='".addslashes($content_id)."'"; + + if($result = $this->db_query($qry)) + { + if($row = $this->db_fetch_object($result)) + { + if($row->anzahl>0) + return true; + else + return false; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + else + { + $this->errormsg='Fehler beim Laden der Daten'; + return false; + } + } + + /** + * Prueft ob ein User die Berechtigung fuer das Anzeigen des Contents besitzt + * + * @param $content_id ID des Contents + * @param $uid User der versucht auf den Content zuzugreifen + */ + public function berechtigt($content_id, $uid) + { + if(!is_numeric($content_id)) + { + $this->errormsg = 'ContentID ist ungueltig'; + return false; + } + + $qry = "SELECT + 1 + FROM + campus.tbl_contentgruppe + JOIN public.vw_gruppen USING(gruppe_kurzbz) + WHERE + tbl_contentgruppe.content_id='".addslashes($content_id)."' + AND vw_gruppen.uid='".addslashes($uid)."'"; + if($result = $this->db_query($qry)) + { + if($this->db_num_rows($result)>0) + return true; + else + return false; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + public function getMenueArray($content_id) + { + $arr = array(); + if(!is_numeric($content_id)) + { + $this->errormsg='ContentID ist ungueltig'; + return false; + } + + $qry = "SELECT + tbl_contentchild.content_id, + tbl_contentchild.child_content_id, + tbl_content.titel + FROM + campus.tbl_contentchild + JOIN campus.tbl_content ON(tbl_contentchild.child_content_id=tbl_content.content_id) + WHERE + tbl_contentchild.content_id='".addslashes($content_id)."'"; + if($result = $this->db_query($qry)) + { + while($row = $this->db_fetch_object($result)) + { + $arr[$row->titel]=array('name'=>$row->titel, 'link'=>APP_ROOT.'content.php?content_id='.$row->child_content_id, 'target'=>'main'); + $arr[$row->titel]=array_merge($arr[$row->titel],$this->getMenueArray($row->child_content_id)); + } + } + return $arr; + } +} +?> \ No newline at end of file diff --git a/include/functions.inc.php b/include/functions.inc.php index b252280b7..bed17cd89 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -812,4 +812,21 @@ function check_filename($filename) else return true; } + +/** + * Startet eine HTTP-Basic-Authentifizierung und prueft das Passwort gegen LDAP + * @return uid wenn erfolgreich. Fehlermeldung und Scriptabbruch bei fehlerhafter Auth. + */ +function manual_basic_auth() +{ + if(!(isset($_SERVER['PHP_AUTH_USER']) && checkldapuser($_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW']))) + { + header('WWW-Authenticate: Basic realm="Technikum-Wien"'); + header('HTTP/1.0 401 Unauthorized'); + echo "Ihre Zugangsdaten sind ungueltig!"; + exit; + } + else + return $_SERVER['PHP_AUTH_USER']; +} ?> diff --git a/include/statistik.class.php b/include/statistik.class.php index 0361bd339..12ad7c47a 100644 --- a/include/statistik.class.php +++ b/include/statistik.class.php @@ -1,5 +1,5 @@ , * Andreas Oesterreicher + * Karl Burkhart . */ require_once(dirname(__FILE__).'/basis_db.class.php'); class statistik extends basis_db { - public $new; // boolean - public $statistik_obj=array();// Statistik Objekt + public $new; + public $statistik_obj=array(); + public $result=array(); + public $statistik_kurzbz; + public $content_id; + public $bezeichnung; + public $url; + public $sql; + public $php; + public $r; + public $gruppe; + public $insertamum; + public $insertvon; + public $updateamum; + public $udpatevon; + public $studiengang_kz; // integer public $prestudent_id; // integer public $geschlecht; // char(1) @@ -39,6 +54,210 @@ class statistik extends basis_db parent::__construct(); } + /** + * Laedt eine Statistik + * @param $statistik_kurzbz + */ + public function load($statistik_kurzbz) + { + $qry = "SELECT + * + FROM + public.tbl_statistik + WHERE + statistik_kurzbz='".addslashes($statistik_kurzbz)."'"; + + if($result = $this->db_query($qry)) + { + if($row = $this->db_fetch_object($result)) + { + $this->statistik_kurzbz = $row->statistik_kurzbz; + $this->content_id = $row->content_id; + $this->bezeichnung = $row->bezeichnung; + $this->url = $row->url; + $this->sql = $row->sql; + $this->php = $row->php; + $this->r = $row->r; + $this->gruppe = $row->gruppe; + $this->insertamum = $row->insertamum; + $this->insertvon = $row->insertvon; + $this->updateamum = $row->updateamum; + $this->udpatevon = $row->updatevon; + + return true; + } + else + { + $this->errormsg = 'Dieser Eintrag wurde nicht gefunden'; + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + /** + * Laedt alle Statistiken + * @return true wenn ok, sonst false + */ + public function getAll() + { + $qry = 'SELECT * FROM public.tbl_statistik'; + + if($result = $this->db_query($qry)) + { + while($row = $this->db_fetch_object($result)) + { + $obj = new statistik(); + + $obj->statistik_kurzbz = $row->statistik_kurzbz; + $obj->content_id = $row->content_id; + $obj->bezeichnung = $row->bezeichnung; + $obj->url = $row->url; + $obj->sql = $row->sql; + $obj->php = $row->php; + $obj->r = $row->r; + $obj->gruppe = $row->gruppe; + $obj->insertamum = $row->insertamum; + $obj->insertvon = $row->insertvon; + $obj->updateamum = $row->updateamum; + $obj->udpatevon = $row->updatevon; + + $this->result[] = $obj; + } + + return true; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + /** + * Speichert einen Statistik Datensatz + * @param $new boolean + * @return boolean true wenn ok false im Fehlerfalls + */ + public function save($new=null) + { + if(is_null($new)) + $new = $this->new; + + if($new) + { + $qry = 'INSERT INTO public.tbl_statistik(statistik_kurzbz, content_id, bezeichnung, url, sql, + php, r, gruppe, insertamum, insertvon, updateamum, updatevon) VALUES('. + $this->addslashes($this->statistik_kurzbz).','. + $this->addslashes($this->content_id).','. + $this->addslashes($this->bezeichnung).','. + $this->addslashes($this->url).','. + $this->addslashes($this->sql).','. + $this->addslashes($this->php).','. + $this->addslashes($this->r).','. + $this->addslashes($this->gruppe).','. + $this->addslashes($this->insertamum).','. + $this->addslashes($this->insertvon).','. + $this->addslashes($this->updateamum).','. + $this->addslashes($this->updatevon).');'; + } + else + { + if($this->statistik_kurzbz_orig=='') + $this->statistik_kurzbz_orig=$this->statistik_kurzbz; + $qry = 'UPDATE public.tbl_statistik SET + content_id='.$this->addslashes($this->content_id).','. + ' bezeichnung='.$this->addslashes($this->bezeichnung).','. + ' statistik_kurzbz='.$this->addslashes($this->statistik_kurzbz).','. + ' url='.$this->addslashes($this->url).','. + ' sql='.$this->addslashes($this->sql).','. + ' php='.$this->addslashes($this->php).','. + ' r='.$this->addslashes($this->r).','. + ' gruppe='.$this->addslashes($this->gruppe).','. + ' insertamum='.$this->addslashes($this->insertamum).','. + ' insertvon='.$this->addslashes($this->insertvon).','. + ' updateamum='.$this->addslashes($this->updateamum).','. + ' updatevon='.$this->addslashes($this->updatevon). + " WHERE statistik_kurzbz='".addslashes($this->statistik_kurzbz_orig)."'"; + } + + if($this->db_query($qry)) + { + return true; + } + else + { + $this->errormsg='Fehler beim Speichern der Daten'; + return false; + } + } + + /** + * Liefert ein Array mit den Menueeintraegen der Statistiken + * Mit dem Returnwert dieser Funktion wird die entsprechende Stelle im + * Menue ueberschrieben + * @return Array fuer Menue + */ + public function getMenueArray() + { + $arr = array(); + + $qry = "SELECT + * + FROM + public.tbl_statistik + ORDER BY gruppe, bezeichnung, statistik_kurzbz"; + + if($result = $this->db_query($qry)) + { + $lastgruppe=''; + while($row = $this->db_fetch_object($result)) + { + if($row->gruppe!='' && $row->gruppe!=$lastgruppe) + { + $arr[$row->gruppe]=array('name'=>$row->gruppe); + $lastgruppe=$row->gruppe; + } + if($row->gruppe!='') + { + $arr[$row->gruppe][$row->statistik_kurzbz]=array('name'=>$row->bezeichnung, 'link'=>APP_ROOT.'vilesci/statistik/statistik_frameset.php?statistik_kurzbz='.$row->statistik_kurzbz, 'target'=>'main'); + } + else + { + $arr[$row->statistik_kurzbz]=array('name'=>$row->bezeichnung, 'link'=>APP_ROOT.'vilesci/statistik/statistik_frameset.php?statistik_kurzbz='.$row->statistik_kurzbz, 'target'=>'main'); + } + } + } + return $arr; + } + + /** + * Loescht einen Eintrag + * + * @param $statistik_kurzbz + * @return true wenn ok, sonst false + */ + public function delete($statistik_kurzbz) + { + $qry = "DELETE FROM public.tbl_statistik WHERE statistik_kurzbz='".addslashes($statistik_kurzbz)."';"; + + if($this->db_query($qry)) + { + return true; + } + else + { + $this->errormsg='Fehler beim Löschen des Eintrages'; + return false; + } + } + + + /** * Laedt bestimmte PreStudenten * @param studiengang_kz KZ des Studienganges der zu Laden ist diff --git a/include/template.class.php b/include/template.class.php new file mode 100644 index 000000000..5938edfc9 --- /dev/null +++ b/include/template.class.php @@ -0,0 +1,77 @@ +, + * Andreas Oesterreicher and + * Karl Burkhart . + */ +require_once('basis_db.class.php'); + +class template extends basis_db +{ + public $new; + public $result = array(); + + public $template_kurzbz; + public $bezeichnung; + public $xsd; + public $xslt_xhtml; + public $xslfo_pdf; + + /** + * Konstruktor + * + */ + public function __construct() + { + parent::__construct(); + } + + public function load($template_kurzbz) + { + $qry = "SELECT + * + FROM + campus.tbl_template + WHERE + tbl_template.template_kurzbz='".addslashes($template_kurzbz)."'"; + + if($result = $this->db_query($qry)) + { + if($row = $this->db_fetch_object($result)) + { + $this->template_kurzbz = $row->template_kurzbz; + $this->bezeichnung = $row->bezeichnung; + $this->xsd = $row->xsd; + $this->xslt_xhtml = $row->xslt_xhtml; + $this->xslfo_pdf = $row->xslfo_pdf; + return true; + } + else + { + $this->errormsg='Dieser Eintrag wurde nicht gefunden'; + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Laden des Templates'; + return false; + } + } +} +?> \ No newline at end of file diff --git a/include/tw/vilesci_menu_main.inc.php b/include/tw/vilesci_menu_main.inc.php index a37919a97..86a8cb0d3 100644 --- a/include/tw/vilesci_menu_main.inc.php +++ b/include/tw/vilesci_menu_main.inc.php @@ -160,6 +160,7 @@ $menu=array 'Ort'=>array('name'=>'Ort (Raum)', 'link'=>'stammdaten/raum_frameset.html', 'target'=>'main','permissions'=>array('basis/ort')), 'Firmen'=>array('name'=>'Firmen', 'link'=>'stammdaten/firma_frameset.html', 'target'=>'main','permissions'=>array('basis/firma')), 'Organisationseinheiten'=>array('name'=>'Organisationseinheiten', 'link'=>'stammdaten/organisationseinheiten.php', 'target'=>'main','permissions'=>array('basis/organisationseinheit')), + 'Statistik'=>array('name'=>'Statistik', 'link'=>'stammdaten/statistik_frameset.html', 'target'=>'main','permissions'=>array('basis/statistik')), 'ImExport'=>array ( 'name'=>'ImExport','permissions'=>array('admin'), @@ -191,6 +192,7 @@ $menu=array ( 'name'=>'Auswertung', 'opener'=>'true', 'hide'=>'true', 'permissions'=>array('admin','lv-plan','support'), 'image'=>'statistic.png', 'link'=>'left.php?categorie=Auswertung', 'target'=>'nav', + /* 'Raumauslastung'=>array('name'=>'Raumauslastung...', 'link'=>'lehre/raumauslastung.php', 'target'=>'main'), 'Verplanungsuebersicht'=>array('name'=>'Verplanungsübersicht...', 'link'=>'lehre/check/verplanungsuebersicht.php', 'target'=>'main'), 'Zeitwünsche'=>array('name'=>'Zeitwünsche', 'link'=>'lehre/zeitwuensche.php', 'target'=>'main'), @@ -206,8 +208,7 @@ $menu=array 'Lektorenstatistik'=>array('name'=>'Lektorenstatistik', 'link'=>'https://vilesci.technikum-wien.at/content/statistik/lektorenstatistik.php', 'target'=>'main'), 'Mitarbeiterstatistik'=>array('name'=>'Mitarbeiterstatistik', 'link'=>'https://vilesci.technikum-wien.at/content/statistik/mitarbeiterstatistik.php', 'target'=>'main'), 'Stromanalyse'=>array('name'=>'Stromanalyse...', 'link'=>'https://vilesci.technikum-wien.at/content/statistik/bama_stromanalyse.php', 'target'=>'main'), - - + */ ), 'Inventar'=> array ( @@ -251,4 +252,10 @@ $menu=array ) ); + +require_once(dirname(__FILE__).'/../statistik.class.php'); +$statistik = new statistik(); +$statistik = $statistik->getMenueArray(1); +$menu['Auswertung']=array_merge($menu['Auswertung'],$statistik); +//var_dump($menu['Auswertung']); ?> \ No newline at end of file diff --git a/vilesci/stammdaten/statistik_details.php b/vilesci/stammdaten/statistik_details.php new file mode 100644 index 000000000..7fb390da4 --- /dev/null +++ b/vilesci/stammdaten/statistik_details.php @@ -0,0 +1,170 @@ + + * Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at > + * Karl Burkhart < burkhart@technikum-wien.at > + */ +/** + * Seite zur Wartung der Statistiken + */ +require_once('../../config/vilesci.config.inc.php'); +require_once('../../include/statistik.class.php'); +require_once('../../include/benutzerberechtigung.class.php'); + +if (!$db = new basis_db()) + die('Es konnte keine Verbindung zum Server aufgebaut werden.'); + +$user = get_uid(); + +$rechte = new benutzerberechtigung(); +$rechte->getBerechtigungen($user); + +if(!$rechte->isBerechtigt('basis/statistik')) + die('Sie haben keine Berechtigung fuer diese Seite'); + +?> + + + + Statistik - Details + + + + + +insertamum=date('Y-m-d H:i:s'); + $statistik->insertvon = $user; + $statistik->new = true; + } + else + { + if(!$statistik->load($statistik_kurzbz_orig)) + die($statistik->errormsg); + + $statistik->new=false; + } + + $statistik->statistik_kurzbz=$statistik_kurzbz; + $statistik->statistik_kurzbz_orig = $statistik_kurzbz_orig; + $statistik->bezeichnung = $bezeichnung; + $statistik->url = $url; + $statistik->sql = $sql; + $statistik->gruppe = $gruppe; + $statistik->content_id = $content_id; + $statistik->php = $php; + $statistik->r = $r; + $statistik->updateamum = date('Y-m-d H:i:s'); + $statistik->updatevon = $user; + + if($statistik->save()) + { + echo 'Daten erfolgreich gespeichert'; + echo "\n"; + $action='update'; + } + else + { + $action='new'; + echo ''.$statistik->errormsg.''; + } + } + + echo '
'; + switch($action) + { + case 'new': + echo 'Neu'; + $new = 'true'; + break; + case 'update': + if(!$statistik->load($statistik_kurzbz)) + die($statistik->errormsg); + echo "Bearbeiten - $statistik_kurzbz"; + $new = 'false'; + break; + default: + die('Invalid Action'); + break; + } + echo '
'; + echo ''; + echo ''; + echo ''; + echo ''; + echo ' '; + echo ' '; + echo ' '; + echo ' '; + echo ' '; + echo ''; + echo ''; + echo ' '; + echo ' '; + echo ' '; + echo ' '; + echo ' '; + echo ''; + echo ''; + echo ' '; + echo ' '; + echo ' '; + echo ' '; + echo ' '; + echo ''; + echo ''; + echo ' '; + echo ' '; + echo ' '; + echo ' '; + echo ' '; + echo ''; + echo ''; + echo ''; + echo ' '; + echo ' '; + echo ' '; + echo ' '; + echo ' '; + echo '
KurzbzGruppe
BezeichnungContentID
URLPHP
SQLR
'; + echo '
'; + + echo '
'; +?> + + \ No newline at end of file diff --git a/vilesci/stammdaten/statistik_frameset.html b/vilesci/stammdaten/statistik_frameset.html new file mode 100644 index 000000000..9c58ff7c0 --- /dev/null +++ b/vilesci/stammdaten/statistik_frameset.html @@ -0,0 +1,20 @@ + + + + + VileSci + + + + + + + + + <body bgcolor="#FFFFFF"> + This application works only with a frames-enabled browser.<br /> + </body> + + + + \ No newline at end of file diff --git a/vilesci/stammdaten/statistik_uebersicht.php b/vilesci/stammdaten/statistik_uebersicht.php new file mode 100644 index 000000000..247436aa3 --- /dev/null +++ b/vilesci/stammdaten/statistik_uebersicht.php @@ -0,0 +1,114 @@ + + * Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at > + * Karl Burkhart < burkhart@technikum-wien.at > + */ +require_once('../../config/vilesci.config.inc.php'); +require_once('../../include/statistik.class.php'); +require_once('../../include/benutzerberechtigung.class.php'); + +$user = get_uid(); + +$rechte = new benutzerberechtigung(); +$rechte->getBerechtigungen($user); + +if(!$rechte->isBerechtigt('basis/statistik')) + die('Sie haben keine Berechtigung fuer diese Seite'); + +echo ' + + + Statistik + + + + + + + + + +

Statistik Übersicht

+
+ Neu +
'; +if(isset($_GET['action']) && $_GET['action']=='delete') +{ + if(!$rechte->isBerechtigt('basis/statistik', null, 'suid')) + die('Sie haben keine Berechtigung fuer diese Seite'); + + if(!isset($_GET['statistik_kurzbz'])) + die('Fehlender Parameter Statistik'); + + $statistik = new statistik(); + if($statistik->delete($_GET['statistik_kurzbz'])) + echo 'Eintrag wurde erfolgreich gelöscht'; + else + echo ''.$statistik->errormsg.''; +} + +$statistik = new statistik(); + +if(!$statistik->getAll()) + die($statistik->errormsg); + +echo ' + + + + + + + + + + '; + +foreach($statistik->result as $row) +{ + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; +} +echo ' +
KurzbzBezeichnungGruppeContentIDAktion
',$row->statistik_kurzbz,'',$row->bezeichnung,'',$row->gruppe,'',$row->content_id,'bearbeitenentfernen
+ +'; +?> \ No newline at end of file diff --git a/vilesci/statistik/statistik.php b/vilesci/statistik/statistik.php new file mode 100644 index 000000000..3e13c40b6 --- /dev/null +++ b/vilesci/statistik/statistik.php @@ -0,0 +1,141 @@ +, + * Andreas Oesterreicher and + * Karl Burkhart . + */ +/** + * Statistik Uebersichtsseite + * - zeigt die Beschreibung einer Statistik ein + * - Link zum Starten der Statistik + * - Eventuelle Parametereingabe für die Statistik + */ +require_once('../../config/vilesci.config.inc.php'); +require_once('../../include/statistik.class.php'); +require_once('../../include/functions.inc.php'); + +if(!isset($_GET['statistik_kurzbz'])) + die('Statistik_kurzbz Parameter fehlt'); + +$statistik_kurzbz = $_GET['statistik_kurzbz']; + +echo ' + + + Statistik + + + + +'; + +$statistik = new statistik(); +if(!$statistik->load($statistik_kurzbz)) + die($statistik->errormsg); + +echo '

Statistik - '.$statistik->bezeichnung.'

'; + +//Beschreibung zu der Statistik anzeigen +if($statistik->content_id!='') +{ + echo "\n",'Beschreibung anzeigen

'; +} +$variablenstring=''; +$action=''; +if($statistik->url!='') +{ + $action = $statistik->url; + $variablenstring = $statistik->url; +} +elseif($statistik->sql!='') +{ + $action = 'statistik_sql.php?statistik_kurzbz='.$statistik_kurzbz; + $variablenstring = $statistik->sql; +} + +$vars = parseVars($variablenstring); +//var_dump($vars); +echo ' + +
+ +'; +foreach($vars as $var) +{ + echo ''; + echo ""; + echo ''; +} +echo ' + + + + +
$var
+
'; + +echo ' +'; + +/***FUNCTIONS***/ + +/** + * + * Parst Variablen aus einem String und liefert diese als Array zurueck + * @param $value String mit Variablen + * z.B.: "Select * from tbl_person where person_id<'$person_id'" + * oder "../content/statistik/bewerberstatistik.php?stsem=$StSem&stg_kz=$stg_kz" + * + * @return Array mit den Variablennamen + */ +function parseVars($value) +{ + $result = array(); + + $check = '/\$[0-9A-z]+/'; + preg_match_all($check, $value, $result); + $result = $result[0]; + + for($i=0;$i \ No newline at end of file diff --git a/vilesci/statistik/statistik_frameset.php b/vilesci/statistik/statistik_frameset.php new file mode 100644 index 000000000..524af9cee --- /dev/null +++ b/vilesci/statistik/statistik_frameset.php @@ -0,0 +1,20 @@ + + + + + VileSci + + + + + + + + + <body bgcolor="#FFFFFF"> + This application works only with a frames-enabled browser.<br /> + </body> + + + + \ No newline at end of file diff --git a/vilesci/statistik/statistik_sql.php b/vilesci/statistik/statistik_sql.php new file mode 100644 index 000000000..1338d6380 --- /dev/null +++ b/vilesci/statistik/statistik_sql.php @@ -0,0 +1,96 @@ +, + * Andreas Oesterreicher and + * Karl Burkhart . + */ +require_once('../../config/vilesci.config.inc.php'); +require_once('../../include/statistik.class.php'); + +if(!isset($_GET['statistik_kurzbz'])) + die('Statistik_kurzbz Parameter fehlt'); + +$statistik_kurzbz = $_GET['statistik_kurzbz']; + +echo ' + + + Statistik + + + + + + + +'; + +$statistik = new statistik(); +if(!$statistik->load($statistik_kurzbz)) + die($statistik->errormsg); + +echo '

Statistik - '.$statistik->bezeichnung.'

'; + +if($statistik->sql!='') +{ + $sql = $statistik->sql; + foreach($_POST as $name=>$value) + { + $sql = str_replace('$'.$name,addslashes($value),$sql); + } + + $db = new basis_db(); + if($result = $db->db_query($sql)) + { + echo ''; + echo ''; + $anzahl_spalten = $db->db_num_fields($result); + for($spalte=0;$spalte<$anzahl_spalten;$spalte++) + { + echo ''; + } + echo ''; + while($row = $db->db_fetch_object($result)) + { + echo ''; + $anzahl_spalten = $db->db_num_fields($result); + for($spalte=0;$spalte<$anzahl_spalten;$spalte++) + { + $name = $db->db_field_name($result,$spalte); + echo ''; + } + echo ''; + } + echo '
'.$db->db_field_name($result,$spalte).'
'.$row->$name.'
'; + } +} +else +{ + echo 'Zu dieser Statistik gibt es keine SQL Abfrage'; +} +?> \ No newline at end of file