filler.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php // $Id: index.php 22269 2009-07-21 15:06:15Z juliomontoya $
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Index of the admin tools
  5. *
  6. * @package chamilo.admin
  7. */
  8. // name of the language file that needs to be included <br />
  9. $language_file=array('admin','tracking');
  10. // resetting the course id
  11. $cidReset=true;
  12. // including some necessary chamilo files
  13. require_once '../inc/global.inc.php';
  14. require_once api_get_path(LIBRARY_PATH).'security.lib.php';
  15. // setting the section (for the tabs)
  16. $this_section=SECTION_PLATFORM_ADMIN;
  17. // Access restrictions
  18. api_protect_admin_script(true);
  19. $nameTools = get_lang('PlatformAdmin');
  20. // setting breadcrumbs
  21. $interbreadcrumb[] = array ("url" => 'index.php', "name" => $nameTools);
  22. // setting the name of the tool
  23. $nameTools = get_lang('DataFiller');
  24. $output = array();
  25. if (!empty($_GET['fill'])) {
  26. switch ($_GET['fill']) {
  27. case 'users':
  28. require api_get_path('SYS_TEST_PATH').'datafiller/fill_users.php';
  29. $output = fill_users();
  30. break;
  31. case 'courses':
  32. require api_get_path('SYS_TEST_PATH').'datafiller/fill_courses.php';
  33. $output = fill_courses();
  34. break;
  35. default:
  36. break;
  37. }
  38. }
  39. // Displaying the header
  40. Display::display_header($nameTools);
  41. $result = '';
  42. if (count($output)>0) {
  43. $result = '<div class="filler-report">'."\n";
  44. $result .= '<div class="filler-report-title">'.$output[0]['title'].'</div>'."\n";
  45. $result .= '<table>';
  46. foreach ($output as $line) {
  47. $result .= '<tr>';
  48. $result .= '<td class="filler-report-data-init">'.$line['line-init'].'</td><td class="filler-report-data">'.$line['line-info'].'</td>';
  49. $result .= '</tr>'."\n";
  50. }
  51. $result .= '</table>';
  52. $result .= '</div>';
  53. Display::display_normal_message($result,false);
  54. }
  55. ?>
  56. <div class="admin_section">
  57. <h4><?php Display::display_icon('bug.gif', 'DataFiller'); echo ' '.api_ucfirst(get_lang('DataFiller'));?></h4>
  58. <div><?php echo get_lang('ThisSectionIsOnlyVisibleOnSourceInstalls');?></div>
  59. <ul>
  60. <li><a href="filler.php?fill=users"><?php echo get_lang('FillUsers');?></a></li>
  61. <li><a href="filler.php?fill=courses"><?php echo get_lang('FillCourses');?></a></li>
  62. </ul>
  63. </div>
  64. <?php
  65. /* FOOTER */
  66. Display::display_footer();