component.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php require_once __DIR__.DIRECTORY_SEPARATOR.'header.php'; ?>
  2. <?php if($myUser->connected()): ?>
  3. <div class="jumbotron">
  4. <div class="jumbotron-contents">
  5. <h2>Mes composants</h2>
  6. <a onclick="edit_component();" class="btn btn-success"><i class="fa fa-plus"></i> Ajouter</a>
  7. <table class="table table-striped table-hover" id="components">
  8. <thead>
  9. <tr>
  10. <th>#</th>
  11. <th>Image</th>
  12. <th>Libellé</th>
  13. <th>Marque</th>
  14. <th>Prix moyen</th>
  15. <th style="width:100px;">Options</th>
  16. </tr>
  17. </thead>
  18. <tbody>
  19. <tr data-id="{{id}}" style="display:none;">
  20. <td>{{id}}</td>
  21. <td><div class="componentImage"><img src="{{image}}"/></div></td>
  22. <td>{{label}}<br/><small class="text-muted"><a href="{{link}}" target="_blank">{{link}}</a></small></td>
  23. <td>{{brand}}</td>
  24. <td>{{price}}</td>
  25. <td>
  26. <div onclick="edit_component(this);" class="btn btn-primary"><i class="fa fa-pencil"></i></div>
  27. <div onclick="delete_component(this);" class="btn btn-danger"><i class="fa fa-times"></i></div>
  28. </td>
  29. </tr>
  30. </tbody>
  31. </table>
  32. </div>
  33. </div>
  34. <!-- Modal -->
  35. <div id="editComponent" class="modal fade" role="dialog" data-id="" data-action="save_component">
  36. <div class="modal-dialog">
  37. <!-- Modal content-->
  38. <div class="modal-content">
  39. <div class="modal-header">
  40. <button type="button" class="close" data-dismiss="modal">&times;</button>
  41. <h4 class="modal-title">Edition composant</h4>
  42. </div>
  43. <div class="modal-body">
  44. <div class="form-group">
  45. <label for="label">Libellé</label>
  46. <input class="form-control" type="text" id="label"/>
  47. </div>
  48. <div class="form-group">
  49. <label for="label">Marque</label>
  50. <input class="form-control" type="text" id="brand"/>
  51. </div>
  52. <div class="form-group">
  53. <label for="label">Lien</label>
  54. <input class="form-control" type="text" id="link"/>
  55. </div>
  56. <div class="form-group">
  57. <label for="label">Prix</label>
  58. <input class="form-control" type="text" id="price"/>
  59. </div>
  60. <div class="form-group">
  61. <label for="imageUpload">Image (fichier)</label><br/>
  62. <img src="img/default_image.png" style="width:100px;height:100px;" id="imageUpload"/>
  63. </div>
  64. </div>
  65. <div class="modal-footer">
  66. <button type="button" class="btn btn-primary" onclick="save_component();" data-dismiss="modal">Enregistrer</button>
  67. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. <?php
  73. else:
  74. header('index.php');
  75. endif; ?>
  76. <?php
  77. require_once __ROOT__.'footer.php' ?>