Пример #1
0
<?php 
$buy = BuyData::getById($_GET["buy_id"]);
$products = BuyProductData::getAllByBuyId($_GET["buy_id"]);
?>
<div class="row">
	<div class="col-md-12">
	<h2> Compra #<?php 
echo $buy->id;
?>
 [<?php 
echo $buy->getStatus()->name;
?>
]</h2>
<?php 
if (count($products) > 0) {
    ?>
<table class="table table-bordered">
	<thead>
		<th></th>
		<th>Codigo</th>
		<th>Total</th>
		<th>Estado</th>
	</thead>
	<?php 
    foreach ($products as $p) {
        $px = $p->getProduct();
        ?>
	<tr>
		<td><a href="index.php?view=producto&product_id=<?php 
        echo $px->id;
Пример #2
0
<?php

if (!empty($_POST)) {
    // print_r($_POST);
    $buy = BuyData::getById($_POST["buy_id"]);
    $buy->cancel();
    Core::alert("Compra Cancelada!");
    Core::redir("index.php?view=client");
}