diff --git a/include/basis_db.class.php b/include/basis_db.class.php index b8becf340..9e685cfca 100644 --- a/include/basis_db.class.php +++ b/include/basis_db.class.php @@ -49,11 +49,12 @@ abstract class db extends basis abstract function db_fetch_array($result=null); abstract function db_fetch_row($result=null, $i=null); abstract function db_fetch_assoc($result=null, $i=null); - abstract function db_result($result = null, $i,$item); + abstract function db_result($result = null, $i, $item); abstract function db_num_rows($result=null); abstract function db_num_fields($result=null); abstract function db_field_name($result=null, $i); abstract function db_affected_rows($result=null); + abstract function db_result_seek($result=null, $offset); abstract function db_last_error(); abstract function db_free_result($result=null); abstract function db_version(); diff --git a/include/pgsql.class.php b/include/pgsql.class.php index c919eb3ff..59149d57b 100644 --- a/include/pgsql.class.php +++ b/include/pgsql.class.php @@ -163,6 +163,14 @@ class basis_db extends db return pg_affected_rows($result); } + public function db_result_seek($result=null, $offset) + { + if(is_null($result)) + return pg_result_seek($this->db_result, $offset); + else + return pg_result_seek($result, $offset); + } + public function db_fetch_array($result=null) { if(is_null($result)) diff --git a/include/process.class.php b/include/process.class.php new file mode 100644 index 000000000..b8540d091 --- /dev/null +++ b/include/process.class.php @@ -0,0 +1,87 @@ + + */ + +class process +{ + private $pid; + private $command; + + public $lastout; + public $output; + public $exit; + + public function __construct($cl=false) + { + if ($cl != false) + { + $this->command = $cl; + $this->runCom(); + } + } + private function runCom() + { + $command = 'nohup '.$this->command.' > /dev/null 2>&1 & echo $!'; + $this->lastout=exec($command, $this->output, $this->exit); //exec($command ,$op); + $this->pid = (int)$this->output[0]; + } + + public function setPid($pid) + { + $this->pid = $pid; + } + + public function getPid() + { + return $this->pid; + } + + public function status() + { + $command = 'ps -p '.$this->pid; + exec($command,$op); + if (!isset($op[1])) + return false; + else + return true; + } + + public function start() + { + if ($this->command != '') + $this->runCom(); + else + return true; + } + + public function stop() + { + $command = 'kill '.$this->pid; + exec($command); + if ($this->status() == false) + return true; + else + return false; + } +} +?> diff --git a/include/statistik.class.php b/include/statistik.class.php index 1dfa126d9..c66ddb503 100644 --- a/include/statistik.class.php +++ b/include/statistik.class.php @@ -25,7 +25,7 @@ class statistik extends basis_db { public $new; public $statistik_obj=array(); - public $result=array(); + public $result; public $statistik_kurzbz; public $content_id; @@ -52,7 +52,7 @@ class statistik extends basis_db public $anzahl; //Hilfsvariable fuer Group BY Abfragen // Daten der Statistik - public $data; + public $data; // DB ressource public $html; public $csv; public $json; @@ -60,9 +60,14 @@ class statistik extends basis_db /** * Konstruktor */ - public function __construct($studiengang_kz=null) + public function __construct($statistik_kurzbz=null) { - parent::__construct(); + parent::__construct(); + + if(!is_null($statistik_kurzbz)) + $this->load($statistik_kurzbz); + else + $this->new=true; } /** @@ -122,9 +127,8 @@ class statistik extends basis_db { $qry = 'SELECT * FROM public.tbl_statistik'; - if($order) { + if($order) $qry .= ' ORDER BY ' . $order; - } if($result = $this->db_query($qry)) { @@ -242,7 +246,7 @@ class statistik extends basis_db { $this->errormsg = 'Fehler beim Laden der Daten'; return false; - } + } } /** * Speichert einen Statistik Datensatz @@ -566,7 +570,7 @@ class statistik extends basis_db } else { - $this->error_msg= 'Zu dieser Statistik gibt es keine SQL Abfrage'; + $this->errormsg= 'Zu dieser Statistik gibt es keine SQL Abfrage'; return false; } } @@ -582,6 +586,21 @@ class statistik extends basis_db return $this->csv; } + function writeCSV($filename, $delimiter=',', $enclosure='"') + { + $fh=fopen($filename,'w'); + + $fieldnames=array(); + for ($i=0; $i < $this->db_num_fields($this->data); $i++) + $fieldnames[]=$this->db_field_name($this->data,$i); + fputcsv($fh, $fieldnames, $delimiter, $enclosure); + $this->db_result_seek($this->data,0); + while ($row = $this->db_fetch_row($this->data)) + fputcsv($fh, $row, $delimiter, $enclosure); + fclose($fh); + return true; + } + function getJSON() { return json_encode($this->json); diff --git a/include/studiensemester.class.php b/include/studiensemester.class.php index 27a190a2a..f9d412a73 100644 --- a/include/studiensemester.class.php +++ b/include/studiensemester.class.php @@ -24,16 +24,16 @@ require_once('basis_db.class.php'); class studiensemester extends basis_db { - protected $new; // boolean - protected $studiensemester = array(); // studiensemester Objekt + public $new; // boolean + public $studiensemester = array(); // studiensemester Objekt //Tabellenspalten - protected $studiensemester_kurzbz;// varchar(16) - protected $start; // date - protected $ende; // date - protected $bezeichnung; // varchar(32) - protected $studienjahr_kurzbz; // varchar(16) - protected $studiensemester_kurzbz_alternativ; // varchar(16) + public $studiensemester_kurzbz;// varchar(16) + public $start; // date + public $ende; // date + public $bezeichnung; // varchar(32) + public $studienjahr_kurzbz; // varchar(16) + public $studiensemester_kurzbz_alternativ; // varchar(16) /** * Konstruktor - Laedt optional ein StSem diff --git a/system/xsl/Studienblatt.xsl b/system/xsl/StudienblattEng_0_1.xsl similarity index 100% rename from system/xsl/Studienblatt.xsl rename to system/xsl/StudienblattEng_0_1.xsl diff --git a/system/xsl/Studienblatt_0_1.xsl b/system/xsl/Studienblatt_0_1.xsl new file mode 100644 index 000000000..1b3a1cdda --- /dev/null +++ b/system/xsl/Studienblatt_0_1.xsl @@ -0,0 +1,498 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Studienblatt + Bestätigung des Studierendenstatus + + + + + + + + Familienname, Vorname + , + + + + Personenkennzeichen + + + + + + Adresse + , + + + + + + + Geburtsdatum + + + + Geburtsort + + + + Geschlecht + + + + + + + + + + + + + Institution + Fachhochschule Technikum Wien + + + + + + + Studiengang + + + + + Kennzahl + + + + + + Studiengangsart + + + + Organisationsform + + + + Unterrichtssprache + + + + + + ECTS + + + + ECTS je Semester + + + + Regelstudiendauer + + + + + + + Akademischer + + Grad + + + + + + + + + + + + + + + Studienantritt + + + + + + + + + + Erstes Studiensemester + + + + + + + + + Aktuelles Studiensemester + + + + + + + + + Aktuelles Ausbildungssemester + + + + + + + + + Aktueller Studierendenstatus + + + + + + + + + Voraussichtlich letztes Studiensemester + + + + + + + + + Voraussichtliches Abschlussdatum + + + + + + + + + + + + + + + + + + Datum: + + + + + + + + + + Studiengangsleitung + + + + + + + + \ No newline at end of file diff --git a/system/xsl/Studienblatt_0_2.xsl b/system/xsl/Studienblatt_0_2.xsl new file mode 100644 index 000000000..33f75130d --- /dev/null +++ b/system/xsl/Studienblatt_0_2.xsl @@ -0,0 +1,504 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Studienblatt + Bestätigung des Studierendenstatus + + + + + + + + Familienname, Vorname + , + + + + Personenkennzeichen + + + + + + Adresse + , + + + + + + + Geburtsdatum + + + + Geburtsort + + + + Geschlecht + + + + + + + + + + + + + Institution + Fachhochschule Technikum Wien + + + + + + + Studiengang + + + + + Kennzahl + + + + + + Studiengangsart + + + + Organisationsform + + + + Unterrichtssprache + + + + + + ECTS + + + + ECTS je Semester + + + + Regelstudiendauer + + + + + + + Akademischer + + Grad + + + + + + + + + + + + + + + Studienantritt + + + + + + + + + + Erstes Studiensemester + + + + + + + + + Aktuelles Studiensemester + + + + + + + + + Aktuelles Ausbildungssemester + + + + + + + + + Aktueller Studierendenstatus + + + + + + + + + Voraussichtlich letztes Studiensemester + + + + + + + + + Voraussichtliches Abschlussdatum + + + + + + + + + + + + + + + + + + Datum: + + + + + + + + + + Studiengangsleitung + + + + + + Gilt auch ohne Unterschrift und Stempel + + + + \ No newline at end of file