show.phtml 1.0 KB

123456789101112131415161718192021222324252627
  1. <?php
  2. if (count($this->data) == 0):
  3. echo "Collection is empty.<br/>";
  4. else:
  5. foreach ($this->data as $document):
  6. ?>
  7. Document ID: <?php echo $document->getID() ?><br/>
  8. Document data: <br/>
  9. <?php
  10. foreach($document->getFields() as $key => $value) {
  11. echo "<b>$key</b>: $value<br/>\n";
  12. }
  13. ?>
  14. <form method="POST" action="<?php echo $this->url(array("action" => "delete-document", "controller" => "document"), "", true) ?>" style="display: inline">
  15. <input type="hidden" name="name" value="<?php echo $this->collection ?>">
  16. <input type="hidden" name="id" value="<?php echo $document->getID() ?>">
  17. <input type="submit" value="Delete" style="display: inline">
  18. </form> <hr>
  19. <?php
  20. endforeach;
  21. endif;
  22. ?>
  23. <form method="POST" action="<?php echo $this->url(array("action" => "add-document", "controller" => "document"), "", true) ?>" style="display: inline">
  24. <input type="hidden" name="name" value="<?php echo $this->collection ?>">
  25. <input type="submit" value="Add Document" style="display: inline">
  26. </form>