skills_ranking.php 2.4 KB

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