filler.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. case 'exe':
  35. require api_get_path(SYS_TEST_PATH).'datafiller/fill_exe.php';
  36. $output = fill_exe();
  37. break;
  38. default:
  39. break;
  40. }
  41. }
  42. // Displaying the header
  43. Display::display_header($nameTools);
  44. $result = '';
  45. if (count($output) > 0) {
  46. $result = '<div class="filler-report">'."\n";
  47. $result .= '<h3>'.$output[0]['title'].'</h3>'."\n";
  48. $result .= '<table>';
  49. foreach ($output as $line) {
  50. $result .= '<tr>';
  51. $result .= '<td class="filler-report-data-init">'.$line['line-init'].' </td><td class="filler-report-data">'.$line['line-info'].'</td>';
  52. $result .= '</tr>';
  53. }
  54. $result .= '</table>';
  55. $result .= '</div>';
  56. Display::display_normal_message($result, false);
  57. }
  58. ?>
  59. <div class="well_border">
  60. <h4><?php Display::display_icon('bug.gif', 'DataFiller');
  61. echo ' '.api_ucfirst(get_lang('DataFiller')); ?></h4>
  62. <div><?php echo get_lang('ThisSectionIsOnlyVisibleOnSourceInstalls'); ?></div>
  63. <ul>
  64. <li><a href="filler.php?fill=users"><?php echo get_lang('FillUsers'); ?></a></li>
  65. <li><a href="filler.php?fill=courses"><?php echo get_lang('FillCourses'); ?></a></li>
  66. <li><a href="filler.php?fill=exe"><?php echo get_lang('FillExercises'); ?></a></li>
  67. </ul>
  68. </div>
  69. <?php
  70. /* FOOTER */
  71. Display::display_footer();