| @@ 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 | } |
|
| @@ 1524-1538 (lines=15) @@ | ||
| 1521 | */ |
|
| 1522 | function api_get_course_int_id($code = null) |
|
| 1523 | { |
|
| 1524 | if (!empty($code)) { |
|
| 1525 | $code = Database::escape_string($code); |
|
| 1526 | $row = Database::select( |
|
| 1527 | 'id', |
|
| 1528 | Database::get_main_table(TABLE_MAIN_COURSE), |
|
| 1529 | array('where'=> array('code = ?' => array($code))), |
|
| 1530 | 'first' |
|
| 1531 | ); |
|
| 1532 | ||
| 1533 | if (is_array($row) && isset($row['id'])) { |
|
| 1534 | return $row['id']; |
|
| 1535 | } else { |
|
| 1536 | return false; |
|
| 1537 | } |
|
| 1538 | } |
|
| 1539 | return Session::read('_real_cid', 0); |
|
| 1540 | } |
|
| 1541 | ||