mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
- Zeugnis anzeigen und löschen hinzugefügt
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006 Technikum-Wien
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
|
||||
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
|
||||
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
|
||||
*/
|
||||
// Holt den Hexcode eines Aktes aus der DB wandelt es in Zeichen
|
||||
// um und gibt das Dokument zurueck.
|
||||
require_once('../vilesci/config.inc.php');
|
||||
require_once('../include/akte.class.php');
|
||||
|
||||
//Hexcode in String umwandeln
|
||||
function hexstr($hex)
|
||||
{
|
||||
$string="";
|
||||
for ($i=0;$i<strlen($hex)-1;$i+=2)
|
||||
$string.=chr(hexdec($hex[$i].$hex[$i+1]));
|
||||
return $string;
|
||||
}
|
||||
|
||||
//Connection Herstellen
|
||||
if(!$conn = pg_pconnect(CONN_STRING))
|
||||
die('Fehler beim oeffnen der Datenbankverbindung');
|
||||
|
||||
//Hex Dump aus der DB holen
|
||||
if(isset($_GET['id']) && is_numeric($_GET['id']))
|
||||
{
|
||||
$akte = new akte($conn, $_GET['id']);
|
||||
|
||||
//Header fuer Bild schicken
|
||||
header("Content-type: $akte->mimetype");
|
||||
echo hexstr($akte->inhalt);
|
||||
}
|
||||
else
|
||||
echo 'Unkown type';
|
||||
|
||||
?>
|
||||
@@ -39,6 +39,7 @@ require_once('../../include/benutzer.class.php');
|
||||
require_once('../../include/student.class.php');
|
||||
require_once('../../include/prestudent.class.php');
|
||||
require_once('../../include/studiengang.class.php');
|
||||
require_once('../../include/akte.class.php');
|
||||
|
||||
$user = get_uid();
|
||||
|
||||
@@ -633,6 +634,28 @@ if(!$error)
|
||||
$errormsg = 'Fehlerhafte Parameteruebergabe';
|
||||
}
|
||||
}
|
||||
elseif(isset($_POST['type']) && $_POST['type']=='deleteAkte')
|
||||
{
|
||||
if(isset($_POST['akte_id']) && is_numeric($_POST['akte_id']))
|
||||
{
|
||||
$akte = new akte($conn);
|
||||
|
||||
if($akte->delete($_POST['akte_id']))
|
||||
{
|
||||
$return = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$return = false;
|
||||
$errormsg = $akte->errormsg;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$return = false;
|
||||
$errormsg = 'Fehlerhafte Parameteruebergabe'.$_POST['akte_id'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$return = false;
|
||||
|
||||
@@ -30,6 +30,8 @@ require_once('../../vilesci/config.inc.php');
|
||||
echo '<?xml version="1.0" encoding="ISO-8859-15" standalone="yes" ?>';
|
||||
|
||||
echo '<?xul-overlay href="'.APP_ROOT.'content/student/studentdetailoverlay.xul.php"?>';
|
||||
echo '<?xul-overlay href="'.APP_ROOT.'content/student/studentzeugnisoverlay.xul.php"?>';
|
||||
echo '<?xul-overlay href="'.APP_ROOT.'content/student/studentkontooverlay.xul.php"?>';
|
||||
?>
|
||||
<!DOCTYPE overlay >
|
||||
|
||||
@@ -170,10 +172,14 @@ echo '<?xul-overlay href="'.APP_ROOT.'content/student/studentdetailoverlay.xul.p
|
||||
<tabs orient="horizontal" id="lehrveranstaltung-tabs">
|
||||
<tab id="student-tab-detail" label="Details" />
|
||||
<tab id="student-tab-prestudent" label="PreStudent" />
|
||||
<tab id="student-tab-konto" label="Konto" />
|
||||
<tab id="student-tab-zeugnis" label="Zeugnis" />
|
||||
</tabs>
|
||||
<tabpanels id="student-tabpanels-main" flex="1">
|
||||
<vbox id="student-detail" style="margin-top:10px;" />
|
||||
<vbox id="student-prestudent" style="margin-top:10px;" />
|
||||
<vbox id="student-konto" style="margin-top:10px;" />
|
||||
<vbox id="student-zeugnis" style="margin-top:10px;" />
|
||||
</tabpanels>
|
||||
</tabbox>
|
||||
</vbox>
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006 Technikum-Wien
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
|
||||
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
|
||||
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
|
||||
*/
|
||||
|
||||
header("Cache-Control: no-cache");
|
||||
header("Cache-Control: post-check=0, pre-check=0",false);
|
||||
header("Expires Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Pragma: no-cache");
|
||||
header("Content-type: application/vnd.mozilla.xul+xml");
|
||||
require_once('../../vilesci/config.inc.php');
|
||||
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
|
||||
|
||||
?>
|
||||
|
||||
<overlay id="StudentKonto"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
>
|
||||
<!-- Zeugnis Overlay -->
|
||||
<vbox id="student-konto" style="margin:0px;" flex="1">
|
||||
|
||||
</vbox>
|
||||
</overlay>
|
||||
@@ -636,6 +636,23 @@ function StudentAuswahl()
|
||||
var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
|
||||
var datasource = rdfService.GetDataSource(url);
|
||||
rollentree.database.AddDataSource(datasource);
|
||||
|
||||
//Zeugnis
|
||||
zeugnistree = document.getElementById('student-zeugnis-tree');
|
||||
url='<?php echo APP_ROOT;?>rdf/akte.rdf.php?person_id='+person_id+"&dokument_kurzbz=Zeugnis&"+gettimestamp();
|
||||
|
||||
//Alte DS entfernen
|
||||
var oldDatasources = zeugnistree.database.GetDataSources();
|
||||
while(oldDatasources.hasMoreElements())
|
||||
{
|
||||
zeugnistree.database.RemoveDataSource(oldDatasources.getNext());
|
||||
}
|
||||
//Refresh damit die entfernten DS auch wirklich entfernt werden
|
||||
zeugnistree.builder.rebuild();
|
||||
|
||||
var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
|
||||
var datasource = rdfService.GetDataSource(url);
|
||||
zeugnistree.database.AddDataSource(datasource);
|
||||
}
|
||||
|
||||
// ****
|
||||
@@ -745,6 +762,9 @@ function StudentPrestudentSave()
|
||||
}
|
||||
}
|
||||
|
||||
// ****
|
||||
// * Anmeldungsdatum fuer den RT wird auf das Aktuelle Datum gesetzt
|
||||
// ****
|
||||
function StudentAnmeldungreihungstestHeute()
|
||||
{
|
||||
var now = new Date();
|
||||
@@ -756,4 +776,79 @@ function StudentAnmeldungreihungstestHeute()
|
||||
if(tag<10) tag='0'+tag;
|
||||
|
||||
document.getElementById('student-prestudent-textbox-anmeldungreihungstest').value=jahr+'-'+monat+'-'+tag;
|
||||
}
|
||||
|
||||
// ****
|
||||
// * Laedt ein Zeugnis dass in der DB gespeichert ist
|
||||
// ****
|
||||
function StudentZeugnisAnzeigen()
|
||||
{
|
||||
var tree = document.getElementById('student-zeugnis-tree');
|
||||
|
||||
if (tree.currentIndex==-1) return;
|
||||
|
||||
try
|
||||
{
|
||||
//Ausgewaehlte ID holen
|
||||
var col = tree.columns ? tree.columns["student-zeugnis-tree-akte_id"] : "student-zeugnis-tree-akte_id";
|
||||
var akte_id=tree.view.getCellText(tree.currentIndex,col);
|
||||
if(akte_id!='')
|
||||
{
|
||||
window.open('<?php echo APP_ROOT;?>content/akte.php?id='+akte_id,'File');
|
||||
//document.location.href='<?php echo APP_ROOT;?>content/akte.php?id='+akte_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
alert(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// ****
|
||||
// * Loescht ein Zeugnis
|
||||
// ****
|
||||
function StudentAkteDel()
|
||||
{
|
||||
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
var tree = document.getElementById('student-zeugnis-tree');
|
||||
|
||||
if (tree.currentIndex==-1)
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
//Ausgewaehlte Akte holen
|
||||
var col = tree.columns ? tree.columns["student-zeugnis-tree-akte_id"] : "student-zeugnis-tree-akte_id";
|
||||
var akte_id=tree.view.getCellText(tree.currentIndex,col);
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
alert(e);
|
||||
return false;
|
||||
}
|
||||
|
||||
//Abfrage ob wirklich geloescht werden soll
|
||||
if (confirm('Zeugnis wirklich entfernen?'))
|
||||
{
|
||||
//Script zum loeschen aufrufen
|
||||
var req = new phpRequest('student/studentDBDML.php','','');
|
||||
|
||||
req.add('type','deleteAkte');
|
||||
req.add('akte_id',akte_id);
|
||||
|
||||
var response = req.executePOST();
|
||||
|
||||
var val = new ParseReturnValue(response)
|
||||
|
||||
if(!val.dbdml_return)
|
||||
alert(val.dbdml_errormsg)
|
||||
|
||||
StudentTreeRefresh();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006 Technikum-Wien
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
|
||||
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
|
||||
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
|
||||
*/
|
||||
|
||||
header("Cache-Control: no-cache");
|
||||
header("Cache-Control: post-check=0, pre-check=0",false);
|
||||
header("Expires Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Pragma: no-cache");
|
||||
header("Content-type: application/vnd.mozilla.xul+xml");
|
||||
require_once('../../vilesci/config.inc.php');
|
||||
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
|
||||
|
||||
?>
|
||||
|
||||
<overlay id="StudentZeugnis"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
>
|
||||
<!-- Zeugnis Overlay -->
|
||||
<vbox id="student-zeugnis" style="margin:0px;" flex="1">
|
||||
<popupset>
|
||||
<popup id="student-zeugnis-tree-popup">
|
||||
<menuitem label="Entfernen" oncommand="StudentAkteDel();" id="student-zeugnis-tree-popup-aktedel" hidden="false"/>
|
||||
</popup>
|
||||
</popupset>
|
||||
<hbox>
|
||||
<groupbox id="student-zeugnis-groupbox" flex="1">
|
||||
<caption label="Zeugnis"/>
|
||||
<tree id="student-zeugnis-tree" seltype="single" hidecolumnpicker="false" flex="1"
|
||||
datasources="rdf:null" ref="http://www.technikum-wien.at/akte/liste"
|
||||
style="margin-left:10px;margin-right:10px;margin-bottom:5px;" height="100px" enableColumnDrag="true"
|
||||
ondblclick="StudentZeugnisAnzeigen()"
|
||||
context="student-zeugnis-tree-popup"
|
||||
>
|
||||
|
||||
<treecols>
|
||||
<treecol id="student-zeugnis-tree-titel" label="Titel" flex="2" hidden="false" primary="true"
|
||||
class="sortDirectionIndicator"
|
||||
sort="rdf:http://www.technikum-wien.at/akte/rdf#titel"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="student-zeugnis-tree-bezeichnung" label="Bezeichnung" flex="5" hidden="false"
|
||||
class="sortDirectionIndicator"
|
||||
sort="rdf:http://www.technikum-wien.at/akte/rdf#bezeichnung"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="student-zeugnis-tree-erstelltam" label="Erstelldatum" flex="2" hidden="false"
|
||||
class="sortDirectionIndicator"
|
||||
sort="rdf:http://www.technikum-wien.at/akte/rdf#erstelltam" />
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="student-zeugnis-tree-gedruckt" label="Gedruckt" flex="2" hidden="false"
|
||||
class="sortDirectionIndicator"
|
||||
sort="rdf:http://www.technikum-wien.at/akte/rdf#gedruckt" />
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="student-zeugnis-tree-akte_id" label="akte_id" flex="2" hidden="true"
|
||||
class="sortDirectionIndicator"
|
||||
sort="rdf:http://www.technikum-wien.at/akte/rdf#akte_id" />
|
||||
<splitter class="tree-splitter"/>
|
||||
</treecols>
|
||||
|
||||
<template>
|
||||
<treechildren flex="1" >
|
||||
<treeitem uri="rdf:*">
|
||||
<treerow>
|
||||
<treecell label="rdf:http://www.technikum-wien.at/akte/rdf#titel"/>
|
||||
<treecell label="rdf:http://www.technikum-wien.at/akte/rdf#bezeichnung"/>
|
||||
<treecell label="rdf:http://www.technikum-wien.at/akte/rdf#erstelltam"/>
|
||||
<treecell label="rdf:http://www.technikum-wien.at/akte/rdf#gedruckt"/>
|
||||
<treecell label="rdf:http://www.technikum-wien.at/akte/rdf#akte_id"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
</template>
|
||||
</tree>
|
||||
</groupbox>
|
||||
<vbox>
|
||||
<spacer flex="1"/>
|
||||
<button id="student-zeugnis-button-archivieren" label="aktuelles Zeugnis archivieren" disabled="false"/>
|
||||
<spacer flex="1"/>
|
||||
</vbox>
|
||||
</hbox>
|
||||
<spacer flex="8" />
|
||||
</vbox>
|
||||
</overlay>
|
||||
@@ -0,0 +1,295 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006 Technikum-Wien
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
|
||||
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
|
||||
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
|
||||
*/
|
||||
|
||||
class akte
|
||||
{
|
||||
var $conn; // @var resource DB-Handle
|
||||
var $new; // @var boolean
|
||||
var $errormsg; // @var string
|
||||
var $result = array(); // @var email Objekt
|
||||
|
||||
//Tabellenspalten
|
||||
var $akte_id;
|
||||
var $person_id;
|
||||
var $dokument_kurzbz;
|
||||
var $inhalt;
|
||||
var $mimetype;
|
||||
var $erstelltam;
|
||||
var $gedruckt;
|
||||
var $titel;
|
||||
var $bezeichnung;
|
||||
var $updateamum;
|
||||
var $updatevon;
|
||||
var $insertamum;
|
||||
var $insertvon;
|
||||
var $uid;
|
||||
|
||||
// ***********************************************
|
||||
// * Konstruktor
|
||||
// * @param conn Connection zur Datenbank
|
||||
// * akte_id ID des zu ladenden Datensatzes
|
||||
// ***********************************************
|
||||
function akte($conn, $akte_id=null, $unicode=false)
|
||||
{
|
||||
$this->conn = $conn;
|
||||
if($unicode!=null)
|
||||
{
|
||||
if($unicode)
|
||||
$qry = "SET CLIENT_ENCODING TO 'UNICODE';";
|
||||
else
|
||||
$qry = "SET CLIENT_ENCODING TO 'LATIN9';";
|
||||
|
||||
if(!pg_query($conn,$qry))
|
||||
{
|
||||
$this->errormsg = "Encoding konnte nicht gesetzt werden";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if($akte_id != null)
|
||||
$this->load($akte_id);
|
||||
}
|
||||
|
||||
// ***********************************************
|
||||
// * Laedt einen Datensatz
|
||||
// * @param akte_id ID des zu ladenden Datensatzes
|
||||
// ***********************************************
|
||||
function load($akte_id)
|
||||
{
|
||||
//akte_id auf gueltigkeit pruefen
|
||||
if(!is_numeric($akte_id) || $akte_id == '')
|
||||
{
|
||||
$this->errormsg = 'akte_id muss eine gueltige Zahl sein';
|
||||
return false;
|
||||
}
|
||||
|
||||
//laden des Datensatzes
|
||||
$qry = "SELECT * FROM public.tbl_akte WHERE akte_id='$akte_id';";
|
||||
|
||||
if($result = pg_query($this->conn,$qry))
|
||||
{
|
||||
if($row=pg_fetch_object($result))
|
||||
{
|
||||
$this->akte_id = $row->akte_id;
|
||||
$this->person_id = $row->person_id;
|
||||
$this->dokument_kurzbz = $row->dokument_kurzbz;
|
||||
$this->inhalt = $row->inhalt;
|
||||
$this->mimetype = $row->mimetype;
|
||||
$this->erstelltam = $row->erstelltam;
|
||||
$this->gedruckt = ($row->gedruckt=='t'?true:false);
|
||||
$this->titel = $row->titel;
|
||||
$this->bezeichnung = $row->bezeichnung;
|
||||
$this->updateamum = $row->updateamum;
|
||||
$this->updatevon = $row->updatevon;
|
||||
$this->insertamum = $row->insertamum;
|
||||
$this->insertvon = $row->insertvon;
|
||||
$this->uid = $row->uid;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler bei der Datenbankabfrage';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler bei der Datenbankabfrage';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// **************************************************
|
||||
// * Loescht einen Datensatz
|
||||
// * @param akte_id ID des zu loeschenden Datensatzes
|
||||
// * @return true wenn ok, false im Fehlerfall
|
||||
// **************************************************
|
||||
function delete($akte_id)
|
||||
{
|
||||
//akte_id auf gueltigkeit pruefen
|
||||
if(!is_numeric($akte_id) || $akte_id == '')
|
||||
{
|
||||
$this->errormsg = 'akte_id muss eine gueltige Zahl sein';
|
||||
return false;
|
||||
}
|
||||
|
||||
$qry = "DELETE FROM public.tbl_akte WHERE akte_id = '$akte_id';";
|
||||
|
||||
if(pg_query($this->conn,$qry))
|
||||
{
|
||||
//Log schreiben
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim loeschen';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function validate()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// ************************************************
|
||||
// * wenn $var '' ist wird "null" zurueckgegeben
|
||||
// * wenn $var !='' ist werden datenbankkritische
|
||||
// * Zeichen mit backslash versehen und das Ergebnis
|
||||
// * unter Hochkomma gesetzt.
|
||||
// ************************************************
|
||||
function addslashes($var)
|
||||
{
|
||||
return ($var!=''?"'".addslashes($var)."'":'null');
|
||||
}
|
||||
|
||||
// *********************************************************************
|
||||
// * Speichert den aktuellen Datensatz
|
||||
// * Wenn $neu auf true gesetzt ist wird ein neuer Datensatz angelegt
|
||||
// * andernfalls wird der Datensatz mit der ID in $akte_id aktualisiert
|
||||
// * @return true wenn ok, false im Fehlerfall
|
||||
// *********************************************************************
|
||||
function save($new=null)
|
||||
{
|
||||
if(!$this->validate())
|
||||
return false;
|
||||
if($new==null)
|
||||
$new = $this->new;
|
||||
|
||||
if($new)
|
||||
{
|
||||
//Neuen Datensatz anlegen
|
||||
$qry = "BEGIN;INSERT INTO public.tbl_akte (person_id, dokument_kurzbz, inhalt, mimetype, erstelltam, gedruckt, titel,
|
||||
bezeichnung, updateamum, updatevon, insertamum, insertvon, ext_id, uid) VALUES (".
|
||||
$this->addslashes($this->person_id).', '.
|
||||
$this->addslashes($this->dokument_kurzbz).', '.
|
||||
$this->addslashes($this->inhalt).', '.
|
||||
$this->addslashes($this->mimetype).', '.
|
||||
$this->addslashes($this->erstelltam).', '.
|
||||
($this->gedruckt?'true':'false').', '.
|
||||
$this->addslashes($this->titel).', '.
|
||||
$this->addslashes($this->bezeichnung).', '.
|
||||
$this->addslashes($this->updateamum).', '.
|
||||
$this->addslashes($this->updatevon).', '.
|
||||
$this->addslashes($this->insertamum).', '.
|
||||
$this->addslashes($this->insertvon).', '.
|
||||
$this->addslashes($this->ext_id).', '.
|
||||
$this->addslashes($this->uid).');';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//Bestehenden Datensatz aktualisieren
|
||||
$qry= "UPDATE public.tbl_akte SET ";
|
||||
" person_id=".$this->addslashes($this->person_id).",".
|
||||
" dokument_kurzbz=".$this->addslashes($this->dokument_kurzbz).",".
|
||||
" inhalt=".$this->addslashes($this->inhalt).",".
|
||||
" mimetype=".$this->addslashes($this->mimetype).",".
|
||||
" erstelltam=".$this->addslashes($this->erstelltam).",".
|
||||
" gedruckt=".($this->gedruckt?'true':'false').",".
|
||||
" titel=".$this->addslashes($this->titel).",".
|
||||
" bezeichnung=".$this->addslashes($this->bezeichnung).",".
|
||||
" updateamum=".$this->addslashes($this->updateamum).",".
|
||||
" updatevon=".$this->addslashes($this->updatevon).",".
|
||||
" ext_id=".$this->addslashes($this->ext_id).",".
|
||||
" uid=".$this->addslashes($this->uid).
|
||||
" WHERE akte_id='".addslashes($akte_id)."'";
|
||||
}
|
||||
|
||||
if(pg_query($this->conn, $qry))
|
||||
{
|
||||
if($new)
|
||||
{
|
||||
$qry = "SELECT currval('public.tbl_akte_akte_id_seq') as id";
|
||||
if($result = pg_query($this->conn, $qry))
|
||||
{
|
||||
if($row = pg_fetch_object($result))
|
||||
{
|
||||
$this->akte_id = $row->id;
|
||||
pg_query($this->conn, 'COMMIT;');
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim auslesen der Sequence';
|
||||
pg_query($this->conn, 'ROLLBACK');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim auslesen der Sequence';
|
||||
pg_query($this->conn, 'ROLLBACK');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Speichern des Datensatzes';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function getAkten($person_id, $dokument_kurzbz=null)
|
||||
{
|
||||
$qry = "SELECT akte_id, person_id, dokument_kurzbz, mimetype, erstelltam, gedruckt, titel, bezeichnung, updateamum, insertamum, updatevon, insertvon, uid FROM public.tbl_akte WHERE person_id='".addslashes($person_id)."'";
|
||||
if($dokument_kurzbz!=null)
|
||||
$qry.=" AND dokument_kurzbz='".addslashes($dokument_kurzbz)."'";
|
||||
$qry.=" ORDER BY erstelltam";
|
||||
|
||||
if($result = pg_query($this->conn, $qry))
|
||||
{
|
||||
while($row = pg_fetch_object($result))
|
||||
{
|
||||
$akten = new akte($this->conn, null, null);
|
||||
|
||||
$akten->akte_id = $row->akte_id;
|
||||
$akten->person_id = $row->person_id;
|
||||
$akten->dokument_kurzbz = $row->dokument_kurzbz;
|
||||
//$akte->inhalt = $row->inhalt;
|
||||
$akten->mimetype = $row->mimetype;
|
||||
$akten->erstelltam = $row->erstelltam;
|
||||
$akten->gedruckt = ($row->gedruckt=='t'?true:false);
|
||||
$akten->titel = $row->titel;
|
||||
$akten->bezeichnung = $row->bezeichnung;
|
||||
$akten->updateamum = $row->updateamum;
|
||||
$akten->updatevon = $row->updatevon;
|
||||
$akten->insertamum = $row->insertamum;
|
||||
$akten->insertvon = $row->insertvon;
|
||||
$akten->uid = $row->uid;
|
||||
|
||||
$this->result[] = $akten;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim laden der Daten';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006 Technikum-Wien
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
|
||||
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
|
||||
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
|
||||
*/
|
||||
// header für no cache
|
||||
header("Cache-Control: no-cache");
|
||||
header("Cache-Control: post-check=0, pre-check=0",false);
|
||||
header("Expires Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Pragma: no-cache");
|
||||
// content type setzen
|
||||
header("Content-type: application/xhtml+xml");
|
||||
// xml
|
||||
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
|
||||
// DAO
|
||||
require_once('../vilesci/config.inc.php');
|
||||
require_once('../include/akte.class.php');
|
||||
|
||||
// Datenbank Verbindung
|
||||
if (!$conn = @pg_pconnect(CONN_STRING))
|
||||
$error_msg='Es konnte keine Verbindung zum Server aufgebaut werden!';
|
||||
|
||||
if(isset($_GET['person_id']))
|
||||
$person_id = $_GET['person_id'];
|
||||
else
|
||||
$person_id = '';
|
||||
|
||||
if(isset($_GET['dokument_kurzbz']))
|
||||
$dokument_kurzbz = $_GET['dokument_kurzbz'];
|
||||
else
|
||||
$dokument_kurzbz = '';
|
||||
|
||||
if(isset($_GET['uid']))
|
||||
$uid = $_GET['uid'];
|
||||
else
|
||||
$uid = '';
|
||||
|
||||
$akten = new akte($conn);
|
||||
if(!$akten->getAkten($person_id, $dokument_kurzbz))
|
||||
die($akten->errormsg);
|
||||
$rdf_url='http://www.technikum-wien.at/akte';
|
||||
?>
|
||||
|
||||
<RDF:RDF
|
||||
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:AKTE="<?php echo $rdf_url; ?>/rdf#"
|
||||
>
|
||||
|
||||
<RDF:Seq about="<?php echo $rdf_url ?>/liste">
|
||||
|
||||
<?php
|
||||
foreach ($akten->result as $row)
|
||||
{
|
||||
?>
|
||||
<RDF:li>
|
||||
<RDF:Description id="<?php echo $row->akte_id; ?>" about="<?php echo $rdf_url.'/'.$row->akte_id; ?>" >
|
||||
<AKTE:akte_id><![CDATA[<?php echo $row->akte_id ?>]]></AKTE:akte_id>
|
||||
<AKTE:person_id><![CDATA[<?php echo $row->person_id ?>]]></AKTE:person_id>
|
||||
<AKTE:dokument_kurzbz><![CDATA[<?php echo $row->dokument_kurzbz ?>]]></AKTE:dokument_kurzbz>
|
||||
<AKTE:mimetype><![CDATA[<?php echo $row->mimetype ?>]]></AKTE:mimetype>
|
||||
<AKTE:erstelltam><![CDATA[<?php echo $row->erstelltam ?>]]></AKTE:erstelltam>
|
||||
<AKTE:gedruckt><![CDATA[<?php echo ($row->gedruckt?'Ja':'Nein') ?>]]></AKTE:gedruckt>
|
||||
<AKTE:titel><![CDATA[<?php echo $row->titel ?>]]></AKTE:titel>
|
||||
<AKTE:bezeichnung><![CDATA[<?php echo $row->bezeichnung; ?>]]></AKTE:bezeichnung>
|
||||
<AKTE:updateamum><![CDATA[<?php echo $row->updateamum; ?>]]></AKTE:updateamum>
|
||||
<AKTE:updatevon><![CDATA[<?php echo $row->updatevon ?>]]></AKTE:updatevon>
|
||||
<AKTE:insertamum><![CDATA[<?php echo $row->insertamum; ?>]]></AKTE:insertamum>
|
||||
<AKTE:insertvon><![CDATA[<?php echo $row->insertvon ?>]]></AKTE:insertvon>
|
||||
<AKTE:uid><![CDATA[<?php echo $row->uid; ?>]]></AKTE:uid>
|
||||
</RDF:Description>
|
||||
</RDF:li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</RDF:Seq>
|
||||
|
||||
</RDF:RDF>
|
||||
Reference in New Issue
Block a user