skills_ranking.php 2.4 KB

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