skills_ranking.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 '../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('name'=>'photo', 'index'=>'photo', 'width'=>'10', 'align'=>'center', 'sortable' => 'false'),
  25. array('name'=>'firstname', 'index'=>'firstname', 'width'=>'70', 'align'=>'left', 'sortable' => 'false'),
  26. array('name'=>'lastname', 'index'=>'lastname', 'width'=>'70', 'align'=>'left', 'sortable' => 'false'),
  27. array('name'=>'skills_acquired', 'index'=>'skills_acquired', 'width'=>'30 ', 'align'=>'left', 'sortable' => 'false'),
  28. array('name'=>'currently_learning', 'index'=>'currently_learning', 'width'=>'30', 'align'=>'left', 'sortable' => 'false'),
  29. array('name'=>'rank', 'index'=>'rank', 'width'=>'30', 'align'=>'left', 'sortable' => 'false')
  30. );
  31. //Autowidth
  32. $extra_params['autowidth'] = 'true';
  33. //height auto
  34. $extra_params['height'] = 'auto';
  35. //$extra_params['excel'] = 'excel';
  36. //$extra_params['rowList'] = array(10, 20 ,30);
  37. $jqgrid = Display::grid_js(
  38. 'skill_ranking',
  39. $url,
  40. $columns,
  41. $column_model,
  42. $extra_params,
  43. array(),
  44. null,
  45. true
  46. );
  47. $content = Display::grid_html('skill_ranking');
  48. $tpl = new Template(get_lang('Ranking'));
  49. //$tpl->assign('actions', $actions);
  50. //$tpl->assign('message', $message);
  51. $tpl->assign('jqgrid_html', $jqgrid);
  52. $content .= $tpl->fetch('default/skill/skill_ranking.tpl');
  53. $tpl->assign('content', $content);
  54. $tpl->display_one_col_template();