component.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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}}</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. <label for="label">Libellé</label>
  45. <input class="form-control" type="text" id="label"/>
  46. <label for="label">Marque</label>
  47. <input class="form-control" type="text" id="brand"/>
  48. <label for="label">Prix</label>
  49. <input class="form-control" type="text" id="price"/>
  50. <label for="imageUpload">Image (fichier)</label><br/>
  51. <img src="img/default_image.png" style="width:100px;height:100px;" id="imageUpload"/>
  52. </div>
  53. <div class="modal-footer">
  54. <button type="button" class="btn btn-primary" onclick="save_component();" data-dismiss="modal">Enregistrer</button>
  55. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. <?php
  61. else:
  62. header('index.php');
  63. endif; ?>
  64. <?php
  65. require_once __ROOT__.'footer.php' ?>