Added Order Form

This commit is contained in:
Frank Schubert
2021-07-29 20:08:43 +02:00
parent b908aec353
commit 1ae970564f
13 changed files with 1155 additions and 0 deletions
+383
View File
@@ -0,0 +1,383 @@
<?php include(realpath(dirname(__FILE__)."/../")."/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")?>">the-tool</a></li>
<li class="breadcrumb-item"><a href="<?=self::getUrl("Order")?>">Bestellungen</a></li>
<li class="breadcrumb-item active"><?=($order->id) ? "bearbeiten" : "Neu" ?></li>
</ol>
</div>
<h4 class="page-title">Bestellungen</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"><?=($order->id) ? "Bestellung bearbeiten" : "Neue Bestellung"?></h4>
<form class="form-horizontal" method="post" action="<?=self::getUrl("Order", "save")?>">
<div class="card">
<div class="card-body">
<input type="hidden" name="id" value="<?=$order->id?>" />
<div class="row">
<div class="col-lg-6">
<div class="form-group row">
<div class="col-lg-12 mb-2">
<h4>Vertragsinhaber</h4>
<select class="form-control" name="owner_id" id="owner_id">
<option></option>
<option value="new">Neu...</option>
<?php foreach($addresses as $address): ?>
<option value="<?=$address->id?>"><?=$address->getCompanyOrName()?> (<?=$address->zip?> <?=$address->city?>, <?=$address->street?>)</option>
<?php endforeach; ?>
</select>
</div>
<div class="col-lg-12 hidden" id="owner-form">
<div class="row">
<div class="col-lg-12">
<div class="form-group">
<label class="form-label" for="owner_company">Firmenname</label>
<textarea class="form-control" name="owner_company" id="owner_company"></textarea>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="form-group">
<label class="form-label" for="owner_firstname">Vorname</label>
<input type="text" class="form-control" name="owner_firstname" id="owner_firstname" value="" />
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<label class="form-label" for="owner_lastname">Nachname</label>
<input type="text" class="form-control" name="owner_lastname" id="owner_lastname" value="" />
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="form-group">
<label class="form-label" for="owner_street">Straße</label>
<input type="text" class="form-control" name="owner_street" id="owner_street" value="" />
</div>
</div>
</div>
<div class="row">
<div class="col-lg-3">
<div class="form-group">
<label class="form-label" for="owner_zip">Postleitzahl</label>
<input type="text" class="form-control" name="owner_zip" id="owner_zip" value="" />
</div>
</div>
<div class="col-lg-9">
<div class="form-group">
<label class="form-label" for="owner_city">Ort</label>
<input type="text" class="form-control" name="owner_city" id="owner_city" value="" />
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="form-group">
<label class="form-label" for="owner_country">Land</label>
<input type="text" class="form-control" name="owner_country" id="owner_country" value="" />
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="form-group">
<label class="form-label" for="owner_phone">Telefon</label>
<input type="text" class="form-control" name="owner_phone" id="owner_phone" value="" />
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<label class="form-label" for="owner_mobile">Mobil</label>
<input type="text" class="form-control" name="owner_mobile" id="owner_mobile" value="" />
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="form-group">
<label class="form-label" for="owner_email">Emailadresse</label>
<input type="text" class="form-control" name="owner_email" id="owner_email" value="" />
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<label class="form-label" for="owner_fax">Fax</label>
<input type="text" class="form-control" name="owner_fax" id="owner_fax" value="" />
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-6">
<div class="form-group row">
<div class="col-lg-12 mb-2">
<h4>Rechungsadresse</h4>
<select class="form-control" name="billingaddress_id" id="billingaddress_id">
<option></option>
<option value="new">Neu...</option>
<?php foreach($addresses as $address): ?>
<option value="<?=$address->id?>"><?=$address->getCompanyOrName()?> (<?=$address->zip?> <?=$address->city?>, <?=$address->street?>)</option>
<?php endforeach; ?>
</select>
</div>
<div class="col-lg-12 hidden" id="billingaddress-form">
<div class="row">
<div class="col-lg-12">
<div class="form-group">
<label class="form-label" for="owner_company">Firmenname</label>
<textarea class="form-control" name="billing_company" id="billing_company"></textarea>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="form-group">
<label class="form-label" for="billing_firstname">Vorname</label>
<input type="text" class="form-control" name="billing_firstname" id="billing_firstname" value="" />
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<label class="form-label" for="billing_lastname">Nachname</label>
<input type="text" class="form-control" name="billing_lastname" id="billing_lastname" value="" />
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="form-group">
<label class="form-label" for="billing_street">Straße</label>
<input type="text" class="form-control" name="billing_street" id="billing_street" value="" />
</div>
</div>
</div>
<div class="row">
<div class="col-lg-3">
<div class="form-group">
<label class="form-label" for="billing_zip">Postleitzahl</label>
<input type="text" class="form-control" name="billing_zip" id="billing_zip" value="" />
</div>
</div>
<div class="col-lg-9">
<div class="form-group">
<label class="form-label" for="billing_city">Ort</label>
<input type="text" class="form-control" name="billing_city" id="billing_city" value="" />
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="form-group">
<label class="form-label" for="billing_country">Land</label>
<input type="text" class="form-control" name="billing_country" id="billing_country" value="" />
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="form-group">
<label class="form-label" for="billing_phone">Telefon</label>
<input type="text" class="form-control" name="billing_phone" id="billing_phone" value="" />
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<label class="form-label" for="billing_mobile">Mobil</label>
<input type="text" class="form-control" name="billing_mobile" id="billing_mobile" value="" />
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="form-group">
<label class="form-label" for="billing_email">Emailadresse</label>
<input type="text" class="form-control" name="billing_email" id="billing_email" value="" />
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<label class="form-label" for="billing_fax">Fax</label>
<input type="text" class="form-control" name="billing_fax" id="billing_fax" value="" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<h4 class="header-title">Verrechnung</h4>
<div class="card">
<div class="card-body">
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="description">Rechnungsart</label>
<div class="col-lg-10">
<select class="form-control" name="billing_type">
<option value="sepa">SEPA Bankeinzug</option>
<option value="invoice">Rechnung</option>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="bank_account_bank">Kreitinstitut</label>
<div class="col-lg-10">
<input type="text" class="form-control" name="bank_account_bank" id="bank_account_bank" value="" />
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="bank_account_owner">Kontoinhaber</label>
<div class="col-lg-10">
<input type="text" class="form-control" name="bank_account_owner" id="bank_account_owner" value="" />
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="bank_account_iban">IBAN</label>
<div class="col-lg-10">
<input type="text" class="form-control" name="bank_account_iban" id="bank_account_iban" value="" />
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="bank_account_bic">BIC</label>
<div class="col-lg-10">
<input type="text" class="form-control" name="bank_account_bic" id="bank_account_bic" value="" />
</div>
</div>
</div>
</div>
<h4 class="header-title">Einwilligungen</h4>
<div class="card">
<div class="card-body">
<div class="form-group row">
<div class="col-lg-2"></div>
<div class="col-lg-10">
<label class="form-check-label"><input type="checkbox" class="form-check-input" name="allow_contact" id="allow_contact" /> Informationen per Post/Email/Telefon</label>
</div>
</div>
<div class="form-group row">
<div class="col-lg-2"></div>
<div class="col-lg-10">
<label class="form-check-label"><input type="checkbox" class="form-check-input" name="allow_spin" id="allow_contact" /> Auskunft mit Service PIN</label>
</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"><?=$order->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">
$("#productgroup_id").select2({
allowClear: true,
placeholder: ""
});
$("#producttech_id").select2({
allowClear: true,
placeholder: ""
});
$("#networks").select2({
allowClear: true,
placeholder: ""
});
$('#owner_id').change(function() {
var val = $('#owner_id').val();
if(val == "new") {
$('#owner-form').show();
} else {
$('#owner-form').hide();
}
});
$('#billingaddress_id').change(function() {
var val = $('#billingaddress_id').val();
if(val == "new") {
$('#billingaddress-form').show();
} else {
$('#billingaddress-form').hide();
}
});
</script>
<?php include(realpath(dirname(__FILE__)."/../")."/footer.php"); ?>
+70
View File
@@ -0,0 +1,70 @@
<?php include(realpath(dirname(__FILE__)."/../")."/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")?>">the-tool</a></li>
<li class="breadcrumb-item active">Bestellungen</li>
</ol>
</div>
<h4 class="page-title">Bestellungen</h4>
</div>
</div>
</div>
<!-- end page title -->
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-body mb-3">
<div class="float-left">
<h4 class="header-title">Liste aller Bestellungen</h4>
</div>
<div class="float-right">
<a class="btn btn-primary mb-2" href="<?=self::getUrl("Order", "add")?>"><i class="fas fa-plus"></i> Neue Bestellung anlegen</a>
</div>
<table class="table table-striped table-hover">
<tr>
<th>Kunde</th>
<th>Adresse</th>
<th>Anschlussadresse</th>
<th>Kontakt</th>
<th>Bestellt am</th>
<th>Zuletzt bearbeitet</th>
<th>Bearbeitet von</th>
<th></th>
</tr>
<?php foreach($orders as $order): ?>
<tr>
<td><?=nl2br($order->owner->getCompanyOrName())?></td>
<td>
<?=$order->owner->street?><br />
<?=$order->owner->zip?> <?=$order->owner->city?>
</td>
<td>
<?=$order->termination->building->street?><?=($order->termination->name) ? " ".$order->termination->name : ""?><br />
<?=$order->termination->building->zip?> <?=$order->termination->building->city?>
</td>
<td><?=$order->contact->getCompanyOrName()?></td>
<td class="text-monospace"><?=$order->create?></td>
<td class="text-monospace"><?=$order->edit?></td>
<td class="text-monospace"><?=$order->editor->name?></td>
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
<a href="<?=self::getUrl("Order", "edit", ["id" => $order->id])?>"><i class="far fa-edit" title="Bearbeiten"></i></a>
<a href="<?=self::getUrl("Order", "delete", ["id" => $order->id])?>" onclick="if(!confirm('Bestellung wirklich löschen?')) return false;" class="text-danger" title="Löschen"><i class="fas fa-trash"></i></a>
</td>
</tr>
<?php endforeach; ?>
</table>
</div>
</div>
</div>
</div>
<?php include(realpath(dirname(__FILE__)."/../")."/footer.php"); ?>