page.list.part.php 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. global $myUser;
  3. if(!$myUser->connected()) throw new Exception("Vous devez être connecté pour accéder à cette fonctionnalité",401);
  4. if(!$myUser->can('part','read')) throw new Exception("Vous n'avez pas la permission pour executer cette fonctionnalité",403);
  5. require_once(__DIR__.SLASH.'Part.class.php');
  6. ?>
  7. <div class="row">
  8. <div class="col-md-8">
  9. <select id="filters" data-type="filter" data-label="Recherche" data-function="part_part_search">
  10. <option value="label" data-filter-type="text">Libellé</option>
  11. </select>
  12. </div>
  13. <div class="col-md-4">
  14. <?php if($myUser->can('part', 'edit')) : ?>
  15. <a href="index.php?module=part&page=sheet.part" class="btn btn-success right"><i class="fas fa-plus"></i> Ajouter</a>
  16. <?php endif; ?>
  17. </div>
  18. </div>
  19. <br/>
  20. <div class="row">
  21. <!-- search results -->
  22. <div class="col-xl-12">
  23. <ul id="parts" data-entity-search="part_part_search">
  24. <li data-id="{{id}}" data-part="{{part}}" class="hidden">
  25. <div class="part">
  26. <input type="text" data-type="part" data-force="false" placeholder="Nom du composant" value="{{label}}" class="form-control label">
  27. <div class="part-image" data-label="Image" style="height:220px;background : url(data:{{picture}}) 0% 0% / cover" data-stream="{{picture}}"></div>
  28. <input class="hidden" type="file">
  29. <div class="price w-100 mt-2">
  30. <div class="input-group">
  31. <div class="input-group-prepend">
  32. <span class="input-group-text">Prix</span>
  33. </div>
  34. <input class="form-control" type="text" value="{{price}}">
  35. <div class="input-group-append">
  36. <span class="input-group-text">€</span>
  37. </div>
  38. </div>
  39. </div>
  40. <div class="brand w-100 mt-2 mb-3">
  41. <div class="input-group">
  42. <div class="input-group-prepend">
  43. <span class="input-group-text">Marque</span>
  44. </div>
  45. <input class="form-control" type="text" value="{{brand}}"/>
  46. </div>
  47. </div>
  48. <a onclick="part_part_find(this)" title="Chercher sur le net" class="link"><i class="fas fa-globe-americas pointer"></i></a>
  49. <div class="btn btn-delete" onclick="part_part_delete(this);"><i class="far fa-trash-alt"></i></div>
  50. <div class="clear"></div>
  51. <div class="btn btn-dark w-100 mb-3 btn-save-part" onclick="part_part_save(this)"><i class="far fa-check-circle"></i>Valider</div>
  52. </div>
  53. </li>
  54. </ul>
  55. <!-- Pagination -->
  56. <ul class="pagination">
  57. <li class="page-item hidden" data-value="{{value}}" title="Voir la page {{label}}" onclick="$(this).parent().find('li').removeClass('active');$(this).addClass('active');part_part_search();">
  58. <a class="page-link" href="#">{{label}}</a>
  59. </li>
  60. </ul>
  61. </div>
  62. </div>