Files
shopPRO/admin/templates/shop-order/order-edit.php

225 lines
9.8 KiB
PHP

<?
$orderId = (int)($this -> order['id'] ?? 0);
?>
<div class="site-title">Edycja zamówienia: <?= htmlspecialchars((string)($this -> order['number'] ?? ''), ENT_QUOTES, 'UTF-8');?></div>
<div class="mb15">
<button type="button" id="order-save" class="btn btn-success btn-sm mr5 ml5">
<i class="fa fa-save"></i> Zapisz zamówienie
</button>
<a href="/admin/shop_order/order_details/order_id=<?= $orderId;?>" class="btn btn-dark btn-sm mr5">
<i class="fa fa-reply"></i> Wstecz
</a>
</div>
<form id="fg-order-details" method="POST" action="/admin/shop_order/order_save/">
<input type="hidden" name="order_id" value="<?= $orderId;?>">
<div class="details panel">
<div class="panel-body">
<div class="row">
<div class="col-xl-8">
<div class="row">
<div class="col-md-6">
<div class="text-big">Numer zamówienia: <b id="order-number"><?= $this -> order[ 'number' ];?></b> <i class="fa fa-copy" onclick="copyToClipboard( 'order-number' ); return false;"></i></div>
<div>Data zamówienia <b><?= $this -> order[ 'date_order' ];?></b></div>
<br>
<div class="text-big">Dane do dostawy:</div>
<div class="row">
<div class="col-sm-6">
<input type="text" class="form-control" name="client_name" value="<?= $this -> order[ 'client_name' ];?>" placeholder="Imię">
</div>
<div class="col-sm-6">
<input type="text" class="form-control" name="client_surname" value="<?= $this -> order[ 'client_surname' ];?>" placeholder="Nazwisko">
</div>
</div>
<div class="row">
<div class="col-12">
<input type="text" class="form-control" name="client_street" value="<?= $this -> order[ 'client_street' ];?>" placeholder="Ulica">
</div>
</div>
<div class="row">
<div class="col-sm-6">
<input type="text" class="form-control" name="client_postal_code" value="<?= $this -> order[ 'client_postal_code' ];?>" placeholder="Kod pocztowy">
</div>
<div class="col-sm-6">
<input type="text" class="form-control" name="client_city" value="<?= $this -> order[ 'client_city' ];?>" placeholder="Miasto">
</div>
</div>
<div class="row">
<div class="col-12">
<input type="text" class="form-control" name="client_email" value="<?= $this -> order[ 'client_email' ];?>" placeholder="Email">
</div>
</div>
<div class="row">
<div class="col-12">
<input type="text" class="form-control" name="client_phone" value="<?= $this -> order[ 'client_phone' ];?>" placeholder="Telefon">
</div>
</div>
<? if ( $this -> order['firm_name'] ):?>
<div class="text-big">Dane do faktury:</div>
<div class="row">
<div class="col-12">
<input type="text" class="form-control" name="firm_name" value="<?= $this -> order[ 'firm_name' ];?>" placeholder="Nazwa firmy">
</div>
</div>
<div class="row">
<div class="col-12">
<input type="text" class="form-control" name="firm_street" value="<?= $this -> order[ 'firm_street' ];?>" placeholder="Ulica">
</div>
</div>
<div class="row">
<div class="col-sm-6">
<input type="text" class="form-control" name="firm_postal_code" value="<?= $this -> order[ 'firm_postal_code' ];?>" placeholder="Kod pocztowy">
</div>
<div class="col-sm-6">
<input type="text" class="form-control" name="firm_city" value="<?= $this -> order[ 'firm_city' ];?>" placeholder="Miasto">
</div>
</div>
<div class="row">
<div class="col-12">
<input type="text" class="form-control" name="firm_nip" value="<?= $this -> order[ 'firm_nip' ];?>" placeholder="NIP">
</div>
</div>
<? endif;?>
</div>
<div class="col-md-6">
<div>Kwota zamówienia <b><?= $this -> order[ 'summary' ];?> zł</b></div>
<br>
<div class="row">
<div class="col-12">
<select name="transport_id" class="form-control" id="transport_id">
<option value="0">--- wybierz formę transportu ---</option>
<? if ( \S::is_array_fix( $this -> transport ) ): foreach ( $this -> transport as $transport_tmp ):?>
<option value="<?= $transport_tmp['id'];?>" <? if ( $this -> order['transport_id'] == $transport_tmp['id'] ):?>selected="selected"<? endif;?>>
<?= $transport_tmp['name'];?> - <?= $transport_tmp['cost'];?> zł
</option>
<? endforeach; endif;?>
</select>
</div>
</div>
<div class="row row-flex">
<div class="col-12">
<div class="input-group">
<input type="text" class="form-control" name="inpost_paczkomat" id="inpost_paczkomat" value="<?= $this -> order[ 'inpost_paczkomat' ];?>" placeholder="Paczkomat">
<span class="input-group-addon btn btn-danger btn-paczkomat">
<i class="fa fa-folder"></i>
</span>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<select name="payment_method_id" class="form-control" id="payment_method_id">
<option value="0">--- wybierz formę płatności ---</option>
<? if ( \S::is_array_fix( $this -> payment_methods ) ): foreach ( $this -> payment_methods as $payment_method ):?>
<option value="<?= $payment_method['id'];?>" <? if ( $this -> order['payment_method_id'] == $payment_method['id'] ):?>selected="selected"<? endif;?>>
<?= $payment_method['name'];?>
</option>
<? endforeach; endif;?>
</select>
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-4">
<div class="order-status text-big">
<?= $this -> order_statuses[ $this -> order[ 'status' ] ];?>
</div>
<div class="form-group status_select">
<select class="form-control" id="order-status">
<? foreach ( $this -> order_statuses as $key => $val ):?>
<option value="<?= $key;?>" <? if ( $key==$this -> order[ 'status' ] ):?>selected="selected"
<? endif;?>><?= $val;?>
</option>
<? endforeach;?>
</select>
</div>
<div class="row">
<div class="col-12 buttons">
<button class="btn btn-primary order_status_change_email">zmień status i wyślij email</button>
<button class="btn btn-success order_status_change">zmień status</button>
</div>
<div class="col-12 order-history">
<? if ( \S::is_array_fix( $this -> order['statuses'] ) ): foreach ( $this -> order['statuses'] as $status ):?>
<div><b><?= date( 'Y-m-d H:i', strtotime( $status['date'] ) );?></b>: <?= $this -> order_statuses[$status['status_id']];?></div>
<? endforeach; endif;?>
</div>
</div>
</div>
<div class="col-md-4">
</div>
<div class="col-md-4">
</div>
<div class="col-md-4">
<div class="text-big">Wiadomość do zamówienia:</div>
<div> <b> <?= $this -> order[ 'message' ];?> </b></div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>Zdjęcie</th>
<th scope="col">Nazwa</th>
<th scope="col" class="tab-center">Ilość</th>
<th scope="col" class="tab-right">Cena / szt:</th>
<th scope="col" class="tab-right">Cena / szt (po rabacie):</th>
<th scope="col" class="tab-right">Suma (po rabacie):</th>
</tr>
</thead>
<tbody>
<? if ( is_array( $this -> order[ 'products' ] ) ): foreach ( $this -> order[ 'products' ] as $product ):?>
<tr class="order-product-details">
<td class="product-image">
<? if ( $product['product_id'] ):?>
<img src="<?= \shop\Product::getProductImg( (int)$product['product_id'] );?>">
<? endif;?>
</td>
<td>
<a href="<?= \shop\Product::getProductUrl( (int)$product['product_id'] );?>" target="_blank"><?= $product[ 'name' ];?></a>
<br />
<div class="atributes">
<?= $product[ 'attributes' ];?>
</div>
<br />
<div class="product-message">
<?= $product[ 'message' ] != '' ? '<strong>Wiadomość:</strong> ' . $product['message'] : '';?>
</div>
</td>
<td class="tab-center"><?= $product[ 'quantity' ];?></td>
<td class="tab-right"><?= $product[ 'price_brutto' ];?> zł</td>
<td class="tab-right"><?= $product[ 'price_brutto_promo' ];?> zł</td>
<td class="tab-right"><?= $product[ 'price_brutto_promo' ] * $product[ 'quantity' ];?> zł</td>
</tr>
<? endforeach; endif;?>
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<form>
<div class="form-group">
<label for="note">Notatki</label>
<textarea class="form-control" id="note" rows="10"></textarea>
</div>
</form>
</div>
</div>
</div>
</div>
</form>
<div class="inpost-map-container">
<a href="#" onclick="$( '.inpost-map-container' ).hide(); return false;" class="inpost-hide"><?= \S::lang( 'zamknij' );?></a>
<div id="inpost-map"></div>
</div>
<link class="footer" rel="stylesheet" type="text/css" href="https://geowidget.easypack24.net/css/easypack.css">
<script class="footer" type="text/javascript" src="https://geowidget.easypack24.net/js/sdk-for-javascript.js"></script>
<?= \Tpl::view('shop-order/order-edit-custom-script');?>