page.report.php 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. global $myUser;
  3. User::check_access('statistic','read');
  4. require_once(__DIR__.SLASH.'StatisticReport.class.php');
  5. require_once(__DIR__.SLASH.'Filter.class.php');
  6. $report = isset($_['id']) ? StatisticReport::getByid($_['id']) : new StatisticReport();
  7. $filters = Filter::loadAll(array('report'=>$report->id),array('sort'));
  8. require_once(__DIR__.SLASH.'element'.SLASH.'Treatment.class.php');
  9. ?>
  10. <div class="row">
  11. <div class="col-xl-12">
  12. <div class="row">
  13. <div class="col-md-9">
  14. <h3 id="chart-title" class="chart-title"><i style="color:<?php echo $report->color; ?>" class="<?php echo $report->icon; ?>"></i>
  15. <?php echo $report->label; ?></h3>
  16. </div>
  17. <div class="col-md-3">
  18. <ul id="chart-menu" class="chart-menu noPrint">
  19. <?php if($myUser->can('statistic','configure')): ?>
  20. <li id="add-widget"><i title="Ajouter un widget au rapport" class="fas fa-plus text-success"></i></li>
  21. <li onclick="stats_export_report();" id="export-report"><i title="Exporter le rapport" class="far fa-file-archive"></i></li>
  22. <li><a class="text-info" title="Éditer le rapport" href="index.php?module=statistic&page=edit_report&id=<?php echo $_['id']; ?>"><i class="far fa-edit"></i></a></li>
  23. <?php endif; ?>
  24. <li onclick="stats_print_report()"><i title="Imprimer le rapport" class="fas fa-print text-primary"></i></li>
  25. </ul>
  26. </div>
  27. </div>
  28. </div>
  29. </div>
  30. <hr class="mb-2 mt-2">
  31. <div id="filter-form" class="mb-3">
  32. <div class="row">
  33. <?php foreach($filters as $filter): ?>
  34. <div class="col-xl-2"><?php echo $filter->toHtml(); ?></div>
  35. <?php endforeach; ?>
  36. <div class="col-xl-2">
  37. <div class="btn btn-primary noLabel noPrint btn-process" onclick="stats_refresh_widget_content();"><i class="fas fa-chart-area"></i> Calculer</div>
  38. </div>
  39. </div>
  40. </div>
  41. <div id="report" class="mb-5 <?php echo $myUser->can('statistic','configure') ? 'statistic-configure': ''; ?>" data-id="<?php echo $report->id; ?>">
  42. <div id="gridtack" class="grid-stack"></div>
  43. <div id="widgetTemplate" class="hidden">
  44. <div class="widgetBlock">
  45. <div class="grid-stack-item-content" onclick="stats_select_widget(event,this)" ondblclick="stats_edit_widget_content(this);">
  46. <ul class="widgetMenu">
  47. <li class="btn-widget-edit" onclick="stats_edit_widget_content(this);"><i class="far fa-edit text-info"></i></li>
  48. <li class="btn-widget-delete" onclick="stats_delete_widget(this);"><i class="far fa-trash-alt text-danger"></i></li>
  49. </ul>
  50. </div>
  51. </div>
  52. </div>
  53. <!-- Modal creation widget -->
  54. <div class="modal fade" id="widgetModal" data-isadmin="<?php echo $myUser->superadmin; ?>" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  55. <div class="modal-dialog" role="document">
  56. <div class="modal-content">
  57. <div class="modal-header">
  58. <h5 class="modal-title" id="exampleModalLabel">Edition du widget</h5>
  59. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  60. <span aria-hidden="true">&times;</span>
  61. </button>
  62. </div>
  63. <div class="modal-body" style="overflow: auto;"></div>
  64. <div class="modal-footer"></div>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. <div class="alert alert-info no-data" role="alert">
  70. <strong>Ce rapport est vide !</strong>Aucune donnée n'est actuellement configurée pour ce rapport.<br>
  71. Vous pouvez ajouter des données a ce rapport en cliquant sur l'icone <i class="fas fa-plus"></i> en haut à droite de l'écran
  72. </div>