incs/saveNchange.php neu geschrieben: Adressen, Telefonnummern, Kontakte, Notizen und Konten laufen ueber db_abfrage() mit Platzhaltern, mehrschrittiges Speichern in einer Transaktion. Weil sich die Speicherfunktionen gegenseitig aufrufen, klammern beginneSpeichern()/beendeSpeichern() die Verschachtelung; incs/rechnung.php nutzt sie ebenfalls. Kunden- und Lieferantenseiten waren zwei fast gleiche Kopien und teilen sich jetzt partnerAddSeite(), partnerChangeSeite() und partnerShowDaten(). Dabei behoben: - SQL-Injektion ueber die Suchbegriffe der Kunden-, Lieferanten-, Adress-, Kommissions- und Projektsuche sowie ueber die Artikel-Autovervollstaendigung - gespeichertes XSS: Notizen (nl2br escapt nicht), Bankname, Dokumenttyp, Namen und Adressen in allen Trefferlisten - sites/liefershow.php war unter PHP 8 ein Fatal ($kdnres.id) - "Telefonnummer loeschen" im Kundenbereich lief in einen Fatal, die Nummern einer geloeschten Adresse blieben stehen (Spalte hiess adress_id statt adresse_id, mysql_fetch_assoc gibt es nicht mehr) - Geburtstag ohne Jahr wurde im Formular verschluckt, die IBAN kam beim Bearbeiten aus $_GET statt aus dem Konto - die Versionskette eines Kunden brach nach einem Schritt ab - Kommissionsadressen speicherten die Ortsangabe der Adresse statt der des Telefonformulars und einen Adresstyp als Telefontyp - Blaettern in den Trefferlisten: ohne ORDER BY konnte dieselbe Zeile zweimal oder gar nicht erscheinen; ajax_searchadress() bekam die Seite nicht - Hauptadresse laesst sich nicht mehr loeschen, Kundendaten nicht mehr ueber die Lieferantenseite (und umgekehrt) - ajax/auto/* baute JSON von Hand zusammen, ein Anfuehrungszeichen im Ort machte die Liste unbrauchbar Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
199 lines
6.6 KiB
Smarty
199 lines
6.6 KiB
Smarty
|
|
{include file="heading.tpl" heading=$head}
|
|
|
|
<div class="widthlimiter">
|
|
<form action="?action={$frmact}&do=adress&kunde={$kunde|escape}&formsent=1&adressid={$adressid|intval}" name="mainform" method='POST'>
|
|
|
|
<fieldset>
|
|
<label>Adresstyp:</label><select name="typ" id="typ" >
|
|
{if $typ == 1}
|
|
<option value='1'>Hauptadresse</option>
|
|
{else}
|
|
{html_options values=$typids output=$typs selected="{$typ}"}
|
|
{/if}
|
|
</select><br />
|
|
<label>Firma:</label><input name='firma' id='firma' value="{$firma|escape}" /><br />
|
|
<label>Straße/Hausnr:</label><input name='str' id='str' value="{$str|escape}" pattern="[^0-9]*" /><input name='hnr' id='hnr' value="{$hnr|escape}" pattern="([0-9/a-zA-Z-\s\/]*[-/])?[0-9/a-zA-Z-\s\/]*" /><br />
|
|
<label>PLZ/Ort:</label><input name='plz' id='plz' value="{$plz|escape}" pattern="[0-9/a-zA-Z-]*" /><input name='ort' id='ort' value="{$ort|escape}" pattern="[^0-9]*" /><br />
|
|
<label>Ortsteil:</label><input name='oteil' id='oteil' value="{$oteil|escape}" pattern="[^0-9]*" /><br />
|
|
<label>Land:</label><input name='land' id='land' value="{$land|escape}" pattern="[^0-9]*" /><br />
|
|
<label>Zusatz:</label><input name='zusatz' id='zusatz' value="{$zusatz|escape}" /><br />
|
|
<input type="hidden" name='overwrite' id='overwrite' value="0" />
|
|
<button type="button" class='spell' onclick="$('textarea:not(#personalnotes,#globalnotes),input:not([type=radio])').spellCheckInDialog()">Rechtschreibung prüfen</button><br />
|
|
</fieldset>
|
|
|
|
<fieldset>
|
|
<legend>Erste Person</legend>
|
|
<label>Anrede:</label><select name="anrede" id="anrede" >
|
|
{html_options values=$anrids output=$anrs selected="{$anrede}"}
|
|
</select><br />
|
|
<label>Titel:</label><select name="titel" id="titel" >
|
|
{html_options values=$titelids output=$titels selected="{$titel}"}
|
|
</select><br />
|
|
<label>Vorname:</label><input name='vname' id='vname' value="{$vname|escape}" pattern="[^0-9]*" /><br />
|
|
<label>Nachname:</label><input name='nname' id='nname' value="{$nname|escape}" pattern="[^0-9]*" /><br />
|
|
<label>Geburtsdatum:</label><input name='gebdat' id='gebdat' value="{$gebdat|escape}" pattern="\d{ldelim}2{rdelim}\.\d{ldelim}2{rdelim}(\.\d{ldelim}4{rdelim})?" /><br />
|
|
</fieldset>
|
|
|
|
<fieldset>
|
|
<legend>Zweite Person</legend>
|
|
<label>Anrede 2:</label><select name="anrede2" id="anrede2" >
|
|
{html_options values=$anrids output=$anrs selected="{$anrede2}"}
|
|
</select><br />
|
|
<label>Titel 2:</label><select name="titel2" id="titel2" >
|
|
{html_options values=$titelids output=$titels selected="{$titel2}"}
|
|
</select><br />
|
|
<label>Vorname2:</label><input name='vname2' id='vname2' value="{$vname2|escape}" pattern="[^0-9]*" /><br />
|
|
<label>Nachname2:</label><input name='nname2' id='nname2' value="{$nname2|escape}" pattern="[^0-9]*" /><br />
|
|
<label>Geburtsdatum2:</label><input name='gebdat2' id='gebdat2' value="{$gebdat2|escape}" pattern="\d{ldelim}2{rdelim}\.\d{ldelim}2{rdelim}(\.\d{ldelim}4{rdelim})?" /><br />
|
|
</fieldset>
|
|
|
|
|
|
<fieldset id='telset'>
|
|
<legend>Telefon:</legend>
|
|
<label>Nummer:</label><input name='nr' id='nr' value="{$nr|escape}" pattern="[0-9-]*" /><br />
|
|
<label>Vorwahl:</label><input name='vwahl' id='vwahl' value="{$vwahl|escape}" pattern="[0-9]*" /><br />
|
|
<label>PLZ/Ort:</label><input name='telplz' id='telplz' value="{$telplz|escape}" pattern="[0-9/a-zA-Z-]*" /><input name='telort' id='telort' value="{$telort|escape}" pattern="[^0-9]*" /><br />
|
|
<label>Ortsteil:</label><input name='teloteil' id='teloteil' value="{$teloteil|escape}" pattern="[^0-9]*" /><br />
|
|
<label>Land:</label><input name='telland' id='telland' value="{$telland|escape}" pattern="[^0-9]*" /><br />
|
|
<button type="button" class='spell' onclick="$('textarea:not(#personalnotes,#globalnotes),input:not([type=radio])').spellCheckInDialog()">Rechtschreibung prüfen</button><br />
|
|
</fieldset>
|
|
|
|
<br />
|
|
{if $adressid > 0}
|
|
<button type='button' onClick='askoverwrite("Möchten Sie sämtliche alte Rechnungen auf diese Adresse auch ändern?")' name='ask'>Speichern</button>
|
|
{else}
|
|
<button type='button' onClick='document.getElementById("overwrite").value = 1;document.forms["mainform"].submit();' name='ask'>Speichern</button>
|
|
{/if}
|
|
</form>
|
|
</div>
|
|
|
|
<script>
|
|
if($("#typ").val() == 5)
|
|
{
|
|
$("#telset").show();
|
|
}
|
|
else
|
|
{
|
|
$("#telset").hide();
|
|
}
|
|
$("#typ").change(function() {
|
|
if($("#typ").val() == 5)
|
|
{
|
|
$("#telset").show();
|
|
}
|
|
else
|
|
{
|
|
$("#telset").hide();
|
|
}
|
|
});
|
|
$(function() {
|
|
$( "#str" ).autocomplete({
|
|
source: "ajax/auto/str.php",
|
|
minLength: 2,
|
|
focus: function( event, ui ) {
|
|
$( "#ort" ).val( ui.item.ort);
|
|
$( "#plz" ).val( ui.item.plz);
|
|
$( "#oteil" ).val( ui.item.otl);
|
|
$( "#land" ).val( ui.item.lnd);
|
|
return false;
|
|
}
|
|
});
|
|
});
|
|
$(function() {
|
|
$( "#plz" ).autocomplete({
|
|
source: "ajax/auto/plz.php",
|
|
minLength: 2,
|
|
focus: function( event, ui ) {
|
|
$( "#ort" ).val( ui.item.ort);
|
|
$( "#land" ).val( ui.item.lnd);
|
|
return false;
|
|
}
|
|
});
|
|
});
|
|
$(function() {
|
|
$( "#ort" ).autocomplete({
|
|
source: "ajax/auto/ort.php",
|
|
minLength: 2,
|
|
focus: function( event, ui ) {
|
|
$( "#land" ).val( ui.item.lnd);
|
|
$( "#plz" ).val( ui.item.plz);
|
|
return false;
|
|
}
|
|
});
|
|
});
|
|
$(function() {
|
|
$( "#oteil" ).autocomplete({
|
|
source: "ajax/auto/oteil.php",
|
|
minLength: 2,
|
|
focus: function( event, ui ) {
|
|
$( "#ort" ).val( ui.item.ort);
|
|
$( "#land" ).val( ui.item.lnd);
|
|
$( "#plz" ).val( ui.item.plz);
|
|
return false;
|
|
}
|
|
});
|
|
});
|
|
$(function() {
|
|
$( "#vwahl" ).autocomplete({
|
|
source: "ajax/auto/vwahl.php",
|
|
minLength: 2,
|
|
focus: function( event, ui ) {
|
|
$( "#telplz" ).val( ui.item.plz);
|
|
$( "#telort" ).val( ui.item.ort);
|
|
$( "#telland" ).val( ui.item.lnd);
|
|
$( "#teloteil" ).val( ui.item.otl);
|
|
return false;
|
|
}
|
|
});
|
|
});
|
|
$(function() {
|
|
$( "#telplz" ).autocomplete({
|
|
source: "ajax/auto/plz.php",
|
|
minLength: 2,
|
|
focus: function( event, ui ) {
|
|
$( "#telort" ).val( ui.item.ort);
|
|
$( "#telland" ).val( ui.item.lnd);
|
|
$( "#vwahl" ).val( ui.item.vwl);
|
|
return false;
|
|
}
|
|
});
|
|
});
|
|
$(function() {
|
|
$( "#telort" ).autocomplete({
|
|
source: "ajax/auto/ort.php",
|
|
minLength: 2,
|
|
focus: function( event, ui ) {
|
|
$( "#telland" ).val( ui.item.lnd);
|
|
$( "#telplz" ).val( ui.item.plz);
|
|
$( "#vwahl" ).val( ui.item.vwl);
|
|
return false;
|
|
}
|
|
});
|
|
});
|
|
$(function() {
|
|
$( "#teloteil" ).autocomplete({
|
|
source: "ajax/auto/oteil.php",
|
|
minLength: 2,
|
|
focus: function( event, ui ) {
|
|
$( "#telort" ).val( ui.item.ort);
|
|
$( "#telland" ).val( ui.item.lnd);
|
|
$( "#telplz" ).val( ui.item.plz);
|
|
$( "#vwahl" ).val( ui.item.vwl);
|
|
return false;
|
|
}
|
|
});
|
|
});
|
|
$(function() {
|
|
$( "#telland" ).autocomplete({
|
|
source: "ajax/auto/land.php",
|
|
minLength: 2,
|
|
focus: function( event, ui ) {
|
|
return false;
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
|
|
<div id="question">
|
|
</div> |