* 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('../../include/firma.class.php');
require_once('../../include/funktion.class.php');
require_once('../../include/standort.class.php');
require_once('../../include/adresse.class.php');
require_once('../../include/kontakt.class.php');
require_once('../../include/person.class.php');
require_once('../../include/organisationseinheit.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:begrenzt'))
die('Sie haben keine Berechtigung für diese Seite');
// Parameter einlesen
$errorstr='';
$tabselect = (isset($_GET['tabselect'])?$_GET['tabselect']:0);
$firma_id = (isset($_REQUEST['firma_id'])?$_REQUEST['firma_id']:'');
$standort_id = (isset($_REQUEST['standort_id'])?$_REQUEST['standort_id']:'');
$adresse_id = (isset($_REQUEST['adresse_id'])?$_REQUEST['adresse_id']:'');
$kontakt_id = (isset($_REQUEST['kontakt_id'])?$_REQUEST['kontakt_id']:'');
$oe_kurzbz= (isset($_REQUEST['oe_kurzbz'])?$_REQUEST['oe_kurzbz']:'');
$oe_parent_kurzbz= (isset($_REQUEST['oe_parent_kurzbz'])?$_REQUEST['oe_parent_kurzbz']:'');
$work = (isset($_REQUEST['work'])?$_REQUEST['work']:(isset($_REQUEST['save'])?$_REQUEST['save']:null));
$showmenue = (isset($_REQUEST['showmenue'])?$_REQUEST['showmenue']:false);
$personfunktionstandort_id = (isset($_REQUEST['personfunktionstandort_id'])?$_REQUEST['personfunktionstandort_id']:'');
$firma_organisationseinheit_id = (isset($_REQUEST['firma_organisationseinheit_id'])?$_REQUEST['firma_organisationseinheit_id']:'');
if(isset($_REQUEST['nation']) && $_REQUEST['nation']=='A' && isset($_REQUEST['gemeinde_combo']) && isset($_REQUEST['ort_combo']))
{
$_REQUEST['gemeinde']=$_REQUEST['gemeinde_combo'];
$_REQUEST['ort']=$_REQUEST['ort_combo'];
}
function getGemeindeDropDown($postleitzahl)
{
global $db, $_REQUEST, $gemeinde;
$return='';
$found=false;
$firstentry='';
$gemeinde_x = (isset($_REQUEST['gemeinde'])?$_REQUEST['gemeinde']:'');
$qry = "SELECT distinct name FROM bis.tbl_gemeinde WHERE plz='".addslashes($postleitzahl)."'";
$return.= '';
if(!$found && (isset($importort) && $importort!=''))
{
$return.= $importort;
}
$gemeinde = $gemeinde_x;
return $return;
}
if(isset($_GET['type']) && $_GET['type']=='getgemeindecontent' && isset($_GET['plz']))
{
header('Content-Type: text/html; charset=UTF-8');
echo getGemeindeDropDown($_GET['plz']);
exit;
}
function getOrtDropDown($postleitzahl, $gemeindename)
{
global $db, $_REQUEST;
$return='';
$ort = (isset($_REQUEST['ort'])?$_REQUEST['ort']:'');
$qry = "SELECT distinct ortschaftsname FROM bis.tbl_gemeinde
WHERE plz='".addslashes($postleitzahl)."' AND name='".addslashes($gemeindename)."'";
$return.='';
return $return;
}
if(isset($_GET['type']) && $_GET['type']=='getortcontent' && isset($_GET['plz']) && isset($_GET['gemeinde']))
{
header('Content-Type: text/html; charset=UTF-8');
echo getOrtDropDown($_GET['plz'], $_GET['gemeinde']);
exit;
}
// Defaultwerte
$adresstyp_arr = array('h'=>'Hauptwohnsitz','n'=>'Nebenwohnsitz','f'=>'Firma',''=>'');
//Loeschen einer Adresse
if(isset($_GET['deleteadresse']))
{
$showmenue=1;
$tabselect=1;
if(!$rechte->isBerechtigt('basis/firma:begrenzt',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 Standort:'.$standort_obj->errormsg;
}
$standort_obj = new standort();
if(!$standort_obj->deletepersonfunktionstandort('',$standort_id))
{
$errorstr=($errorstr?$errorstr.', ':'').'Fehler beim Loeschen Person Funktion Standort:'.$standort_obj->errormsg;
}
}
if(is_numeric($adresse_id))
{
$adresse_obj = new adresse();
if(!$adresse_obj->delete($adresse_id))
{
$errorstr=($errorstr?$errorstr.', ':'').'Fehler beim Loeschen der Adresse:'.$adresse_obj->errormsg;
}
}
}
if(isset($_GET['deletekontakt']))
{
$showmenue=1;
$tabselect=2;
if(!$rechte->isBerechtigt('basis/firma:begrenzt',null, 'suid'))
die('Sie haben keine Berechtigung fuer diese Aktion');
if(is_numeric($kontakt_id))
{
$kontakt_obj = new kontakt();
if(!$kontakt_obj->delete($kontakt_id))
{
$errorstr=($errorstr?$errorstr.', ':'').'Fehler beim Loeschen Standort:'.$kontakt_obj->errormsg;
}
}
}
if(isset($_GET['deletepersonfunktionstandort']))
{
$showmenue=1;
$tabselect=1;
if(!$rechte->isBerechtigt('basis/firma:begrenzt',null, 'suid'))
die('Sie haben keine Berechtigung fuer diese Aktion');
if(is_numeric($personfunktionstandort_id))
{
$standort_obj = new standort();
if(!$standort_obj->deletepersonfunktionstandort($personfunktionstandort_id))
{
$errorstr=($errorstr?$errorstr.', ':'').'Fehler beim Loeschen Person Funktion Standort:'.$standort_obj->errormsg;
}
}
}
?>
Firma - Detailwork
parent.frames[1].location.href=\'firma_details.php?firma_id='.$firma_id.'&tabselect=1\';
';
break;
case 'eingabeOrganisationseinheit':
$htmlcode=eingabeOrganisationseinheit($firma_id,$firma_organisationseinheit_id,$oe_kurzbz,$adresstyp_arr,$user,$rechte);
break;
case 'saveOrganisationseinheit':
$htmlcode=saveOrganisationseinheit($firma_id,$firma_organisationseinheit_id,$oe_kurzbz,$oe_parent_kurzbz,$adresstyp_arr,$user,$rechte);
break;
default:
if (!$showmenue)
$htmlcode=getStandort($firma_id,$standort_id,$adresse_id,$adresstyp_arr,$user,$rechte);
break;
}
if ($showmenue)
echo '