| @@ 948-967 (lines=20) @@ | ||
| 945 | { |
|
| 946 | $userId = intval($userId); |
|
| 947 | $sessionId = intval($sessionId); |
|
| 948 | if (!empty($userId) && !empty($sessionId)) { |
|
| 949 | $queueTable = Database::get_main_table(TABLE_ADVANCED_SUBSCRIPTION_QUEUE); |
|
| 950 | $row = Database::select( |
|
| 951 | 'status', |
|
| 952 | $queueTable, |
|
| 953 | array( |
|
| 954 | 'where' => array( |
|
| 955 | 'user_id = ? AND session_id = ?' => array($userId, $sessionId), |
|
| 956 | ) |
|
| 957 | ) |
|
| 958 | ); |
|
| 959 | ||
| 960 | if (count($row) == 1) { |
|
| 961 | ||
| 962 | return $row[0]['status']; |
|
| 963 | } else { |
|
| 964 | ||
| 965 | return ADVANCED_SUBSCRIPTION_QUEUE_STATUS_NO_QUEUE; |
|
| 966 | } |
|
| 967 | } |
|
| 968 | ||
| 969 | return false; |
|
| 970 | } |
|
| @@ 1638-1652 (lines=15) @@ | ||
| 1635 | */ |
|
| 1636 | function api_get_course_int_id($code = null) |
|
| 1637 | { |
|
| 1638 | if (!empty($code)) { |
|
| 1639 | $code = Database::escape_string($code); |
|
| 1640 | $row = Database::select( |
|
| 1641 | 'id', |
|
| 1642 | Database::get_main_table(TABLE_MAIN_COURSE), |
|
| 1643 | array('where'=> array('code = ?' => array($code))), |
|
| 1644 | 'first' |
|
| 1645 | ); |
|
| 1646 | ||
| 1647 | if (is_array($row) && isset($row['id'])) { |
|
| 1648 | return $row['id']; |
|
| 1649 | } else { |
|
| 1650 | return false; |
|
| 1651 | } |
|
| 1652 | } |
|
| 1653 | return Session::read('_real_cid', 0); |
|
| 1654 | } |
|
| 1655 | ||