mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 08:34:29 +00:00
Removed warning if no statistics are present
This commit is contained in:
+71
-71
@@ -25,7 +25,7 @@ class statistik extends basis_db
|
|||||||
{
|
{
|
||||||
public $new;
|
public $new;
|
||||||
public $statistik_obj=array();
|
public $statistik_obj=array();
|
||||||
public $result;
|
public $result=array();
|
||||||
|
|
||||||
public $statistik_kurzbz;
|
public $statistik_kurzbz;
|
||||||
public $content_id;
|
public $content_id;
|
||||||
@@ -40,32 +40,32 @@ class statistik extends basis_db
|
|||||||
public $udpatevon;
|
public $udpatevon;
|
||||||
public $berechtigung_kurzbz;
|
public $berechtigung_kurzbz;
|
||||||
public $preferences;
|
public $preferences;
|
||||||
|
|
||||||
public $studiengang_kz; // integer
|
public $studiengang_kz; // integer
|
||||||
public $prestudent_id; // integer
|
public $prestudent_id; // integer
|
||||||
public $geschlecht; // char(1)
|
public $geschlecht; // char(1)
|
||||||
public $studiensemester_kurzbz;// varchar(16)
|
public $studiensemester_kurzbz;// varchar(16)
|
||||||
public $ausbildungssemester;// smallint
|
public $ausbildungssemester;// smallint
|
||||||
|
|
||||||
public $anzahl; //Hilfsvariable fuer Group BY Abfragen
|
public $anzahl; //Hilfsvariable fuer Group BY Abfragen
|
||||||
|
|
||||||
// Daten der Statistik
|
// Daten der Statistik
|
||||||
public $data; // DB ressource
|
public $data; // DB ressource
|
||||||
public $html;
|
public $html;
|
||||||
public $csv;
|
public $csv;
|
||||||
public $json;
|
public $json;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Konstruktor
|
* Konstruktor
|
||||||
*/
|
*/
|
||||||
public function __construct($statistik_kurzbz=null)
|
public function __construct($statistik_kurzbz=null)
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
if(!is_null($statistik_kurzbz))
|
if(!is_null($statistik_kurzbz))
|
||||||
$this->load($statistik_kurzbz);
|
$this->load($statistik_kurzbz);
|
||||||
else
|
else
|
||||||
$this->new=true;
|
$this->new=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -74,13 +74,13 @@ class statistik extends basis_db
|
|||||||
*/
|
*/
|
||||||
public function load($statistik_kurzbz)
|
public function load($statistik_kurzbz)
|
||||||
{
|
{
|
||||||
$qry = "SELECT
|
$qry = "SELECT
|
||||||
*
|
*
|
||||||
FROM
|
FROM
|
||||||
public.tbl_statistik
|
public.tbl_statistik
|
||||||
WHERE
|
WHERE
|
||||||
statistik_kurzbz = " . $this->db_add_param($statistik_kurzbz);
|
statistik_kurzbz = " . $this->db_add_param($statistik_kurzbz);
|
||||||
|
|
||||||
if($result = $this->db_query($qry))
|
if($result = $this->db_query($qry))
|
||||||
{
|
{
|
||||||
if($row = $this->db_fetch_object($result))
|
if($row = $this->db_fetch_object($result))
|
||||||
@@ -99,7 +99,7 @@ class statistik extends basis_db
|
|||||||
$this->berechtigung_kurzbz = $row->berechtigung_kurzbz;
|
$this->berechtigung_kurzbz = $row->berechtigung_kurzbz;
|
||||||
$this->preferences = $row->preferences;
|
$this->preferences = $row->preferences;
|
||||||
$this->new = false;
|
$this->new = false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -114,7 +114,7 @@ class statistik extends basis_db
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Laedt alle Statistiken
|
* Laedt alle Statistiken
|
||||||
* @return true wenn ok, sonst false
|
* @return true wenn ok, sonst false
|
||||||
@@ -123,15 +123,15 @@ class statistik extends basis_db
|
|||||||
{
|
{
|
||||||
$qry = 'SELECT * FROM public.tbl_statistik';
|
$qry = 'SELECT * FROM public.tbl_statistik';
|
||||||
|
|
||||||
if($order)
|
if($order)
|
||||||
$qry .= ' ORDER BY ' . $order;
|
$qry .= ' ORDER BY ' . $order;
|
||||||
|
|
||||||
if($result = $this->db_query($qry))
|
if($result = $this->db_query($qry))
|
||||||
{
|
{
|
||||||
while($row = $this->db_fetch_object($result))
|
while($row = $this->db_fetch_object($result))
|
||||||
{
|
{
|
||||||
$obj = new statistik();
|
$obj = new statistik();
|
||||||
|
|
||||||
$obj->statistik_kurzbz = $row->statistik_kurzbz;
|
$obj->statistik_kurzbz = $row->statistik_kurzbz;
|
||||||
$obj->content_id = $row->content_id;
|
$obj->content_id = $row->content_id;
|
||||||
$obj->bezeichnung = $row->bezeichnung;
|
$obj->bezeichnung = $row->bezeichnung;
|
||||||
@@ -145,10 +145,10 @@ class statistik extends basis_db
|
|||||||
$obj->udpatevon = $row->updatevon;
|
$obj->udpatevon = $row->updatevon;
|
||||||
$obj->berechtigung_kurzbz = $row->berechtigung_kurzbz;
|
$obj->berechtigung_kurzbz = $row->berechtigung_kurzbz;
|
||||||
$obj->preferences = $row->preferences;
|
$obj->preferences = $row->preferences;
|
||||||
|
|
||||||
$this->result[] = $obj;
|
$this->result[] = $obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -169,13 +169,13 @@ class statistik extends basis_db
|
|||||||
elseif ($publish==false)
|
elseif ($publish==false)
|
||||||
$qry.=' AND NOT publish ';
|
$qry.=' AND NOT publish ';
|
||||||
$qry.=' ORDER BY bezeichnung;';
|
$qry.=' ORDER BY bezeichnung;';
|
||||||
|
|
||||||
if($result = $this->db_query($qry))
|
if($result = $this->db_query($qry))
|
||||||
{
|
{
|
||||||
while($row = $this->db_fetch_object($result))
|
while($row = $this->db_fetch_object($result))
|
||||||
{
|
{
|
||||||
$obj = new statistik();
|
$obj = new statistik();
|
||||||
|
|
||||||
$obj->statistik_kurzbz = $row->statistik_kurzbz;
|
$obj->statistik_kurzbz = $row->statistik_kurzbz;
|
||||||
$obj->content_id = $row->content_id;
|
$obj->content_id = $row->content_id;
|
||||||
$obj->bezeichnung = $row->bezeichnung;
|
$obj->bezeichnung = $row->bezeichnung;
|
||||||
@@ -189,17 +189,17 @@ class statistik extends basis_db
|
|||||||
$obj->udpatevon = $row->updatevon;
|
$obj->udpatevon = $row->updatevon;
|
||||||
$obj->berechtigung_kurzbz = $row->berechtigung_kurzbz;
|
$obj->berechtigung_kurzbz = $row->berechtigung_kurzbz;
|
||||||
$obj->preferences = $row->preferences;
|
$obj->preferences = $row->preferences;
|
||||||
|
|
||||||
$this->result[] = $obj;
|
$this->result[] = $obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->errormsg = 'Fehler beim Laden der Daten';
|
$this->errormsg = 'Fehler beim Laden der Daten';
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Laedt alle Statistik Gruppen, Parameter publish zum Filtern.
|
* Laedt alle Statistik Gruppen, Parameter publish zum Filtern.
|
||||||
@@ -225,20 +225,20 @@ class statistik extends basis_db
|
|||||||
while($row = $this->db_fetch_object($result))
|
while($row = $this->db_fetch_object($result))
|
||||||
{
|
{
|
||||||
$obj = new statistik();
|
$obj = new statistik();
|
||||||
|
|
||||||
$obj->gruppe = $row->gruppe;
|
$obj->gruppe = $row->gruppe;
|
||||||
$obj->anzahl = $row->anzahl;
|
$obj->anzahl = $row->anzahl;
|
||||||
|
|
||||||
$this->result[] = $obj;
|
$this->result[] = $obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->errormsg = 'Fehler beim Laden der Daten';
|
$this->errormsg = 'Fehler beim Laden der Daten';
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Speichert einen Statistik Datensatz
|
* Speichert einen Statistik Datensatz
|
||||||
@@ -255,10 +255,10 @@ class statistik extends basis_db
|
|||||||
* integer umgestellt ist)
|
* integer umgestellt ist)
|
||||||
*/
|
*/
|
||||||
$this->statistik_kurzbz = preg_replace('/\W/', '', $this->statistik_kurzbz);
|
$this->statistik_kurzbz = preg_replace('/\W/', '', $this->statistik_kurzbz);
|
||||||
|
|
||||||
if($new)
|
if($new)
|
||||||
{
|
{
|
||||||
$qry = 'INSERT INTO public.tbl_statistik(statistik_kurzbz, content_id, bezeichnung, url, sql,
|
$qry = 'INSERT INTO public.tbl_statistik(statistik_kurzbz, content_id, bezeichnung, url, sql,
|
||||||
gruppe, publish, insertamum, insertvon, updateamum, updatevon, preferences, berechtigung_kurzbz) VALUES('.
|
gruppe, publish, insertamum, insertvon, updateamum, updatevon, preferences, berechtigung_kurzbz) VALUES('.
|
||||||
$this->db_add_param($this->statistik_kurzbz).','.
|
$this->db_add_param($this->statistik_kurzbz).','.
|
||||||
$this->db_add_param($this->content_id,FHC_INTEGER).','.
|
$this->db_add_param($this->content_id,FHC_INTEGER).','.
|
||||||
@@ -305,23 +305,23 @@ class statistik extends basis_db
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Liefert ein Array mit den Menueeintraegen der Statistiken
|
* Liefert ein Array mit den Menueeintraegen der Statistiken
|
||||||
* Mit dem Returnwert dieser Funktion wird die entsprechende Stelle im
|
* Mit dem Returnwert dieser Funktion wird die entsprechende Stelle im
|
||||||
* Menue ueberschrieben
|
* Menue ueberschrieben
|
||||||
* @return Array fuer Menue
|
* @return Array fuer Menue
|
||||||
*/
|
*/
|
||||||
public function getMenueArray()
|
public function getMenueArray()
|
||||||
{
|
{
|
||||||
$arr = array();
|
$arr = array();
|
||||||
|
|
||||||
$qry = "SELECT
|
$qry = "SELECT
|
||||||
*
|
*
|
||||||
FROM
|
FROM
|
||||||
public.tbl_statistik
|
public.tbl_statistik
|
||||||
ORDER BY gruppe, bezeichnung, statistik_kurzbz";
|
ORDER BY gruppe, bezeichnung, statistik_kurzbz";
|
||||||
|
|
||||||
if($result = $this->db_query($qry))
|
if($result = $this->db_query($qry))
|
||||||
{
|
{
|
||||||
$lastgruppe='';
|
$lastgruppe='';
|
||||||
@@ -342,13 +342,13 @@ class statistik extends basis_db
|
|||||||
{
|
{
|
||||||
$arr[$row->statistik_kurzbz]=array('name'=>$row->bezeichnung, 'link'=>APP_ROOT.'vilesci/statistik/statistik_frameset.php?statistik_kurzbz='.$row->statistik_kurzbz, 'target'=>'main');
|
$arr[$row->statistik_kurzbz]=array('name'=>$row->bezeichnung, 'link'=>APP_ROOT.'vilesci/statistik/statistik_frameset.php?statistik_kurzbz='.$row->statistik_kurzbz, 'target'=>'main');
|
||||||
if($row->berechtigung_kurzbz!='')
|
if($row->berechtigung_kurzbz!='')
|
||||||
$arr[$row->statistik_kurzbz]['permissions']=array($row->berechtigung_kurzbz);
|
$arr[$row->statistik_kurzbz]['permissions']=array($row->berechtigung_kurzbz);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $arr;
|
return $arr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loescht einen Eintrag
|
* Loescht einen Eintrag
|
||||||
*
|
*
|
||||||
@@ -358,7 +358,7 @@ class statistik extends basis_db
|
|||||||
public function delete($statistik_kurzbz)
|
public function delete($statistik_kurzbz)
|
||||||
{
|
{
|
||||||
$qry = "DELETE FROM public.tbl_statistik WHERE statistik_kurzbz=".$this->db_add_param($statistik_kurzbz).";";
|
$qry = "DELETE FROM public.tbl_statistik WHERE statistik_kurzbz=".$this->db_add_param($statistik_kurzbz).";";
|
||||||
|
|
||||||
if($this->db_query($qry))
|
if($this->db_query($qry))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
@@ -369,9 +369,9 @@ class statistik extends basis_db
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Laedt bestimmte PreStudenten
|
* Laedt bestimmte PreStudenten
|
||||||
* @param studiengang_kz KZ des Studienganges der zu Laden ist
|
* @param studiengang_kz KZ des Studienganges der zu Laden ist
|
||||||
@@ -393,22 +393,22 @@ class statistik extends basis_db
|
|||||||
$this->errormsg = 'Ausbildungssemester muss eine gueltige Zahl sein';
|
$this->errormsg = 'Ausbildungssemester muss eine gueltige Zahl sein';
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Neue Studenten ermitteln
|
// Neue Studenten ermitteln
|
||||||
$qry="
|
$qry="
|
||||||
SELECT
|
SELECT
|
||||||
DISTINCT prestudent_id, geschlecht, studiengang_kz, ausbildungssemester, studiensemester_kurzbz
|
DISTINCT prestudent_id, geschlecht, studiengang_kz, ausbildungssemester, studiensemester_kurzbz
|
||||||
FROM
|
FROM
|
||||||
public.tbl_prestudent
|
public.tbl_prestudent
|
||||||
JOIN public.tbl_prestudentstatus status USING (prestudent_id)
|
JOIN public.tbl_prestudentstatus status USING (prestudent_id)
|
||||||
JOIN public.tbl_person USING (person_id)
|
JOIN public.tbl_person USING (person_id)
|
||||||
WHERE
|
WHERE
|
||||||
status_kurzbz='Student'
|
status_kurzbz='Student'
|
||||||
AND NOT EXISTS(SELECT 1 FROM public.tbl_prestudentstatus WHERE status_kurzbz='Student' AND datum<status.datum AND prestudent_id=status.prestudent_id)
|
AND NOT EXISTS(SELECT 1 FROM public.tbl_prestudentstatus WHERE status_kurzbz='Student' AND datum<status.datum AND prestudent_id=status.prestudent_id)
|
||||||
AND studiengang_kz=".$this->db_add_param($studiengang_kz);
|
AND studiengang_kz=".$this->db_add_param($studiengang_kz);
|
||||||
if($ausbildungssemester!='')
|
if($ausbildungssemester!='')
|
||||||
$qry.=" AND ausbildungssemester=".$this->db_add_param($ausbildungssemester);
|
$qry.=" AND ausbildungssemester=".$this->db_add_param($ausbildungssemester);
|
||||||
|
|
||||||
$qry.=" AND ((studiensemester_kurzbz=".$this->db_add_param($studiensemester_kurzbz);
|
$qry.=" AND ((studiensemester_kurzbz=".$this->db_add_param($studiensemester_kurzbz);
|
||||||
if (!is_null($datum_stichtag))
|
if (!is_null($datum_stichtag))
|
||||||
$qry.=" AND datum <=".$this->db_add_param($datum_stichtag);
|
$qry.=" AND datum <=".$this->db_add_param($datum_stichtag);
|
||||||
@@ -418,7 +418,7 @@ class statistik extends basis_db
|
|||||||
$qry.=" AND datum <=".$this->db_add_param($datum_stichtag);
|
$qry.=" AND datum <=".$this->db_add_param($datum_stichtag);
|
||||||
$qry.="))";
|
$qry.="))";
|
||||||
$qry.=" ORDER BY prestudent_id;";
|
$qry.=" ORDER BY prestudent_id;";
|
||||||
|
|
||||||
if($result = $this->db_query($qry))
|
if($result = $this->db_query($qry))
|
||||||
{
|
{
|
||||||
while($row = $this->db_fetch_object($result))
|
while($row = $this->db_fetch_object($result))
|
||||||
@@ -440,9 +440,9 @@ class statistik extends basis_db
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Liefert die DropOut Rate
|
* Liefert die DropOut Rate
|
||||||
* @param unknown_type $studiengang_kz
|
* @param unknown_type $studiengang_kz
|
||||||
* @param unknown_type $studiensemester_kurzbz
|
* @param unknown_type $studiensemester_kurzbz
|
||||||
@@ -452,7 +452,7 @@ class statistik extends basis_db
|
|||||||
public function get_DropOut($studiengang_kz, $studiensemester_kurzbz, $ausbildungssemester=null, $datum_stichtag=null)
|
public function get_DropOut($studiengang_kz, $studiensemester_kurzbz, $ausbildungssemester=null, $datum_stichtag=null)
|
||||||
{
|
{
|
||||||
$this->statistik_obj=array();
|
$this->statistik_obj=array();
|
||||||
|
|
||||||
if(!is_numeric($studiengang_kz))
|
if(!is_numeric($studiengang_kz))
|
||||||
{
|
{
|
||||||
$this->errormsg = 'Studiengang_kz muss eine gueltige Zahl sein';
|
$this->errormsg = 'Studiengang_kz muss eine gueltige Zahl sein';
|
||||||
@@ -464,21 +464,21 @@ class statistik extends basis_db
|
|||||||
$this->errormsg = 'Ausbildungssemester muss eine gueltige Zahl sein';
|
$this->errormsg = 'Ausbildungssemester muss eine gueltige Zahl sein';
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Neue Studenten ermitteln
|
// Neue Studenten ermitteln
|
||||||
$qry="SELECT DISTINCT prestudent_id, geschlecht, studiengang_kz, ausbildungssemester, studiensemester_kurzbz
|
$qry="SELECT DISTINCT prestudent_id, geschlecht, studiengang_kz, ausbildungssemester, studiensemester_kurzbz
|
||||||
FROM tbl_prestudent JOIN tbl_prestudentstatus USING (prestudent_id) JOIN tbl_person USING (person_id)
|
FROM tbl_prestudent JOIN tbl_prestudentstatus USING (prestudent_id) JOIN tbl_person USING (person_id)
|
||||||
WHERE (status_kurzbz='Abbrecher')
|
WHERE (status_kurzbz='Abbrecher')
|
||||||
AND studiengang_kz=".$this->db_add_param($studiengang_kz);
|
AND studiengang_kz=".$this->db_add_param($studiengang_kz);
|
||||||
if($ausbildungssemester!='')
|
if($ausbildungssemester!='')
|
||||||
$qry.=" AND ausbildungssemester=".$this->db_add_param($ausbildungssemester);
|
$qry.=" AND ausbildungssemester=".$this->db_add_param($ausbildungssemester);
|
||||||
|
|
||||||
$qry.=" AND (studiensemester_kurzbz=".$this->db_add_param($studiensemester_kurzbz);
|
$qry.=" AND (studiensemester_kurzbz=".$this->db_add_param($studiensemester_kurzbz);
|
||||||
if (!is_null($datum_stichtag))
|
if (!is_null($datum_stichtag))
|
||||||
$qry.=" AND datum <=".$this->db_add_param($datum_stichtag);
|
$qry.=" AND datum <=".$this->db_add_param($datum_stichtag);
|
||||||
$qry.=') ';
|
$qry.=') ';
|
||||||
$qry.=" ORDER BY prestudent_id;";
|
$qry.=" ORDER BY prestudent_id;";
|
||||||
|
|
||||||
if($result = $this->db_query($qry))
|
if($result = $this->db_query($qry))
|
||||||
{
|
{
|
||||||
while($row = $this->db_fetch_object($result))
|
while($row = $this->db_fetch_object($result))
|
||||||
@@ -497,10 +497,10 @@ class statistik extends basis_db
|
|||||||
$this->errormsg = 'Datensatz konnte nicht geladen werden';
|
$this->errormsg = 'Datensatz konnte nicht geladen werden';
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Laedt die Daten einer Statistik (derzeit nur SQL)
|
* Laedt die Daten einer Statistik (derzeit nur SQL)
|
||||||
* @param $statistik_kurzbz
|
* @param $statistik_kurzbz
|
||||||
@@ -510,7 +510,7 @@ class statistik extends basis_db
|
|||||||
$this->html='';
|
$this->html='';
|
||||||
$this->csv='';
|
$this->csv='';
|
||||||
$this->json=array();
|
$this->json=array();
|
||||||
|
|
||||||
if($this->sql!='')
|
if($this->sql!='')
|
||||||
{
|
{
|
||||||
$sql = $this->sql;
|
$sql = $this->sql;
|
||||||
@@ -524,7 +524,7 @@ class statistik extends basis_db
|
|||||||
else
|
else
|
||||||
$sql = str_replace('$'.$name,$this->db_add_param($value),$sql);
|
$sql = str_replace('$'.$name,$this->db_add_param($value),$sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->data = $this->db_query($sql))
|
if($this->data = $this->db_query($sql))
|
||||||
{
|
{
|
||||||
$this->html.= '<thead><tr>';
|
$this->html.= '<thead><tr>';
|
||||||
@@ -562,22 +562,22 @@ class statistik extends basis_db
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getHtmlTable($id, $class='')
|
function getHtmlTable($id, $class='')
|
||||||
{
|
{
|
||||||
|
|
||||||
return '<table class="'.$class.'" id="'.$id.'">'.$this->html.'</table>';
|
return '<table class="'.$class.'" id="'.$id.'">'.$this->html.'</table>';
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCSV()
|
function getCSV()
|
||||||
{
|
{
|
||||||
return $this->csv;
|
return $this->csv;
|
||||||
}
|
}
|
||||||
|
|
||||||
function writeCSV($filename, $delimiter=',', $enclosure='"')
|
function writeCSV($filename, $delimiter=',', $enclosure='"')
|
||||||
{
|
{
|
||||||
$fh=fopen($filename,'w');
|
$fh=fopen($filename,'w');
|
||||||
|
|
||||||
$fieldnames=array();
|
$fieldnames=array();
|
||||||
for ($i=0; $i < $this->db_num_fields($this->data); $i++)
|
for ($i=0; $i < $this->db_num_fields($this->data); $i++)
|
||||||
$fieldnames[]=$this->db_field_name($this->data,$i);
|
$fieldnames[]=$this->db_field_name($this->data,$i);
|
||||||
@@ -588,24 +588,24 @@ class statistik extends basis_db
|
|||||||
fclose($fh);
|
fclose($fh);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getJSON()
|
function getJSON()
|
||||||
{
|
{
|
||||||
return json_encode($this->json);
|
return json_encode($this->json);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getArray()
|
function getArray()
|
||||||
{
|
{
|
||||||
return $this->json;
|
return $this->json;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Parst Variablen aus einem String und liefert diese als Array zurueck
|
* Parst Variablen aus einem String und liefert diese als Array zurueck
|
||||||
* @param $value String mit Variablen
|
* @param $value String mit Variablen
|
||||||
* z.B.: "Select * from tbl_person where person_id<'$person_id'"
|
* z.B.: "Select * from tbl_person where person_id<'$person_id'"
|
||||||
* oder "../content/statistik/bewerberstatistik.php?stsem=$StSem&stg_kz=$stg_kz"
|
* oder "../content/statistik/bewerberstatistik.php?stsem=$StSem&stg_kz=$stg_kz"
|
||||||
*
|
*
|
||||||
* @return Array mit den Variablennamen
|
* @return Array mit den Variablennamen
|
||||||
*/
|
*/
|
||||||
function parseVars($value)
|
function parseVars($value)
|
||||||
@@ -615,7 +615,7 @@ class statistik extends basis_db
|
|||||||
$check = '/\$[0-9A-z]+/';
|
$check = '/\$[0-9A-z]+/';
|
||||||
preg_match_all($check, $value, $result);
|
preg_match_all($check, $value, $result);
|
||||||
$result = $result[0];
|
$result = $result[0];
|
||||||
|
|
||||||
for($i=0;$i<count($result);$i++)
|
for($i=0;$i<count($result);$i++)
|
||||||
{
|
{
|
||||||
$result[$i] = mb_str_replace('$','',$result[$i]);
|
$result[$i] = mb_str_replace('$','',$result[$i]);
|
||||||
|
|||||||
Reference in New Issue
Block a user