12345678910111213141516171819202122232425262728293031323334 |
- <?php
- require_once __DIR__.'/../inc/global.inc.php';
- function getAllCategoriesAndUsers() {
- $table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_RESULT);
- $jointable = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
- $joinStatement = ' JOIN '.$jointable.' ON '.$table.'.evaluation_id = '.$jointable.'.id';
- return Database::select(
- 'DISTINCT '.$jointable.'.category_id,'.$table.'.user_id',
- $table.$joinStatement
- );
- }
- if ($categoriesAndUsers = getAllCategoriesAndUsers()) {
- foreach ($categoriesAndUsers as $categoryAndUser) {
- Category::register_user_certificate(
- $categoryAndUser['category_id'],
- $categoryAndUser['user_id']
- );
- }
- }
|