WIP PreorderPrice 2025-02-21
This commit is contained in:
@@ -30,36 +30,61 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<form class="form-inline" type="get" action="<?=self::getUrl("PreorderProduct")?>">
|
||||
<div class="form-group mx-sm-3 mb-2">
|
||||
<label for="view_date">Ansichtsdatum:</label>
|
||||
<input type="text" class="form-control datepicker-sys ml-2" name="view_date" placeholder="Datum..." value="<?=$today_date?>" />
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary mb-2">Anzeigen</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<?php foreach($netoperators as $netoperator): // TODO: Netoperators als Tabs anzeigen ?>
|
||||
<h4><span class="text-pink"><?=$netoperator->getCompanyOrName()?> (<?=$netoperator->id?>)</span></h4>
|
||||
<?php //foreach([new Address(5668), new Address(4803)] as $netoperator): // TODO: Netoperators als Tabs anzeigen ?>
|
||||
<h4><?=$netoperator->getCompanyOrName()?> (<?=$netoperator->id?>)</h4>
|
||||
<div class="card">
|
||||
<div class="card-body mb-3">
|
||||
<form method="post" action="<?=self::getUrl("PreorderProduct", "save")?>">
|
||||
|
||||
<h4>Produkte</h4>
|
||||
<?php foreach($products as $product): ?>
|
||||
<?php $product->setNetoperatorId($netoperator->id) ?>
|
||||
<?php $prices = (array_key_exists($netoperator->id, $product->prices)) ? $product->prices[$netoperator->id] : false; ?>
|
||||
<?php //var_dump($prices); ?>
|
||||
<?php $product->setNetoperatorId($netoperator->id) ?>
|
||||
<?php $product->setTodayDate($today_date); ?>
|
||||
<?php //$prices = (array_key_exists($netoperator->id, $product->prices)) ? $product->prices[$netoperator->id] : false; ?>
|
||||
<div class="card">
|
||||
<div class="card-body mb-3">
|
||||
<h4>Preiseinstellungen für <?=$product->name?></h4>
|
||||
<div class="card-header" >
|
||||
<h4 class="pointer"
|
||||
data-toggle="collapse" data-target="#price-detail-<?=$netoperator->id?>-<?=$product->id?>"
|
||||
id="price-detail-<?=$netoperator->id?>-<?=$product->id?>-collapse" data-collapse-indicator="fa-chevron" onclick="toggleCollapseIndicator(this)"
|
||||
>
|
||||
<i class="fas fa-fw fa-chevron-right collapse-indicator"></i> Preiseinstellungen für <span class="text-pink"><?=$product->name?></span>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="card-body mb-3 collapse" id="price-detail-<?=$netoperator->id?>-<?=$product->id?>">
|
||||
<?php if($product->type == "operator_setup"): ?>
|
||||
<?php include(__DIR__."/include/netoperator-prices-setup.php"); ?>
|
||||
<?php include(__DIR__."/include/prices-setup.php"); ?>
|
||||
<?php elseif($product->type == "enduser_setup"): ?>
|
||||
<?php include(__DIR__."/include/enduser-prices-setup.php"); ?>
|
||||
<?php elseif($product->type == "operatr_usage"): ?>
|
||||
<?php include(__DIR__."/include/prices-setup.php"); ?>
|
||||
<?php elseif($product->type == "operator_usage"): ?>
|
||||
<?php include(__DIR__."/include/netoperator-prices-usage.php"); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
<input type="submit" class="btn btn-primary mt-2" value="Speichern" />
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
@@ -83,5 +108,40 @@
|
||||
todayBtn: 'linked',
|
||||
autoclose: true
|
||||
});
|
||||
$('.datepicker-sys').datepicker({
|
||||
language: 'de',
|
||||
format: "yyyy-mm-dd",
|
||||
showWeekDays: true,
|
||||
todayBtn: 'linked',
|
||||
autoclose: true
|
||||
});
|
||||
|
||||
$(".select2").select2({
|
||||
allowClear: true,
|
||||
placeholder: "",
|
||||
closeOnSelect: true
|
||||
});
|
||||
|
||||
$(".select2-nc").select2({
|
||||
allowClear: true,
|
||||
placeholder: "",
|
||||
closeOnSelect: false
|
||||
});
|
||||
|
||||
function toggleCollapseIndicator(elem) {
|
||||
var selector = "#" + $(elem).attr("id");
|
||||
var itype = $(elem).data("collapse-indicator");
|
||||
|
||||
//console.log("selector: " + selector);
|
||||
|
||||
if($(selector + " i.collapse-indicator").hasClass(itype + "-right")) {
|
||||
$(selector + " i.collapse-indicator").removeClass(itype + "-right").addClass(itype + "-down");
|
||||
} else {
|
||||
$(selector + " i.collapse-indicator").removeClass(itype + "-down").addClass(itype + "-right");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>
|
||||
Reference in New Issue
Block a user