if (!$student->load($preoutgoing->uid)) {
     die('Konnte Student nicht laden!');
 }
 $projektarbeittitel = $preoutgoing->projektarbeittitel;
 $studiengang->load($student->studiengang_kz);
 $preoutgoingFirma = new preoutgoing();
 $preoutgoingFirma->loadAuswahl($preoutgoing_id);
 $preoutgoing_firma = $preoutgoingFirma->firma_id;
 $prestudent->getLastStatus($student->prestudent_id);
 $firma = new firma();
 $nation = new nation();
 if ($preoutgoing_firma != '') {
     $standort = new standort();
     $adresse = new adresse();
     $firma->load($preoutgoing_firma);
     $standort->load_firma($firma->firma_id);
     $adresse->load($standort->adresse_id);
     $nation->load($adresse->nation);
 }
 $preoutgoingLv = new preoutgoing();
 $preoutgoingLv->loadLvs($preoutgoing_id);
 echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?> ';
 echo '<learningagreement_outgoing>';
 echo '  <outgoing>';
 echo '      <vorname><![CDATA[' . $benutzer->vorname . ']]></vorname>';
 echo '      <nachname><![CDATA[' . $benutzer->nachname . ']]></nachname>';
 echo '      <titel_pre><![CDATA[' . $benutzer->titelpre . ']]></titel_pre>';
 echo '      <titel_post><![CDATA[' . $benutzer->titelpost . ']]></titel_post>';
 echo '      <email><![CDATA[' . $benutzer->uid . '@' . DOMAIN . ']]></email>';
 echo '      <sending_institution>FH Technikum Wien</sending_institution>';
 echo '      <sending_institution_nation>Austria</sending_institution_nation>';
// ------------------------------------------------------------------------------------------
switch ($work) {
    // Firmen Search
    case 'wawi_firma_search':
        $firma_search = trim(isset($_REQUEST['term']) ? $_REQUEST['term'] : '');
        if (is_null($firma_search) || $firma_search == '') {
            exit;
        }
        $sFirma = new firma();
        if (!$sFirma->getAll($firma_search)) {
            exit($sFirma->errormsg . "\n");
        }
        $result = array();
        for ($i = 0; $i < count($sFirma->result); $i++) {
            $standort = new standort();
            $standort->load_firma($sFirma->result[$i]->firma_id);
            if (isset($standort->result[0])) {
                $kurzbz = $standort->result[0]->kurzbz;
            } else {
                $kurzbz = '';
            }
            $item['gesperrt'] = html_entity_decode($sFirma->result[$i]->gesperrt ? '!!GESPERRT!! ' : '');
            $item['name'] = html_entity_decode($sFirma->result[$i]->name);
            $item['kurzbz'] = $kurzbz;
            $item['firma_id'] = html_entity_decode($sFirma->result[$i]->firma_id);
            $result[] = $item;
            //				echo html_entity_decode(($sFirma->result[$i]->gesperrt?'!!GESPERRT!! ':'').$sFirma->result[$i]->name).($kurzbz!=''?' ('.$kurzbz.')':'').'|'.html_entity_decode($sFirma->result[$i]->firma_id)."\n";
        }
        echo json_encode($result);
        break;
        // Bestellung Tags
Exemplo n.º 3
0
/**
 * 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) {
        $firma_obj = new firma();
        $firma_obj->load($firma_id);
        $standort_obj->new = true;
        $standort_obj->standort_id = null;
        $standort_obj->adresse_id = null;
        $standort_obj->kurzbz = mb_substr($firma_obj->name, 0, 16);
        $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);
    }
    $htmlstr .= '<table class="liste">
				<tr>
					<th>Kurzbz</th>
					<th>Nation</th>
					<th>Gemeinde</th>
					<th>Plz</th>
					<th>Ort</th>
					<th>Strasse</th>
					<th>Typ</th>
					<th><font size="0">Zustelladr.</font></th>
					
					<td align="center" valign="top" colspan="2"><a target="detail_workfirma" href="firma_detailwork.php?showmenue=1&firma_id=' . $firma_id . '"><input type="Button" value="Neuanlage" name="work"></a></td>
			</tr>';
    $i = 1;
    foreach ($standort_obj->result as $row) {
        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 = false;
            $adresse_obj->zustelladresse = false;
            $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;
        }
        $htmlstr .= "<tr id='standort" . $i . "' class='liste" . $i % 2 . "'>\n";
        $i++;
        $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 align="center">' . ($adresse_obj->zustelladresse ? 'Ja' : 'Nein') . '</td>';
            $htmlstr .= '<td align="center"><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 . '"><img src="../../skin/images/application_form_edit.png" alt="editieren" title="edit"/></a></td>';
            $htmlstr .= "<td align='center'><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()'><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>';
    }
    $htmlstr .= '</table>';
    return $htmlstr;
}
/**
 * Erimtteln der Firmen.- Standortdaten
 *
 * @param $firma_id_geloescht
 * @param $firma_id_bleibt
 */
function getFirmaUndStandorte($firma_id_geloescht, $firma_id_bleibt)
{
    //----------------------------------------------------------------------------------------
    //  zwei Teileanzeigen a) wird geloescht b) bleibt
    //----------------------------------------------------------------------------------------
    // -------------------------------------------------------------------------
    // Firmenstammdaten holen
    // -------------------------------------------------------------------------
    $firma = new firma();
    if (!$firma->load($firma_id_geloescht)) {
        exit('Firma wird gel&ouml;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++) {
            // 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();
            if (!isset($geloescht->personen[$i])) {
                $geloescht->personen[$i] = new stdclass();
            }
            $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->get_firmaorganisationseinheit($geloescht->firma_id)) {
        $geloescht->firmaorganisationseinheit = array();
    }
    if ($firmaorganisationseinheit_obj->result) {
        $geloescht->firmaorganisationseinheit = $firmaorganisationseinheit_obj->result;
    }
    // - 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++) {
            // 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)) {
                if (!isset($bleibt->standorte[$i])) {
                    $bleibt->standorte[$i] = new stdClass();
                }
                $bleibt->standorte[$i]->kontakt = $kontakt_obj;
            }
            // Personen zum Standort
            $personfunktion_obj = new person();
            if (!isset($bleibt->personen[$i])) {
                $bleibt->personen[$i] = new stdClass();
            }
            $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->get_firmaorganisationseinheit($bleibt->firma_id)) {
        $bleibt->firmaorganisationseinheit = array();
    }
    if ($firmaorganisationseinheit_obj->result) {
        $bleibt->firmaorganisationseinheit = $firmaorganisationseinheit_obj->result;
    }
    return $standort = array("geloescht" => $geloescht, "bleibt" => $bleibt);
}