| @@ -106,9 +106,12 @@ discard block | ||
| 106 | 106 |                      <h2 class="pointered noselect" onclick="clearNewFoneInput(); showModal('addNumber');">Adicionar telefone...</h2> | 
| 107 | 107 | </div> | 
| 108 | 108 | </div> | 
| 109 | - <?php else: ?> | |
| 109 | +        <?php else { | |
| 110 | + : ?> | |
| 110 | 111 | <?php foreach ($userData->phone as $key => $value): ?> | 
| 111 | -                <div class="col-12 bordered bordered-line-top pointered" id="foneRow" onclick="changeFoneInput('<?= $value->number; ?>', <?= $value->id; ?>); showModal('alterNumber');"> | |
| 112 | +                <div class="col-12 bordered bordered-line-top pointered" id="foneRow" onclick="changeFoneInput('<?= $value->number; | |
| 113 | +} | |
| 114 | +?>', <?= $value->id; ?>); showModal('alterNumber');"> | |
| 112 | 115 | <div class="bordered-content bordered-align-left" id="foneHeader"> | 
| 113 | 116 | <h2>Telefone <span id="foneIndex"><?= ($key + 1); ?></span></h2> | 
| 114 | 117 | </div> | 
| @@ -137,11 +140,14 @@ discard block | ||
| 137 | 140 |                      <h2 class="pointered noselect" onclick="clearNewAddressInputs(); showModal('addAddress');">Adicionar endereço...</h2> | 
| 138 | 141 | </div> | 
| 139 | 142 | </div> | 
| 140 | - <?php else: ?> | |
| 143 | +        <?php else { | |
| 144 | + : ?> | |
| 141 | 145 | <?php foreach ($userData->address as $key => $value): ?> | 
| 142 | 146 |                  <div class="col-12 bordered bordered-line-top pointered" id="addressRow" onclick="changeAlterAddressInputs(<?= $value->id ?>); showModal('alterAddress');"> | 
| 143 | 147 | <div class="bordered-content bordered-align-left"> | 
| 144 | - <h2><strong>Endereço <?= ($key + 1); ?></strong></h2> | |
| 148 | + <h2><strong>Endereço <?= ($key + 1); | |
| 149 | +} | |
| 150 | +?></strong></h2> | |
| 145 | 151 | <h2>Cidade, Estado</h2> | 
| 146 | 152 | <h2>CEP</h2> | 
| 147 | 153 | <h2>Rua</h2> | 
| @@ -83,12 +83,15 @@ | ||
| 83 | 83 | <div class="row"> | 
| 84 | 84 | <h2 class="title" style="margin-top: 50px; margin-bottom: 120px;">No products related!</h2> | 
| 85 | 85 | </div> | 
| 86 | -<?php else: ?> | |
| 86 | +<?php else { | |
| 87 | + : ?> | |
| 87 | 88 | <div class="small-container"> | 
| 88 | 89 | <div class="row"> | 
| 89 | 90 | <?php foreach ($relatedProducts as $product): ?> | 
| 90 | 91 | <div class="col-4"> | 
| 91 | -                    <a href="<?= url("/product/{$product->id}"); ?>"><img src="<?= productImage($product); ?>" class="big-img" alt="produto1"></a> | |
| 92 | +                    <a href="<?= url("/product/{$product->id}"); | |
| 93 | +} | |
| 94 | +?>"><img src="<?= productImage($product); ?>" class="big-img" alt="produto1"></a> | |
| 92 | 95 |                      <a href="<?= url("/product/{$product->id}"); ?>"><h4><?= str_limit_chars($product->name, 30); ?></h4></a> | 
| 93 | 96 | <div class="rating"> | 
| 94 | 97 | <?= starRate($product->rate); ?> | 
| @@ -56,11 +56,14 @@ | ||
| 56 | 56 | </div> | 
| 57 | 57 | </div> | 
| 58 | 58 | |
| 59 | - <?php else: ?> | |
| 59 | +    <?php else { | |
| 60 | + : ?> | |
| 60 | 61 | <?php foreach ($userData->address as $key => $value): ?> | 
| 61 | 62 |              <div class="col-12 bordered bordered-line-top pointered" id="addressRow" onclick="changeAlterAddressInputs(<?= $value->id ?>); showModal('alterAddress');"> | 
| 62 | 63 | <div class="bordered-content bordered-align-left"> | 
| 63 | - <h2><strong>Endereço <?= ($key + 1); ?></strong></h2> | |
| 64 | + <h2><strong>Endereço <?= ($key + 1); | |
| 65 | +} | |
| 66 | +?></strong></h2> | |
| 64 | 67 | <h2>Cidade, Estado</h2> | 
| 65 | 68 | <h2>CEP</h2> | 
| 66 | 69 | <h2>Rua</h2> | 
| @@ -22,8 +22,11 @@ discard block | ||
| 22 | 22 | <div class="row"> | 
| 23 | 23 | <h2 class="title" style="margin-top: 15vh; margin-bottom: 20vh;">No products available!</h2> | 
| 24 | 24 | </div> | 
| 25 | - <?php else: ?> | |
| 26 | - <?php $productCounter = 0; ?> | |
| 25 | +    <?php else { | |
| 26 | + : ?> | |
| 27 | + <?php $productCounter = 0; | |
| 28 | +} | |
| 29 | +?> | |
| 27 | 30 | <?php for ($i = 0; $i < count($products); $i++): ?> | 
| 28 | 31 | <?php if ($i === 0 || ($i % 4) === 0): ?> | 
| 29 | 32 | <?php $productCounter += 1; ?> | 
| @@ -45,12 +48,18 @@ discard block | ||
| 45 | 48 | <div class="page-btn"> | 
| 46 | 49 | <?php if ($productsCount < 12): ?> | 
| 47 | 50 | <span>1</span> | 
| 48 | - <?php else: ?> | |
| 49 | - <?php for ($i = 1; $i <= ceil($productsCount / 12); $i++): ?> | |
| 51 | +            <?php else { | |
| 52 | + : ?> | |
| 53 | + <?php for ($i = 1; | |
| 54 | +} | |
| 55 | +$i <= ceil($productsCount / 12); $i++): ?> | |
| 50 | 56 | <?php if ($i == $currentPage): ?> | 
| 51 | 57 | <span style="color: #ff2400;"><?= $i; ?></span> | 
| 52 | - <?php else: ?> | |
| 53 | -                        <a href="<?= url("/products/{$i}"); ?>"><span style="color: #000;"><?= $i; ?></span></a> | |
| 58 | +                    <?php else { | |
| 59 | + : ?> | |
| 60 | +                        <a href="<?= url("/products/{$i}"); | |
| 61 | +} | |
| 62 | +?>"><span style="color: #000;"><?= $i; ?></span></a> | |
| 54 | 63 | <?php endif; ?> | 
| 55 | 64 | <?php endfor; ?> | 
| 56 | 65 | <?php endif; ?> | 
| @@ -40,8 +40,11 @@ | ||
| 40 | 40 | <?php if (!empty($_SESSION["user"])): ?> | 
| 41 | 41 |                          <li><a href="<?= $router->route("app.account"); ?>">Account</a></li> | 
| 42 | 42 |                          <li><a href="<?= $router->route("app.logoff"); ?>">Logoff</a></li> | 
| 43 | - <?php else: ?> | |
| 44 | -                        <li><a href="<?= $router->route("login.login"); ?>">Login</a></li> | |
| 43 | +                    <?php else { | |
| 44 | + : ?> | |
| 45 | +                        <li><a href="<?= $router->route("login.login"); | |
| 46 | +} | |
| 47 | +?>">Login</a></li> | |
| 45 | 48 | <?php endif; ?> | 
| 46 | 49 | </ul> | 
| 47 | 50 | </nav> | 
| @@ -26,7 +26,7 @@ | ||
| 26 | 26 | */ | 
| 27 | 27 | protected function consume() | 
| 28 | 28 |      { | 
| 29 | -        $callback = function ($message) { | |
| 29 | +        $callback = function($message) { | |
| 30 | 30 | $this->handler($message); | 
| 31 | 31 | }; | 
| 32 | 32 | $this->channel->basic_consume($this->getQueue(), 'consumer', false, $this->getReply(), false, false, $callback); | 
| @@ -35,12 +35,15 @@ | ||
| 35 | 35 | </tr> | 
| 36 | 36 | <?php endforeach; ?> | 
| 37 | 37 | </table> | 
| 38 | - <?php else: ?></table> | |
| 38 | +    <?php else { | |
| 39 | + : ?></table> | |
| 39 | 40 | <div class="row"> | 
| 40 | 41 | <h2 class="title" style="margin-top: 15vh; margin-bottom: 17vh;">Your cart is empty!</h2> | 
| 41 | 42 | </div> | 
| 42 | 43 | </table> | 
| 43 | - <?php endif; ?> | |
| 44 | + <?php endif; | |
| 45 | +} | |
| 46 | +?> | |
| 44 | 47 | |
| 45 | 48 | <div class="total-price"> | 
| 46 | 49 | <table class="frete-class"> | 
| @@ -234,7 +234,7 @@ | ||
| 234 | 234 | ]; | 
| 235 | 235 | |
| 236 | 236 | // $rawProducts = $_COOKIE['rawproducts']; | 
| 237 | - $rawProducts = [['id' => 1],[ 'id' => 2]]; | |
| 237 | + $rawProducts = [['id' => 1], ['id' => 2]]; | |
| 238 | 238 | |
| 239 | 239 |          foreach ($rawProducts as $key => $value) { | 
| 240 | 240 |              $req = callAPI("/product/{$value['id']}", 'GET', [], $_SESSION['user'] ?? ''); |