|
|
@ -1214,36 +1214,44 @@ class MySpace |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static function get_total_number_sessions() |
|
|
|
public static function get_total_number_sessions() |
|
|
|
{ |
|
|
|
{ |
|
|
|
$table = Database::get_main_table(TABLE_MAIN_SESSION); |
|
|
|
return SessionManager::count_sessions(api_get_current_access_url_id()); |
|
|
|
$sql = "SELECT COUNT(id) count FROM $table"; |
|
|
|
|
|
|
|
$result = Database::query($sql); |
|
|
|
|
|
|
|
$row = Database::fetch_assoc($result); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $row['count']; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Get data for the sessions |
|
|
|
* Get data for the sessions |
|
|
|
* |
|
|
|
* |
|
|
|
* @param int $from Inferior limit |
|
|
|
* @param int $from Inferior limit |
|
|
|
* @param int $number_of_items Number of items to select |
|
|
|
* @param int $numberItems Number of items to select |
|
|
|
* @param string $column Column to order on |
|
|
|
* @param string $column Column to order on |
|
|
|
* @param string $direction Order direction |
|
|
|
* @param string $direction Order direction |
|
|
|
* @return array Results |
|
|
|
* @return array Results |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static function get_session_data_tracking_overview($from, $number_of_items, $column, $direction) |
|
|
|
public static function get_session_data_tracking_overview($from, $numberItems, $column, $direction) |
|
|
|
{ |
|
|
|
{ |
|
|
|
$main_session_table = Database::get_main_table(TABLE_MAIN_SESSION); |
|
|
|
$from = (int) $from; |
|
|
|
|
|
|
|
$numberItems = (int) $numberItems; |
|
|
|
$sql = "SELECT id AS col0, name AS col1 FROM $main_session_table"; |
|
|
|
$direction = Database::escape_string($direction); |
|
|
|
$sql .= " ORDER BY col$column $direction "; |
|
|
|
$columnName = 'name'; |
|
|
|
$sql .= " LIMIT $from,$number_of_items"; |
|
|
|
if ($column === 1) { |
|
|
|
$result = Database::query($sql); |
|
|
|
$columnName = 'id'; |
|
|
|
$return = array (); |
|
|
|
} |
|
|
|
while ($session = Database::fetch_row($result)) { |
|
|
|
|
|
|
|
$return[] = $session; |
|
|
|
$options = [ |
|
|
|
} |
|
|
|
'order' => " $columnName $direction", |
|
|
|
return $return; |
|
|
|
'limit' => " $from,$numberItems" |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
$sessions = SessionManager::get_sessions_admin($options); |
|
|
|
|
|
|
|
$list = []; |
|
|
|
|
|
|
|
foreach ($sessions as $session) { |
|
|
|
|
|
|
|
$list[] = [ |
|
|
|
|
|
|
|
'0' => $session['id'], |
|
|
|
|
|
|
|
'col0' => $session['id'], |
|
|
|
|
|
|
|
'1' => $session['name'], |
|
|
|
|
|
|
|
'col1' => $session['name'] |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $list; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|