$sql .= " AND (firstname LIKE '%".$keyword."%' OR lastname LIKE '%".$keyword."%' OR username LIKE '%".$keyword."%' OR official_code LIKE '%".$keyword."%')";
}
$res = api_sql_query($sql, __FILE__, __LINE__);
$result = mysql_num_rows($res);
$result = Database::num_rows($res);
return $result;
}
/**
@ -251,7 +251,8 @@ function get_user_data($from, $number_of_items, $column, $direction)
u.lastname AS col2,
u.firstname AS col3,
u.email AS col4,
u.user_id AS col5
u.active AS col5,
u.user_id AS col6
FROM $user_table u
LEFT JOIN $course_user_table cu on u.user_id = cu.user_id and course_code='".$_SESSION['_course']['id']."'
WHERE u.status='1' and cu.user_id IS NULL
@ -265,7 +266,8 @@ function get_user_data($from, $number_of_items, $column, $direction)
u.lastname AS col2,
u.firstname AS col3,
u.email AS col4,
u.user_id AS col5
u.active AS col5,
u.user_id AS col6
FROM $user_table u
LEFT JOIN $course_user_table cu on u.user_id = cu.user_id and course_code='".$_SESSION['_course']['id']."'
WHERE u.status='5' and cu.user_id IS NULL
@ -273,14 +275,14 @@ function get_user_data($from, $number_of_items, $column, $direction)
$sql .= " AND (firstname LIKE '%".$keyword."%' OR lastname LIKE '%".$keyword."%' OR username LIKE '%".$keyword."%' OR official_code LIKE '%".$keyword."%')";
* Build the active-column of the table to lock or unlock a certain user
* lock = the user can no longer use this account
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
* @param int $active the current state of the account
* @param int $user_id The user id
* @param string $url_params
* @return string Some HTML-code with the lock/unlock button
*/
function active_filter($active, $url_params, $row)
{
global $_user;
if ($active=='1')
{
$action='AccountActive';
$image='right';
}
if ($active=='0')
{
$action='AccountInactive';
$image='wrong';
}
if ($row['0']<>$_user['user_id']) // you cannot lock yourself out otherwise you could disable all the accounts including your own => everybody is locked out and nobody can change it anymore.