filler.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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'); echo ' '.api_ucfirst(get_lang('DataFiller'));?></h4>
  61. <div><?php echo get_lang('ThisSectionIsOnlyVisibleOnSourceInstalls');?></div>
  62. <ul>
  63. <li><a href="filler.php?fill=users"><?php echo get_lang('FillUsers');?></a></li>
  64. <li><a href="filler.php?fill=courses"><?php echo get_lang('FillCourses');?></a></li>
  65. <li><a href="filler.php?fill=exe"><?php echo get_lang('FillExercises');?></a></li>
  66. </ul>
  67. </div>
  68. <?php
  69. /* FOOTER */
  70. Display::display_footer();