/magazine/Pages/Admin/sales-view.php

https://gitlab.com/mvcarvalho/plataforma-e-commerce · PHP · 119 lines · 109 code · 10 blank · 0 comment · 20 complexity · eae9deb6f541a12165d49001019dc9a4 MD5 · raw file

  1. <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
  2. <h3>Detalhes do Cliente</h3>
  3. <table class="table table-hover" style="background-color: #ffffff; padding: 20px;">
  4. <tr>
  5. <td >Cliente</td>
  6. <td ><?php echo($this->viewItems['user']->name);?></td>
  7. </tr>
  8. <tr>
  9. <td >Contato</td>
  10. <td ><?php echo($this->viewItems['user']->email . ' - ' . $this->viewItems['user']->phone);?></td>
  11. </tr>
  12. <tr>
  13. <td >CPF / CNPJ</td>
  14. <td ><?php echo($this->viewItems['user']->cpf);?></td>
  15. </tr>
  16. <tr>
  17. <td >Endereço</td>
  18. <td ><?php echo($this->viewItems['user']->address);?></td>
  19. </tr>
  20. <tr>
  21. <td >Cidade</td>
  22. <td ><?php echo($this->viewItems['user']->city . ' - ' . $this->viewItems['user']->state);?></td>
  23. </tr>
  24. <tr>
  25. <td >CEP</td>
  26. <td ><?php echo($this->viewItems['user']->cep);?></td>
  27. </tr>
  28. </table>
  29. <h3>Detalhes da Venda</h3>
  30. <table class="table table-hover" style="background-color: #ffffff; padding: 20px;">
  31. <tr>
  32. <td>Data da Venda</td>
  33. <td><?php echo($this->viewItems['sale']->date);?></td>
  34. </tr>
  35. <tr>
  36. <td>Valor total</td>
  37. <td><?php echo(number_format($this->viewItems['sale']->value, 2, ',', '.'));?></td>
  38. </tr>
  39. <tr>
  40. <td>Status Atual</td>
  41. <td><?php
  42. if($sale->status == 6){
  43. echo('Pagamento Expirado (Cancelado)');
  44. }else if($this->viewItems['sale']->status == 5){
  45. echo('Aguardando Confirmação');
  46. } else if($this->viewItems['sale']->status == 4){
  47. echo('Produto enviado');
  48. } else if($this->viewItems['sale']->status == 3){
  49. echo('Pagamento completo');
  50. } else if($this->viewItems['sale']->status == 2){
  51. echo('Falha no pagamento');
  52. } else if($this->viewItems['sale']->status == 1){
  53. echo('Pagamento pendente');
  54. } else if($this->viewItems['sale']->status == 0){
  55. echo('Não confirmado');
  56. }
  57. ?></td>
  58. </tr>
  59. <tr>
  60. <td>Id da transação</td>
  61. <td><?php echo($this->viewItems['sale']->externalToken);?></td>
  62. </tr>
  63. <tr>
  64. <td>Código de Rastreio</td>
  65. <td><?php echo($this->viewItems['sale']->trackingCode);?></td>
  66. </tr>
  67. </table>
  68. <h3>Itens da Venda</h3>
  69. <table class="table table-hover" style="background-color: #ffffff; padding: 20px;">
  70. <tr style="font-size: 14px">
  71. <th>ID</th>
  72. <th>Produto</th>
  73. <th>Quantidade</th>
  74. <th>Valor unitário</th>
  75. <th>Valor total</th>
  76. </tr>
  77. <?php foreach($this->viewItems['sale']->items as $item){?>
  78. <tr style="font-size: 14px">
  79. <td>
  80. <?php
  81. echo($item->product->id);
  82. ?>
  83. </td>
  84. <td><?php
  85. echo($item->product->shortDescription);
  86. if(strlen($item->optionsText) > 0){
  87. echo( " - " . $item->optionsText);
  88. }?></td>
  89. <td><?php echo($item->quantity);?></td>
  90. <td>R$ <?php echo(number_format($item->price, 2, ',', '.'));?></td>
  91. <td>R$ <?php echo(number_format($item->price * $item->quantity, 2, ',', '.'));?></td>
  92. </tr>
  93. <?php }?>
  94. </table>
  95. <form rule="form" method="post" enctype="multipart/form-data" action="<?php echo $this->viewItems['viewLink'] . $this->viewItems['sale']->id;?>">
  96. <input type="hidden" name="id" value="<?php echo($this->viewItems['sale']->id);?>">
  97. <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
  98. <div class="form-group">
  99. <label for="tracking">Adicionar/Modificar Código de Rastreio</label>
  100. <input type="text" name="tracking" class="form-control" value="<?php echo($this->viewItems['sale']->trackingCode);?>">
  101. </div>
  102. </div>
  103. <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
  104. <div class="form-group">
  105. <input type="submit" value="Salvar" class="btn btn-danger">
  106. </div>
  107. </div>
  108. </form>
  109. </div>