filler.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  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','create_course');
  10. // resetting the course id
  11. $cidReset = true;
  12. // including some necessary chamilo files
  13. require_once '../inc/global.inc.php';
  14. // setting the section (for the tabs)
  15. $this_section = SECTION_PLATFORM_ADMIN;
  16. // Access restrictions
  17. api_protect_admin_script(true);
  18. $nameTools = get_lang('PlatformAdmin');
  19. // setting breadcrumbs
  20. $interbreadcrumb[] = array ("url" => 'index.php', "name" => $nameTools);
  21. // setting the name of the tool
  22. $nameTools = get_lang('DataFiller');
  23. $output = array();
  24. if (!empty($_GET['fill'])) {
  25. switch ($_GET['fill']) {
  26. case 'users':
  27. require api_get_path(SYS_TEST_PATH).'datafiller/fill_users.php';
  28. $output = fill_users();
  29. break;
  30. case 'courses':
  31. require api_get_path(SYS_TEST_PATH).'datafiller/fill_courses.php';
  32. $output = fill_courses();
  33. break;
  34. default:
  35. break;
  36. }
  37. }
  38. // Displaying the header
  39. Display::display_header($nameTools);
  40. $result = '';
  41. if (count($output)>0) {
  42. $result = '<div class="filler-report">'."\n";
  43. $result .= '<h3>'.$output[0]['title'].'</h3>'."\n";
  44. $result .= '<table>';
  45. foreach ($output as $line) {
  46. $result .= '<tr>';
  47. $result .= '<td class="filler-report-data-init">'.$line['line-init'].' </td><td class="filler-report-data">'.$line['line-info'].'</td>';
  48. $result .= '</tr>';
  49. }
  50. $result .= '</table>';
  51. $result .= '</div>';
  52. Display::display_normal_message($result,false);
  53. }
  54. ?>
  55. <div class="well_border">
  56. <h4><?php Display::display_icon('bug.gif', 'DataFiller'); echo ' '.api_ucfirst(get_lang('DataFiller'));?></h4>
  57. <div><?php echo get_lang('ThisSectionIsOnlyVisibleOnSourceInstalls');?></div>
  58. <ul>
  59. <li><a href="filler.php?fill=users"><?php echo get_lang('FillUsers');?></a></li>
  60. <li><a href="filler.php?fill=courses"><?php echo get_lang('FillCourses');?></a></li>
  61. </ul>
  62. </div>
  63. <?php
  64. /* FOOTER */
  65. Display::display_footer();