mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-19 16:02:15 +00:00
This commit is contained in:
+6
-10
@@ -332,7 +332,7 @@ class firma extends basis_db
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Laedt alle Firmen eines bestimmen Firmentyps
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
@@ -483,16 +483,12 @@ class firma extends basis_db
|
||||
}
|
||||
|
||||
$qry =" select tbl_firma.* ";
|
||||
|
||||
$qry.=", tbl_firma_organisationseinheit.firma_organisationseinheit_id ,tbl_firma_organisationseinheit.kundennummer ,tbl_firma_organisationseinheit.oe_kurzbz ";
|
||||
|
||||
$qry.=" ,tbl_organisationseinheit.oe_parent_kurzbz,tbl_organisationseinheit.bezeichnung,tbl_organisationseinheit.bezeichnung ,tbl_organisationseinheit.organisationseinheittyp_kurzbz,tbl_organisationseinheit.aktiv as oe_aktiv,tbl_organisationseinheit.mailverteiler ";
|
||||
|
||||
$qry.=" FROM public.tbl_firma, public.tbl_firma_organisationseinheit ";
|
||||
$qry.=" left outer join public.tbl_organisationseinheit on ( tbl_organisationseinheit.oe_kurzbz=tbl_firma_organisationseinheit.oe_kurzbz ) ";
|
||||
$qry.=" WHERE tbl_firma.firma_id=tbl_firma_organisationseinheit.firma_id ";
|
||||
|
||||
|
||||
if($firma_organisationseinheit_id!='')
|
||||
$qry.=" and tbl_firma_organisationseinheit.firma_organisationseinheit_id='".addslashes($firma_organisationseinheit_id)."'";
|
||||
if($firma_id!='')
|
||||
@@ -530,13 +526,13 @@ class firma extends basis_db
|
||||
$fa->organisationseinheittyp_kurzbz = $row->organisationseinheittyp_kurzbz;
|
||||
$fa->bezeichnung = $row->bezeichnung;
|
||||
$fa->kundennummer = $row->kundennummer;
|
||||
|
||||
$fa->oe_aktiv = ($row->oe_aktiv=='t'?true:false);
|
||||
$fa->mailverteiler = ($row->mailverteiler=='t'?true:false);
|
||||
|
||||
$fa->oe_aktiv = $row->oe_aktiv;
|
||||
$fa->mailverteiler = $row->mailverteiler;
|
||||
|
||||
$this->result[] = $fa;
|
||||
$this->result[]=$fa;
|
||||
}
|
||||
return true;
|
||||
return $this->result;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+36
-22
@@ -319,26 +319,46 @@ class kontakt extends basis_db
|
||||
* @param standort_id
|
||||
* @return boolean
|
||||
*/
|
||||
public function load_standort($standort_id='',$firma_id='')
|
||||
public function load_standort($standort_id='',$firma_id='',$kontakt_id='',$person_id='')
|
||||
{
|
||||
if(!is_numeric($standort_id))
|
||||
$this->result=array();
|
||||
$this->errormsg = '';
|
||||
|
||||
if($firma_id!='' && !is_numeric($firma_id))
|
||||
{
|
||||
$this->errormsg = 'Firma ist ungueltig';
|
||||
return false;
|
||||
}
|
||||
if($standort_id!='' && !is_numeric($standort_id))
|
||||
{
|
||||
$this->errormsg = 'Standort ist ungueltig';
|
||||
return false;
|
||||
}
|
||||
|
||||
$qry = "SELECT tbl_kontakt.*, tbl_standort.kurzbz as standort_kurzbz, tbl_standort.bezeichnung as standort_bezeichnung
|
||||
,tbl_person.anrede,tbl_person.titelpost,tbl_person.titelpre,tbl_person.nachname,tbl_person.vorname,tbl_person.vornamen
|
||||
FROM public.tbl_kontakt
|
||||
LEFT JOIN public.tbl_standort USING(standort_id,firma_id)
|
||||
LEFT JOIN public.tbl_person USING(person_id)
|
||||
WHERE standort_id>0
|
||||
if($kontakt_id!='' && !is_numeric($kontakt_id))
|
||||
{
|
||||
$this->errormsg = 'Kontakt ist ungueltig';
|
||||
return false;
|
||||
}
|
||||
if($person_id!='' && !is_numeric($person_id))
|
||||
{
|
||||
$this->errormsg = 'Person ist ungueltig';
|
||||
return false;
|
||||
}
|
||||
$qry = "SELECT tbl_kontakt.*
|
||||
,tbl_standort.firma_id, tbl_standort.kurzbz as standort_kurzbz, tbl_standort.bezeichnung as standort_bezeichnung
|
||||
FROM public.tbl_kontakt,public.tbl_standort
|
||||
WHERE tbl_standort.standort_id=tbl_kontakt.standort_id
|
||||
";
|
||||
if(is_numeric($standort_id))
|
||||
$qry.=" and standort_id='".addslashes($standort_id)."'";
|
||||
|
||||
if(is_numeric($firma_id))
|
||||
$qry.=" and tbl_kontakt.firma_id='".addslashes($firma_id)."'";
|
||||
|
||||
$qry.=" and tbl_standort.firma_id='".addslashes($firma_id)."'";
|
||||
if(is_numeric($standort_id))
|
||||
$qry.=" and tbl_kontakt.standort_id='".addslashes($standort_id)."'";
|
||||
if(is_numeric($kontakt_id))
|
||||
$qry.=" and tbl_kontakt.kontakt_id='".addslashes($kontakt_id)."'";
|
||||
if(is_numeric($person_id))
|
||||
$qry.=" and tbl_kontakt.person_id='".addslashes($person_id)."'";
|
||||
##echo $qry;
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object())
|
||||
@@ -360,22 +380,16 @@ class kontakt extends basis_db
|
||||
$obj->insertamum = $row->insertamum;
|
||||
$obj->insertvon = $row->insertvon;
|
||||
$obj->ext_id = $row->ext_id;
|
||||
$obj->anrede=$row->anrede;
|
||||
$obj->titelpost=$row->titelpost;
|
||||
$obj->titelpre=$row->titelpre;
|
||||
$obj->nachname=$row->nachname;
|
||||
$obj->vorname=$row->vorname;
|
||||
$obj->vornamen=$row->vornamen;
|
||||
$this->result[] = $row;
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden der Daten';
|
||||
return false;
|
||||
}
|
||||
return $this->result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+250
-3
@@ -47,12 +47,20 @@ class standort extends basis_db
|
||||
public $person_id; // integer
|
||||
public $funktion_kurzbz; // string
|
||||
public $position; // string
|
||||
public $anrede; // string
|
||||
|
||||
public $person_anrede; // string
|
||||
public $titelpost; // string
|
||||
public $titelpre; // string
|
||||
public $nachname; // string
|
||||
public $vorname; // string
|
||||
public $vornamen; // string
|
||||
|
||||
|
||||
public $funktion_beschreibung; // string
|
||||
public $funktion_aktiv; // boolean
|
||||
public $funktion_fachbereich; // string
|
||||
public $funktion_semester; // string
|
||||
public $anrede; // string
|
||||
|
||||
|
||||
/**
|
||||
@@ -207,6 +215,8 @@ class standort extends basis_db
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Prueft die Variablen auf Gueltigkeit
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
@@ -240,8 +250,6 @@ class standort extends basis_db
|
||||
$this->errormsg = 'bezeichnung darf nicht länger als 255 Zeichen sein';
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$this->errormsg = '';
|
||||
return true;
|
||||
}
|
||||
@@ -254,6 +262,8 @@ class standort extends basis_db
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
$this->errormsg = '';
|
||||
|
||||
//Variablen pruefen
|
||||
if(!$this->validate())
|
||||
return false;
|
||||
@@ -352,5 +362,242 @@ class standort extends basis_db
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Laedt alle Standort,Funktion zu der Adress ID die uebergeben wird
|
||||
* @param adress_id ID der Adresse zu der die standorte geladen werden sollen
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function load_personfunktionstandort($personfunktionstandort_id='',$firma_id='',$standort_id='',$adress_id='',$person_id='')
|
||||
{
|
||||
$this->result=array();
|
||||
$this->errormsg = '';
|
||||
|
||||
//Pruefen ob xxx_ID eine gueltige Zahl ist
|
||||
if($firma_id!='' && !is_numeric($firma_id))
|
||||
{
|
||||
$this->errormsg = 'Firma ID muss eine gültige Zahl sein';
|
||||
return false;
|
||||
}
|
||||
if($standort_id!='' && !is_numeric($standort_id))
|
||||
{
|
||||
$this->errormsg = 'Standort ID muss eine gültige Zahl sein';
|
||||
return false;
|
||||
}
|
||||
if($adress_id!='' && !is_numeric($adress_id))
|
||||
{
|
||||
$this->errormsg = 'Adressen ID muss eine gültige Zahl sein';
|
||||
return false;
|
||||
}
|
||||
if($person_id!='' && !is_numeric($person_id))
|
||||
{
|
||||
$this->errormsg = 'Person ID muss eine gültige Zahl sein';
|
||||
return false;
|
||||
}
|
||||
|
||||
//Pruefen ob pers_id eine gueltige Zahl ist
|
||||
if($personfunktionstandort_id!='' && !is_numeric($personfunktionstandort_id))
|
||||
{
|
||||
$this->errormsg = 'Personfunktionstandort ID muss eine gültige Zahl sein';
|
||||
return false;
|
||||
}
|
||||
|
||||
//Lesen der Daten aus der Datenbank
|
||||
$qry = "SELECT tbl_standort.*
|
||||
, personfunktionstandort_id,funktion_kurzbz,position,tbl_personfunktionstandort.anrede
|
||||
,tbl_person.person_id,tbl_person.anrede as person_anrede,tbl_person.titelpost,tbl_person.titelpre,tbl_person.nachname,tbl_person.vorname,tbl_person.vornamen
|
||||
FROM public.tbl_standort ,public.tbl_personfunktionstandort,public.tbl_person
|
||||
WHERE tbl_personfunktionstandort.standort_id=tbl_standort.standort_id
|
||||
AND tbl_person.person_id=tbl_personfunktionstandort.person_id
|
||||
";
|
||||
|
||||
if ($personfunktionstandort_id!='' && is_numeric($personfunktionstandort_id))
|
||||
$qry.=" AND personfunktionstandort_id='".addslashes($personfunktionstandort_id)."'";
|
||||
if ($firma_id!='' && is_numeric($firma_id))
|
||||
$qry.=" AND tbl_standort.firma_id='".addslashes($firma_id)."'";
|
||||
if ($standort_id!='' && is_numeric($standort_id))
|
||||
$qry.=" AND tbl_standort.standort_id='".addslashes($standort_id)."'";
|
||||
if ($adress_id!='' && is_numeric($adress_id))
|
||||
$qry.=" AND tbl_standort.adress_id='".addslashes($adress_id)."'";
|
||||
if ($person_id!='' && is_numeric($person_id))
|
||||
$qry.=" AND tbl_standort.person_id='".addslashes($person_id)."'";
|
||||
|
||||
if(!$this->db_query($qry))
|
||||
{
|
||||
$this->errormsg = 'Fehler bei einer Datenbankabfrage';
|
||||
return false;
|
||||
}
|
||||
|
||||
while($row = $this->db_fetch_object())
|
||||
{
|
||||
$adr_obj = new standort();
|
||||
|
||||
$adr_obj->standort_id = $row->standort_id;
|
||||
$adr_obj->adresse_id = $row->adresse_id;
|
||||
$adr_obj->kurzbz = $row->kurzbz;
|
||||
$adr_obj->bezeichnung = $row->bezeichnung;
|
||||
$adr_obj->updateamum = $row->updateamum;
|
||||
$adr_obj->updatevon = $row->updatevon;
|
||||
$adr_obj->insertamum = $row->insertamum;
|
||||
$adr_obj->insertvon = $row->insertvon;
|
||||
$adr_obj->ext_id = $row->ext_id;
|
||||
$adr_obj->firma_id = $row->firma_id;
|
||||
|
||||
$adr_obj->personfunktionstandort_id=$row->personfunktionstandort_id;
|
||||
$adr_obj->funktion_kurzbz=$row->funktion_kurzbz;
|
||||
$adr_obj->position=$row->position;
|
||||
$adr_obj->anrede=$row->anrede;
|
||||
|
||||
|
||||
|
||||
$adr_obj->person_id=$row->person_id;
|
||||
$adr_obj->person_anrede=$row->person_anrede;
|
||||
$adr_obj->titelpost=$row->titelpost;
|
||||
$adr_obj->titelpre=$row->titelpre;
|
||||
$adr_obj->nachname=$row->nachname;
|
||||
$adr_obj->vorname=$row->vorname;
|
||||
$adr_obj->vornamen=$row->vornamen;
|
||||
|
||||
$this->result[] = $adr_obj;
|
||||
}
|
||||
return $this->result;
|
||||
}
|
||||
/**
|
||||
* Speichert den aktuellen Personfunktionstandort Datensatz in die Datenbank
|
||||
* Wenn $neu auf true gesetzt ist wird ein neuer Datensatz angelegt
|
||||
* andernfalls wird der Datensatz mit der ID in $standort_id aktualisiert
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function savepersonfunktionstandort()
|
||||
{
|
||||
$this->errormsg = '';
|
||||
//Pruefen ob standort_id eine gueltige Zahl ist
|
||||
if($this->personfunktionstandort_id!='' && !is_numeric($this->personfunktionstandort_id))
|
||||
{
|
||||
$this->errormsg = 'personfunktionstandort_id muss eine gültige Zahl sein: '.$this->personfunktionstandort_id."\n";
|
||||
return false;
|
||||
}
|
||||
//Pruefen ob standort_id eine gueltige Zahl ist
|
||||
if(!is_numeric($this->standort_id))
|
||||
{
|
||||
$this->errormsg = 'standort_id muss eine gültige Zahl sein: '.$this->standort_id."\n";
|
||||
return false;
|
||||
}
|
||||
//Pruefen ob standort_id eine gueltige Zahl ist
|
||||
if(!is_numeric($this->person_id))
|
||||
{
|
||||
$this->errormsg = 'person_id muss eine gültige Zahl sein: '.$this->person_id."\n";
|
||||
return false;
|
||||
}
|
||||
//Pruefen ob standort_id eine gueltige Zahl ist
|
||||
if(empty($this->funktion_kurzbz))
|
||||
{
|
||||
$this->errormsg = 'funktion_kurzbz muss eingegeben werden: '.$this->funktion_kurzbz."\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if($this->new)
|
||||
{
|
||||
//Neuen Datensatz einfuegen
|
||||
$qry='BEGIN;INSERT INTO public.tbl_personfunktionstandort (funktion_kurzbz,person_id,position,anrede,standort_id)
|
||||
VALUES('.
|
||||
($this->funktion_kurzbz!=null?$this->addslashes($this->funktion_kurzbz):'null').', '.
|
||||
($this->person_id!=null?$this->addslashes($this->person_id):'null').', '.
|
||||
$this->addslashes($this->position).', '.
|
||||
$this->addslashes($this->anrede).', '.
|
||||
($this->standort_id!=null?$this->addslashes($this->standort_id):'null').');';
|
||||
}
|
||||
else
|
||||
{
|
||||
$qry='UPDATE public.tbl_personfunktionstandort SET'.
|
||||
' funktion_kurzbz='.($this->funktion_kurzbz!=null?$this->addslashes($this->funktion_kurzbz):'null').', '.
|
||||
' person_id='.($this->person_id!=null?$this->addslashes($this->person_id):'null').', '.
|
||||
' position='.$this->addslashes($this->position).', '.
|
||||
' anrede='.$this->addslashes($this->anrede).','.
|
||||
' standort_id='.($this->standort_id!=null?$this->addslashes($this->standort_id):'null').' '.
|
||||
' WHERE personfunktionstandort_id='.$this->personfunktionstandort_id.';';
|
||||
}
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
if($this->new)
|
||||
{
|
||||
//naechste ID aus der Sequence holen
|
||||
$qry="SELECT currval('public.tbl_personfunktionstandort_personfunktionstandort_id_seq') as id;";
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
if($row = $this->db_fetch_object())
|
||||
{
|
||||
$this->personfunktionstandort_id = $row->id;
|
||||
$this->db_query('COMMIT');
|
||||
return $this->personfunktionstandort_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db_query('ROLLBACK');
|
||||
$this->errormsg = "Fehler beim Auslesen der Sequence";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db_query('ROLLBACK');
|
||||
$this->errormsg = 'Fehler beim Auslesen der Sequence';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Speichern des Adress-Datensatzes';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loescht den Datenensatz mit der ID die uebergeben wird
|
||||
* @param $standort_id ID die geloescht werden soll
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function deletepersonfunktionstandort($personfunktionstandort_id='',$standort_id='')
|
||||
{
|
||||
//Pruefen ob standort_id eine gueltige Zahl ist
|
||||
if(!is_numeric($personfunktionstandort_id) && $personfunktionstandort_id != '')
|
||||
{
|
||||
$this->errormsg = 'personfunktionstandort_id muss eine gültige Zahl sein'."\n";
|
||||
return false;
|
||||
}
|
||||
if(!is_numeric($standort_id) && $standort_id != '')
|
||||
{
|
||||
$this->errormsg = 'standort_id muss eine gültige Zahl sein'."\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if($personfunktionstandort_id != '')
|
||||
$qry="DELETE FROM public.tbl_personfunktionstandort WHERE personfunktionstandort_id='".addslashes($personfunktionstandort_id)."';";
|
||||
else if($standort_id != '')
|
||||
$qry="DELETE FROM public.tbl_personfunktionstandort WHERE standort_id='".addslashes($standort_id)."';";
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'personfunktionstandort_id oder standort_id muss eingegeben werden'."\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Löschen der Daten'."\n";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -575,10 +575,17 @@
|
||||
<td class="tdwrap">
|
||||
<table class="tabcontent" id="QM" style="display: none">
|
||||
|
||||
<tr>
|
||||
<td class="tdwidth10" nowrap> </td>
|
||||
<td class="tdwrap"><a href="private/info/qm/info.html" target="content" class="MenuItem" onClick="return(js_toggle_container('QM_DE'));"><img src="../skin/images/menu_item.gif" alt="menu item" width="7" height="9"> Deutsch</a>
|
||||
<table class="tabcontent" id="QM_DE" style="display: none">
|
||||
<tr>
|
||||
|
||||
<td class="tdwidth10" nowrap> </td>
|
||||
<td class="tdwrap"><a href="private/info/qm/info.html" target="content" class="MenuItem" onClick="return(js_toggle_container('QM_DE'));"><img src="../skin/images/menu_item.gif" alt="menu item" width="7" height="9"> Deutsch</a>
|
||||
<table class="tabcontent" id="QM_DE" style="display: none">
|
||||
|
||||
<tr>
|
||||
<td class="tdwidth10" nowrap> </td>
|
||||
<td class="tdwrap"><a target="content" class="Item" href="private/info/qm/Qualitaetsmanagementhandbuch.pdf" ><img src="../skin/images/menu_item.gif" alt="menu item" width="7" height="9"> QM-Handbuch</a></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="tdwidth10" nowrap> </td>
|
||||
<td class="tdwrap"><a target="content" class="Item" href="private/info/qm/Qualitaetsmanagementhandbuch.php?lang="><img src="../skin/images/menu_item.gif" alt="menu item" width="7" height="9"> CRM@FHTW</a></td>
|
||||
@@ -613,9 +620,9 @@
|
||||
<table class="tabcontent" id="QM_EN" style="display:none">
|
||||
|
||||
<!-- EN QM Handbuch CRM@FHTW ist nun in Documents/Support Documents CRM@FHTW-->
|
||||
<tr style="display:none;">
|
||||
<tr>
|
||||
<td class="tdwidth10" nowrap> </td>
|
||||
<td class="tdwrap"><a target="content" class="Item" href="private/info/qm/Qualitaetsmanagementhandbuch.php?lang=en" ><img src="../skin/images/menu_item.gif" alt="menu item" width="7" height="9"> QM-Handbook</a></td>
|
||||
<td class="tdwrap"><a target="content" class="Item" href="private/info/qm/Quality management Handbook.pdf" ><img src="../skin/images/menu_item.gif" alt="menu item" width="7" height="9"> QM-Handbook</a></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
||||
@@ -20,180 +20,85 @@
|
||||
* Rudolf Hangl < rudolf.hangl@technikum-wien.at >
|
||||
* Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at >
|
||||
*/
|
||||
|
||||
$firma_id = (isset($_REQUEST["firma_id"])?$_REQUEST['firma_id']:'');
|
||||
|
||||
require_once('../../config/vilesci.config.inc.php');
|
||||
require_once('../../include/functions.inc.php');
|
||||
require_once('../../include/firma.class.php');
|
||||
require_once('../../include/standort.class.php');
|
||||
require_once('../../include/adresse.class.php');
|
||||
require_once('../../include/nation.class.php');
|
||||
require_once('../../include/benutzerberechtigung.class.php');
|
||||
|
||||
|
||||
if (!$db = new basis_db())
|
||||
die('Es konnte keine Verbindung zum Server aufgebaut werden.');
|
||||
|
||||
// ******* INIT ********
|
||||
$user = get_uid();
|
||||
|
||||
//Zugriffsrechte pruefen
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($user);
|
||||
|
||||
if(!$rechte->isBerechtigt('basis/firma'))
|
||||
if(!$rechte->isBerechtigt('admin') && !$rechte->isBerechtigt('basis/firma'))
|
||||
die('Sie haben keine Berechtigung für diese Seite');
|
||||
|
||||
$htmlstr = '';
|
||||
$errorstr = '';
|
||||
$messagestr='';
|
||||
$reloadstr = '';
|
||||
$error = false;
|
||||
$firma_id = (isset($_REQUEST["firma_id"])?$_REQUEST['firma_id']:'');
|
||||
$name = (isset($_POST['name'])?$_POST['name']:'');
|
||||
$adresse = (isset($_POST['adresse'])?$_POST['adresse']:'');
|
||||
$email = (isset($_POST['email'])?$_POST['email']:'');
|
||||
$telefon = (isset($_POST['telefon'])?$_POST['telefon']:'');
|
||||
$fax = (isset($_POST['fax'])?$_POST['fax']:'');
|
||||
$anmerkung = (isset($_POST['anmerkung'])?$_POST['anmerkung']:'');
|
||||
$firmentyp_kurzbz = (isset($_POST['typ'])?$_POST['typ']:'');
|
||||
$schule = isset($_POST['schule']);
|
||||
|
||||
$adresstyp = (isset($_POST['adresstyp'])?$_POST['adresstyp']:'');
|
||||
$strasse = (isset($_POST['strasse'])?$_POST['strasse']:'');
|
||||
$plz = (isset($_POST['plz'])?$_POST['plz']:'');
|
||||
$ort = (isset($_POST['ort'])?$_POST['ort']:'');
|
||||
$gemeinde = (isset($_POST['gemeinde'])?$_POST['gemeinde']:'');
|
||||
$nation = (isset($_POST['nation'])?$_POST['nation']:'');
|
||||
$heimatadresse = (isset($_POST['heimatadresse'])?true:false);
|
||||
$zustelladresse = (isset($_POST['zustelladresse'])?true:false);
|
||||
$zustellung = (isset($_POST['zustellung'])?true:false);
|
||||
// Parameter einlesen
|
||||
$adresse_id = (isset($_REQUEST['adresse_id'])?$_REQUEST['adresse_id']:'');
|
||||
$standort_id = (isset($_REQUEST['standort_id'])?$_REQUEST['standort_id']:'');
|
||||
$oe_kurzbz = (isset($_REQUEST['oe_kurzbz'])?$_REQUEST['oe_kurzbz']:'');
|
||||
$firma_organisationseinheit_id = (isset($_REQUEST['firma_organisationseinheit_id'])?$_REQUEST['firma_organisationseinheit_id']:'');
|
||||
|
||||
$save = (isset($_REQUEST['save'])?$_REQUEST['save']:null);
|
||||
$work = (isset($_REQUEST['work'])?$_REQUEST['work']:(isset($_REQUEST['save'])?$_REQUEST['save']:null));
|
||||
$ajax = (isset($_REQUEST['ajax'])?$_REQUEST['ajax']:null);
|
||||
|
||||
// Defaultwerte
|
||||
$adresstyp_arr = array('h'=>'Hauptwohnsitz','n'=>'Nebenwohnsitz','f'=>'Firma',''=>'');
|
||||
$errorstr='';
|
||||
|
||||
//Loeschen einer Adresse
|
||||
if(isset($_GET['deleteadresse']))
|
||||
{
|
||||
if(!$rechte->isBerechtigt('basis/firma',null, 'suid'))
|
||||
if( !$rechte->isBerechtigt('admin',null,'suid') && !$rechte->isBerechtigt('basis/firma',null, 'suid'))
|
||||
die('Sie haben keine Berechtigung fuer diese Aktion');
|
||||
|
||||
if(is_numeric($standort_id))
|
||||
{
|
||||
$standort_obj = new standort();
|
||||
if(!$standort_obj->delete($standort_id))
|
||||
{
|
||||
$errorstr=($errorstr?$errorstr.', ':'').'Fehler beim Loeschen Firma/Standort:'.$standort_obj->errormsg;
|
||||
}
|
||||
}
|
||||
if(is_numeric($adresse_id))
|
||||
{
|
||||
$adresse_obj = new adresse();
|
||||
if(!$adresse_obj->delete($adresse_id))
|
||||
{
|
||||
$errorstr = 'Fehler beim Loeschen der Adresse:'.$adresse_obj->errormsg;
|
||||
$errorstr=($errorstr?$errorstr.', ':'').'Fehler beim Loeschen der Firma/Adresse:'.$adresse_obj->errormsg;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<script language="JavaScript1.2" type="text/javascript">
|
||||
parent.frames[0].location.reload();
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
//Speichern einer Adresse
|
||||
if(isset($_POST['saveadresse']))
|
||||
//Loeschen einer Adresse
|
||||
if(isset($_GET['deleteorganisationseinheit']))
|
||||
{
|
||||
if(!$rechte->isBerechtigt('basis/firma',null,'suid'))
|
||||
if( !$rechte->isBerechtigt('admin',null,'suid') && !$rechte->isBerechtigt('basis/firma',null, 'suid'))
|
||||
die('Sie haben keine Berechtigung fuer diese Aktion');
|
||||
|
||||
$adresse_obj = new adresse();
|
||||
|
||||
if(is_numeric($adresse_id))
|
||||
if(!empty($firma_organisationseinheit_id))
|
||||
{
|
||||
if($adresse_obj->load($adresse_id))
|
||||
$firma = new firma();
|
||||
if(!$firma->deleteorganisationseinheit($firma_organisationseinheit_id))
|
||||
{
|
||||
$adresse_obj->new = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$errorstr = 'Adresse wurde nicht gefunden:'.$adresse_id;
|
||||
$error=true;
|
||||
$errorstr=($errorstr?$errorstr.', ':'').'Fehler beim Loeschen Firma/Organisation:'.$firma->errormsg;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$adresse_obj->new = true;
|
||||
$adresse_obj->insertamum = date('Y-m-d H:i:s');
|
||||
$adresse_obj->insertvon = $user;
|
||||
}
|
||||
|
||||
if(!$error)
|
||||
{
|
||||
$adresse_obj->person_id=null;
|
||||
$adresse_obj->strasse = $strasse;
|
||||
$adresse_obj->plz = $plz;
|
||||
$adresse_obj->ort = $ort;
|
||||
$adresse_obj->gemeinde = $gemeinde;
|
||||
$adresse_obj->nation = $nation;
|
||||
$adresse_obj->typ = $adresstyp;
|
||||
$adresse_obj->heimatadresse = $heimatadresse;
|
||||
$adresse_obj->zustelladresse = $zustelladresse;
|
||||
$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;
|
||||
}
|
||||
else
|
||||
{
|
||||
$messagestr = 'Adressdaten wurden erfolgreich gespeichert';
|
||||
}
|
||||
}
|
||||
$errorstr=($errorstr?$errorstr.', ':'').'Fehler beim Loeschen Firma/Organisation : ID fehlt';
|
||||
}
|
||||
|
||||
// Speichern der Firmendaten
|
||||
if(isset($_POST['save']))
|
||||
{
|
||||
if(!$rechte->isBerechtigt('basis/firma',null, 'suid'))
|
||||
die('Sie haben keine Berechtigung fuer diese Aktion');
|
||||
|
||||
$firma = new firma();
|
||||
|
||||
if($firma_id!='')
|
||||
{
|
||||
if(!$firma->load($firma_id))
|
||||
{
|
||||
$error = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$firma->new = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$firma->insertamum = date('Y-m-d H:i:s');
|
||||
$firma->insertvon = $user;
|
||||
$firma->new = true;
|
||||
}
|
||||
|
||||
if(!$error)
|
||||
{
|
||||
$firma->name = $name;
|
||||
$firma->adresse = $adresse;
|
||||
$firma->email = $email;
|
||||
$firma->telefon = $telefon;
|
||||
$firma->fax = $fax;
|
||||
$firma->anmerkung = $anmerkung;
|
||||
$firma->firmentyp_kurzbz = $firmentyp_kurzbz;
|
||||
$firma->updateamum = date('Y-m-d H:i:s');
|
||||
$firma->updatevon = $user;
|
||||
$firma->schule = $schule;
|
||||
|
||||
if($firma->save())
|
||||
{
|
||||
$reloadstr .= "<script type='text/javascript'>\n";
|
||||
$reloadstr .= " parent.uebersicht_firma.location.href='firma_uebersicht.php?filter='+parent.uebersicht_firma.filter+'&firmentypfilter='+parent.uebersicht_firma.firmentypfilter;";
|
||||
$reloadstr .= " window.top.opener.StudentProjektarbeitFirmaRefresh();";
|
||||
$reloadstr .= "</script>\n";
|
||||
$messagestr='Firmendaten wurden erfolgreich gespeichert';
|
||||
}
|
||||
else
|
||||
{
|
||||
$errorstr = 'Datensatz konnte nicht gespeichert werden: '.$firma->errormsg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
@@ -204,191 +109,473 @@
|
||||
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
|
||||
<script src="../../include/js/mailcheck.js"></script>
|
||||
<script src="../../include/js/datecheck.js"></script>
|
||||
<script type="text/javascript">
|
||||
<script src="../../include/js/jquery.js" type="text/javascript"></script>
|
||||
<script src="../../include/js/jquery-ui.js" type="text/javascript"></script>
|
||||
<script src="../../include/js/jquery.tools.min.js" type="text/javascript"></script>
|
||||
|
||||
function confdel()
|
||||
{
|
||||
if(confirm("Diesen Datensatz wirklich loeschen?"))
|
||||
return true;
|
||||
return false;
|
||||
|
||||
<script src="../../include/js/jquery.autocomplete.js" type="text/javascript"></script>
|
||||
<script src="../../include/js/jquery.autocomplete.min.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript" language="JavaScript1.2">
|
||||
function confdel()
|
||||
{
|
||||
if(confirm("Diesen Datensatz wirklich loeschen?"))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
function workFirmaDetail(wohin)
|
||||
{
|
||||
|
||||
$("div##"+wohin).show("slow"); // div# langsam oeffnen
|
||||
$("div#"+wohin).html('<img src="../../skin/images/spinner.gif" alt="warten" title="warten" >');
|
||||
var formdata = $('form#addFirma').serialize();
|
||||
//alert(formdata);
|
||||
$.ajax
|
||||
(
|
||||
{
|
||||
type: "POST", timeout: 3500,dataType: 'html',url: 'firma_details.php',data: formdata+'&ajax=1',
|
||||
error: function()
|
||||
{
|
||||
$("div#"+wohin).html("error ");
|
||||
return;
|
||||
},
|
||||
success: function(phpData)
|
||||
{
|
||||
$("div#"+wohin).html(phpData);
|
||||
}
|
||||
}
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
$(function()
|
||||
{
|
||||
$("ul.css-tabs").tabs("div.css-panes > div", {effect: 'ajax'}).history();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
<!--
|
||||
|
||||
/* root element for tabs */
|
||||
ul.css-tabs {
|
||||
margin:0 !important;
|
||||
padding:0;
|
||||
height:30px;
|
||||
border-bottom:1px solid #666;
|
||||
}
|
||||
|
||||
</script>
|
||||
/* single tab */
|
||||
ul.css-tabs li {
|
||||
float:left;
|
||||
padding:0;
|
||||
margin:0;
|
||||
list-style-type:none;
|
||||
}
|
||||
|
||||
/* link inside the tab. uses a background image */
|
||||
ul.css-tabs a {
|
||||
float:left;
|
||||
font-size:13px;
|
||||
display:block;
|
||||
padding:5px 30px;
|
||||
text-decoration:none;
|
||||
border:1px solid #666;
|
||||
border-bottom:0px;
|
||||
height:18px;
|
||||
background-color:#efefef;
|
||||
color:#777;
|
||||
margin-right:2px;
|
||||
-moz-border-radius-topleft: 4px;
|
||||
-moz-border-radius-topright:4px;
|
||||
position:relative;
|
||||
top:1px;
|
||||
}
|
||||
|
||||
ul.css-tabs a:hover {
|
||||
background-color:#F7F7F7;
|
||||
color:#333;
|
||||
}
|
||||
|
||||
/* selected tab */
|
||||
ul.css-tabs a.current {
|
||||
background-color:#ddd;
|
||||
border-bottom:2px solid #ddd;
|
||||
color:#000;
|
||||
cursor:default;
|
||||
}
|
||||
/* tab pane */
|
||||
div.css-panes div {
|
||||
display:none;
|
||||
border:1px solid #666;
|
||||
border-width:0 1px 1px 1px;
|
||||
min-height:150px;
|
||||
padding:15px 20px;
|
||||
background-color:#ddd;
|
||||
}
|
||||
-->
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body style="background-color:#eeeeee;">
|
||||
|
||||
<?php
|
||||
//Formular fuer die Firmendaten
|
||||
if($errorstr!='')
|
||||
echo "<div class='inserterror'>".$errorstr."</div>\n";
|
||||
elseif($messagestr!='')
|
||||
echo "<div class='insertok'>".$messagestr."</div>\n";
|
||||
|
||||
if (empty($firma_id))
|
||||
exit('');
|
||||
|
||||
##echo "$work <br>";
|
||||
|
||||
switch ($work)
|
||||
{
|
||||
case 'standortliste':
|
||||
echo getStandortliste($firma_id,$adresstyp_arr,$user);
|
||||
break;
|
||||
|
||||
case 'organisationliste':
|
||||
echo getOrganisationsliste($firma_id,$adresstyp_arr,$user);
|
||||
break;
|
||||
|
||||
case 'saveFirma':
|
||||
$status=saveFirma($user,$rechte); // Postdaten werden in der Funktion verarbeitet
|
||||
if (is_numeric($status))
|
||||
$firma_id=$status;
|
||||
if (!$ajax)
|
||||
echo getFirmadetail($firma_id,$adresstyp_arr,$user);
|
||||
else if (is_numeric($status))
|
||||
echo "Daten erfolgreich gespeichert" ;
|
||||
if (!is_numeric($status))
|
||||
echo $status;
|
||||
break;
|
||||
default:
|
||||
echo getFirmadetail($firma_id,$adresstyp_arr,$user);
|
||||
break;
|
||||
}
|
||||
echo ($errorstr?'<br>'.$errorstr:'');
|
||||
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
/*
|
||||
Firmenliste - lt. Suchekriterien
|
||||
*/
|
||||
function getFirmadetail($firma_id,$adresstyp_arr,$user)
|
||||
{
|
||||
if (!$db = new basis_db())
|
||||
die('Es konnte keine Verbindung zum Server aufgebaut werden.');
|
||||
// Init
|
||||
$htmlstr='';
|
||||
// Datenlesen zur Firma
|
||||
$firma = new firma();
|
||||
if($firma_id!='')
|
||||
if($firma_id!='' && is_numeric($firma_id) )
|
||||
{
|
||||
if (!$firma->load($firma_id))
|
||||
{
|
||||
die('<br>Firma mit der ID <b>'.$firma_id.'</b> existiert nicht');
|
||||
}
|
||||
return '<br>Firma mit der ID <b>'.$firma_id.'</b> existiert nicht';
|
||||
}
|
||||
else
|
||||
{
|
||||
//Bei neuen Firmen wird standardmaessig Partnerfirma ausgewaehlt
|
||||
$firma->firmentyp_kurzbz='Partnerfirma';
|
||||
$firma->aktiv=true;
|
||||
$firma->gesperrt=false;
|
||||
$firma->schule=false;
|
||||
}
|
||||
|
||||
echo "<form action='firma_details.php' method='POST' name='firma'>\n";
|
||||
echo "<input type='hidden' name='firma_id' value='".$firma->firma_id."'>\n";
|
||||
|
||||
echo "<table class='detail' style='padding-top:10px;'>\n";
|
||||
echo "<tr></tr>\n";
|
||||
|
||||
echo " <tr>\n";
|
||||
echo " <td>Name: </td>";
|
||||
echo " <td colspan='3'><input type='text' name='name' value='".$firma->name."' size='80' maxlength='128' /></td>\n";
|
||||
echo " <td>Typ: </td>";
|
||||
echo " <td><select name='typ'>\n";
|
||||
$htmlstr.="<form id='addFirma' name='addFirma' action='firma_details.php' method='POST'>\n";
|
||||
$htmlstr.="<input type='hidden' name='work' value='saveFirma'>\n";
|
||||
$htmlstr.="<input type='hidden' name='firma_id' value='".$firma->firma_id."'>\n";
|
||||
// Firma Detailanzeige
|
||||
$htmlstr.="<table class='detail' style='padding-top:10px;'>\n";
|
||||
$htmlstr.="<tr><td><table><tr>\n";
|
||||
$htmlstr.="<td>Typ: </td>";
|
||||
$htmlstr.="<td><select name='typ'>\n";
|
||||
|
||||
$qry = "SELECT firmentyp_kurzbz FROM public.tbl_firmentyp ORDER BY firmentyp_kurzbz";
|
||||
|
||||
if($result = $db->db_query($qry))
|
||||
{
|
||||
while($row = $db->db_fetch_object($result))
|
||||
$qry = "SELECT firmentyp_kurzbz FROM public.tbl_firmentyp ORDER BY firmentyp_kurzbz";
|
||||
if($result = $db->db_query($qry))
|
||||
{
|
||||
if ($firma->firmentyp_kurzbz == $row->firmentyp_kurzbz)
|
||||
$sel = " selected";
|
||||
else
|
||||
$sel = "";
|
||||
echo " <option value='".$row->firmentyp_kurzbz."' ".$sel.">".$row->firmentyp_kurzbz."</option>";
|
||||
while($row = $db->db_fetch_object($result))
|
||||
{
|
||||
$htmlstr.="<option value='".$row->firmentyp_kurzbz."' ".($firma->firmentyp_kurzbz == $row->firmentyp_kurzbz?' selected ':'').">".$row->firmentyp_kurzbz."</option>";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo " </select></td>";
|
||||
|
||||
echo " <td>Schule: </td>";
|
||||
echo " <td><input type='checkbox' name='schule' ".($firma->schule?'checked':'')."></td>\n";
|
||||
echo "</tr><tr>\n";
|
||||
|
||||
echo " <td>EMail: </td>";
|
||||
echo " <td><input type='text' name='email' value='".$firma->email."' size='40' maxlength='128' /></td>\n";
|
||||
echo " <td>Telefon: </td>";
|
||||
echo " <td><input type='text' name='telefon' value='".$firma->telefon."' maxlength='32' /></td>\n";
|
||||
echo " <td>Fax: </td>";
|
||||
echo " <td><input type='text' name='fax' value='".$firma->fax."' maxlength='32' /></td>\n";
|
||||
echo " <td>Adresse (alt): </td>";
|
||||
echo " <td><input type='text' name='adresse' value='".$firma->adresse."' maxlength='256'></td>\n";
|
||||
echo "</tr><tr valign='top'>";
|
||||
echo " <td>Anmerkung: </td>";
|
||||
echo " <td colspan='5'><textarea style='width:100%' name='anmerkung'/>".$firma->anmerkung."</textarea></td>\n";
|
||||
echo " <td></td><td valign='bottom'><input type='submit' name='save' value='speichern'></td>\n";
|
||||
echo " </tr></table>\n";
|
||||
echo "</form>\n";
|
||||
|
||||
//Nationen laden
|
||||
$nation_arr = array();
|
||||
$nation = new nation();
|
||||
$nation->getAll();
|
||||
|
||||
foreach($nation->nation as $row)
|
||||
$nation_arr[$row->code]=$row->kurztext;
|
||||
|
||||
$adresstyp_arr = array('h'=>'Hauptwohnsitz','n'=>'Nebenwohnsitz','f'=>'Firma',''=>'');
|
||||
$htmlstr.="</select></td>";
|
||||
$htmlstr.="<td> </td>";
|
||||
$htmlstr.="<td>Name: </td>";
|
||||
$htmlstr.="<td><input type='text' name='name' value='".$firma->name."' size='80' maxlength='128' /></td>\n";
|
||||
$htmlstr.="<td> </td>";
|
||||
$htmlstr.="</tr></table></td>";
|
||||
$htmlstr.="<td rowspan='2'><table><tr>\n";
|
||||
$htmlstr.="<td valign='top'>Anmerkung: </td>";
|
||||
$htmlstr.="<td><textarea cols='40' style='width:100%' name='anmerkung'/>".$firma->anmerkung."</textarea></td>\n";
|
||||
// Unterscheiden der Wartung - Neuanlage = Submit, Aendern = Ajax
|
||||
if($firma_id!='' && is_numeric($firma_id) )
|
||||
$htmlstr.="<td> </td><td valign='bottom'><input type='Button' onclick=\"workFirmaDetail('addFirmaInfo');\" name='save' value='speichern'></td>\n";
|
||||
else
|
||||
$htmlstr.="<td> </td><td valign='bottom'><input type='submit' name='save' value='anlegen'></td>\n";
|
||||
|
||||
// Formular fuer die Adressdaten
|
||||
//echo "<h3>Adressen:</h3>";
|
||||
echo "<form accept-charset='UTF-8' action='".$_SERVER['PHP_SELF']."?firma_id=$firma_id' method='POST' />";
|
||||
echo "<table class='liste'><tr><th>STRASSE</th><th>PLZ</th><th>ORT</th><th>GEMEINDE</th><th>NATION</th><th>TYP</th><th><font size='0'>Heimatadr.</font></th><th><font size='0'>Zustelladr.</font></th></tr>";
|
||||
$adresse_obj = new adresse();
|
||||
$adresse_obj->load_firma($firma_id);
|
||||
$htmlstr.="</tr></table></td>";
|
||||
$htmlstr.="</tr>\n";
|
||||
$htmlstr.="<tr><td><table><tr>\n";
|
||||
$htmlstr.="<td>Steuernummer: </td>";
|
||||
$htmlstr.="<td><input size='32' maxlength='32' type='text' name='steuernummer' value=".$firma->steuernummer."></td>\n";
|
||||
$htmlstr.="<td> </td>";
|
||||
$htmlstr.="<td>Finanzamt: </td>";
|
||||
// Finanzamt anzeige und suche
|
||||
$firma_finanzamt = new firma();
|
||||
$firmentyp_finanzamt='Finanzamt';
|
||||
$firma_finanzamt->searchFirma('',$firmentyp_finanzamt);
|
||||
#var_dump($firma_finanzamt);
|
||||
$htmlstr.="<td><select name='finanzamt'>";
|
||||
$htmlstr.="<option value=''> </option>";
|
||||
foreach ($firma_finanzamt->result as $row_finazamt)
|
||||
$htmlstr.=" <option value='".$row_finazamt->standort_id ."'>".$row_finazamt->bezeichnung." </option>";
|
||||
$htmlstr.="</select></td>\n";
|
||||
|
||||
//Anzeigen aller Adresssen
|
||||
foreach ($adresse_obj->result as $row)
|
||||
$htmlstr.="<td>Aktiv: </td>";
|
||||
$htmlstr.="<td><input ".($firma->aktiv?' style="background-color: #E3FDEE;" ':' style="background-color: #FFF4F4;" ')." type='checkbox' name='aktiv' ".($firma->aktiv?'checked':'')."></td>\n";
|
||||
$htmlstr.="<td> </td>\n";
|
||||
|
||||
$htmlstr.="<td>Gesperrt: </td>";
|
||||
$htmlstr.="<td><input ".($firma->gesperrt?' style="background-color: #FFF4F4;" ':' style="background-color: #E3FDEE;" ')." type='checkbox' name='gesperrt' ".($firma->gesperrt?'checked':'')."></td>\n";
|
||||
$htmlstr.="<td> </td>\n";
|
||||
|
||||
$htmlstr.="<td>Schule:</td>";
|
||||
$htmlstr.="<td><input ".($firma->schule?' style="background-color: #E3FDEE;" ':' style="background-color: #FFF4F4;" ')." type='checkbox' name='schule' ".($firma->schule?'checked':'')."> </td>";
|
||||
$htmlstr.="<td> </td>";
|
||||
|
||||
$htmlstr.="</tr></table></td>";
|
||||
$htmlstr.="</tr>\n";
|
||||
$htmlstr.=" </table>\n";
|
||||
$htmlstr.="</form>\n";
|
||||
|
||||
$htmlstr.='<div id="addFirmaInfo"></div>';
|
||||
|
||||
$htmlstr.='
|
||||
<!-- Tabs -->
|
||||
<ul class="css-tabs">
|
||||
<li><a href="firma_details.php?work=standortliste&firma_id='.$firma_id.'">Standorte</a></li>
|
||||
<li><a href="firma_details.php?work=organisationliste&firma_id='.$firma_id.'">Organisationseinheit</a></li>
|
||||
</ul>
|
||||
<div class="css-panes">
|
||||
<div style="display:block"></div>
|
||||
</div>
|
||||
<div id="detailstandort"> </div>
|
||||
';
|
||||
return $htmlstr;
|
||||
}
|
||||
// ----------------------------------------------------------------------------------------------------------------------------------
|
||||
/*
|
||||
FirmenDatenspeichern POST ( Ajax )
|
||||
Param $user Objekt vom Aktivenbenutzer
|
||||
Param $recht Objekt der Rechte des Aktivenbenutzer
|
||||
Return firma_id oder Fehlertext
|
||||
*/
|
||||
function saveFirma($user,$rechte)
|
||||
{
|
||||
// Speichern der Firmendaten
|
||||
if(!$rechte->isBerechtigt('basis/firma',null, 'suid'))
|
||||
return 'Sie haben keine Berechtigung fuer diese Aktion';
|
||||
// Verarbeiten
|
||||
$firma_id = (isset($_POST['firma_id'])?$_POST['firma_id']:'');
|
||||
$firma = new firma();
|
||||
if($firma_id!='')
|
||||
{
|
||||
echo '<tr class="liste1">';
|
||||
echo "<td>$row->strasse</td>";
|
||||
echo "<td>$row->plz</td>";
|
||||
echo "<td>$row->ort</td>";
|
||||
echo "<td>$row->gemeinde</td>";
|
||||
echo "<td>".(isset($nation_arr[$row->nation])?$nation_arr[$row->nation]:'')."</td>";
|
||||
echo "<td>".$adresstyp_arr[$row->typ]."</td>";
|
||||
echo "<td>".($row->heimatadresse?'Ja':'Nein')."</td>";
|
||||
echo "<td>".($row->zustelladresse?'Ja':'Nein')."</td>";
|
||||
echo "<td><a href='".$_SERVER['PHP_SELF']."?editadresse=true&adresse_id=$row->adresse_id&firma_id=$firma_id'><img src='../../skin/images/application_form_edit.png' alt='bearbeiten' title='bearbeiten' /></a></td>";
|
||||
echo "<td><a href='".$_SERVER['PHP_SELF']."?deleteadresse=true&adresse_id=$row->adresse_id&firma_id=$firma_id' onclick='return confdel()'><img src='../../skin/images/application_form_delete.png' alt='loeschen' title='loeschen'/></a></td>";
|
||||
if(!$firma->load($firma_id))
|
||||
return 'Firma '.$firma_id.' wurde nicht gefunden';
|
||||
else
|
||||
$firma->new = false;
|
||||
}
|
||||
|
||||
$savebuttonvalue='Neu';
|
||||
//wenn die Adressen editiert werden dann die Adressdaten laden
|
||||
if(isset($_GET['editadresse']))
|
||||
else
|
||||
{
|
||||
$adresse_obj = new adresse();
|
||||
if($adresse_obj->load($adresse_id))
|
||||
{
|
||||
$strasse = $adresse_obj->strasse;
|
||||
$plz = $adresse_obj->plz;
|
||||
$ort = $adresse_obj->ort;
|
||||
$gemeinde = $adresse_obj->gemeinde;
|
||||
$nation = $adresse_obj->nation;
|
||||
$typ = $adresse_obj->typ;
|
||||
$heimatadresse = $adresse_obj->heimatadresse;
|
||||
$zustelladresse = $adresse_obj->zustelladresse;
|
||||
$firma_id = $adresse_obj->firma_id;
|
||||
$savebuttonvalue='Speichern';
|
||||
}
|
||||
$firma->insertamum = date('Y-m-d H:i:s');
|
||||
$firma->insertvon = $user;
|
||||
$firma->new = true;
|
||||
}
|
||||
$firma->name = (isset($_POST['name'])?$_POST['name']:'');
|
||||
$firma->anmerkung = (isset($_REQUEST['anmerkung'])?$_REQUEST['anmerkung']:'');
|
||||
$firma->firmentyp_kurzbz = (isset($_POST['typ'])?$_POST['typ']:'');
|
||||
$firma->updateamum = date('Y-m-d H:i:s');
|
||||
$firma->updatevon = $user;
|
||||
$firma->schule = isset($_POST['schule']);
|
||||
// Neu in Rel. 2.0
|
||||
$firma->steuernummer = (isset($_POST['steuernummer'])?$_POST['steuernummer']:'');
|
||||
$firma->gesperrt = (isset($_POST['gesperrt'])?true:false);
|
||||
$firma->aktiv = (isset($_POST['aktiv'])?true:false);
|
||||
$firma->finanzamt = (isset($_POST['finanzamt'])?$_POST['finanzamt']:'');
|
||||
if($firma->save())
|
||||
{
|
||||
if ($firma->new)
|
||||
$firma_id=$firma->firma_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
//bei einer neuen Adresse die Felder leeren
|
||||
$strasse='';
|
||||
$plz='';
|
||||
$ort='';
|
||||
$gemeinde='';
|
||||
$nation = 'A';
|
||||
$typ='';
|
||||
$heimatadresse='';
|
||||
$zustelladresse='';
|
||||
$adresse_id='';
|
||||
return 'Datensatz konnte nicht gespeichert werden: '.$firma->errormsg;
|
||||
}
|
||||
## var_dump($firma);
|
||||
return $firma_id;
|
||||
}
|
||||
// ----------------------------------------------------------------------------------------------------------------------------------
|
||||
/*
|
||||
Standortliste
|
||||
*/
|
||||
function getStandortliste($firma_id,$adresstyp_arr,$user)
|
||||
{
|
||||
// Init
|
||||
$htmlstr='';
|
||||
|
||||
// Plausib
|
||||
if (empty($firma_id) || !is_numeric($firma_id) )
|
||||
return 'Firma fehlt.';
|
||||
|
||||
// Datenlesen
|
||||
$standort_obj = new standort();
|
||||
$standort_obj->result=array();
|
||||
if (!$standort_obj->load_firma($firma_id))
|
||||
return $standort_obj->errormsg;
|
||||
|
||||
// Es gibt noch keinen Standort zur Firma - Neuanlage
|
||||
if ($firma_id && !$standort_obj->result)
|
||||
{
|
||||
$standort_obj->new=true;
|
||||
$standort_obj->standort_id=null;
|
||||
$standort_obj->adresse_id=null;
|
||||
$standort_obj->kurzbz='';
|
||||
$standort_obj->bezeichnung='';
|
||||
$standort_obj->updatevon=$user;
|
||||
$standort_obj->insertvon=$user;
|
||||
$standort_obj->ext_id=null;
|
||||
$standort_obj->firma_id=$firma_id;
|
||||
if (!$standort_obj->save())
|
||||
return 'Fehler Standort '.$standort_obj->errormsg;
|
||||
$standort_obj = new standort();
|
||||
$standort_obj->load_firma($firma_id);
|
||||
}
|
||||
|
||||
echo "<input type='hidden' name='adresse_id' value='".$adresse_id."' />";
|
||||
echo '<tr class="liste1">';
|
||||
echo "<td><input type='text' name='strasse' value='".$strasse."' /></td>";
|
||||
echo "<td><input type='text' name='plz' size='4' value='".$plz."' /></td>";
|
||||
echo "<td><input type='text' name='ort' value='".$ort."' /></td>";
|
||||
echo "<td><input type='text' name='gemeinde' value='".$gemeinde."' /></td>";
|
||||
echo "<td><SELECT name='nation'>";
|
||||
foreach ($nation_arr as $code=>$kurzbz)
|
||||
#var_dump($standort_obj);
|
||||
$htmlstr.= '<table class="liste">
|
||||
<tr>
|
||||
<th>Kurzbez</th>
|
||||
<th>Nation</th>
|
||||
<th>Gemeinde</th>
|
||||
<th>Plz</th>
|
||||
<th>Ort</th>
|
||||
<th>Strasse</th>
|
||||
<th>TYP</th>
|
||||
<th><font size="0">Heimatadr.</font></th>
|
||||
<th><font size="0">Zustelladr.</font></th>
|
||||
<th>Ext.Id</th>
|
||||
<td valign="top"><a target="detail_workfirma" href="firma_detailwork.php?showmenue=1&firma_id='.$firma_id.'"><input type="Button" value="Neuanlage" name="work"></a></td>
|
||||
</tr>';
|
||||
#var_dump($standort_obj);
|
||||
$i=0;
|
||||
foreach ($standort_obj->result as $row)
|
||||
{
|
||||
if($code==$nation)
|
||||
$selected='selected';
|
||||
else
|
||||
$selected='';
|
||||
|
||||
if ($firma_id && $row->standort_id && !$row->adresse_id)
|
||||
{
|
||||
$adresse_obj = new adresse();
|
||||
$adresse_obj->new = true;
|
||||
$adresse_obj->insertamum = date('Y-m-d H:i:s');
|
||||
$adresse_obj->insertvon = $user;
|
||||
$adresse_obj->person_id=null;
|
||||
$adresse_obj->strasse = '';
|
||||
$adresse_obj->plz = '';
|
||||
$adresse_obj->ort = '';
|
||||
$adresse_obj->gemeinde = '';
|
||||
$adresse_obj->nation = '';
|
||||
$adresse_obj->typ = '';
|
||||
$adresse_obj->heimatadresse = '';
|
||||
$adresse_obj->zustelladresse = '';
|
||||
$adresse_obj->firma_id = null;
|
||||
$adresse_obj->updateamum = date('Y-m-d H:i:s');
|
||||
$adresse_obj->updatvon = $user;
|
||||
if(!$adresse_obj->save())
|
||||
return 'Fehler Adresse '.$adresse_obj->errormsg;
|
||||
|
||||
$standort_obj = new standort($row->standort_id);
|
||||
$standort_obj->updatevon=$user;
|
||||
$standort_obj->adresse_id=$adresse_obj->adresse_id;
|
||||
if (!$standort_obj->save())
|
||||
return 'Fehler Standort - Adresse '.$standort_obj->errormsg;
|
||||
$row->adresse_id=$adresse_obj->adresse_id;
|
||||
}
|
||||
|
||||
echo "<OPTION value='$code' $selected>$kurzbz</OPTION>";
|
||||
$htmlstr .= "<tr id='standort".$i."' class='liste". ($i%2) ."'>\n";
|
||||
$i++;
|
||||
//getDetailStandort(wohin,prameter)
|
||||
$adresse_id=$row->adresse_id;
|
||||
$adresse_obj = new adresse();
|
||||
if ($adresse_obj->load($adresse_id))
|
||||
{
|
||||
$htmlstr.= '<td><a target="detail_workfirma" href="firma_detailwork.php?showmenue=1&firma_id='.$firma_id.'&standort_id='.$row->standort_id.'&adresse_id='.$adresse_obj->adresse_id.'">'.$row->kurzbz.'</a></td>';
|
||||
$htmlstr.= "<td title='Nation ".$adresse_obj->nation."'>".(isset($nation_arr[$adresse_obj->nation])?$nation_arr[$adresse_obj->nation]:$adresse_obj->nation)."</td>";
|
||||
$htmlstr.= '<td>'.$adresse_obj->gemeinde.'</td>';
|
||||
$htmlstr.= '<td>'.$adresse_obj->plz.'</td>';
|
||||
$htmlstr.= '<td>'.$adresse_obj->ort.'</td>';
|
||||
$htmlstr.= '<td>'.$adresse_obj->strasse.'</td>';
|
||||
$htmlstr.= '<td>'.$adresstyp_arr[$adresse_obj->typ].'</td>';
|
||||
$htmlstr.= '<td>'.($adresse_obj->heimatadresse?'Ja':'Nein').'</td>';
|
||||
$htmlstr.= '<td>'.($adresse_obj->zustelladresse?'Ja':'Nein').'</td>';
|
||||
$htmlstr.= '<td>'.$row->ext_id.'</td>';
|
||||
$htmlstr.= "<td><a href='".$_SERVER['PHP_SELF']."?deleteadresse=true&standort_id=$row->standort_id&adresse_id=$adresse_obj->adresse_id&firma_id=$firma_id' onclick='return confdel()'>löschen <img src='../../skin/images/application_form_delete.png' alt='loeschen' title='loeschen'/></a></td>";
|
||||
}
|
||||
else
|
||||
$htmlstr.= '<td><a target="detail_workfirma" href="firma_detailwork.php?showmenue=1&firma_id='.$firma_id.'&standort_id='.$row->standort_id.'&adresse_id='.$row->adresse_id.'">'.$row->kurzbz.'</a></td>';
|
||||
$htmlstr.= '<td colspan="10">'.$adresse_obj->errormsg.'</td>';
|
||||
$htmlstr.= '</tr>';
|
||||
}
|
||||
|
||||
echo "</SELECT></td>";
|
||||
echo "<td><SELECT name='adresstyp'>";
|
||||
foreach($adresstyp_arr as $code=>$kurzbz)
|
||||
$htmlstr.= '</table>';
|
||||
return $htmlstr;
|
||||
}
|
||||
// ----------------------------------------------------------------------------------------------------------------------------------
|
||||
/*
|
||||
Standortliste
|
||||
*/
|
||||
function getOrganisationsliste($firma_id,$adresstyp_arr,$user)
|
||||
{
|
||||
// Init
|
||||
$htmlstr='';
|
||||
// Plausib
|
||||
if (empty($firma_id) || !is_numeric($firma_id) )
|
||||
return 'Firma fehlt.';
|
||||
|
||||
// Datenlesen zur Firma
|
||||
$firma = new firma();
|
||||
if (!$firma->load_firmaorganisationseinheit($firma_id))
|
||||
return '<br>Firma ID <b>'.$firma_id.'</b> '.$firma->errormsg;;
|
||||
|
||||
## var_dump($firma);
|
||||
$htmlstr.= '<table class="liste">
|
||||
<tr>
|
||||
<th>Kurzbz</th>
|
||||
<th>TYP</th>
|
||||
<th>Bezeichnung</th>
|
||||
<th>Mailverteiler</th>
|
||||
<th>Aktiv</th>
|
||||
<td valign="top"><a target="detail_workfirma" href="firma_detailwork.php?work=eingabeOrganisationseinheit&firma_organisationseinheit_id=&oe_kurzbz=&firma_id='.$firma_id.'"><input type="Button" value="Neuanlage" name="work"></a></td>
|
||||
</tr>
|
||||
';
|
||||
$i=0;
|
||||
foreach ($firma->result as $row)
|
||||
{
|
||||
if($code==$typ)
|
||||
$selected='selected';
|
||||
else
|
||||
$selected='';
|
||||
$htmlstr .= "<tr id='standort".$i."' class='liste". ($i%2) ."'>\n";
|
||||
$i++;
|
||||
$htmlstr.= '<td><a target="detail_workfirma" href="firma_detailwork.php?work=eingabeOrganisationseinheit&firma_organisationseinheit_id='.$row->firma_organisationseinheit_id.'&oe_kurzbz='.$row->oe_kurzbz.'&firma_id='.$firma_id.'">'.$row->oe_kurzbz.'</a></td>';
|
||||
$htmlstr.= '<td>'.$row->organisationseinheittyp_kurzbz.'</td>';
|
||||
$htmlstr.= '<td>'.$row->bezeichnung.'</td>';
|
||||
|
||||
echo "<OPTION value='$code' $selected>$kurzbz</OPTION>";
|
||||
$htmlstr.= '<td>'.($row->mailverteiler?'Ja':'Nein').'</td>';
|
||||
$htmlstr.= '<td>'.($row->oe_aktiv?'Ja':'Nein').'</td>';
|
||||
|
||||
$htmlstr.= "<td><a href='".$_SERVER['PHP_SELF']."?deleteorganisationseinheit=true&firma_organisationseinheit_id=".$row->firma_organisationseinheit_id."&oe_kurzbz=".$row->oe_kurzbz."&firma_id=".$firma_id."' onclick='return confdel()'>löschen <img src='../../skin/images/application_form_delete.png' alt='loeschen' title='loeschen'/></a></td>";
|
||||
$htmlstr.= '</tr>';
|
||||
}
|
||||
echo "</SELECT></td>";
|
||||
echo "<td><input type='checkbox' name='heimatadresse' ".($heimatadresse?'checked':'')." /></td>";
|
||||
echo "<td><input type='checkbox' name='zustelladresse' ".($zustelladresse?'checked':'')." /></td>";
|
||||
echo "<td colspan='2'><input type='submit' name='saveadresse' value='$savebuttonvalue' /></td>";
|
||||
|
||||
echo "</table>";
|
||||
echo "</form>";
|
||||
|
||||
//eventuell die Felder im oeffnenden Fenster aktualisieren
|
||||
echo $reloadstr;
|
||||
$htmlstr.= '</table>';
|
||||
return $htmlstr;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -4,11 +4,17 @@
|
||||
<head>
|
||||
<title>VileSci</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
|
||||
|
||||
</head>
|
||||
|
||||
<frameset rows="70%,*">
|
||||
<frameset rows="40%,30%,*" border="0" frameborder="0" framespacing="1" >
|
||||
|
||||
<frame src="firma_uebersicht.php" name="uebersicht_firma" frameborder="0" />
|
||||
<frame src="firma_details.php" name="detail_firma" frameborder="0" />
|
||||
|
||||
<frame src="firma_detailwork.php" name="detail_workfirma" frameborder="0" />
|
||||
|
||||
<noframes>
|
||||
<body bgcolor="#FFFFFF">
|
||||
This application works only with a frames-enabled browser.<br />
|
||||
|
||||
@@ -33,55 +33,14 @@
|
||||
//Berechtigung pruefen
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($user);
|
||||
$berechtigung_kurzbz = 'basis/firma';
|
||||
if(!$rechte->isBerechtigt($berechtigung_kurzbz))
|
||||
die('Sie haben keine Berechtigung fuer diese Seite ');
|
||||
|
||||
if(!$rechte->isBerechtigt('basis/firma'))
|
||||
die('Sie haben keine Berechtigung fuer diese Seite');
|
||||
|
||||
// Parameter uebernehmen
|
||||
$suchen = (isset($_GET['suchen'])?$_GET['suchen']:null);
|
||||
$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>
|
||||
@@ -92,26 +51,19 @@
|
||||
<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; ?>';
|
||||
//var firmentypfilter='<?php echo $firmentypfilter; ?>';
|
||||
//var filter = '<?php echo $filter; ?>';
|
||||
-->
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="background_main">
|
||||
<h2>Firmen - Ü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>';
|
||||
echo '<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr>';
|
||||
//Suche
|
||||
echo '<form action="'.$_SERVER['PHP_SELF'].'" method="GET">';
|
||||
echo '<input type="text" name="filter" value="'.$filter.'">';
|
||||
echo 'Typ: <SELECT name="firmentypfilter">
|
||||
echo '<form onsubmit="parent.frames[1].location.href =\'firma_details.php\';parent.frames[2].location.href =\'firma_detailwork.php\';" action="'.$_SERVER['PHP_SELF'].'" method="GET"><td>';
|
||||
echo ' Suche: <input type="text" name="filter" value="'.$filter.'">';
|
||||
echo ' Typ: <SELECT name="firmentypfilter">
|
||||
<option value="">-- Alle --</option>';
|
||||
$firma = new firma();
|
||||
$firma->getFirmenTypen();
|
||||
@@ -124,13 +76,80 @@ var filter = '<?php echo $filter; ?>';
|
||||
echo "<option value='$row->firmentyp_kurzbz' $selected>$row->firmentyp_kurzbz</option>";
|
||||
}
|
||||
echo '</SELECT>';
|
||||
echo '<input type="submit" value="Suchen">';
|
||||
echo '</form>';
|
||||
echo ' <input type="submit" name="suchen" value="Suchen">';
|
||||
echo '</td></form>';
|
||||
|
||||
echo "<td align='right'><input type='button' onclick='parent.detail_firma.location=\"firma_details.php?neu=true\"' value='Neue Firma anlegen'/></td>";
|
||||
echo '</tr></table>';
|
||||
echo creatList($suchen,$filter,$firmentypfilter);
|
||||
|
||||
echo $htmlstr;
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<?php
|
||||
|
||||
function creatList($suchen,$filter,$firmentypfilter)
|
||||
{
|
||||
// Initialisieren HTML Listenausgabe
|
||||
$htmlstr = "";
|
||||
$firma_finanzamt = new firma();
|
||||
$firmentyp_finanzamt='Finanzamt';
|
||||
$firma_finanzamt->errormsg='';
|
||||
$firma_finanzamt->result=array();
|
||||
if (!is_null($suchen)) // Nur wenn Suchknopf gedrueck wurde
|
||||
$firma_finanzamt->searchFirma($filter,$firmentypfilter);
|
||||
|
||||
if($firma_finanzamt->errormsg)
|
||||
return 'Fehler beim Laden der Firma<br>';
|
||||
|
||||
if ($firma_finanzamt->result)
|
||||
{
|
||||
$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>";
|
||||
$htmlstr .= " <th class='table-sortable:default'>Name</th>";
|
||||
$htmlstr .= " <th class='table-sortable:default'>Anmerkung</th>";
|
||||
$htmlstr .= " <th class='table-sortable:default'>Kurzbz.</th>";
|
||||
$htmlstr .= " <th class='table-sortable:default'>Standort</th>";
|
||||
|
||||
$htmlstr .= " <th class='table-sortable:default'>Plz</th>";
|
||||
$htmlstr .= " <th class='table-sortable:default'>Ort</th>";
|
||||
$htmlstr .= " <th class='table-sortable:default'>Strasse</th>";
|
||||
|
||||
$htmlstr .= " <th class='table-sortable:default'>Typ</th>";
|
||||
$htmlstr .= " <th class='table-sortable:default'>Schule</th>";
|
||||
$htmlstr .= " <th class='table-sortable:default'>Gesperrt</th>";
|
||||
$htmlstr .= " <th class='table-sortable:default'>Aktiv</th>";
|
||||
$htmlstr .= " <th class='table-sortable:default'>Ext ID</th>";
|
||||
|
||||
$htmlstr .= " </tr></thead><tbody>\n";
|
||||
$i = 0;
|
||||
foreach ($firma_finanzamt->result as $row)
|
||||
{
|
||||
// Adresse
|
||||
$row->adresse_neu=$row->plz.' '.$row->ort;
|
||||
|
||||
$htmlstr .= " <tr class='liste". ($i%2) ."'>\n";
|
||||
$htmlstr .= " <td><a onclick=\"parent.frames[2].location.href ='firma_detailwork.php';\" href='firma_details.php?firma_id=".$row->firma_id."' target='detail_firma'>".$row->firma_id."</a></td>\n";
|
||||
$htmlstr .= " <td><a onclick=\"parent.frames[2].location.href ='firma_detailwork.php';\" href='firma_details.php?firma_id=".$row->firma_id."' target='detail_firma'>".$row->name."</a></td>\n";
|
||||
$htmlstr .= " <td title='".$row->anmerkung."'>".StringCut($row->anmerkung,27)."</td>\n";
|
||||
$htmlstr .= " <td>".$row->kurzbz."</td>\n";
|
||||
$htmlstr .= " <td>".StringCut($row->bezeichnung,27)."</td>\n";
|
||||
// Adresse
|
||||
$htmlstr .= " <td>$row->plz</td>\n";
|
||||
$htmlstr .= " <td>$row->ort</td>\n";
|
||||
$htmlstr .= " <td>$row->strasse</td>\n";
|
||||
$htmlstr .= " <td>$row->firmentyp_kurzbz</td>\n";
|
||||
$htmlstr .= " <td>".($row->gesperrt=='t'?'Ja':'Nein')."</td>\n";
|
||||
$htmlstr .= " <td>".($row->schule=='t'?'Ja':'Nein')."</td>\n";
|
||||
$htmlstr .= " <td>".($row->aktiv=='t'?'Ja':'Nein')."</td>\n";
|
||||
$htmlstr .= " <td>$row->ext_id</td>\n";
|
||||
$htmlstr .= " </tr>\n";
|
||||
$i++;
|
||||
}
|
||||
$htmlstr .= "</tbody></table>\n";
|
||||
}
|
||||
return $htmlstr;
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -62,8 +62,9 @@ if ((isset($_GET['person2']) || isset($_POST['person2']))&&(isset($_GET['person1
|
||||
$sql_query_upd1.="UPDATE public.tbl_akte SET person_id='$person1' WHERE person_id='$person2';";
|
||||
$sql_query_upd1.="UPDATE public.tbl_bankverbindung SET person_id='$person1' WHERE person_id='$person2';";
|
||||
$sql_query_upd1.="UPDATE public.tbl_kontakt SET person_id='$person1' WHERE person_id='$person2';";
|
||||
$sql_query_upd1.="UPDATE public.tbl_betriebsmittelperson SET person_id='$person1' WHERE person_id='$person2';";
|
||||
|
||||
$sql_query_upd1.="UPDATE wawi.tbl_betriebsmittelperson SET person_id='$person1' WHERE person_id='$person2';";
|
||||
|
||||
$sql_query_upd1.="DELETE FROM public.tbl_person WHERE person_id='$person2';";
|
||||
if($db->db_query($sql_query_upd1))
|
||||
{
|
||||
|
||||
@@ -121,7 +121,9 @@ if(isset($radio_1) && isset($radio_2) && $radio_1>=0 && $radio_2>=0)
|
||||
$sql_query_upd1.="UPDATE public.tbl_akte SET person_id='$radio_2' WHERE person_id='$radio_1';";
|
||||
$sql_query_upd1.="UPDATE public.tbl_bankverbindung SET person_id='$radio_2' WHERE person_id='$radio_1';";
|
||||
$sql_query_upd1.="UPDATE public.tbl_kontakt SET person_id='$radio_2' WHERE person_id='$radio_1';";
|
||||
$sql_query_upd1.="UPDATE public.tbl_betriebsmittelperson SET person_id='$radio_2' WHERE person_id='$radio_1';";
|
||||
|
||||
$sql_query_upd1.="UPDATE wawi.tbl_betriebsmittelperson SET person_id='$radio_2' WHERE person_id='$radio_1';";
|
||||
|
||||
$sql_query_upd1.="UPDATE public.tbl_preinteressent SET person_id='$radio_2' WHERE person_id='$radio_1';";
|
||||
$sql_query_upd1.="UPDATE public.tbl_personfunktionfirma SET person_id='$radio_2' WHERE person_id='$radio_1';";
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
$kosten = '';
|
||||
$ausstattung = '';
|
||||
$stockwerk = '';
|
||||
$standort_kurzbz = '';
|
||||
$standort_id = '';
|
||||
$telefonklappe = '';
|
||||
|
||||
$neu = "true";
|
||||
@@ -75,7 +75,7 @@
|
||||
$kosten = $_POST["kosten"];
|
||||
$ausstattung = $_POST["ausstattung"];
|
||||
$stockwerk = $_POST["stockwerk"];
|
||||
$standort_kurzbz = $_POST["standort_kurzbz"];
|
||||
$standort_id = $_POST["standort_id"];
|
||||
$telefonklappe = $_POST["telefonklappe"];
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
$sg_update->ausstattung = $ausstattung;
|
||||
$sg_update->stockwerk = $stockwerk;
|
||||
$sg_update->telefonklappe = $telefonklappe;
|
||||
$sg_update->standort_kurzbz = $standort_kurzbz;
|
||||
$sg_update->standort_id = $standort_id;
|
||||
|
||||
|
||||
if ($_POST["neu"] == "true")
|
||||
@@ -128,7 +128,7 @@
|
||||
$kosten = $sg->kosten;
|
||||
$ausstattung = $sg->ausstattung;
|
||||
$stockwerk = $sg->stockwerk;
|
||||
$standort_kurzbz = $sg->standort_kurzbz;
|
||||
$standort_id = $sg->standort_id;
|
||||
$telefonklappe = $sg->telefonklappe;
|
||||
$neu = "false";
|
||||
}
|
||||
@@ -166,19 +166,19 @@
|
||||
$htmlstr .= " <td><input class='detail' type='text' name='stockwerk' size='8' maxlength='5' value='".$stockwerk."' onchange='submitable()'></td>\n";
|
||||
$htmlstr .= " <td>Standort</td>\n";
|
||||
$htmlstr .= " <td>";
|
||||
$htmlstr .= " <SELECT name='standort_kurzbz'>";
|
||||
$htmlstr .= " <SELECT name='standort_id'>";
|
||||
$htmlstr.=" <OPTION value=''>-- keine Auswahl --</OPTION>\n";
|
||||
$qry = 'SELECT * FROM public.tbl_standort ORDER BY standort_kurzbz';
|
||||
$qry = 'SELECT * FROM public.tbl_standort ORDER BY standort_id';
|
||||
if($result = $db->db_query($qry))
|
||||
{
|
||||
while($row = $db->db_fetch_object($result))
|
||||
{
|
||||
if($row->standort_kurzbz==$standort_kurzbz)
|
||||
if($row->standort_id==$standort_id)
|
||||
$selected='selected';
|
||||
else
|
||||
$selected='';
|
||||
|
||||
$htmlstr.=" <OPTION value='$row->standort_kurzbz' $selected>$row->standort_kurzbz</OPTION>\n";
|
||||
$htmlstr.=" <OPTION value='$row->standort_id' $selected>$row->standort_id</OPTION>\n";
|
||||
}
|
||||
}
|
||||
$htmlstr .= " </SELECT>";
|
||||
|
||||
Reference in New Issue
Block a user