setting.statistic.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. global $myUser;
  3. User::check_access('statistic','configure');
  4. $handlers = array();
  5. foreach(glob(__ROOT__.SLASH.'connector'.SLASH.'*.class.php') as $classFile){
  6. require_once($classFile);
  7. $className = str_replace('.class.php','',basename($classFile));
  8. $handlers[$className] = $className::label;
  9. }
  10. ?>
  11. <div class="row">
  12. <div class="col-md-12">
  13. <br>
  14. <div onclick="stats_save_connection();" class="btn btn-success float-right"><i class="fas fa-check"></i> Enregistrer</div>
  15. <h3>Réglages Statistiques</h3>
  16. <hr/>
  17. <h5 class="panel-heading">Configuration de connexion</h5>
  18. <small class="text-muted">L'utilisateur doit avoir les droits "SELECT" sur les tables concernées pas les statistiques </small>
  19. <div id="connectionForm" class="row" data-action="stats_save_connection" data-id="">
  20. <div class="col-md-12">
  21. <div class="row">
  22. <div class="col-md-6">
  23. <label for="label">Libellé </label>
  24. <input id="label" class="form-control" placeholder="Ma connexion 1" type="text"><br>
  25. </div>
  26. <div class="col-md-6">
  27. <label for="database">Type de base </label>
  28. <select class="form-control" id="handler" name="handler" onchange="stats_connection_handler_change()">
  29. <option value="">-</option>
  30. <?php foreach($handlers as $class=>$label): ?>
  31. <option value="<?php echo $class ?>"><?php echo $label; ?></option>
  32. <?php endforeach; ?>
  33. </select>
  34. </div>
  35. </div>
  36. <div class="row">
  37. <div class="col-md-12 stats-connection-info"></div>
  38. </div>
  39. </div>
  40. </div>
  41. <hr>
  42. <div class="panel panel-default">
  43. <legend class="panel-heading">Connexions existantes </legend>
  44. <table id="connections" class="table table-striped">
  45. <thead>
  46. <tr>
  47. <th>#</th>
  48. <th>Libellé</th>
  49. <th>Type</th>
  50. <th></th>
  51. </tr>
  52. </thead>
  53. <tbody>
  54. <tr data-id="{{id}}" class="hidden">
  55. <td>{{id}}</td>
  56. <td>{{label}}</td>
  57. <td>{{handler}}</td>
  58. <td class="text-right">
  59. <div onclick="stats_connection_test(this)" title="Tester la connexion" class="btn btn-dark btn-squarred btn-mini btn-test"><i class="fas fa-vial"></i></div>
  60. <div onclick="stats_edit_connection(this)" class="btn btn-info btn-squarred btn-mini"><i class="fas fa-pencil-alt"></i></div>
  61. <div onclick="stats_delete_connection(this)" class="btn btn-danger btn-squarred btn-mini"><i class="fas fa-times"></i></div>
  62. </td>
  63. </tr>
  64. </tbody>
  65. </table>
  66. </div>
  67. </div>
  68. </div>