PageRenderTime 45ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/command/Test.php

https://bitbucket.org/cheghamwassim/php-design-patterns
PHP | 70 lines | 60 code | 8 blank | 2 comment | 0 complexity | 9e88c0697ca93beeeb475204aa5ec8d8 MD5 | raw file
  1. <?php
  2. require_once('App.php');
  3. print_r($_SESSION['c']);
  4. unset($_SESSION['c']);
  5. var_dump($c);
  6. exit;
  7. ?>
  8. <!DOCTYPE html>
  9. <html>
  10. <head>
  11. <title>Design Pattern : Command</title>
  12. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  13. <script type="text/javascript" src="/site/assets/js.php?v=2"></script>
  14. <script type="text/javascript">
  15. //<![CDATA[
  16. $(function(){
  17. $('a').click(function(e){
  18. e.preventDefault();
  19. $('#response').load($(this).attr('href')+'&ajax&t='+new Date().getTime());
  20. });
  21. });
  22. //]]>
  23. </script>
  24. </head>
  25. <body>
  26. <div id="hBox" style="width:600px;height:600px;margin-left:50%;left:-300px;position:relative;background:#fff;padding:10px;">
  27. <div id="menuView" style="width:100%;">
  28. <p>Menu:
  29. <?php
  30. foreach( $c->menu as $i => $menuItem )
  31. {
  32. echo '<a href="?m=' . $i . '" >' . $menuItem->name. '</a>&nbsp;&nbsp;';
  33. }
  34. ?>
  35. </p>
  36. <hr />
  37. <p>Actions:
  38. <a href="?undo">Annuler</a>&nbsp;&nbsp;
  39. <a href="?redo">Rétablir</a>
  40. </p>
  41. </div>
  42. <div id="response" style="width:100%;height:100px;">
  43. <div id="canvas" style="background:#<?php echo $c->getCanvasColor(); ?>;width:100%;height:100%;border:1px solid #aaa;">
  44. </div>
  45. <div id="historyDisplay">
  46. Historique (public):<ul>
  47. <?php foreach( $c->historyDisplay as $i => $menuItem ){
  48. echo '<li>' . $menuItem->name . '</li>';
  49. }?>
  50. </ul>
  51. Historique (privé):<ul>
  52. <?php foreach( $c->history as $i => $menuItem ){
  53. echo '<li>' . $menuItem->name . '</li>';
  54. }?>
  55. </ul>
  56. </div>
  57. </div>
  58. </div>
  59. </body>
  60. </html>
  61. <?php
  62. ?>