company_reports_resumed.php 2.6 KB

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