This commit is contained in:
Gerald Simane
2009-07-09 08:58:33 +00:00
parent 01a629f477
commit dc93327a8c
4 changed files with 246 additions and 199 deletions
+68 -27
View File
@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2007 Technikum-Wien
/* 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
@@ -15,11 +15,17 @@
* 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>.
* Authors: Christian Paminger < christian.paminger@technikum-wien.at >
* Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at >
* Rudolf Hangl < rudolf.hangl@technikum-wien.at >
* Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at >
*/
require_once('../../config/vilesci.config.inc.php');
require_once('../../config/vilesci.config.inc.php');
require_once('../../include/basis_db.class.php');
if (!$db = new basis_db())
die('Es konnte keine Verbindung zum Server aufgebaut werden.');
require_once('../../include/betriebsmittel.class.php');
require_once('../../include/betriebsmittelperson.class.php');
require_once('../../include/globals.inc.php');
@@ -29,18 +35,17 @@
require_once('../../include/person.class.php');
require_once('../../include/benutzer.class.php');
require_once('../../include/studiensemester.class.php');
require_once('../../include/datum.class.php');
$user = get_uid();
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($user);
$datum_obj = new datum();
if(!$rechte->isBerechtigt('admin'))
die('Sie haben keine Rechte für diese Seite');
$db = new basis_db();
$reloadstr = ""; // neuladen der liste im oberen frame
$htmlstr = "";
$errorstr = ""; //fehler beim insert
@@ -60,30 +65,65 @@
$bmreservieren=isset($_POST["bmreservieren"])?$_POST["bmreservieren"]:'';
$bmort_kurzbz=isset($_POST["bmort_kurzbz"])?$_POST["bmort_kurzbz"]:'';
$bmext_id=isset($_POST["bmext_id"])?$_POST["bmext_id"]:'';
$bmupdatevon=isset($_POST["bmupdatevon"])?$_POST["bmupdatevon"]:'';
$bminsertvon=isset($_POST["bminsertvon"])?$_POST["bminsertvon"]:'';
$bmupdatevon=isset($_POST["bmupdatevon"])?$_POST["bmupdatevon"]:'';
$bminsertvon=isset($_POST["bminsertvon"])?$_POST["bminsertvon"]:'';
$bmpausgegebenam=isset($_POST["bmpausgegebenam"])?$_POST["bmpausgegebenam"]:'';
$bmpretouram=isset($_POST["bmpretouram"])?$_POST["bmpretouram"]:'';
$bmpkaution=isset($_POST["bmpkaution"])?$_POST["bmpkaution"]:'';
$bmpanmerkung=isset($_POST["bmpanmerkung"])?$_POST["bmpanmerkung"]:'';
$bmpext_id=isset($_POST["bmpext_id"])?$_POST["bmpext_id"]:'';
$bmpupdatevon=isset($_POST["bmpupdatevon"])?$_POST["bmpupdatevon"]:'';
$bmpinsertvon=isset($_POST["bmpinsertvon"])?$_POST["bmpinsertvon"]:'';
$bmpupdatevon=isset($_POST["bmpupdatevon"])?$_POST["bmpupdatevon"]:'';
$bmpinsertvon=isset($_POST["bmpinsertvon"])?$_POST["bmpinsertvon"]:'';
if(isset($_GET['standard']))
{
$stsem_obj = new studiensemester();
$stsem = $stsem_obj->getaktorNext();
$qrys = array(
"Insert into public.tbl_variable(name, uid, wert) values('semester_aktuell','$uid','$stsem');",
"Insert into public.tbl_variable(name, uid, wert) values('db_stpl_table','$uid','stundenplandev');",
"Insert into public.tbl_variable(name, uid, wert) values('ignore_kollision','$uid','false');",
"Insert into public.tbl_variable(name, uid, wert) values('kontofilterstg','$uid','false');",
"Insert into public.tbl_variable(name, uid, wert) values('ignore_zeitsperre','$uid','false');",
"Insert into public.tbl_variable(name, uid, wert) values('ignore_reservierung','$uid','false');"
);
$error = false;
foreach ($qrys as $qry)
{
if(!$db->db_query($qry))
{
$error = true;
}
}
if($error)
{
$errorstr.="Es konnten nicht alle Werte angelegt werden";
}
$reloadstr .= "<script type='text/javascript'>\n";
$reloadstr .= " parent.uebersicht.location.href='variablen_uebersicht.php';";
$reloadstr .= "</script>\n";
}
if(isset($_POST["schick"]))
{
if($betriebsmittel_id!='')
{
$bm=new betriebsmittel();
if(!$bm->load($betriebsmittel_id))
die('Betriebsmittel nicht gefunden');
$bm->betriebsmittel_id=$betriebsmittel_id;
$bm->betriebsmitteltyp=$bmbetriebsmitteltyp;
$bm->nummer=$bmnummer;
$bm->nummerintern=$bmnummerintern;
$bm->beschreibung=$bmbeschreibung;
$bm->ort_kurzbz=$bmort_kurzbz;
$bm->reservieren=$bmreservieren;
$bm->insertvon=$bminsertvon;
$bm->updatevon=$bmupdatevon;
$bm->ext_id=$bmext_id;
if(!$bm->save())
{
$reloadstr.="<br>Aktualisierung des Betriebsmittel-Datensatzes fehlgeschlagen!";
@@ -95,16 +135,15 @@
if($person_id!='')
{
$bmp=new betriebsmittelperson();
if(!$bmp->load($betriebsmittel_id, $person_id))
die('Betriebsmittelperson nicht gefunden');
$bmp->betriebsmittel_id=$betriebsmittel_id;
$bmp->person_id=$person_id;
$bmp->ausgegebenam=$bmpausgegebenam;
$bmp->retouram=$bmpretouram;
$bmp->kaution=$bmpkaution;
$bmp->anmerkung=$bmpanmerkung;
$bmp->ext_id=$bmpext_id;
$bmp->updatevon=$bmpupdatevon;
$bmp->insertvon=$bmpinsertvon;
if(!$bmp->save())
{
$reloadstr.="<br>Aktualisierung des Betriebsmittelperson-Datensatzes fehlgeschlagen!";
@@ -136,12 +175,13 @@
$htmlstr .= " <td><b>Beschreibung </b><input type='text' name='bmbeschreibung' value='".$bm->beschreibung."' size='15' maxlength='64'></td>\n";
$htmlstr .= " <td><b>Ort Kurzbz &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
<input type='text' name='bmort_kurzbz' value='".$bm->ort_kurzbz."' size='15' maxlength='64'></td>\n";
$htmlstr .= " <td><b>reservieren </b>".($bm->reservieren?'Ja':'Nein')."</td>\n";
$htmlstr .= " <td><b>reservieren </b><input type='text' name='bmreservieren' value='".$bm->reservieren."' size='15' maxlength='64'></td>\n";
$htmlstr .= " </tr><tr>";
$htmlstr .= " <td><b>insertamum </b>".$datum_obj->formatDatum($bm->insertamum)."</td>\n";
$htmlstr .= " <td><b>insertamum </b>".$bm->insertamum."</td>\n";
$htmlstr .= " <td><b>insertvon </b><input type='hidden' name='bminsertvon' value='$bm->insertvon'>".$bm->insertvon."</td>\n";
$htmlstr .= " <td><b>updateamum </b>".$datum_obj->formatDatum($bm->updateamum,'Y-m-d H:i:s')."</td>\n";
$htmlstr .= " <td><b>updateamum </b>".$bm->updateamum."</td>\n";
$htmlstr .= " <td><b>updatevon </b><input type='hidden' name='bmupdatevon' value='$bm->updatevon'>".$bm->updatevon."</td>\n";
$htmlstr .= " <td><b>ext_id </b><input type='hidden' name='bmext_id' value='$bm->ext_id'>".$bm->ext_id."</td>\n";
$htmlstr .= " </tr><tr>";
$htmlstr .= " <td>&nbsp;</td>\n";
$htmlstr .= " </tr><tr>";
@@ -152,14 +192,16 @@
$htmlstr .= " <td><b>retour am </b><input type='text' name='bmpretouram' value='".$bmp->retouram."' size='15' maxlength='64'></td>\n";
$htmlstr .= " <td><b>Kaution </b><input type='text' name='bmpkaution' value='".$bmp->kaution."' size='15' maxlength='64'></td>\n";
$htmlstr .= " </tr><tr>";
$htmlstr .= " <td colspan='4'><b>Anmerkung </b><input type='bmpanmerkung' name='bmpanmerkung' value='".$bmp->anmerkung."' size='60' maxlength='256'></td>\n";
$htmlstr .= " <td><b>Anmerkung </b><input type='bmpanmerkung' name='bmpanmerkung' value='".$bmp->anmerkung."' size='15' maxlength='64'></td>\n";
$htmlstr .= " </tr><tr>";
$htmlstr .= " <td><b>insertamum </b>".$datum_obj->formatDatum($bmp->insertamum,'Y-m-d H:i:s')."</td>\n";
$htmlstr .= " <td><b>insertamum </b>".$bmp->insertamum."</td>\n";
$htmlstr .= " <td><b>insertvon </b><input type='hidden' name='bmpinsertvon' value='$bm->insertvon'>".$bmp->insertvon."</td>\n";
$htmlstr .= " <td><b>updateamum </b>".$datum_obj->formatDatum($bmp->updateamum,'Y-m-d H:i:s')."</td>\n";
$htmlstr .= " <td><b>updateamum </b>".$bmp->updateamum."</td>\n";
$htmlstr .= " <td><b>updatevon </b><input type='hidden' name='bmpupdatevon' value='$bm->updatevon'>".$bmp->updatevon."</td>\n";
$htmlstr .= " <td><b>ext_id </b><input type='hidden' name='bmpext_id' value='$bm->ext_id'>".$bmp->ext_id."</td>\n";
$htmlstr .= " </tr><tr>";
$htmlstr .= " <td><input type='submit' name='schick' value='speichern'></td>";
$htmlstr .= " <td><input type='submit' name='del' value='l&ouml;schen'></td>";
$htmlstr .= " </tr>\n";
$htmlstr .= "</form>\n";
$htmlstr .= "</table>\n";
@@ -170,7 +212,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Betriebsmitel-Details</title>
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
<script src="../../include/js/mailcheck.js"></script>
@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2007 Technikum-Wien
/* 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
@@ -15,15 +15,21 @@
* 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>.
* Authors: Christian Paminger < christian.paminger@technikum-wien.at >
* Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at >
* Rudolf Hangl < rudolf.hangl@technikum-wien.at >
* Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at >
*/
require_once('../../config/vilesci.config.inc.php');
require_once('../../include/functions.inc.php');
require_once('../../config/vilesci.config.inc.php');
require_once('../../include/basis_db.class.php');
if (!$db = new basis_db())
die('Es konnte keine Verbindung zum Server aufgebaut werden.');
require_once('../../include/functions.inc.php');
require_once('../../include/studiengang.class.php');
require_once('../../include/benutzerberechtigung.class.php');
$user = get_uid();
$rechte = new benutzerberechtigung();
@@ -31,40 +37,44 @@
if(!$rechte->isBerechtigt('admin'))
die('Sie haben keine Berechtigung für diese Seite');
$db = new basis_db();
$htmlstr = "";
if (isset($_POST['bmsuche']))
{
$bmsuche=mb_strtoupper($_POST['bmsuche']);
$bmsuche=strtoupper($_POST['bmsuche']);
$bmsuche = ereg_replace("^0*", "", $bmsuche);
$sql_query="SELECT * FROM public.vw_betriebsmittelperson
WHERE upper(uid) LIKE '%$bmsuche%' OR upper(nachname) LIKE '%$bmsuche%' OR upper(vorname) LIKE '%$bmsuche%'
OR upper(nummer) LIKE '%$bmsuche%' OR upper(nummerintern) LIKE '%$bmsuche%'
LIMIT 30";
//echo $sql_query;
}
else
{
$sql_query="SELECT * FROM public.vw_betriebsmittelperson ORDER BY insertamum DESC LIMIT 20";
}
else
$sql_query = 'SELECT * FROM public.vw_betriebsmittelperson ORDER BY nummer LIMIT 20;';
if(!$erg=$db->db_query($sql_query))
{
$errormsg='Fehler beim Laden der Berechtigungen';
$htmlstr='Fehler beim Laden der Berechtigungen';
}
else
{
$htmlstr .= "<table id='t1' class='liste table-autosort:2 table-stripeclass:alternate table-autostripe'>\n";
//$htmlstr = "<table class='liste sortable'>\n";
$htmlstr .= "<div style='text-align:right'>";
$htmlstr .= "<form name='suche' method='POST' action=''>
<input type='text' value=''id='bmsuche' maxlength=12 size=12 name='bmsuche' tabindex='1'/>&nbsp;
<input type='submit' name='submit' value='BM-Suche'>
</form>";
$htmlstr .= "</div>";
$htmlstr .= "<form name='formular'><input type='hidden' name='check' value=''></form><table id='t1' class='liste table-autosort:2 table-stripeclass:alternate table-autostripe'>\n";
$htmlstr .= " <thead><tr class='liste'>\n";
$htmlstr .= " <th class='table-sortable:default'>Typ</th><th class='table-sortable:default'>Nummer</th>
$htmlstr .= " <th class='table-sortable:default'>Typ</th><th class='table-sortable:default'>Nummer</th>
<th class='table-sortable:default'>NrIntern</th><th class='table-sortable:default'>Person (UID)</th>
<th class='table-sortable:default'>Ausgabe</th><th class='table-sortable:alphanumeric'>Retour</th>";
$htmlstr .= " </tr></thead><tbody>\n";
$i = 0;
while($row = $db->db_fetch_object($erg))
$htmlstr .= " </tr></thead><tbody>\n";
$i = 0;
while($row=$db->db_fetch_object($erg))
{
//$htmlstr .= " <tr class='liste". ($i%2) ."'>\n";
$htmlstr .= " <tr>\n";
@@ -81,7 +91,6 @@
}
$htmlstr .= "</tbody></table>\n";
}
?>
<html>
<head>
@@ -101,14 +110,6 @@
<h2>Betriebsmittel &Uuml;bersicht</h2>
<?php
//$htmlstr = "<table class='liste sortable'>\n";
echo "<div style='text-align:right'>
<form name='suche' method='POST' action=''>
<input type='text' value=''id='bmsuche' maxlength=12 size=12 name='bmsuche' tabindex='1'/>&nbsp;
<input type='submit' name='submit' value='BM-Suche'>
</form>
</div>
<form name='formular'><input type='hidden' name='check' value=''></form>";
echo $htmlstr;
?>
+16 -13
View File
@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2008 Technikum-Wien
/* 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
@@ -15,21 +15,24 @@
* 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>.
* Authors: Christian Paminger < christian.paminger@technikum-wien.at >
* Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at >
* Rudolf Hangl < rudolf.hangl@technikum-wien.at >
* Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at >
*/
/**
* Detailansicht fuer die Firmenverwaltung
* Ermoeglicht die Eingabe der Firmendaten plus zugehoeriger Adressen
*/
require_once('../../config/vilesci.config.inc.php');
require_once('../../config/vilesci.config.inc.php');
require_once('../../include/basis_db.class.php');
if (!$db = new basis_db())
die('Es konnte keine Verbindung zum Server aufgebaut werden.');
require_once('../../include/functions.inc.php');
require_once('../../include/firma.class.php');
require_once('../../include/adresse.class.php');
require_once('../../include/nation.class.php');
require_once('../../include/benutzerberechtigung.class.php');
// ******* INIT ********
$user = get_uid();
@@ -40,8 +43,6 @@
if(!$rechte->isBerechtigt('admin') && !$rechte->isBerechtigt('preinteressent') && !$rechte->isBerechtigt('assistenz'))
die('Sie haben keine Berechtigung für diese Seite');
$db = new basis_db();
$htmlstr = '';
$errorstr = '';
$messagestr='';
@@ -119,7 +120,9 @@
$adresse_obj->firma_id = $firma_id;
$adresse_obj->updateamum = date('Y-m-d H:i:s');
$adresse_obj->updatvon = $user;
//var_dump($adresse_obj);
if(!$adresse_obj->save())
{
$errorstr = 'Fehler beim Speichern der Adresse:'.$adresse_obj->errormsg;
+130 -128
View File
@@ -1,128 +1,130 @@
<?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> and
* Gerald Raab <gerald.raab@technikum-wien.at>.
*/
require_once('../../config/vilesci.config.inc.php');
require_once('../../include/functions.inc.php');
require_once('../../include/firma.class.php');
$db = new basis_db();
$filter = (isset($_GET['filter'])?$_GET['filter']:'');
$firmentypfilter = (isset($_GET['firmentypfilter'])?$_GET['firmentypfilter']:'');
$htmlstr = "";
if($filter=='')
$sql_query = "SELECT * FROM public.tbl_firma WHERE true";
else
$sql_query = "SELECT * FROM public.tbl_firma
WHERE lower(name) like lower('%".addslashes($filter)."%')
OR lower(adresse) like lower('%".addslashes($filter)."%')
OR lower(anmerkung) like lower('%".addslashes($filter)."%')";
if($firmentypfilter!='')
$sql_query.=" AND firmentyp_kurzbz='".addslashes($firmentypfilter)."'";
if(!$erg=$db->db_query($sql_query))
{
$errormsg='Fehler beim Laden der Firma';
}
else
{
$htmlstr .= "</form><table id='t1' class='liste table-autosort:1 table-stripeclass:alternate table-autostripe'>\n";
$htmlstr .= " <thead><tr class='liste'>\n";
$htmlstr .= " <th class='table-sortable:numeric'>ID</th><th class='table-sortable:default'>Name</th><th class='table-sortable:default'>Adresse</th><th class='table-sortable:default'>Email</th><th class='table-sortable:default'>Telefon</th><th class='table-sortable:default'>Fax</th><th class='table-sortable:default'>Anmerkung</th><th class='table-sortable:default'>Typ</th><th class='table-sortable:default'>Schule</th>";
$htmlstr .= " </tr></thead><tbody>\n";
$i = 0;
while($row=$db->db_fetch_object($erg))
{
$htmlstr .= " <tr>\n";
$htmlstr .= " <td><a href='firma_details.php?firma_id=".$row->firma_id."' target='detail_firma'>".$row->firma_id."</a></td>\n";
$htmlstr .= " <td><a href='firma_details.php?firma_id=".$row->firma_id."' target='detail_firma'>".$row->name."</a></td>\n";
$htmlstr .= " <td>$row->adresse</td>\n";
$htmlstr .= " <td>$row->email</td>\n";
$htmlstr .= " <td>$row->telefon</td>\n";
$htmlstr .= " <td>$row->fax</td>\n";
$htmlstr .= " <td title='".$row->anmerkung."'>".(strlen($row->anmerkung)>30?substr($row->anmerkung,0,27).'...':$row->anmerkung)."</td>\n";
$htmlstr .= " <td>$row->firmentyp_kurzbz</td>\n";
$htmlstr .= " <td>".($row->schule=='t'?'Ja':'Nein')."</td>\n";
$htmlstr .= " </tr>\n";
$i++;
}
$htmlstr .= "</tbody></table>\n";
}
?>
<html>
<head>
<title>Firma Uebersicht</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
<link rel="stylesheet" href="../../include/js/tablesort/table.css" type="text/css">
<script src="../../include/js/tablesort/table.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
var firmentypfilter='<?php echo $firmentypfilter; ?>';
var filter = '<?php echo $filter; ?>';
-->
</script>
</head>
<body class="background_main">
<h2>Firmen - &Uuml;bersicht</h2>
<?php
echo '<table width="100%"><tr><td>';
echo '<h3>Übersicht</h3>';
echo '</td><td align="right">';
echo "<input type='button' onclick='parent.detail_firma.location=\"firma_details.php?neu=true\"' value='Neue Firma anlegen'/>";
echo '</td></tr></table>';
//Suche
echo '<form action="'.$_SERVER['PHP_SELF'].'" method="GET">';
echo '<input type="text" name="filter" value="'.$filter.'">';
echo 'Typ: <SELECT name="firmentypfilter">
<option value="">-- Alle --</option>';
$firma = new firma();
$firma->getFirmenTypen();
foreach ($firma->result as $row)
{
if($row->firmentyp_kurzbz==$firmentypfilter)
$selected='selected';
else
$selected='';
echo "<option value='$row->firmentyp_kurzbz' $selected>$row->firmentyp_kurzbz</option>";
}
echo '</SELECT>';
echo '<input type="submit" value="Suchen">';
echo '</form>';
echo $htmlstr;
?>
</body>
</html>
<?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 >
* Rudolf Hangl < rudolf.hangl@technikum-wien.at >
* Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at >
*/
require_once('../../config/vilesci.config.inc.php');
require_once('../../include/basis_db.class.php');
if (!$db = new basis_db())
die('Es konnte keine Verbindung zum Server aufgebaut werden.');
require_once('../../include/functions.inc.php');
require_once('../../include/firma.class.php');
$filter = (isset($_GET['filter'])?$_GET['filter']:'');
$firmentypfilter = (isset($_GET['firmentypfilter'])?$_GET['firmentypfilter']:'');
$htmlstr = "";
if($filter=='')
$sql_query = "SELECT * FROM public.tbl_firma WHERE true";
else
$sql_query = "SELECT * FROM public.tbl_firma WHERE lower(name) like lower('%$filter%') OR lower(adresse) like lower('%$filter%') OR lower(anmerkung) like lower('%$filter%')";
if($firmentypfilter!='')
$sql_query.=" AND firmentyp_kurzbz='".addslashes($firmentypfilter)."'";
//echo $sql_query;
if(!$erg=$db->db_query($sql_query))
{
$htmlstr='Fehler beim Laden der Firma';
}
else
{
$htmlstr .= "</form><table id='t1' class='liste table-autosort:1 table-stripeclass:alternate table-autostripe'>\n";
$htmlstr .= " <thead><tr class='liste'>\n";
$htmlstr .= " <th class='table-sortable:numeric'>ID</th><th class='table-sortable:default'>Name</th><th class='table-sortable:default'>Adresse</th><th class='table-sortable:default'>Email</th><th class='table-sortable:default'>Telefon</th><th class='table-sortable:default'>Fax</th><th class='table-sortable:default'>Anmerkung</th><th class='table-sortable:default'>Typ</th><th class='table-sortable:default'>Schule</th>";
$htmlstr .= " </tr></thead><tbody>\n";
$i = 0;
while($row=$db->db_fetch_object($erg))
{
//$htmlstr .= " <tr class='liste". ($i%2) ."'>\n";
$htmlstr .= " <tr>\n";
$htmlstr .= " <td><a href='firma_details.php?firma_id=".$row->firma_id."' target='detail_firma'>".$row->firma_id."</a></td>\n";
$htmlstr .= " <td><a href='firma_details.php?firma_id=".$row->firma_id."' target='detail_firma'>".$row->name."</a></td>\n";
$htmlstr .= " <td>$row->adresse</td>\n";
$htmlstr .= " <td>$row->email</td>\n";
$htmlstr .= " <td>$row->telefon</td>\n";
$htmlstr .= " <td>$row->fax</td>\n";
$htmlstr .= " <td title='".$row->anmerkung."'>".(strlen($row->anmerkung)>30?substr($row->anmerkung,0,27).'...':$row->anmerkung)."</td>\n";
$htmlstr .= " <td>$row->firmentyp_kurzbz</td>\n";
$htmlstr .= " <td>".($row->schule=='t'?'Ja':'Nein')."</td>\n";
$htmlstr .= " </tr>\n";
$i++;
}
$htmlstr .= "</tbody></table>\n";
}
?>
<html>
<head>
<title>Firma Uebersicht</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
<link rel="stylesheet" href="../../include/js/tablesort/table.css" type="text/css">
<script src="../../include/js/tablesort/table.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
var firmentypfilter='<?php echo $firmentypfilter; ?>';
var filter = '<?php echo $filter; ?>';
-->
</script>
</head>
<body class="background_main">
<h2>Firmen - &Uuml;bersicht</h2>
<?php
echo '<table width="100%"><tr><td>';
echo '<h3>Übersicht</h3>';
echo '</td><td align="right">';
echo "<input type='button' onclick='parent.detail_firma.location=\"firma_details.php?neu=true\"' value='Neue Firma anlegen'/>";
echo '</td></tr></table>';
//Suche
echo '<form action="'.$_SERVER['PHP_SELF'].'" method="GET">';
echo '<input type="text" name="filter" value="'.$filter.'">';
echo 'Typ: <SELECT name="firmentypfilter">
<option value="">-- Alle --</option>';
$firma = new firma();
$firma->getFirmenTypen();
foreach ($firma->result as $row)
{
if($row->firmentyp_kurzbz==$firmentypfilter)
$selected='selected';
else
$selected='';
echo "<option value='$row->firmentyp_kurzbz' $selected>$row->firmentyp_kurzbz</option>";
}
echo '</SELECT>';
echo '<input type="submit" value="Suchen">';
echo '</form>';
echo $htmlstr;
?>
</body>
</html>