|
|
|
@@ -1,5 +1,5 @@
|
|
|
|
|
<?php
|
|
|
|
|
/* Copyright (C) 2006 Technikum-Wien
|
|
|
|
|
/* Copyright (C) 2010 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,122 +15,137 @@
|
|
|
|
|
* 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 >
|
|
|
|
|
* Authors: Christian Paminger < christian.paminger@technikum-wien.at >
|
|
|
|
|
* Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at >
|
|
|
|
|
* Rudolf Hangl < rudolf.hangl@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/standort.class.php');
|
|
|
|
|
require_once('../../include/adresse.class.php');
|
|
|
|
|
require_once('../../include/kontakt.class.php');
|
|
|
|
|
require_once('../../include/person.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.');
|
|
|
|
|
|
|
|
|
|
// Benutzerinformation
|
|
|
|
|
$user=get_uid();
|
|
|
|
|
|
|
|
|
|
// Zugriffsrechte pruefen
|
|
|
|
|
$rechte = new benutzerberechtigung();
|
|
|
|
|
$rechte->getBerechtigungen($user);
|
|
|
|
|
if(!$rechte->isBerechtigt('admin') && !$rechte->isBerechtigt('basis/firma',null,'suid'))
|
|
|
|
|
die('Sie haben keine Berechtigung für diese Seite');
|
|
|
|
|
|
|
|
|
|
// Parameter
|
|
|
|
|
$firma_id_geloescht = (isset($_REQUEST['firma_id_geloescht'])?$_REQUEST['firma_id_geloescht']:'');
|
|
|
|
|
if (empty($firma_id_geloescht))
|
|
|
|
|
exit('Es fehlt welche Firma gelöscht werden soll !');
|
|
|
|
|
$firma_id_bleibt = (isset($_REQUEST['firma_id_bleibt'])?$_REQUEST['firma_id_bleibt']:'');
|
|
|
|
|
if (empty($firma_id_bleibt))
|
|
|
|
|
exit('Es fehlt welche Firma bleibt !');
|
|
|
|
|
if ($firma_id_geloescht==$firma_id_bleibt)
|
|
|
|
|
exit('Zusammenlegen nicht möglich ! Firmendaten sind gleich ');
|
|
|
|
|
$work = (isset($_REQUEST['work'])?$_REQUEST['work']:'');
|
|
|
|
|
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/kontakt.class.php');
|
|
|
|
|
require_once('../../include/person.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.');
|
|
|
|
|
|
|
|
|
|
// Benutzerinformation
|
|
|
|
|
$user=get_uid();
|
|
|
|
|
|
|
|
|
|
// Zugriffsrechte pruefen
|
|
|
|
|
$rechte = new benutzerberechtigung();
|
|
|
|
|
$rechte->getBerechtigungen($user);
|
|
|
|
|
if(!$rechte->isBerechtigt('admin') && !$rechte->isBerechtigt('basis/firma:begrenzt',null,'suid'))
|
|
|
|
|
die('Sie haben keine Berechtigung für diese Seite');
|
|
|
|
|
|
|
|
|
|
// Parameter
|
|
|
|
|
$firma_id_geloescht = (isset($_REQUEST['firma_id_geloescht'])?$_REQUEST['firma_id_geloescht']:'');
|
|
|
|
|
if (empty($firma_id_geloescht))
|
|
|
|
|
exit('Es fehlt welche Firma gelöscht werden soll !');
|
|
|
|
|
$firma_id_bleibt = (isset($_REQUEST['firma_id_bleibt'])?$_REQUEST['firma_id_bleibt']:'');
|
|
|
|
|
if (empty($firma_id_bleibt))
|
|
|
|
|
exit('Es fehlt welche Firma bleibt !');
|
|
|
|
|
if ($firma_id_geloescht==$firma_id_bleibt)
|
|
|
|
|
exit('Zusammenlegen nicht möglich ! Firmendaten sind gleich ');
|
|
|
|
|
$work = (isset($_REQUEST['work'])?$_REQUEST['work']:'');
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------------------
|
|
|
|
|
// wenn Work ok (Voranzeige) PopUp Anzeige , und Ende / Funktion am Ende
|
|
|
|
|
//----------------------------------------------------------------------------------------
|
|
|
|
|
if (empty($work) )
|
|
|
|
|
{
|
|
|
|
|
if (!$standort=getFirmaUndStandorte($firma_id_geloescht,$firma_id_bleibt))
|
|
|
|
|
exit("Fehler beim Ermitteln der Daten! Firma $firma_id_geloescht die geloescht werden soll, und Firma $firma_id_bleibt die bleibt.");
|
|
|
|
|
$geloescht=$standort['geloescht'];
|
|
|
|
|
$bleibt=$standort['bleibt'];
|
|
|
|
|
if (empty($work) )
|
|
|
|
|
{
|
|
|
|
|
if (!$standort=getFirmaUndStandorte($firma_id_geloescht,$firma_id_bleibt))
|
|
|
|
|
exit("Fehler beim Ermitteln der Daten! Firma $firma_id_geloescht die geloescht werden soll, und Firma $firma_id_bleibt die bleibt.");
|
|
|
|
|
$geloescht=$standort['geloescht'];
|
|
|
|
|
$bleibt=$standort['bleibt'];
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
<html>
|
|
|
|
|
<head>
|
|
|
|
|
<title>Firmen zusammenlegen</title>
|
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
|
|
|
<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 src="../../include/js/jquery.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../../include/js/jquery-ui.js" type="text/javascript"></script>
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript" language="JavaScript1.2">
|
|
|
|
|
function show_firma_bleibt(work)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<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 src="../../include/js/jquery.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../../include/js/jquery-ui.js" type="text/javascript"></script>
|
|
|
|
|
<script type="text/javascript" language="JavaScript1.2">
|
|
|
|
|
function show_firma_bleibt(work)
|
|
|
|
|
var wohin='detailInfoAnzeigeZusammenlegen';
|
|
|
|
|
$("div#detailInfoZusammenlegen").show("slow"); // div# langsam oeffnen
|
|
|
|
|
|
|
|
|
|
$("div#"+wohin).html('<img src="../../skin/images/spinner.gif" alt="warten" title="warten" >');
|
|
|
|
|
var formdata = $('form#firmaform').serialize();
|
|
|
|
|
|
|
|
|
|
$.ajax
|
|
|
|
|
(
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var wohin='detailInfoAnzeigeZusammenlegen';
|
|
|
|
|
$("div#detailInfoZusammenlegen").show("slow"); // div# langsam oeffnen
|
|
|
|
|
|
|
|
|
|
$("div#"+wohin).html('<img src="../../skin/images/spinner.gif" alt="warten" title="warten" >');
|
|
|
|
|
var formdata = $('form#firmaform').serialize();
|
|
|
|
|
//alert(formdata);
|
|
|
|
|
$.ajax
|
|
|
|
|
(
|
|
|
|
|
{
|
|
|
|
|
type: "POST", timeout: 3500,
|
|
|
|
|
dataType: 'html',
|
|
|
|
|
url: 'firma_zusammen_details.php',
|
|
|
|
|
data: formdata+'&work='+work,
|
|
|
|
|
error: function()
|
|
|
|
|
{
|
|
|
|
|
$("div#"+wohin).html("error ");
|
|
|
|
|
return;
|
|
|
|
|
},
|
|
|
|
|
success: function(phpData)
|
|
|
|
|
{
|
|
|
|
|
$("div#"+wohin).html(phpData);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// if (work=='save')
|
|
|
|
|
// {
|
|
|
|
|
// $('input[@type=checkbox]:checked').each(function()
|
|
|
|
|
// {
|
|
|
|
|
// $(this).parent().parent().css('background-color','#C0C0C0');
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
return;
|
|
|
|
|
type: "POST", timeout: 3500,
|
|
|
|
|
dataType: 'html',
|
|
|
|
|
url: 'firma_zusammen_details.php',
|
|
|
|
|
data: formdata+'&work='+work,
|
|
|
|
|
error: function()
|
|
|
|
|
{
|
|
|
|
|
$("div#"+wohin).html("error ");
|
|
|
|
|
return;
|
|
|
|
|
},
|
|
|
|
|
success: function(phpData)
|
|
|
|
|
{
|
|
|
|
|
$("div#"+wohin).html(phpData);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// if (work=='save')
|
|
|
|
|
// {
|
|
|
|
|
// $('input[@type=checkbox]:checked').each(function()
|
|
|
|
|
// {
|
|
|
|
|
// $(this).parent().parent().css('background-color','#C0C0C0');
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// $(function()
|
|
|
|
|
// {
|
|
|
|
|
// $("#detailInfoZusammenlegen").resizable();
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
-->
|
|
|
|
|
</script>
|
|
|
|
|
<style type="text/css">
|
|
|
|
|
<!--
|
|
|
|
|
div.detailInfoZusammenlegen {width:90%;display:none;padding: 5px 5px 5px 5px;border: 1px solid Black;empty-cells : hide;text-align:center;vertical-align: top;z-index: 99;background-color: white; position:absolute;}
|
|
|
|
|
div.detailInfoCloseZusammenlegen {border: 7px outset #008381;padding: 0px 10px 0px 10px;}
|
|
|
|
|
div.detailInfoAnzeigeZusammenlegen {font-size:medium;text-align:left;background-color: #F5F5F5;padding: 15px 15px 15px 15px;}
|
|
|
|
|
|
|
|
|
|
/*function my_array_unique($old)
|
|
|
|
|
{
|
|
|
|
|
$new = array();
|
|
|
|
|
foreach( $old AS $key => $val )
|
|
|
|
|
{
|
|
|
|
|
if(in_array($val, $new) === false)
|
|
|
|
|
{
|
|
|
|
|
$new[$key] = $val;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return $new;
|
|
|
|
|
}*/
|
|
|
|
|
-->
|
|
|
|
|
</style>
|
|
|
|
|
</script>
|
|
|
|
|
<style type="text/css">
|
|
|
|
|
<!--
|
|
|
|
|
div.detailInfoZusammenlegen {width:90%;display:none;padding: 5px 5px 5px 5px;border: 1px solid Black;empty-cells : hide;text-align:center;vertical-align: top;z-index: 99;background-color: white; position:absolute;}
|
|
|
|
|
div.detailInfoCloseZusammenlegen {border: 7px outset #008381;padding: 0px 10px 0px 10px;}
|
|
|
|
|
div.detailInfoAnzeigeZusammenlegen {font-size:medium;text-align:left;background-color: #F5F5F5;padding: 15px 15px 15px 15px;}
|
|
|
|
|
-->
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
@@ -154,7 +169,7 @@
|
|
|
|
|
<input type="button" name="Voranzeigen" value="voranzeigen zusammenlegen" onclick="show_firma_bleibt('ok');">
|
|
|
|
|
<input type="button" name="Zusammenlegen" value="start zusammenlegen" onclick="show_firma_bleibt('save');">
|
|
|
|
|
<div id="detailInfoZusammenlegen" class="detailInfoZusammenlegen">
|
|
|
|
|
<div style="text-align:right;color:#000;cursor:hand;" onclick="document.getElementById('detailInfoZusammenlegen').style.display = 'none';">
|
|
|
|
|
<div style="text-align:right;color:#000; cursor: pointer; cursor: hand;" onclick="document.getElementById('detailInfoZusammenlegen').style.display = 'none';">
|
|
|
|
|
<b id="detailInfoCloseZusammenlegen">schliessen <img border="0" src="../../skin/images/cross.png" title="schliessen"> </b></div>
|
|
|
|
|
<br>
|
|
|
|
|
<div id="detailInfoAnzeigeZusammenlegen" class="detailInfoAnzeigeZusammenlegen"> </div>
|
|
|
|
@@ -174,10 +189,10 @@
|
|
|
|
|
|
|
|
|
|
<!-- TEIL LINKS das wird geloescht -->
|
|
|
|
|
<td width="50%" valign="top">
|
|
|
|
|
<fieldset>
|
|
|
|
|
<legend><?php echo $geloescht->firma_id.' '.$geloescht->firmentyp_kurzbz.' '.$geloescht->name ;?> wird gelöscht</legend>
|
|
|
|
|
<fieldset>
|
|
|
|
|
<legend>Standorte</legend>
|
|
|
|
|
<fieldset style="background-color:#ff978f;">
|
|
|
|
|
<legend style="background-color:#ff978f;"><?php echo $geloescht->firma_id.' '.$geloescht->firmentyp_kurzbz.' '.$geloescht->name ;?> wird gelöscht</legend>
|
|
|
|
|
<fieldset style="background-color:#ffeac9;">
|
|
|
|
|
<legend style="background-color:#ffeac9;">Standorte</legend>
|
|
|
|
|
<table>
|
|
|
|
|
<?php
|
|
|
|
|
if ($geloescht->standorte)
|
|
|
|
@@ -185,34 +200,35 @@
|
|
|
|
|
foreach ($geloescht->standorte as $standort)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
echo '<tr><td colspan="2"><fieldset><legend>'.$standort->standort_id.' '.$standort->bezeichnung.'</legend><table>';
|
|
|
|
|
echo '<tr><td><input checked class="checkbox" value="'.$standort->standort_id.'" id="standort" name="standort[]" type="checkbox" ></td><td>'.$standort->bezeichnung.'</td></tr>';
|
|
|
|
|
echo '<tr><td colspan="2"><fieldset><legend>Adressen zu '.$standort->kurzbz.'</legend><table>';
|
|
|
|
|
if ($standort->adresse)
|
|
|
|
|
{
|
|
|
|
|
echo '<tr><td valign="top">'.$standort->adresse->strasse.'<br>'.$standort->adresse->plz.' '.$standort->adresse->ort.'</td></tr>';
|
|
|
|
|
}
|
|
|
|
|
echo '</table></fieldset></td></tr>';
|
|
|
|
|
echo '<tr><td colspan="2"><fieldset style="background-color:#ffdab9;"><legend style="background-color:#ffdab9;">'.$standort->standort_id.' '.($standort->bezeichnung==NULL?$standort->kurzbz:$standort->bezeichnung).'</legend><table>';
|
|
|
|
|
echo '<tr><td><input checked class="checkbox" value="'.$standort->standort_id.'" id="standort" name="standort[]" type="checkbox" ></td><td>'.(($standort->bezeichnung==NULL||$standort->bezeichnung=="")?$standort->kurzbz:$standort->bezeichnung).'</td></tr>';
|
|
|
|
|
echo '<tr><td colspan="2"><fieldset style="background-color:#ffe4e1;"><legend style="background-color:#ffe4e1;">Adressen zu '.$standort->kurzbz.'</legend><table>';
|
|
|
|
|
if ($standort->adresse)
|
|
|
|
|
{
|
|
|
|
|
echo '<tr><td valign="top">'.$standort->adresse->strasse.'<br>'.$standort->adresse->plz.' '.$standort->adresse->ort.'</td></tr>';
|
|
|
|
|
}
|
|
|
|
|
echo '</table></fieldset></td></tr>';
|
|
|
|
|
|
|
|
|
|
echo '<tr><td colspan="2"><fieldset><legend>Direktekontakte zu '.$standort->kurzbz.'</legend><table>';
|
|
|
|
|
if ($standort->kontakt->result)
|
|
|
|
|
{
|
|
|
|
|
foreach ($standort->kontakt->result as $kontakt)
|
|
|
|
|
{
|
|
|
|
|
echo '<tr><td valign="top"><input checked title="'.$kontakt->kontakt_id.'" value="'.$kontakt->kontakt_id.'" id="kontakt_'.$kontakt->kontakt_id.'" name="kontakt['.$standort->standort_id.'][]" type="Checkbox" ></td><td valign="top">'.$kontakt->kontakttyp.' '.$kontakt->kontakt.'<br>'.$kontakt->anmerkung.'</td></tr>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
echo '</table></fieldset></td></tr>';
|
|
|
|
|
|
|
|
|
|
echo '<tr><td colspan="2"><fieldset><legend>Personenkontakte zu '.$standort->kurzbz.'</legend><table>';
|
|
|
|
|
if ($standort->personfunktion->result)
|
|
|
|
|
{
|
|
|
|
|
foreach ($standort->personfunktion->result as $personfunktion)
|
|
|
|
|
{
|
|
|
|
|
echo '<tr><td valign="top"><input checked value="'.$personfunktion->personfunktionstandort_id.'" id="personfunktionstandort_'.$personfunktion->personfunktionstandort_id.'" name="personfunktionstandort['.$standort->standort_id.'][]" type="Checkbox" ></td><td valign="top">'.$personfunktion->funktion_kurzbz.'<br>'.$personfunktion->position.'<br>'.$personfunktion->anrede.'</td></tr>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
echo '</table></fieldset></td></tr>';
|
|
|
|
|
echo '<tr><td colspan="2"><fieldset style="background-color:#ffe4e1;"><legend style="background-color:#ffe4e1;">Direktekontakte zu '.$standort->kurzbz.'</legend><table>';
|
|
|
|
|
//if ($standort->kontakt->result)
|
|
|
|
|
if ($standort->kontakt)
|
|
|
|
|
{
|
|
|
|
|
foreach ($standort->kontakt->result as $kontakt)
|
|
|
|
|
{
|
|
|
|
|
echo '<tr><td valign="top"><input checked title="'.$kontakt->kontakt_id.'" value="'.$kontakt->kontakt_id.'" id="kontakt_'.$kontakt->kontakt_id.'" name="kontakt['.$standort->standort_id.'][]" type="Checkbox" ></td><td valign="top">'.$kontakt->kontakttyp.' '.$kontakt->kontakt.'<br>'.$kontakt->anmerkung.'</td></tr>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
echo '</table></fieldset></td></tr>';
|
|
|
|
|
|
|
|
|
|
echo '<tr><td colspan="2"><fieldset style="background-color:#ffe4e1;"><legend style="background-color:#ffe4e1;">Personenkontakte zu '.$standort->kurzbz.'</legend><table>';
|
|
|
|
|
if ($standort->personfunktion->result)
|
|
|
|
|
{
|
|
|
|
|
foreach ($standort->personfunktion->result as $personfunktion)
|
|
|
|
|
{
|
|
|
|
|
echo '<tr><td valign="top"><input checked value="'.$personfunktion->personfunktionstandort_id.'" id="personfunktionstandort_'.$personfunktion->personfunktionstandort_id.'" name="personfunktionstandort['.$standort->standort_id.'][]" type="Checkbox" ></td><td valign="top">'.$personfunktion->funktion_kurzbz.'<br>'.$personfunktion->position.'<br>'.$personfunktion->anrede.'</td></tr>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
echo '</table></fieldset></td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo '</table></fieldset></td></tr>';
|
|
|
|
@@ -225,39 +241,43 @@
|
|
|
|
|
</fieldset>
|
|
|
|
|
</fieldset>
|
|
|
|
|
|
|
|
|
|
<fieldset>
|
|
|
|
|
<legend>Organisation</legend>
|
|
|
|
|
<fieldset style="background-color:#ff978f;">
|
|
|
|
|
<legend style="background-color:#ff978f;">Organisation</legend>
|
|
|
|
|
<table>
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
if ($geloescht->firmaorganisationseinheit)
|
|
|
|
|
{
|
|
|
|
|
foreach ($geloescht->firmaorganisationseinheit as $firmaorganisationseinheit)
|
|
|
|
|
{
|
|
|
|
|
echo '<tr><td><input checked="checked" value="'.$firmaorganisationseinheit->firma_organisationseinheit_id.'" id="firmaorganisationseinheit" name="firmaorganisationseinheit[]" type="Checkbox" ></td><td>'.$firmaorganisationseinheit->bezeichnung.'</td></tr>';
|
|
|
|
|
//var_dump($firmaorganisationseinheit);
|
|
|
|
|
echo '<tr><td><input checked="checked" value="'.$firmaorganisationseinheit->firma_organisationseinheit_id.'" id="firmaorganisationseinheit" name="firmaorganisationseinheit[]" type="Checkbox" ></td><td>'.$firmaorganisationseinheit->bezeichnung.'</td></tr>';
|
|
|
|
|
echo '<tr><td></td><td>'.$firmaorganisationseinheit->fobezeichnung.'</td></tr>';
|
|
|
|
|
echo '<tr><td></td><td>KNr.: '.$firmaorganisationseinheit->kundennummer.'</td></tr>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
?>
|
|
|
|
|
<tr><td> </td></tr>
|
|
|
|
|
</table>
|
|
|
|
|
</fieldset>
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
<!-- TEIL RECHTS das blebt -->
|
|
|
|
|
<!-- TEIL RECHTS das bleibt -->
|
|
|
|
|
<td width="50%" valign="top">
|
|
|
|
|
<fieldset>
|
|
|
|
|
<legend><?php echo $bleibt->firma_id.' '.$bleibt->firmentyp_kurzbz.' '.$bleibt->name ;?> bleibt</legend>
|
|
|
|
|
<fieldset style="background-color:#B6ffAf;">
|
|
|
|
|
<legend style="background-color:#B6ffAf;"><?php echo $bleibt->firma_id.' '.$bleibt->firmentyp_kurzbz.' '.$bleibt->name ;?> bleibt</legend>
|
|
|
|
|
|
|
|
|
|
<fieldset>
|
|
|
|
|
<legend>Standorte</legend>
|
|
|
|
|
<fieldset style="background-color:#c9ffd0;">
|
|
|
|
|
<legend style="background-color:#c9ffd0;">Standorte</legend>
|
|
|
|
|
<table>
|
|
|
|
|
<?php
|
|
|
|
|
if ($bleibt->standorte)
|
|
|
|
|
{
|
|
|
|
|
foreach ($bleibt->standorte as $standort)
|
|
|
|
|
{
|
|
|
|
|
echo '<tr><td colspan="2"><fieldset><legend>'.$standort->standort_id.' '.$standort->bezeichnung.'</legend><table>';
|
|
|
|
|
echo '<tr><td colspan="2"><fieldset style="background-color:#c3ffb9;"><legend style="background-color:#c3ffb9;">'.$standort->standort_id.' '.$standort->bezeichnung.'</legend><table>';
|
|
|
|
|
echo '<tr><td><input checked="checked" value="'.$standort->standort_id.'" id="standort" name="standort[]" type="Checkbox" ></td><td>'.$standort->bezeichnung.'</td></tr>';
|
|
|
|
|
echo '<tr><td colspan="2"><fieldset><legend>Adressen zu '.$standort->kurzbz.'</legend><table>';
|
|
|
|
|
echo '<tr><td colspan="2"><fieldset style="background-color:#e3ffe1;"><legend style="background-color:#e3ffe1;">Adressen zu '.$standort->kurzbz.'</legend><table>';
|
|
|
|
|
if ($standort->adresse)
|
|
|
|
|
{
|
|
|
|
|
echo '<tr><td valign="top">'.$standort->adresse->strasse.'<br>'.$standort->adresse->plz.' '.$standort->adresse->ort.'</td></tr>';
|
|
|
|
@@ -265,8 +285,9 @@
|
|
|
|
|
echo '</table></fieldset></td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo '<tr><td colspan="2"><fieldset><legend>Direktekontakte zu '.$standort->kurzbz.'</legend><table>';
|
|
|
|
|
if ($standort->kontakt->result)
|
|
|
|
|
echo '<tr><td colspan="2"><fieldset style="background-color:#e3ffe1;"><legend style="background-color:#e3ffe1;">Direktekontakte zu '.$standort->kurzbz.'</legend><table>';
|
|
|
|
|
//if ($standort->kontakt->result)
|
|
|
|
|
if ($standort->kontakt)
|
|
|
|
|
{
|
|
|
|
|
foreach ($standort->kontakt->result as $kontakt)
|
|
|
|
|
{
|
|
|
|
@@ -278,12 +299,13 @@
|
|
|
|
|
echo '</table></fieldset></td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo '<tr><td colspan="2"><fieldset><legend>Personenkontakte zu '.$standort->kurzbz.'</legend><table>';
|
|
|
|
|
echo '<tr><td colspan="2"><fieldset style="background-color:#e3ffe1;"><legend style="background-color:#e3ffe1;">Personenkontakte zu '.$standort->kurzbz.'</legend><table>';
|
|
|
|
|
if ($standort->personfunktion->result)
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
//var_dump($standort->personfunktion);
|
|
|
|
|
foreach ($standort->personfunktion->result as $personfunktion)
|
|
|
|
|
{
|
|
|
|
|
echo '<tr><td valign="top"><input checked="checked" value="'.$personfunktion->personfunktionstandort_id.'" id="personfunktionstandort_'.$personfunktion->personfunktionstandort_id.'" name="personfunktionstandort['.$standort->standort_id.'][]" type="Checkbox" ></td><td valign="top">'.$personfunktion->funktion_kurzbz.'<br>'.$personfunktion->position.'<br>'.$personfunktion->anrede.'</td></tr>';
|
|
|
|
|
echo '<tr><td valign="top"><input checked="checked" value="'.$personfunktion->personfunktionstandort_id.'" id="personfunktionstandort_'.$personfunktion->personfunktionstandort_id.'" name="personfunktionstandort['.$standort->standort_id.'][]" type="Checkbox" ></td><td valign="top">'.$personfunktion->funktion_kurzbz.'<br>'.$personfunktion->position.'<br>Anrede: '.$personfunktion->anrede.'<br>'.trim($personfunktion->titelpre.' '.$personfunktion->vorname.' '.$personfunktion->nachname.' '.$personfunktion->titelpost).'</td></tr>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
echo '</table></fieldset></td></tr>';
|
|
|
|
@@ -298,8 +320,8 @@
|
|
|
|
|
</fieldset>
|
|
|
|
|
</fieldset>
|
|
|
|
|
|
|
|
|
|
<fieldset>
|
|
|
|
|
<legend>Organisation</legend>
|
|
|
|
|
<fieldset style="background-color:#B6ffAf;">
|
|
|
|
|
<legend style="background-color:#B6ffAf;">Organisation</legend>
|
|
|
|
|
<table>
|
|
|
|
|
<?php
|
|
|
|
|
if ($bleibt->firmaorganisationseinheit)
|
|
|
|
@@ -307,6 +329,8 @@
|
|
|
|
|
foreach ($bleibt->firmaorganisationseinheit as $firmaorganisationseinheit)
|
|
|
|
|
{
|
|
|
|
|
echo '<tr><td><input checked="checked" value="'.$firmaorganisationseinheit->firma_organisationseinheit_id.'" id="firmaorganisationseinheit" name="firmaorganisationseinheit[]" type="Checkbox" ></td><td>'.$firmaorganisationseinheit->bezeichnung.'</td></tr>';
|
|
|
|
|
echo '<tr><td></td><td>'.$firmaorganisationseinheit->fobezeichnung.'</td></tr>';
|
|
|
|
|
echo '<tr><td></td><td>KNr.: '.$firmaorganisationseinheit->kundennummer.'</td></tr>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
@@ -335,6 +359,24 @@
|
|
|
|
|
$personfunktionstandort = (isset($firmendaten['personfunktionstandort'])?$firmendaten['personfunktionstandort']:array());
|
|
|
|
|
$firmaorganisationseinheit = (isset($firmendaten['firmaorganisationseinheit'])?$firmendaten['firmaorganisationseinheit']:array());
|
|
|
|
|
|
|
|
|
|
//Überprüfung auf doppelte Organisationseinheiten
|
|
|
|
|
$firmaorganisationseinheit_check=array();
|
|
|
|
|
for ($i=0;$i<count($firmaorganisationseinheit);$i++)
|
|
|
|
|
{
|
|
|
|
|
$firmaorganisationseinheit_obj->result[$i] = new firma();
|
|
|
|
|
if($firmaorganisationseinheit_obj->result[$i]->load_firmaorganisationseinheit($firmaorganisationseinheit[$i]))
|
|
|
|
|
{
|
|
|
|
|
if (isset($firmaorganisationseinheit_obj->result[$i]))
|
|
|
|
|
{
|
|
|
|
|
if(array_key_exists($firmaorganisationseinheit_obj->result[$i]->oe_kurzbz,$firmaorganisationseinheit_check))
|
|
|
|
|
{
|
|
|
|
|
exit("<b style='color:red'>Es wurden Zuordnungen von Organisationseiheiten mehrfach ausgewählt!<br>Bitte Auswahl korrigieren.</b>");
|
|
|
|
|
}
|
|
|
|
|
$firmaorganisationseinheit_check[$firmaorganisationseinheit_obj->result[$i]->oe_kurzbz]=$firmaorganisationseinheit[$i];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (is_array($standort) && count($standort))
|
|
|
|
|
{
|
|
|
|
|
// Array mit Standort als Key fuer Kontrolle der Adressen ob der Standort noch gueltig ist oder neu zugeordnet wird
|
|
|
|
@@ -395,23 +437,33 @@
|
|
|
|
|
{
|
|
|
|
|
// Array mit Standort als Key fuer Kontrolle der Adressen ob der Standort noch gueltig ist oder neu zugeordnet wird
|
|
|
|
|
$firmaorganisationseinheit_check=array();
|
|
|
|
|
$firmaorganisationseinheit_ok=array();
|
|
|
|
|
for ($i=0;$i<count($firmaorganisationseinheit);$i++)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
$firmaorganisationseinheit_obj = new firma();
|
|
|
|
|
$firmaorganisationseinheit_check=array();
|
|
|
|
|
$firmaorganisationseinheit_ok=array();
|
|
|
|
|
if($firmaorganisationseinheit_obj->load_firmaorganisationseinheit('','',$firmaorganisationseinheit[$i]))
|
|
|
|
|
$firmaorganisationseinheit_obj->result[$i] = new firma();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if($firmaorganisationseinheit_obj->result[$i]->load_firmaorganisationseinheit($firmaorganisationseinheit[$i]))
|
|
|
|
|
{
|
|
|
|
|
if (isset($firmaorganisationseinheit_obj->result[0]))
|
|
|
|
|
$firmaorganisationseinheit_check[$firmaorganisationseinheit_obj->result[0]->oe_kurzbz]=$firmaorganisationseinheit[$i];
|
|
|
|
|
if (isset($firmaorganisationseinheit_obj->result[$i]))
|
|
|
|
|
{
|
|
|
|
|
if(!array_key_exists($firmaorganisationseinheit_obj->result[$i]->oe_kurzbz,$firmaorganisationseinheit_check))
|
|
|
|
|
{
|
|
|
|
|
$firmaorganisationseinheit_check[$firmaorganisationseinheit_obj->result[$i]->oe_kurzbz]=$firmaorganisationseinheit[$i];
|
|
|
|
|
//echo $firmaorganisationseinheit_obj->result[$i]->oe_kurzbz." ".$firmaorganisationseinheit_check[$firmaorganisationseinheit_obj->result[$i]->oe_kurzbz]."<br>";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
echo "<br>".$firmaorganisationseinheit_obj->errormsg;
|
|
|
|
|
echo "<br>".$firmaorganisationseinheit_obj->errormsg;
|
|
|
|
|
}
|
|
|
|
|
//var_dump($firmaorganisationseinheit_check);
|
|
|
|
|
foreach ($firmaorganisationseinheit_check as $key => $val)
|
|
|
|
|
{
|
|
|
|
|
$firmaorganisationseinheit_ok[]=$val;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$firmaorganisationseinheit=$firmaorganisationseinheit_ok;
|
|
|
|
|
$firmaorganisationseinheit_ok=null;
|
|
|
|
|
$firmaorganisationseinheit_check=null;
|
|
|
|
@@ -419,14 +471,14 @@
|
|
|
|
|
|
|
|
|
|
$firma = new firma();
|
|
|
|
|
if(!$firma->load($firma_id_bleibt))
|
|
|
|
|
exit('Welche Firma bleibt fehler :'.$firma->errormsg);
|
|
|
|
|
exit('Welche Firma bleibt Fehler :'.$firma->errormsg);
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
<fieldset>
|
|
|
|
|
<legend>Informationen nach der Zusammenlegung</legend>
|
|
|
|
|
<legend>Informationen nach der Zusammenlegung </legend>
|
|
|
|
|
<fieldset>
|
|
|
|
|
<legend>Firma <?php echo $firma->firma_id; ?></legend>
|
|
|
|
|
<legend>Firma <?php echo $firma->firma_id; ?> </legend>
|
|
|
|
|
<?php
|
|
|
|
|
echo '<table>';
|
|
|
|
|
echo '<tr><td>'.$firma->firmentyp_kurzbz.' '.$firma->name
|
|
|
|
@@ -456,7 +508,7 @@
|
|
|
|
|
{
|
|
|
|
|
?>
|
|
|
|
|
<fieldset>
|
|
|
|
|
<legend>Standort <?php echo $key .' der Firma '. $firma->name; ?></legend>
|
|
|
|
|
<legend>Standort <?php echo $key .' der Firma '. $firma->name; ?> </legend>
|
|
|
|
|
<?php
|
|
|
|
|
$standort_obj = new standort();
|
|
|
|
|
$standort_obj->result=array();
|
|
|
|
@@ -468,7 +520,7 @@
|
|
|
|
|
// Kontakt zum Standort
|
|
|
|
|
if (!isset($kontakt[$key]) || !is_array($kontakt[$key]) || !count($kontakt[$key]))
|
|
|
|
|
{
|
|
|
|
|
echo '<font color="red">Keinen Kontakte zum Standort !</font><br>';
|
|
|
|
|
echo '<font color="red">Keine Kontakte zum Standort !</font><br>';
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@@ -477,7 +529,7 @@
|
|
|
|
|
// Kontakte zum Standort
|
|
|
|
|
$kontakt_obj = new kontakt();
|
|
|
|
|
if($kontakt_obj->load($vals))
|
|
|
|
|
echo 'Kontakt '
|
|
|
|
|
echo '<b>Kontakt</b> '
|
|
|
|
|
." Zustellung:<input disabled ".($kontakt_obj->zustellung?' style="background-color: #E3FDEE;" ':' style="background-color: #FFF4F4;" ')." type='checkbox' name='schule' ".($kontakt_obj->zustellung?'checked':'')."> "
|
|
|
|
|
. $vals.' '.$kontakt_obj->kontakttyp.' '.$kontakt_obj->kontakt
|
|
|
|
|
.' '.$kontakt_obj->beschreibung
|
|
|
|
@@ -490,20 +542,25 @@
|
|
|
|
|
// Personfunktionstandort zum Standort
|
|
|
|
|
if (!isset($personfunktionstandort[$key]) || !is_array($personfunktionstandort[$key]) || !count($personfunktionstandort[$key]))
|
|
|
|
|
{
|
|
|
|
|
echo '<font color="red">Keinen Personen mit Funktionen zum Standort !</font><br>';
|
|
|
|
|
echo '<font color="red">Keine Personen mit Funktionen zum Standort !</font><br>';
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
foreach ($personfunktionstandort[$key] as $keys => $vals)
|
|
|
|
|
{
|
|
|
|
|
// Personfunktion zum Standort
|
|
|
|
|
$personfunktion_obj = new person();
|
|
|
|
|
if($personfunktion_obj->load_personfunktion('','','','',$vals))
|
|
|
|
|
echo 'Personen und Funktion '
|
|
|
|
|
. $vals.' '.$personfunktion_obj->funktion_kurzbz.' '.$personfunktion_obj->position.' '.$personfunktion_obj->anrede
|
|
|
|
|
.'<br>';
|
|
|
|
|
else
|
|
|
|
|
echo $personfunktion_obj->errormsg.'<br>';
|
|
|
|
|
// Personfunktion zum Standort
|
|
|
|
|
$personfunktion_obj = new person();
|
|
|
|
|
if($personfunktion_obj->load_personfunktion('','','','',$vals))
|
|
|
|
|
{
|
|
|
|
|
//var_dump($personfunktion_obj);
|
|
|
|
|
echo '<b>Personen und Funktion</b> '
|
|
|
|
|
. $vals.' '.$personfunktion_obj->result[0]->funktion_kurzbz.' '.$personfunktion_obj->result[0]->position.' '.$personfunktion_obj->result[0]->anrede.'<br> '.trim($personfunktion_obj->result[0]->titelpre.' '.$personfunktion_obj->result[0]->vorname.' '.$personfunktion_obj->result[0]->nachname.' '.$personfunktion_obj->result[0]->titelpost)
|
|
|
|
|
.'<br>';
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
echo $personfunktion_obj->errormsg.'<br>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
@@ -514,29 +571,33 @@
|
|
|
|
|
<?php } ?>
|
|
|
|
|
|
|
|
|
|
<fieldset>
|
|
|
|
|
<legend>Organisationseinheit zur Firma <?php $firma->name; ?></legend>
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
<legend>Organisationseinheit zur Firma <?php echo $firma->name; ?> </legend>
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
if (isset($firmaorganisationseinheit) && is_array($firmaorganisationseinheit) && count($firmaorganisationseinheit) )
|
|
|
|
|
{
|
|
|
|
|
$i=0;
|
|
|
|
|
foreach ($firmaorganisationseinheit as $key => $val)
|
|
|
|
|
{
|
|
|
|
|
$firmaorganisationseinheit_obj = new firma();
|
|
|
|
|
$firmaorganisationseinheit_obj->result[$i] = new firma();
|
|
|
|
|
$bleibt->firmaorganisationseinheit=array();
|
|
|
|
|
if(!$firmaorganisationseinheit_obj->load_firmaorganisationseinheit('','',$val))
|
|
|
|
|
if(!$firmaorganisationseinheit_obj->result[$i]->load_firmaorganisationseinheit($val))
|
|
|
|
|
{
|
|
|
|
|
echo $firmaorganisationseinheit_obj->errormsg.'<br>';
|
|
|
|
|
}
|
|
|
|
|
else if ($firmaorganisationseinheit_obj->result)
|
|
|
|
|
else if ($firmaorganisationseinheit_obj->result[$i])
|
|
|
|
|
{
|
|
|
|
|
foreach ($firmaorganisationseinheit_obj->result as $keys => $vals)
|
|
|
|
|
echo $vals->firma_organisationseinheit_id.' '.$vals->name.', '. $vals->organisationseinheittyp_kurzbz.' '.$vals->bezeichnung.'<br>';
|
|
|
|
|
}
|
|
|
|
|
//var_dump($firmaorganisationseinheit_obj->result[$i]);
|
|
|
|
|
echo $firmaorganisationseinheit_obj->result[$i]->firma_organisationseinheit_id.' <b>'.$firmaorganisationseinheit_obj->result[$i]->oe_kurzbz.'</b><br>'.$firmaorganisationseinheit_obj->result[$i]->bezeichnung.', KNr.: '.$firmaorganisationseinheit_obj->result[$i]->kundennummer.'<br>';
|
|
|
|
|
}
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
echo '<font color="red">Keine Organisationseinheit zur Firma !</font><br>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
</fieldset>
|
|
|
|
@@ -565,6 +626,25 @@
|
|
|
|
|
$personfunktionstandort = (isset($firmendaten['personfunktionstandort'])?$firmendaten['personfunktionstandort']:array());
|
|
|
|
|
$firmaorganisationseinheit = (isset($firmendaten['firmaorganisationseinheit'])?$firmendaten['firmaorganisationseinheit']:array());
|
|
|
|
|
|
|
|
|
|
//Überprüfung auf doppelte Organisationseinheiten
|
|
|
|
|
$firmaorganisationseinheit_check=array();
|
|
|
|
|
for ($i=0;$i<count($firmaorganisationseinheit);$i++)
|
|
|
|
|
{
|
|
|
|
|
$firmaorganisationseinheit_obj->result[$i] = new firma();
|
|
|
|
|
if($firmaorganisationseinheit_obj->result[$i]->load_firmaorganisationseinheit($firmaorganisationseinheit[$i]))
|
|
|
|
|
{
|
|
|
|
|
if (isset($firmaorganisationseinheit_obj->result[$i]))
|
|
|
|
|
{
|
|
|
|
|
if(array_key_exists($firmaorganisationseinheit_obj->result[$i]->oe_kurzbz,$firmaorganisationseinheit_check))
|
|
|
|
|
{
|
|
|
|
|
exit("<b style='color:red'>Es wurden Zuordnungen von Organisationseiheiten mehrfach ausgewählt!<br>Bitte Auswahl korrigieren.</b>");
|
|
|
|
|
}
|
|
|
|
|
$firmaorganisationseinheit_check[$firmaorganisationseinheit_obj->result[$i]->oe_kurzbz]=$firmaorganisationseinheit[$i];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Ermitteln der Standorte zu den Firmen - geloescht und bleibt. Wichtiger Teil zum ermitteln welche Standorte entfernt werden sollen
|
|
|
|
|
$standorte_vorhanden=array();
|
|
|
|
|
$standort_obj = new standort();
|
|
|
|
@@ -723,7 +803,7 @@
|
|
|
|
|
foreach ($firmaorganisationseinheit as $key => $firma_organisationseinheit_id)
|
|
|
|
|
{
|
|
|
|
|
$firmaorganisationseinheit_obj = new firma();
|
|
|
|
|
if(!$firmaorganisationseinheit_obj->load_firmaorganisationseinheit('','',$firma_organisationseinheit_id))
|
|
|
|
|
if(!$firmaorganisationseinheit_obj->load_firmaorganisationseinheit($firma_organisationseinheit_id))
|
|
|
|
|
{
|
|
|
|
|
echo 'Firma - Organisationseinheit: '.$firmaorganisationseinheit_obj->errormsg.'<br>';
|
|
|
|
|
}
|
|
|
|
@@ -760,7 +840,7 @@
|
|
|
|
|
$firmaorganisationseinheit_check[$vals]=$vals;
|
|
|
|
|
|
|
|
|
|
$firmaorganisationseinheit_obj = new firma();
|
|
|
|
|
if($firmaorganisationseinheit_obj->load_firmaorganisationseinheit($firma_id_bleibt))
|
|
|
|
|
if($firmaorganisationseinheit_obj->get_firmaorganisationseinheit($firma_id_bleibt))
|
|
|
|
|
{
|
|
|
|
|
if (is_array($firmaorganisationseinheit_obj->result) && count($firmaorganisationseinheit_obj->result) )
|
|
|
|
|
{
|
|
|
|
@@ -800,115 +880,117 @@
|
|
|
|
|
|
|
|
|
|
function getFirmaUndStandorte($firma_id_geloescht,$firma_id_bleibt)
|
|
|
|
|
{
|
|
|
|
|
//----------------------------------------------------------------------------------------
|
|
|
|
|
// zwei Teileanzeigen a) wird geloescht b) bleibt
|
|
|
|
|
//----------------------------------------------------------------------------------------
|
|
|
|
|
//----------------------------------------------------------------------------------------
|
|
|
|
|
// zwei Teileanzeigen a) wird geloescht b) bleibt
|
|
|
|
|
//----------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
// Firmenstammdaten holen
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
$firma = new firma();
|
|
|
|
|
if(!$firma->load($firma_id_geloescht))
|
|
|
|
|
exit('Firma wird gelöscht fehler :'.$firma->errormsg);
|
|
|
|
|
$geloescht=$firma;
|
|
|
|
|
|
|
|
|
|
$firma = new firma();
|
|
|
|
|
if(!$firma->load($firma_id_bleibt))
|
|
|
|
|
exit('Welche Firma bleibt fehler :'.$firma->errormsg);
|
|
|
|
|
$bleibt=$firma;
|
|
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
// Standorte je Firmenstammdaten holen
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
// - wird geloescht
|
|
|
|
|
$standort_obj = new standort();
|
|
|
|
|
$standort_obj->result=array();
|
|
|
|
|
$standort_obj->load_firma($geloescht->firma_id);
|
|
|
|
|
$geloescht->standorte=array();
|
|
|
|
|
if ($standort_obj->result)
|
|
|
|
|
{
|
|
|
|
|
$geloescht->standorte=$standort_obj->result;
|
|
|
|
|
for ($i=0;$i<count($geloescht->standorte);$i++)
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
// Firmenstammdaten holen
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
$firma = new firma();
|
|
|
|
|
if(!$firma->load($firma_id_geloescht))
|
|
|
|
|
exit('Firma wird gelöscht Fehler :'.$firma->errormsg);
|
|
|
|
|
$geloescht=$firma;
|
|
|
|
|
|
|
|
|
|
$firma = new firma();
|
|
|
|
|
if(!$firma->load($firma_id_bleibt))
|
|
|
|
|
exit('Welche Firma bleibt Fehler :'.$firma->errormsg);
|
|
|
|
|
$bleibt=$firma;
|
|
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
// Standorte je Firmenstammdaten holen
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
// - wird geloescht
|
|
|
|
|
$standort_obj = new standort();
|
|
|
|
|
$standort_obj->result=array();
|
|
|
|
|
$standort_obj->load_firma($geloescht->firma_id);
|
|
|
|
|
$geloescht->standorte=array();
|
|
|
|
|
if ($standort_obj->result)
|
|
|
|
|
{
|
|
|
|
|
// Adresse zum Standort
|
|
|
|
|
$adresse_obj = new adresse();
|
|
|
|
|
$geloescht->standorte[$i]->adresse=array();
|
|
|
|
|
if($geloescht->standorte[$i]->adresse_id && $adresse_obj->load($geloescht->standorte[$i]->adresse_id))
|
|
|
|
|
$geloescht->standorte=$standort_obj->result;
|
|
|
|
|
for ($i=0;$i<count($geloescht->standorte);$i++)
|
|
|
|
|
{
|
|
|
|
|
$geloescht->standorte[$i]->adresse=$adresse_obj;
|
|
|
|
|
}
|
|
|
|
|
// Kontakte zum Standort
|
|
|
|
|
$kontakt_obj = new kontakt();
|
|
|
|
|
$geloescht->standorte[$i]->kontakt=array();
|
|
|
|
|
if($geloescht->standorte[$i]->standort_id && $kontakt_obj->load_standort($geloescht->standorte[$i]->standort_id))
|
|
|
|
|
{
|
|
|
|
|
$geloescht->standorte[$i]->kontakt=$kontakt_obj;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Personen zum Standort
|
|
|
|
|
$personfunktion_obj = new person();
|
|
|
|
|
$geloescht->personen[$i]->personfunktion=array();
|
|
|
|
|
if($geloescht->standorte[$i]->standort_id && $personfunktion_obj->load_personfunktion($geloescht->standorte[$i]->standort_id,'',$geloescht->firma_id))
|
|
|
|
|
{
|
|
|
|
|
$geloescht->standorte[$i]->personfunktion=$personfunktion_obj;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$firmaorganisationseinheit_obj = new firma();
|
|
|
|
|
$geloescht->firmaorganisationseinheit=array();
|
|
|
|
|
if(!$firmaorganisationseinheit_obj->load_firmaorganisationseinheit($geloescht->firma_id))
|
|
|
|
|
$geloescht->firmaorganisationseinheit=array();
|
|
|
|
|
if ($firmaorganisationseinheit_obj->result)
|
|
|
|
|
{
|
|
|
|
|
$geloescht->firmaorganisationseinheit=$firmaorganisationseinheit_obj->result;
|
|
|
|
|
}
|
|
|
|
|
// Adresse zum Standort
|
|
|
|
|
$adresse_obj = new adresse();
|
|
|
|
|
$geloescht->standorte[$i]->adresse=array();
|
|
|
|
|
if($geloescht->standorte[$i]->adresse_id && $adresse_obj->load($geloescht->standorte[$i]->adresse_id))
|
|
|
|
|
{
|
|
|
|
|
$geloescht->standorte[$i]->adresse=$adresse_obj;
|
|
|
|
|
}
|
|
|
|
|
// Kontakte zum Standort
|
|
|
|
|
$kontakt_obj = new kontakt();
|
|
|
|
|
$geloescht->standorte[$i]->kontakt=array();
|
|
|
|
|
if($geloescht->standorte[$i]->standort_id && $kontakt_obj->load_standort($geloescht->standorte[$i]->standort_id))
|
|
|
|
|
{
|
|
|
|
|
$geloescht->standorte[$i]->kontakt=$kontakt_obj;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Personen zum Standort
|
|
|
|
|
$personfunktion_obj = new person();
|
|
|
|
|
$geloescht->personen[$i]->personfunktion=array();
|
|
|
|
|
if($geloescht->standorte[$i]->standort_id && $personfunktion_obj->load_personfunktion($geloescht->standorte[$i]->standort_id,'',$geloescht->firma_id))
|
|
|
|
|
{
|
|
|
|
|
$geloescht->standorte[$i]->personfunktion=$personfunktion_obj;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// - bleibt
|
|
|
|
|
$standort_obj = new standort();
|
|
|
|
|
$standort_obj->result=array();
|
|
|
|
|
$standort_obj->load_firma($bleibt->firma_id);
|
|
|
|
|
$bleibt->standorte=array();
|
|
|
|
|
if ($standort_obj->result)
|
|
|
|
|
{
|
|
|
|
|
$bleibt->standorte=$standort_obj->result;
|
|
|
|
|
for ($i=0;$i<count($bleibt->standorte);$i++)
|
|
|
|
|
$firmaorganisationseinheit_obj = new firma();
|
|
|
|
|
$geloescht->firmaorganisationseinheit=array();
|
|
|
|
|
if(!$firmaorganisationseinheit_obj->get_firmaorganisationseinheit($geloescht->firma_id))
|
|
|
|
|
{
|
|
|
|
|
// Adresse zum Standort
|
|
|
|
|
$adresse_obj = new adresse();
|
|
|
|
|
$bleibt->standorte[$i]->adresse=array();
|
|
|
|
|
if($bleibt->standorte[$i]->adresse_id && $adresse_obj->load($bleibt->standorte[$i]->adresse_id))
|
|
|
|
|
{
|
|
|
|
|
$bleibt->standorte[$i]->adresse=$adresse_obj;
|
|
|
|
|
}
|
|
|
|
|
// Kontakte zum Standort
|
|
|
|
|
$kontakt_obj = new kontakt();
|
|
|
|
|
$bleibt->standorte[$i]->kontakt=array();
|
|
|
|
|
if($bleibt->standorte[$i]->standort_id && $kontakt_obj->load_standort($bleibt->standorte[$i]->standort_id))
|
|
|
|
|
{
|
|
|
|
|
$bleibt->standorte[$i]->kontakt=$kontakt_obj;
|
|
|
|
|
}
|
|
|
|
|
$geloescht->firmaorganisationseinheit=array();
|
|
|
|
|
}
|
|
|
|
|
if ($firmaorganisationseinheit_obj->result)
|
|
|
|
|
{
|
|
|
|
|
$geloescht->firmaorganisationseinheit=$firmaorganisationseinheit_obj->result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Personen zum Standort
|
|
|
|
|
$personfunktion_obj = new person();
|
|
|
|
|
$bleibt->personen[$i]->personfunktion=array();
|
|
|
|
|
if($bleibt->standorte[$i]->standort_id && $personfunktion_obj->load_personfunktion($bleibt->standorte[$i]->standort_id,'',$bleibt->firma_id))
|
|
|
|
|
// - bleibt
|
|
|
|
|
$standort_obj = new standort();
|
|
|
|
|
$standort_obj->result=array();
|
|
|
|
|
$standort_obj->load_firma($bleibt->firma_id);
|
|
|
|
|
$bleibt->standorte=array();
|
|
|
|
|
if ($standort_obj->result)
|
|
|
|
|
{
|
|
|
|
|
$bleibt->standorte=$standort_obj->result;
|
|
|
|
|
for ($i=0;$i<count($bleibt->standorte);$i++)
|
|
|
|
|
{
|
|
|
|
|
$bleibt->standorte[$i]->personfunktion=$personfunktion_obj;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$firmaorganisationseinheit_obj = new firma();
|
|
|
|
|
$bleibt->firmaorganisationseinheit=array();
|
|
|
|
|
if(!$firmaorganisationseinheit_obj->load_firmaorganisationseinheit($bleibt->firma_id))
|
|
|
|
|
// Adresse zum Standort
|
|
|
|
|
$adresse_obj = new adresse();
|
|
|
|
|
$bleibt->standorte[$i]->adresse=array();
|
|
|
|
|
if($bleibt->standorte[$i]->adresse_id && $adresse_obj->load($bleibt->standorte[$i]->adresse_id))
|
|
|
|
|
{
|
|
|
|
|
$bleibt->standorte[$i]->adresse=$adresse_obj;
|
|
|
|
|
}
|
|
|
|
|
// Kontakte zum Standort
|
|
|
|
|
$kontakt_obj = new kontakt();
|
|
|
|
|
$bleibt->standorte[$i]->kontakt=array();
|
|
|
|
|
if($bleibt->standorte[$i]->standort_id && $kontakt_obj->load_standort($bleibt->standorte[$i]->standort_id))
|
|
|
|
|
{
|
|
|
|
|
$bleibt->standorte[$i]->kontakt=$kontakt_obj;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Personen zum Standort
|
|
|
|
|
$personfunktion_obj = new person();
|
|
|
|
|
$bleibt->personen[$i]->personfunktion=array();
|
|
|
|
|
if($bleibt->standorte[$i]->standort_id && $personfunktion_obj->load_personfunktion($bleibt->standorte[$i]->standort_id,'',$bleibt->firma_id))
|
|
|
|
|
{
|
|
|
|
|
$bleibt->standorte[$i]->personfunktion=$personfunktion_obj;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$firmaorganisationseinheit_obj = new firma();
|
|
|
|
|
$bleibt->firmaorganisationseinheit=array();
|
|
|
|
|
if ($firmaorganisationseinheit_obj->result)
|
|
|
|
|
{
|
|
|
|
|
$bleibt->firmaorganisationseinheit=$firmaorganisationseinheit_obj->result;
|
|
|
|
|
}
|
|
|
|
|
return $standort=array("geloescht"=>$geloescht,"bleibt"=>$bleibt);
|
|
|
|
|
}
|
|
|
|
|
if(!$firmaorganisationseinheit_obj->get_firmaorganisationseinheit($bleibt->firma_id))
|
|
|
|
|
$bleibt->firmaorganisationseinheit=array();
|
|
|
|
|
if ($firmaorganisationseinheit_obj->result)
|
|
|
|
|
{
|
|
|
|
|
$bleibt->firmaorganisationseinheit=$firmaorganisationseinheit_obj->result;
|
|
|
|
|
}
|
|
|
|
|
//var_dump($geloescht);
|
|
|
|
|
return $standort=array("geloescht"=>$geloescht,"bleibt"=>$bleibt);
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|