adressentyp class hinzugefuegt

dynamische anzeige der adressentypen
This commit is contained in:
ma0048
2022-02-23 16:17:29 +01:00
parent 23e10d8fbf
commit c3cef1c5f1
5 changed files with 59 additions and 45 deletions
-26
View File
@@ -53,8 +53,6 @@ class adresse extends basis_db
public $rechnungsadresse=false; // boolean
public $anmerkung; // string
public $co_name;
public $adressentyp;
public $bezeichnung;
public $bezeichnung_mehrsprachig;
/**
@@ -523,29 +521,5 @@ class adresse extends basis_db
}
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;
}
}
}
?>
+41
View File
@@ -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;
}
}
}
?>
+3 -3
View File
@@ -30,9 +30,9 @@ header("Content-type: application/xhtml+xml");
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
// DAO
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';
echo '
@@ -44,7 +44,7 @@ echo '
<RDF:Seq about="'.$rdf_url.'/liste">
';
if ($adresse->getAdressentyp())
if ($adresse->getAll())
{
foreach ($adresse->result as $row)
{
+14 -13
View File
@@ -27,6 +27,7 @@ require_once('../../include/benutzerberechtigung.class.php');
require_once('../../include/person.class.php');
require_once('../../include/datum.class.php');
require_once('../../include/adresse.class.php');
require_once('../../include/adressentyp.class.php');
require_once('../../include/nation.class.php');
require_once('../../include/firma.class.php');
require_once('../../include/standort.class.php');
@@ -70,11 +71,11 @@ if(isset($_GET['getstandort']))
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../../skin/vilesci.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="../../skin/styles/jquery.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="../../skin/jquery-ui-1.9.2.custom.min.css">
<script type="text/javascript" src="../../vendor/jquery/jqueryV1/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="../../vendor/christianbach/tablesorter/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="../../vendor/components/jqueryui/jquery-ui.min.js"></script>
<script type="text/javascript" src="../../include/js/jquery.ui.datepicker.translation.js"></script>
<link rel="stylesheet" type="text/css" href="../../skin/jquery-ui-1.9.2.custom.min.css">
<script type="text/javascript" src="../../vendor/jquery/jqueryV1/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="../../vendor/christianbach/tablesorter/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="../../vendor/components/jqueryui/jquery-ui.min.js"></script>
<script type="text/javascript" src="../../include/js/jquery.ui.datepicker.translation.js"></script>
<script type="text/javascript" src="../../vendor/jquery/sizzle/sizzle.js"></script>
<script type="text/javascript" src="../../vendor/components/jqueryui/jquery-ui.min.js" ></script>
@@ -260,8 +261,6 @@ if(isset($_POST['saveadresse']))
$adresse_obj->updateamum = date('Y-m-d H:i:s');
$adresse_obj->updatvon = $user;
//var_dump($adresse_obj);
if(!$adresse_obj->save())
{
$errormsg = 'Fehler beim Speichern der Adresse:'.$adresse_obj->errormsg;
@@ -342,8 +341,6 @@ $firma->getAll();
foreach($firma->result as $row)
$firma_arr[$row->firma_id]=$row->name;
$adresstyp_arr = array('h'=>'Hauptwohnsitz','n'=>'Nebenwohnsitz','f'=>'Firma');
//Kontakttypen laden
$kontakttyp_arr = array();
$kontakt_obj = new kontakt();
@@ -369,7 +366,7 @@ foreach ($adresse_obj->result as $row)
echo "<td>$row->ort</td>";
echo "<td>$row->gemeinde</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->zustelladresse?'Ja':'Nein')."</td>";
echo "<td>".($row->firma_id!=''?$firma_arr[$row->firma_id]:'')."</td>";
@@ -426,15 +423,19 @@ else
}
echo "</SELECT></td>";
$adressetyp = new adressentyp();
$adressetyp->getAll();
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';
else
$selected='';
echo "<OPTION value='$code' $selected>$kurzbz</OPTION>";
echo "<OPTION value='". $row->adressentyp ."' $selected>$row->bezeichnung</OPTION>";
}
echo "</SELECT></td>";
echo "<td><input type='checkbox' name='heimatadresse' ".($heimatadresse?'checked':'')." /></td>";
+1 -3
View File
@@ -191,8 +191,6 @@ $nation_arr['']='';
foreach($nation->nation as $row)
$nation_arr[$row->code]=$row->kurztext;
$adresstyp_arr = array(''=>'','h'=>'Hauptwohnsitz','n'=>'Nebenwohnsitz','f'=>'Firma');
// *** ADRESSEN ***
echo '<h3>Adressen:</h3>';
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->gemeinde</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->zustelladresse?'Ja':'Nein')."</td>";
$firma=new firma();