Merge branch 'fronkdev' into 'master'

Finished IvtProductMatch

See merge request fronk/thetool!94
This commit is contained in:
Frank Schubert
2023-10-03 18:02:53 +00:00
8 changed files with 208 additions and 71 deletions

View File

@@ -21,48 +21,62 @@
</div>
</div>
<!-- end page title -->
<div class="row">
<div class="col-12">
<form method="post" action="<?=self::getUrl("Admin", "saveIvtImportMatchProducts")?>">
<input type="hidden" name="s" value="<?=$pagination['start']?>" />
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination.php"); ?>
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination-summary.php"); ?>
<table class="table table-sm table-striped table-hover">
<tr>
<th class="text-right">IVT Produkt</th>
<th>Preis</th>
<th>Interval</th>
<th>Typ</th>
<th></th>
<th style="border-left: 1px solid #000">thetool Produkt</th>
<th>ivt_id hinterlegt</th>
</tr>
<?php foreach($ivtproducts as $ip): ?>
<?php $match = false; ?>
<table class="table table-sm table-striped table-hover">
<tr>
<td class="text-right"><?=$ip->name?></td>
<td><?=$ip->price?></td>
<td><?=$ip->interval?></td>
<td><?=$ip->typ?></td>
<td><?=$ip->id?></td>
<td style="border-left: 1px solid #000">
<select class="form-control" name="product[<?=$ip->id?>]" id="product_<?=$ip->id?>">
<option></option>
<?php foreach($products as $p): ?>
<?php if($p->ivt_id == $ip->id) $match = "prod"; ?>
<option value="<?=$p->id?>" <?=($p->ivt_id == $ip->id) ? "selected='selected'" : ""?>><?=$p->name?></option>
<?php endforeach; ?>
</select>
</td>
<td><?=($match == "prod") ? "<i class='fas fa-check text-success'></i>" : ""?></td>
<th>IVT ID</th>
<th class="text-right">IVT Produkt</th>
<th>Preis</th>
<th>Interval</th>
<th>Typ</th>
<th></th>
<th style="border-left: 1px solid #000">thetool Produkt</th>
<th>ivt_id hinterlegt</th>
</tr>
<?php endforeach; ?>
</table>
<?php foreach($ivtproducts as $ip): ?>
<?php $match = false; ?>
<tr>
<td><?=$ip->id?></td>
<td class="text-right"><?=$ip->name?></td>
<td><?=$ip->price?></td>
<td><?=$ip->interval?></td>
<td><?=$ip->typ?></td>
<td><?=$ip->id?></td>
<td style="border-left: 1px solid #000">
<select class="form-control" name="product[<?=$ip->id?>]" id="product_<?=$ip->id?>">
<option></option>
<?php foreach($products as $p): ?>
<?php if($ip->match): ?>
<option value="<?=$p->id?>" <?=($p->id == $ip->match->product_id) ? "selected='selected'" : ""?>><?=$p->name?></option>
<?php else: ?>
<?php if($p->ivt_id == $ip->id) $match = "prod"; ?>
<option value="<?=$p->id?>" <?=($p->ivt_id == $ip->id) ? "selected='selected'" : ""?>><?=$p->name?></option>
<?php endif; ?>
<?php endforeach; ?>
</select>
</td>
<td><?=($match == "prod") ? "<i class='fas fa-check text-success'></i>" : ""?></td>
</tr>
<?php endforeach; ?>
</table>
<div class="text-right">
<button type="submit" class="btn btn-success">Speichern</button>
</div>
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination-summary.php"); ?>
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination.php"); ?>
</form>
</div>
</div>
<script type="text/javascript">

View File

@@ -191,6 +191,8 @@
</div>
</div>
<hr />
<div class="form-group">
<input type="submit" name="submit" value="Speichern" class="btn btn-primary" />
</div>