insert_sessions_categories.php 619 B

1234567891011121314151617181920212223242526
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * This script generates four session categories.
  5. */
  6. require_once '../../main/inc/global.inc.php';
  7. api_protect_admin_script();
  8. $accessUrlId = api_get_current_access_url_id();
  9. $categories = array(
  10. 'capacitaciones',
  11. 'programas',
  12. 'especializaciones',
  13. 'cursos prácticos'
  14. );
  15. $tableSessionCategory = Database::get_main_table(TABLE_MAIN_SESSION_CATEGORY);
  16. foreach ($categories as $category) {
  17. Database::insert(
  18. $tableSessionCategory,
  19. [
  20. 'name' => $category,
  21. 'access_url_id' => $accessUrlId
  22. ]
  23. );
  24. }