mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-10-12 15:04:04 +00:00
adressentyp class hinzugefuegt
dynamische anzeige der adressentypen
This commit is contained in:
@@ -53,8 +53,6 @@ class adresse extends basis_db
|
|||||||
public $rechnungsadresse=false; // boolean
|
public $rechnungsadresse=false; // boolean
|
||||||
public $anmerkung; // string
|
public $anmerkung; // string
|
||||||
public $co_name;
|
public $co_name;
|
||||||
public $adressentyp;
|
|
||||||
public $bezeichnung;
|
|
||||||
public $bezeichnung_mehrsprachig;
|
public $bezeichnung_mehrsprachig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -523,29 +521,5 @@ class adresse extends basis_db
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAdressentyp()
|
|
||||||
{
|
|
||||||
$qry = "SELECT * FROM public.tbl_adressentyp ORDER BY sort";
|
|
||||||
|
|
||||||
if($this->db_query($qry))
|
|
||||||
{
|
|
||||||
while($row = $this->db_fetch_object())
|
|
||||||
{
|
|
||||||
$obj = new adresse();
|
|
||||||
|
|
||||||
$obj->adressentyp = $row->adressentyp_kurzbz;
|
|
||||||
$obj->bezeichnung = $row->bezeichnung;
|
|
||||||
|
|
||||||
$this->result[] = $obj;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$this->errormsg = 'Fehler beim Laden der Daten';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require_once(dirname(__FILE__) . '/basis_db.class.php');
|
||||||
|
|
||||||
|
class adressentyp extends basis_db {
|
||||||
|
|
||||||
|
public $result = array();
|
||||||
|
public $adressentyp;
|
||||||
|
public $bezeichnung;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAll()
|
||||||
|
{
|
||||||
|
$qry = "SELECT * FROM public.tbl_adressentyp ORDER BY sort";
|
||||||
|
|
||||||
|
if($this->db_query($qry))
|
||||||
|
{
|
||||||
|
while($row = $this->db_fetch_object())
|
||||||
|
{
|
||||||
|
$obj = new adressentyp();
|
||||||
|
|
||||||
|
$obj->adressentyp = $row->adressentyp_kurzbz;
|
||||||
|
$obj->bezeichnung = $row->bezeichnung;
|
||||||
|
|
||||||
|
$this->result[] = $obj;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->errormsg = 'Fehler beim Laden der Daten';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -30,9 +30,9 @@ header("Content-type: application/xhtml+xml");
|
|||||||
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
|
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
|
||||||
// DAO
|
// DAO
|
||||||
require_once('../config/vilesci.config.inc.php');
|
require_once('../config/vilesci.config.inc.php');
|
||||||
require_once('../include/adresse.class.php');
|
require_once('../include/adressentyp.class.php');
|
||||||
|
|
||||||
$adresse = new adresse();
|
$adresse = new adressentyp();
|
||||||
|
|
||||||
$rdf_url='http://www.technikum-wien.at/adressentyp';
|
$rdf_url='http://www.technikum-wien.at/adressentyp';
|
||||||
echo '
|
echo '
|
||||||
@@ -44,7 +44,7 @@ echo '
|
|||||||
<RDF:Seq about="'.$rdf_url.'/liste">
|
<RDF:Seq about="'.$rdf_url.'/liste">
|
||||||
';
|
';
|
||||||
|
|
||||||
if ($adresse->getAdressentyp())
|
if ($adresse->getAll())
|
||||||
{
|
{
|
||||||
foreach ($adresse->result as $row)
|
foreach ($adresse->result as $row)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ require_once('../../include/benutzerberechtigung.class.php');
|
|||||||
require_once('../../include/person.class.php');
|
require_once('../../include/person.class.php');
|
||||||
require_once('../../include/datum.class.php');
|
require_once('../../include/datum.class.php');
|
||||||
require_once('../../include/adresse.class.php');
|
require_once('../../include/adresse.class.php');
|
||||||
|
require_once('../../include/adressentyp.class.php');
|
||||||
require_once('../../include/nation.class.php');
|
require_once('../../include/nation.class.php');
|
||||||
require_once('../../include/firma.class.php');
|
require_once('../../include/firma.class.php');
|
||||||
require_once('../../include/standort.class.php');
|
require_once('../../include/standort.class.php');
|
||||||
@@ -260,8 +261,6 @@ if(isset($_POST['saveadresse']))
|
|||||||
$adresse_obj->updateamum = date('Y-m-d H:i:s');
|
$adresse_obj->updateamum = date('Y-m-d H:i:s');
|
||||||
$adresse_obj->updatvon = $user;
|
$adresse_obj->updatvon = $user;
|
||||||
|
|
||||||
//var_dump($adresse_obj);
|
|
||||||
|
|
||||||
if(!$adresse_obj->save())
|
if(!$adresse_obj->save())
|
||||||
{
|
{
|
||||||
$errormsg = 'Fehler beim Speichern der Adresse:'.$adresse_obj->errormsg;
|
$errormsg = 'Fehler beim Speichern der Adresse:'.$adresse_obj->errormsg;
|
||||||
@@ -342,8 +341,6 @@ $firma->getAll();
|
|||||||
foreach($firma->result as $row)
|
foreach($firma->result as $row)
|
||||||
$firma_arr[$row->firma_id]=$row->name;
|
$firma_arr[$row->firma_id]=$row->name;
|
||||||
|
|
||||||
$adresstyp_arr = array('h'=>'Hauptwohnsitz','n'=>'Nebenwohnsitz','f'=>'Firma');
|
|
||||||
|
|
||||||
//Kontakttypen laden
|
//Kontakttypen laden
|
||||||
$kontakttyp_arr = array();
|
$kontakttyp_arr = array();
|
||||||
$kontakt_obj = new kontakt();
|
$kontakt_obj = new kontakt();
|
||||||
@@ -369,7 +366,7 @@ foreach ($adresse_obj->result as $row)
|
|||||||
echo "<td>$row->ort</td>";
|
echo "<td>$row->ort</td>";
|
||||||
echo "<td>$row->gemeinde</td>";
|
echo "<td>$row->gemeinde</td>";
|
||||||
echo "<td>".(isset($nation_arr[$row->nation])?$nation_arr[$row->nation]:'')."</td>";
|
echo "<td>".(isset($nation_arr[$row->nation])?$nation_arr[$row->nation]:'')."</td>";
|
||||||
echo "<td>".(isset($adresstyp_arr[$row->typ])?$adresstyp_arr[$row->typ]:'')."</td>";
|
echo "<td>".(isset($row->bezeichnung_mehrsprachig[DEFAULT_LANGUAGE])?$row->bezeichnung_mehrsprachig[DEFAULT_LANGUAGE]:'')."</td>";
|
||||||
echo "<td>".($row->heimatadresse?'Ja':'Nein')."</td>";
|
echo "<td>".($row->heimatadresse?'Ja':'Nein')."</td>";
|
||||||
echo "<td>".($row->zustelladresse?'Ja':'Nein')."</td>";
|
echo "<td>".($row->zustelladresse?'Ja':'Nein')."</td>";
|
||||||
echo "<td>".($row->firma_id!=''?$firma_arr[$row->firma_id]:'')."</td>";
|
echo "<td>".($row->firma_id!=''?$firma_arr[$row->firma_id]:'')."</td>";
|
||||||
@@ -426,15 +423,19 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo "</SELECT></td>";
|
echo "</SELECT></td>";
|
||||||
|
|
||||||
|
$adressetyp = new adressentyp();
|
||||||
|
$adressetyp->getAll();
|
||||||
|
|
||||||
echo "<td><SELECT name='adresstyp'>";
|
echo "<td><SELECT name='adresstyp'>";
|
||||||
foreach($adresstyp_arr as $code=>$kurzbz)
|
foreach($adressetyp->result as $row)
|
||||||
{
|
{
|
||||||
if($code==$typ)
|
if($row->adressentyp==$typ)
|
||||||
$selected='selected';
|
$selected='selected';
|
||||||
else
|
else
|
||||||
$selected='';
|
$selected='';
|
||||||
|
|
||||||
echo "<OPTION value='$code' $selected>$kurzbz</OPTION>";
|
echo "<OPTION value='". $row->adressentyp ."' $selected>$row->bezeichnung</OPTION>";
|
||||||
}
|
}
|
||||||
echo "</SELECT></td>";
|
echo "</SELECT></td>";
|
||||||
echo "<td><input type='checkbox' name='heimatadresse' ".($heimatadresse?'checked':'')." /></td>";
|
echo "<td><input type='checkbox' name='heimatadresse' ".($heimatadresse?'checked':'')." /></td>";
|
||||||
|
|||||||
@@ -191,8 +191,6 @@ $nation_arr['']='';
|
|||||||
foreach($nation->nation as $row)
|
foreach($nation->nation as $row)
|
||||||
$nation_arr[$row->code]=$row->kurztext;
|
$nation_arr[$row->code]=$row->kurztext;
|
||||||
|
|
||||||
$adresstyp_arr = array(''=>'','h'=>'Hauptwohnsitz','n'=>'Nebenwohnsitz','f'=>'Firma');
|
|
||||||
|
|
||||||
// *** ADRESSEN ***
|
// *** ADRESSEN ***
|
||||||
echo '<h3>Adressen:</h3>';
|
echo '<h3>Adressen:</h3>';
|
||||||
echo '<table class="tablesorter" data-sortlist="[[7,0],[0,0]]">
|
echo '<table class="tablesorter" data-sortlist="[[7,0],[0,0]]">
|
||||||
@@ -222,7 +220,7 @@ foreach ($adresse_obj->result as $row)
|
|||||||
echo "<td>$row->ort</td>";
|
echo "<td>$row->ort</td>";
|
||||||
echo "<td>$row->gemeinde</td>";
|
echo "<td>$row->gemeinde</td>";
|
||||||
echo "<td>".$nation_arr[$row->nation]."</td>";
|
echo "<td>".$nation_arr[$row->nation]."</td>";
|
||||||
echo "<td>".$adresstyp_arr[$row->typ]."</td>";
|
echo "<td>".$row->bezeichnung_mehrsprachig[DEFAULT_LANGUAGE]."</td>";
|
||||||
echo "<td>".($row->heimatadresse?'Ja':'Nein')."</td>";
|
echo "<td>".($row->heimatadresse?'Ja':'Nein')."</td>";
|
||||||
echo "<td>".($row->zustelladresse?'Ja':'Nein')."</td>";
|
echo "<td>".($row->zustelladresse?'Ja':'Nein')."</td>";
|
||||||
$firma=new firma();
|
$firma=new firma();
|
||||||
|
|||||||
Reference in New Issue
Block a user