skills_ranking.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /* For licensing terms, see /chamilo_license.txt */
  3. /**
  4. * @package chamilo.social
  5. * @author Julio Montoya <gugli100@gmail.com>
  6. */
  7. /**
  8. * Initialization
  9. */
  10. $language_file = array('userInfo');
  11. $cidReset = true;
  12. require_once '../inc/global.inc.php';
  13. //Add the JS needed to use the jqgrid
  14. $htmlHeadXtra[] = api_get_jqgrid_js();
  15. $interbreadcrumb[] = array("url" => "index.php","name" => get_lang('Skills'));
  16. //jqgrid will use this URL to do the selects
  17. $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_user_skill_ranking';
  18. //The order is important you need to check the the $column variable in the model.ajax.php file
  19. $columns = array(get_lang('Photo'),
  20. get_lang('Firstname'),
  21. get_lang('Lastname'),
  22. get_lang('SkillsAcquired'),
  23. get_lang('CurrentlyLearning'),
  24. get_lang('Rank'));
  25. $column_model = array(
  26. array('name'=>'photo', 'index'=>'photo', 'width'=>'10', 'align'=>'center', 'sortable' => 'false'),
  27. array('name'=>'firstname', 'index'=>'firstname', 'width'=>'70', 'align'=>'left', 'sortable' => 'false'),
  28. array('name'=>'lastname', 'index'=>'lastname', 'width'=>'70', 'align'=>'left', 'sortable' => 'false'),
  29. array('name'=>'skills_acquired', 'index'=>'skills_acquired', 'width'=>'30 ', 'align'=>'left', 'sortable' => 'false'),
  30. array('name'=>'currently_learning', 'index'=>'currently_learning', 'width'=>'30', 'align'=>'left', 'sortable' => 'false'),
  31. array('name'=>'rank', 'index'=>'rank', 'width'=>'30', 'align'=>'left', 'sortable' => 'false')
  32. );
  33. //Autowidth
  34. $extra_params['autowidth'] = 'true';
  35. //height auto
  36. $extra_params['height'] = 'auto';
  37. //$extra_params['excel'] = 'excel';
  38. //$extra_params['rowList'] = array(10, 20 ,30);
  39. $jqgrid = Display::grid_js('skill_ranking', $url,$columns,$column_model,$extra_params, array(), $action_links,true);
  40. $content = Display::grid_html('skill_ranking');
  41. $app['title'] = $tool_name;
  42. $tpl = $app['template'];
  43. $tpl->assign('actions', $actions);
  44. $tpl->assign('message', $message);
  45. $tpl->assign('jqgrid_html', $jqgrid);
  46. $content .= $tpl->fetch('default/skill/skill_ranking.tpl');
  47. $tpl->assign('content', $content);
  48. $tpl->display_one_col_template();