563 lines
27 KiB
PHP
563 lines
27 KiB
PHP
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/header.php"); ?>
|
|
<!-- start page title -->
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="page-title-box">
|
|
<div class="page-title-right">
|
|
<ol class="breadcrumb m-0">
|
|
<li class="breadcrumb-item"><a href="<?=self::getUrl("Dashboard")?>"><?=MFAPPNAME_SLUG?></a></li>
|
|
<li class="breadcrumb-item"><a href="<?=self::getUrl("Preordercampaign")?>">Vorbestellung</a></li>
|
|
<li class="breadcrumb-item active"><?=($campaign->id) ? "bearbeiten" : "Neu" ?></li>
|
|
</ol>
|
|
</div>
|
|
<h4 class="page-title">Vorbestellung</h4>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- end page title -->
|
|
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<h4 class="header-title mb-2"><?=($preorder->id) ? "Vorbestellung bearbeiten" : "Neue Vorbestellung"?></h4>
|
|
|
|
<form class="form-horizontal" method="post" action="<?=self::getUrl("Preorder", "save", ['preordercampaign_id' => $campaign->id])?>">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
|
|
<input type="hidden" name="id" value="<?=$preorder->id?>" />
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="network_id">Vorbestellkampagne</label>
|
|
<div class="col-lg-10">
|
|
<input type="hidden" name="campaign_id" id="campaign_id" value="<?=$campaign->id?>" />
|
|
<input type="text" class="form-control" value="<?=$campaign->name?>" readonly="readonly"/>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="network_id">Netzgebiet</label>
|
|
<div class="col-lg-10">
|
|
<input type="hidden" name="network_id" id="network_id" value="<?=$campaign->network_id?>" />
|
|
<input type="text" class="form-control" value="<?=$campaign->network->name?>" readonly="readonly" />
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="price">Adresse *</label>
|
|
<div class="col-lg-10">
|
|
<select class="form-control" name="adb_hausnummer_id" id="adb_hausnummer_id" />
|
|
<?php if($preorder->adb_hausnummer_id): ?>
|
|
<option value="<?=$preorder->adb_hausnummer_id?>" selected="selected"><?=$preorder->adb_hausnummer->plz->plz?> <?=$preorder->adb_hausnummer->strasse->ortschaft->name?>, <?=$preorder->adb_hausnummer->strasse->name?> <?=$preorder->adb_hausnummer->hausnummer?></option>
|
|
<?php endif; ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="price">Wohneinheit *</label>
|
|
<div class="col-lg-10">
|
|
<select class="form-control" name="adb_wohneinheit_id" id="adb_wohneinheit_id" />
|
|
<?php if($preorder->adb_wohneinheit_id): ?>
|
|
<option value="<?=$preorder->adb_wohneinheit_id?>" selected="selected"><?=$preorder->adb_hausnummer->strasse->name?> <?=$preorder->adb_hausnummer->hausnummer?> <?=$preorder->adb_wohneinheit?></option>
|
|
<?php endif; ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="product_id">Vertriebspartner</label>
|
|
<div class="col-lg-10">
|
|
<select class="form-control" name="partner_id" id="partner_id">
|
|
<option value=""></option>
|
|
<?php foreach($partners as $partner): ?>
|
|
<option value="<?=$partner->id?>" <?=($preorder->partner_id == $partner->id) ? "selected='selected'" : ""?>><?=$partner->getCompanyOrName()?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="preorder-form" class="mt-4">
|
|
<h4>Vorbestellung & Produkt</h4>
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="type">Vorbestelltyp *</label>
|
|
<div class="col-lg-10">
|
|
<select class="form-control" name="type" id="type">
|
|
<?php if(array_key_exists("interest", $campaign->types)): ?><option value="interest" <?=($preorder->type == "interest") ? "selected='selected'" : ""?>>Interessensbekundung</option><?php endif; ?>
|
|
<?php if(array_key_exists("provision", $campaign->types)): ?><option value="provision" <?=($preorder->type == "provision") ? "selected='selected'" : ""?>>Vorsorgeanschluss</option><?php endif; ?>
|
|
<?php if(array_key_exists("order", $campaign->types)): ?><option value="order" <?=($preorder->type == "order") ? "selected='selected'" : ""?>>Vollanschluss</option><?php endif; ?>
|
|
<?php if(array_key_exists("reorder", $campaign->types)): ?><option value="reorder" <?=($preorder->type == "reorder") ? "selected='selected'" : ""?>>Nachbestellung</option><?php endif; ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="connection_type">Anschlusstyp *</label>
|
|
<div class="col-lg-10">
|
|
<select class="form-control" name="connection_type" id="connection_type">
|
|
<option value="single-dwelling" <?=($preorder->connection_type == "single-dwelling") ? "selected='selected'" : ""?>>Einfamilienhaus</option>
|
|
<option value="multi-dwelling" <?=($preorder->connection_type == "multi-dwelling") ? "selected='selected'" : ""?>>Mehrfamilienhaus</option>
|
|
<option value="apartment-building" <?=($preorder->connection_type == "apartment-building") ? "selected='selected'" : ""?>>Mehrparteienhaus</option>
|
|
<option value="apartment" <?=($preorder->connection_type == "apartment") ? "selected='selected'" : ""?>>Wohneinheit in Mehrparteienhaus</option>
|
|
<option value="business" <?=($preorder->connection_type == "business") ? "selected='selected'" : ""?>>Gewerbebetrieb</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="connection_count">Anzahl Anschlüsse</label>
|
|
<div class="col-lg-10">
|
|
<input type="text" class="form-control" name="connection_count" id="connection_count" value="<?=$preorder->connection_count?>" placeholder="1" />
|
|
</div>
|
|
</div>
|
|
|
|
<input type="hidden" name="setup_product_id" id="setup_product_id" value="<?=$preorder->setup_product_id?>" />
|
|
|
|
<?php if($campaign->product_type != "no_setup" && is_array($campaign->setup_products) && count($campaign->setup_products)): ?>
|
|
<?php if(is_array($campaign->setup_products['provision']) && count($campaign->setup_products['provision'])): ?>
|
|
<div class="form-group row" id="setup-provision">
|
|
<label class="col-lg-2 col-form-label" for="">Anschlussprodukt (Herstellung) *</label>
|
|
<div class="col-lg-10">
|
|
<input type="hidden" class="form-control value <?=(count($campaign->setup_products['provision']) == 1) ? "" : "hidden" ?>" data-price="<?=$campaign->setup_products['provision'][0]->price_setup?>" value="<?=(count($campaign->setup_products['provision']) == 1) ? $campaign->setup_products['provision'][0]->id : ""?>" readonly="readonly" />
|
|
<input type="text" class="form-control text <?=(count($campaign->setup_products['provision']) == 1) ? "" : "hidden" ?>" value="<?=(count($campaign->setup_products['provision'])) ? $campaign->setup_products['provision'][0]->name : ""?>" readonly="readonly" />
|
|
|
|
<select class="form-control select <?=(count($campaign->setup_products['provision']) < 2) ? "hidden" : "" ?>" onchange="updateSetupProduct('provision')">
|
|
<option value="0"></option>
|
|
<?php foreach($campaign->setup_products['provision'] as $sp): ?>
|
|
<option data-price="<?=$sp->price_setup?>" value="<?=$sp->id?>" <?=($preorder->setup_product_id == $sp->id) ? "selected='selected'" : ""?>><?=$sp->name?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<?php if(is_array($campaign->setup_products['activation']) && count($campaign->setup_products['activation'])): ?>
|
|
<div class="form-group row" id="setup-activation">
|
|
<label class="col-lg-2 col-form-label" for="">Anschlussprodukt (Herstellung) *</label>
|
|
<div class="col-lg-10">
|
|
<input type="hidden" class="form-control value <?=(count($campaign->setup_products['activation']) == 1) ? "" : "hidden" ?>" data-price="<?=$campaign->setup_products['activation'][0]->price_setup?>" value="<?=(count($campaign->setup_products['activation']) == 1) ? $campaign->setup_products['activation'][0]->id : ""?>" readonly="readonly" />
|
|
<input type="text" class="form-control text <?=(count($campaign->setup_products['activation']) == 1) ? "" : "hidden" ?>" value="<?=(count($campaign->setup_products['activation'])) ? $campaign->setup_products['activation'][0]->name : ""?>" readonly="readonly" />
|
|
|
|
<select class="form-control select <?=(count($campaign->setup_products['activation']) < 2) ? "hidden" : "" ?>" onchange="updateSetupProduct('activation')">
|
|
<option value="0"></option>
|
|
<?php foreach($campaign->setup_products['activation'] as $sp): ?>
|
|
<option data-price="<?=$sp->price_setup?>" value="<?=$sp->id?>" <?=($preorder->setup_product_id == $sp->id) ? "selected='selected'" : ""?>><?=$sp->name?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
<?php endif; ?>
|
|
|
|
<?php if($campaign->product_type != "setup_only"): ?>
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="product_id">Internetprodukt</label>
|
|
<div class="col-lg-10">
|
|
<select class="form-control" name="product_id" id="product_id" onchange="updateProduct()">
|
|
<option value=""></option>
|
|
<?php foreach($products as $product): ?>
|
|
<option value="<?=$product->id?>" <?=($preorder->product_id == $product->id) ? "selected='selected'" : ""?>><?=$product->name?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="price_setup">Netto Preis Setup *</label>
|
|
<div class="col-lg-10">
|
|
<input type="text" class="form-control" name="price_setup" id="price_setup" value="<?=$preorder->price_setup?>" />
|
|
</div>
|
|
</div>
|
|
|
|
<?php if($campaign->product_type != "setup_only"): ?>
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="price">Netto Preis Periodisch</label>
|
|
<div class="col-lg-10">
|
|
<input type="text" class="form-control" name="price" id="price" value="<?=$preorder->price?>" />
|
|
</div>
|
|
</div>
|
|
|
|
<?php if($me->isAdmin()): ?>
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="price_nne">Preis NNE</label>
|
|
<div class="col-lg-10">
|
|
<input type="text" class="form-control" name="price_nne" id="price_nne" value="<?=$preorder->price_nne?>" />
|
|
</div>
|
|
</div>
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="price_nbe">Preis NBE</label>
|
|
<div class="col-lg-10">
|
|
<input type="text" class="form-control" name="price_nbe" id="price_nbe" value="<?=$preorder->price_nbe?>" />
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="billing_delay">Verzögerter Verrechnungsstart</label>
|
|
<div class="col-lg-10">
|
|
<input type="text" class="form-control" name="billing_delay" id="billing_delay" placeholder="Freimonate" value="<?=$preorder->billing_delay?>" />
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<h4 class="mt-4">Zustimmungen</h4>
|
|
<div class="form-group row">
|
|
<div class="col-lg-2"></div>
|
|
<div class="col-lg-10">
|
|
<label><input type="checkbox" name="accept_agb" id="accept_agb" value="1" disabled="disabled" checked="checked" /> AGB akzeptiert</label><br />
|
|
<label><input type="checkbox" name="accept_dsgvo" id="accept_dsgvo" value="1" disabled="disabled" checked="checked" /> DSGVO akzeptiert</label><br />
|
|
<label><input type="checkbox" name="accept_withdrawal" id="accept_withdrawal" value="1" disabled="disabled" checked="checked" /> Rücktrittsrecht akzeptiert</label><br />
|
|
<label><input type="checkbox" name="accept_marketing" id="accept_marketing" value="1" <?=($preorder->accept_marketing) ? "checked='checked'" : ""?> /> Datenweitergabe akzeptiert</label>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<h4 class="mt-4">Kundendaten</h4>
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="company">Firma</label>
|
|
<div class="col-lg-10">
|
|
<input type="text" class="form-control" name="company" id="company" value="<?=$preorder->company?>" />
|
|
</div>
|
|
</div>
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="uid">UID</label>
|
|
<div class="col-lg-10">
|
|
<input type="text" class="form-control" name="uid" id="uid" value="<?=$preorder->uid?>" />
|
|
</div>
|
|
</div>
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="firstname">Vorname *</label>
|
|
<div class="col-lg-10">
|
|
<input type="text" class="form-control" name="firstname" id="firstname" value="<?=$preorder->firstname?>" />
|
|
</div>
|
|
</div>
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="lastname">Nachname *</label>
|
|
<div class="col-lg-10">
|
|
<input type="text" class="form-control" name="lastname" id="lastname" value="<?=$preorder->lastname?>" />
|
|
</div>
|
|
</div>
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="street">Straße *</label>
|
|
<div class="col-lg-10">
|
|
<input type="text" class="form-control" name="street" id="street" value="<?=$preorder->street?>" />
|
|
</div>
|
|
</div>
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="zip">PLZ / Ort *</label>
|
|
<div class="col-lg-3">
|
|
<input type="text" class="form-control" name="zip" id="zip" value="<?=$preorder->zip?>" />
|
|
</div>
|
|
<div class="col-lg-7">
|
|
<input type="text" class="form-control" name="city" id="city" value="<?=$preorder->city?>" />
|
|
</div>
|
|
</div>
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="phone">Telefon</label>
|
|
<div class="col-lg-10">
|
|
<input type="text" class="form-control" name="phone" id="phone" value="<?=$preorder->phone?>" />
|
|
</div>
|
|
</div>
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="email">Email</label>
|
|
<div class="col-lg-10">
|
|
<input type="text" class="form-control" name="email" id="email" value="<?=$preorder->email?>" />
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="note">Interne Notiz</label>
|
|
<div class="col-lg-10">
|
|
<textarea id="note" class="form-control" name="note" rows="5"><?=$preorder->note?></textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2"></label>
|
|
<div class="col-lg-10">
|
|
<button type="submit" class="btn btn-primary">Speichern</button>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function() {
|
|
|
|
<?php if($preorder->type != "provision"): ?>
|
|
$('#setup-provision').hide();
|
|
<?php endif; ?>
|
|
<?php if($preorder->type != "order"): ?>
|
|
$('#setup-activation').hide();
|
|
<?php endif; ?>
|
|
|
|
|
|
if($('#type').val() == "provision") {
|
|
$('#setup-provision').show();
|
|
if(!$("#price_setup").val()) {
|
|
$("#price_setup").val($("#setup-provision input.value").data("price"));
|
|
}
|
|
<?php if(count($campaign->setup_products['provision']) == 1): ?>
|
|
$("#setup_product_id").val($("#setup-provision input.value").val());
|
|
<?php endif; ?>
|
|
}
|
|
|
|
if($('#type').val() == "order") {
|
|
$('#setup-activation').show();
|
|
if(!$("#price_setup").val()) {
|
|
$("#price_setup").val($("#setup-provision input.value").data("price"));
|
|
}
|
|
<?php if(count($campaign->setup_products['activation']) == 1): ?>
|
|
$("#setup_product_id").val($("#setup-activation input.value").val());
|
|
<?php endif; ?>
|
|
}
|
|
|
|
|
|
$("#product_id").select2({
|
|
allowClear: true,
|
|
placeholder: ""
|
|
});
|
|
$("#partner_id").select2({
|
|
allowClear: true,
|
|
placeholder: ""
|
|
});
|
|
|
|
/**********************
|
|
* Event handler
|
|
**********************/
|
|
// show Building Search when selecting Network
|
|
$('#network_id').change(function() {
|
|
var network_id = $('#network_id').val();
|
|
if(network_id) {
|
|
$('#building-search').show();
|
|
$('#building_id_search').focus();
|
|
} else {
|
|
$('#building-search').hide();
|
|
resetBuildingSearch();
|
|
}
|
|
});
|
|
|
|
|
|
$('#adb_hausnummer_id').select2({
|
|
ajax: {
|
|
url: '<?=self::getUrl("AddressDB", "api", ["do" => "findAddress", "campaign_id" => $campaign->id])?>',
|
|
delay: 250,
|
|
dataType: 'json'
|
|
},
|
|
minimumInputLength: 3,
|
|
placeholder: "Suche nach Straße, Hausnummer, Ort"
|
|
});
|
|
|
|
|
|
$('#adb_hausnummer_id').change(function() {
|
|
var hausnummer_id = $('#adb_hausnummer_id').val();
|
|
if(!hausnummer_id) return;
|
|
|
|
|
|
$.get('<?=self::getUrl("AddressDB", "Api")?>',
|
|
{
|
|
do: "getUnits",
|
|
hausnummer_id: hausnummer_id
|
|
},
|
|
function(success) {
|
|
if(success.status != "OK") {
|
|
return;
|
|
}
|
|
|
|
$('#adb_wohneinheit_id').empty();
|
|
$('#adb_wohneinheit_id').append("<option></option>")
|
|
|
|
success.result.units.forEach(function(unit) {
|
|
let opt = "<option value='" + unit.id + "'>";
|
|
opt += unit.zip + " " + unit.city + ", " + unit.street + " " + unit.housenumber;
|
|
if(unit.extra) {
|
|
opt += " " + unit.extra;
|
|
}
|
|
|
|
/*let extras = new Array();
|
|
if(unit.block) extras.push("Block " + unit.block);
|
|
if(unit.stiege) extras.push("Stiege " + unit.stiege);
|
|
if(unit.stock) extras.push("Stock " + unit.stock);
|
|
if(unit.tuer) extras.push("Tür " + unit.tuer);
|
|
if(unit.zusatz) extras.push(unit.zusatz);
|
|
|
|
if(extras.length) {
|
|
opt += " " + extras.join(", ");
|
|
}*/
|
|
|
|
if(unit.nutzung) {
|
|
opt += " " + unit.nutzung;
|
|
}
|
|
|
|
opt += "</option>";
|
|
$('#adb_wohneinheit_id').append(opt);
|
|
$('#adb_wohneinheit_id').addClass("is-invalid");
|
|
$('#adb_wohneinheit_id')
|
|
.data("zip", unit.zip)
|
|
.data("city", unit.city)
|
|
.data("street", unit.street)
|
|
.data("housenumber", unit.housenumber)
|
|
.data("block", unit.block)
|
|
.data("stiege", unit.stiege)
|
|
.data("stock", unit.stock)
|
|
.data("tuer", unit.tuer)
|
|
.data("zusatz", unit.zusatz);
|
|
|
|
afterHausnummerChange();
|
|
|
|
});
|
|
|
|
},
|
|
"json");
|
|
});
|
|
|
|
$('#adb_wohneinheit_id').change(function() {
|
|
val = $('#adb_wohneinheit_id').val();
|
|
|
|
if($('#adb_wohneinheit_id option').length < 2) return;
|
|
|
|
if(val) {
|
|
$('#adb_wohneinheit_id').removeClass("is-invalid");
|
|
|
|
if(!$('input[name=street]').val() && !$('input[name=zip]').val() && !$('input[name=city]').val()) {
|
|
$('input[name=street]').val($('#adb_wohneinheit_id').data("street") + " " + $('#adb_wohneinheit_id').data("housenumber"));
|
|
$('input[name=zip]').val($('#adb_wohneinheit_id').data("zip"));
|
|
$('input[name=city]').val($('#adb_wohneinheit_id').data("city"));
|
|
}
|
|
|
|
} else {
|
|
$('#adb_wohneinheit_id').addClass("is-invalid");
|
|
}
|
|
});
|
|
|
|
$('#type').change(function() {
|
|
var type = $('#type').val();
|
|
var pid = 0;
|
|
var price = 0;
|
|
|
|
$("#price_setup").val("");
|
|
|
|
if(type == "interest") {
|
|
$('#setup-provision').hide();
|
|
$('#setup-activation').hide();
|
|
$('#setup_product_id').val("");
|
|
$("#price_setup").val("");
|
|
} else if(type == "provision") {
|
|
$('#setup-provision').show();
|
|
$('#setup-activation').hide();
|
|
$('#setup_product_id').val("");
|
|
if($("#setup-provision input.value").val()) {
|
|
pid = $("#setup-provision input.value").val();
|
|
price = $("#setup-provision input.value").data("price");
|
|
$("#setup_product_id").val(pid);
|
|
$("#price_setup").val(price);
|
|
}
|
|
$("#setup-activation select").val("0");
|
|
} else if(type == "order") {
|
|
$('#setup-provision').hide();
|
|
$('#setup-activation').show();
|
|
$('#setup_product_id').val("");
|
|
if($("#setup-activation input.value").val()) {
|
|
pid = $("#setup-activation input.value").val();
|
|
price = $("#setup-activation input.value").data("price");
|
|
$("#setup_product_id").val(pid);
|
|
$("#price_setup").val(price);
|
|
}
|
|
$("#setup-provision select").val("0");
|
|
}
|
|
});
|
|
|
|
|
|
<?php if($preorder->adb_hausnummer_id): ?>
|
|
console.log("Hausnummer");
|
|
$('#adb_hausnummer_id').trigger("change");
|
|
// afterHausnummerChange() will be called by change event
|
|
<?php endif; ?>
|
|
});
|
|
|
|
|
|
|
|
function afterHausnummerChange() {
|
|
<?php if($preorder->adb_wohneinheit_id): ?>
|
|
console.log("selecting wohneinheit");
|
|
$('#adb_wohneinheit_id option[value=<?=$preorder->adb_wohneinheit_id?>]').prop("selected", true);
|
|
$('#adb_wohneinheit_id').trigger("change");
|
|
<?php endif; ?>
|
|
}
|
|
|
|
function updateSetupProduct(type) {
|
|
if(type == "provision") {
|
|
$('#setup_product_id').val($("#setup-provision select").val());
|
|
var price = $("#setup-provision select option:selected").data("price");
|
|
$("#price_setup").val(price);
|
|
} else if(type == "activation") {
|
|
$('#setup_product_id').val($("#setup-activation select").val());
|
|
var price = $("#setup-activation select option:selected").data("price");
|
|
$("#price_setup").val(price);
|
|
} else {
|
|
$("#price_setup").val("");
|
|
}
|
|
}
|
|
|
|
|
|
function showPreorderForm() {
|
|
|
|
}
|
|
|
|
function showTerminationSearch() {
|
|
|
|
}
|
|
|
|
|
|
function updateProduct() {
|
|
var pid = $('#product_id').val();
|
|
if(!pid) {
|
|
return false;
|
|
}
|
|
|
|
$.get("<?=self::getUrl("Product", "Api")?>",
|
|
{
|
|
"do": "getProduct",
|
|
product_id: pid,
|
|
form_id: 0
|
|
},
|
|
function (success) {
|
|
//console.log(success);
|
|
p = success.result.product;
|
|
|
|
$('#billing_delay').val(p.billing_delay);
|
|
$('#billing_period').val(p.billing_period);
|
|
$('#price').val(p.price);
|
|
//$('#price_setup').val(p.price_setup);
|
|
$('#price_nne').val(p.price_nne);
|
|
$('#price_nbe').val(p.price_nbe);
|
|
},
|
|
'json');
|
|
|
|
}
|
|
</script>
|
|
|
|
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>
|