company_reports_resumed.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. $language_file = array('admin', 'gradebook', 'tracking');
  4. $cidReset = true;
  5. require_once '../inc/global.inc.php';
  6. api_protect_admin_script();
  7. $interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('MySpace'));
  8. $tool_name = get_lang('Report');
  9. $this_section = SECTION_TRACKING;
  10. $htmlHeadXtra[] = api_get_jqgrid_js();
  11. //jqgrid will use this URL to do the selects
  12. $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_user_course_report_resumed';
  13. $extra_fields = UserManager::get_extra_fields(0, 100, null, null, true, true);
  14. //The order is important you need to check the the $column variable in the model.ajax.php file
  15. $columns = array(get_lang('Company'), get_lang('TrainingHoursAccumulated'), get_lang('CountOfSubscribedUsers'), get_lang('AverageHoursPerStudent'), get_lang('CountCertificates'));
  16. //Column config
  17. $column_model = array(
  18. array('name'=>'extra_ruc', 'index'=>'extra_ruc', 'width'=>'100', 'align'=>'left','sortable'=>'false'),
  19. array('name'=>'training_hours', 'index'=>'training_hours', 'width'=>'100', 'align'=>'left'),
  20. array('name'=>'count_users', 'index'=>'count_users', 'width'=>'100', 'align'=>'left','sortable'=>'false'),
  21. array('name'=>'average_hours_per_user', 'index'=>'average_hours_per_user', 'width'=>'100', 'align'=>'left','sortable'=>'false'),
  22. array('name'=>'count_certificates', 'index'=>'count_certificates', 'width'=>'100', 'align'=>'left','sortable'=>'false'),
  23. );
  24. /*
  25. if (!empty($extra_fields)) {
  26. foreach($extra_fields as $extra) {
  27. $col = array(
  28. 'name' => $extra['1'],
  29. 'index'=> $extra['1'],
  30. 'width'=>'120',
  31. 'sortable'=>'false'
  32. );
  33. $column_model[] = $col;
  34. $columns[] = $extra['3'];
  35. }
  36. }*/
  37. //Autowidth
  38. $extra_params['autowidth'] = 'true';
  39. //height auto
  40. $extra_params['height'] = 'auto';
  41. $htmlHeadXtra[] = '<script>
  42. $(function() {
  43. '.Display::grid_js('user_course_report', $url,$columns,$column_model,$extra_params, array(), null, true).'
  44. jQuery("#user_course_report").jqGrid("navGrid","#user_course_report_pager",{view:false, edit:false, add:false, del:false, search:false, excel:true});
  45. jQuery("#user_course_report").jqGrid("navButtonAdd","#user_course_report_pager",{
  46. caption:"",
  47. onClickButton : function () {
  48. jQuery("#user_course_report").jqGrid("excelExport",{"url":"'.$url.'&export_format=xls"});
  49. }
  50. });
  51. });
  52. </script>';
  53. $content = Display::grid_html('user_course_report');
  54. $tpl = new Template($tool_name);
  55. $tpl->assign('content', $content);
  56. $tpl->display_one_col_template();