skills_ranking.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. use Chamilo\CoreBundle\Framework\Container;
  4. /**
  5. * @package chamilo.social
  6. * @author Julio Montoya <gugli100@gmail.com>
  7. */
  8. $cidReset = true;
  9. //require_once '../inc/global.inc.php';
  10. //Add the JS needed to use the jqgrid
  11. $htmlHeadXtra[] = api_get_jqgrid_js();
  12. $interbreadcrumb[] = array("url" => "index.php","name" => get_lang('Skills'));
  13. //jqgrid will use this URL to do the selects
  14. $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_user_skill_ranking';
  15. //The order is important you need to check the the $column variable in the model.ajax.php file
  16. $columns = array(
  17. get_lang('Photo'),
  18. get_lang('FirstName'),
  19. get_lang('LastName'),
  20. get_lang('SkillsAcquired'),
  21. get_lang('CurrentlyLearning'),
  22. get_lang('Rank')
  23. );
  24. $column_model = array(
  25. array(
  26. 'name' => 'photo',
  27. 'index' => 'photo',
  28. 'width' => '10',
  29. 'align' => 'center',
  30. 'sortable' => 'false',
  31. ),
  32. array(
  33. 'name' => 'firstname',
  34. 'index' => 'firstname',
  35. 'width' => '70',
  36. 'align' => 'center',
  37. 'sortable' => 'false',
  38. ),
  39. array(
  40. 'name' => 'lastname',
  41. 'index' => 'lastname',
  42. 'width' => '70',
  43. 'align' => 'center',
  44. 'sortable' => 'false',
  45. ),
  46. array(
  47. 'name' => 'skills_acquired',
  48. 'index' => 'skills_acquired',
  49. 'width' => '30 ',
  50. 'align' => 'center',
  51. 'sortable' => 'false',
  52. ),
  53. array(
  54. 'name' => 'currently_learning',
  55. 'index' => 'currently_learning',
  56. 'width' => '30',
  57. 'align' => 'center',
  58. 'sortable' => 'false',
  59. ),
  60. array(
  61. 'name' => 'rank',
  62. 'index' => 'rank',
  63. 'width' => '30',
  64. 'align' => 'center',
  65. 'sortable' => 'false',
  66. ),
  67. );
  68. //Autowidth
  69. $extra_params['autowidth'] = 'true';
  70. //height auto
  71. $extra_params['height'] = 'auto';
  72. //$extra_params['excel'] = 'excel';
  73. //$extra_params['rowList'] = array(10, 20 ,30);
  74. $jqgrid = Display::grid_js(
  75. 'skill_ranking',
  76. $url,
  77. $columns,
  78. $column_model,
  79. $extra_params,
  80. array(),
  81. null,
  82. true
  83. );
  84. $content = Display::grid_html('skill_ranking');
  85. //$tpl = new Template(get_lang('Ranking'));
  86. $tpl = Container::getTwig();
  87. $tpl->addGlobal('jqgrid_html', $jqgrid);
  88. $content .= $tpl->render('@template_style/skill/skill_ranking.html.twig');
  89. echo $content;