From fb3909325ae5f2f0b2c2c3496e8b85c6f3d27a93 Mon Sep 17 00:00:00 2001 From: Paminger Date: Thu, 7 May 2015 08:18:55 +0200 Subject: [PATCH 1/4] PG-Field-Name --- include/basis_db.class.php | 3 ++- include/pgsql.class.php | 8 ++++++++ include/statistik.class.php | 35 +++++++++++++++++++++++++++-------- 3 files changed, 37 insertions(+), 9 deletions(-) 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/statistik.class.php b/include/statistik.class.php index c2bf7d642..5e6b2bbea 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); From ec47c2bca0fb084cbd10abd6558769bba818d000 Mon Sep 17 00:00:00 2001 From: Paminger Date: Thu, 7 May 2015 08:25:06 +0200 Subject: [PATCH 2/4] Prozessklasse --- include/process.class.php | 87 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 include/process.class.php 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; + } +} +?> From d1b9d3cc89b0f64df168cbcb8c4e7d61d03206f5 Mon Sep 17 00:00:00 2001 From: Stefan Puraner Date: Thu, 7 May 2015 10:20:47 +0200 Subject: [PATCH 3/4] changing attributes to public --- include/studiensemester.class.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 From 6b6cbf682f68cb115a404dfdd5f62fe2c691c4af Mon Sep 17 00:00:00 2001 From: kindlm Date: Thu, 7 May 2015 10:57:45 +0200 Subject: [PATCH 4/4] =?UTF-8?q?Text=C3=A4nderung=20Studienblatt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "Gilt auch ohne Unterschrift und Stempel" hinzugefügt. --- ...udienblatt.xsl => StudienblattEng_0_1.xsl} | 0 system/xsl/Studienblatt_0_1.xsl | 498 +++++++++++++++++ system/xsl/Studienblatt_0_2.xsl | 504 ++++++++++++++++++ 3 files changed, 1002 insertions(+) rename system/xsl/{Studienblatt.xsl => StudienblattEng_0_1.xsl} (100%) create mode 100644 system/xsl/Studienblatt_0_1.xsl create mode 100644 system/xsl/Studienblatt_0_2.xsl 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