Esempio n. 1
0
<?php

require_once './global.inc.php';
verify_oauth_session_exists();
$studentTools = new StudentTools();
$settingsTools = new SettingsTools();
$sort = 'name';
if (isset($_GET['sort'])) {
    $sort = $_GET['sort'];
}
if (HttpSession::currentUser()->getOrganization()->access_level > 2) {
    $technology = explode('_', $_GET['technology']);
}
//print_r($technology);
if (isset($_GET['batch']) && $_GET['batch'] == "level_2") {
    $batch = "level_2";
    $batchId = $settingsTools->getLevelTwoId();
} else {
    if (isset($_GET['batch']) && $_GET['batch'] == "level_3") {
        $batch = "level_3";
        $batchId = $settingsTools->getLevelThreeId();
    } else {
        if (isset($_GET['batch']) && $_GET['batch'] == "level_1") {
            $batch = "level_1";
            $batchId = $settingsTools->getLevelOneId();
        } else {
            $batch = "level_4";
            $batchId = $settingsTools->getLevelFourId();
        }
    }
}
Esempio n. 2
0
            $technology->name = trim($tech);
            $technology->save(TRUE);
        }
        if (!Endorsement::checkEndorsementExists($techId, $student_id)) {
            $endorsement = new Endorsement();
            $endorsement->student_id = $student_id;
            $endorsement->technology_id = $techId;
            $endorsement->count = 1;
            $endorsement->save(TRUE);
        }
    }
}
?>

<?php 
$studentTools = new StudentTools();
if (isset($batch_id)) {
    $students = $studentTools->getStudents($batch_id, 'students.id', null);
} else {
    $students = $studentTools->getAllStudents($start_index);
}
echo 'Begining the processing ...<br />';
foreach ($students as $student) {
    try {
        $html = file_get_html($student->profile_url);
        $skills = getSkills($html);
        insertSkills($skills, $student->id);
        echo 'Imported data for Student:' . $student->id . '<br />';
        flush();
        ob_flush();
    } catch (Exception $e) {