require_once("util/fns.inc"); require_once("html/study_los.inc"); require_once("html/comment.inc"); require_once("html/package.inc"); //limited_access(18); pre_check(); $show_pay_info = true; $include_social = true; $dbo = db_connect_dbo(); $id = get_subid_from_html();//if id provided, won't query the db. if(!is_numeric($id)) { show_user_error(); exit; } $id = intval($id); if($id > 5000) { show_old_subject($id); exit; } //limited_access: step 2 if(!is_local_testing() && !can_access_member_page(18)) { exit; } if(isset($_REQUEST['comment'])) { add_user_comment($id, 1, $_REQUEST['comment']); } if(!validate_id($id) || !cross_level_check(3, $id)) { show_restricted_access(); exit; } //for guest juggling around: if(is_guest()) { $exam_guide_id = get_exam_guide_id_by_sub_id($id); set_up_exam_guide_id_for_guest($exam_guide_id); } increment_access_score(4); //Now: if(should_redirect_to_payment()) { print_package("study_los.php?id=$id"); exit; } $custom_js = get_study_los_jquery_js($id); $user = $_SESSION['user']; $sub_row = get_subject_info_from_subid($id); if(is_restricted_user() && $sub_row['substatus'] == 1) { show_restricted_access(); exit; } $los_value = ""; $los_notes = ""; $year = $user['exam_year']; $level_label = get_exam_name_for_user(); $los_result = do_mysqli_query("select l.value, l.notes from los_main l, los_subject ls where ls.losid = l.id and ls.subid = " . $id); if($los_row = mysqli_fetch_array($los_result)) { $los_value = $los_row['value']; $los_notes = "CFA® $level_label Curriculum, " . $los_row['notes']; } $tweeter_text = "CFA Study Notes for $level_label - Topic " . $sub_row['ssnumber'] . ". Learning Module " . $sub_row['rnumber'] . ". LOS " . $los_value; //bq: $query = "select count(bqid) as count from basic_question where subid = $id"; if(!grant_access_based_on_region($user['ip'])) { $query = $query . " and source not like 'CFAI%'"; } $num_bq = get_count($query); //user complete subject and bookmark. $complete_status = 0; $bookmark = 0; if (!(is_paid_user_qb() && $sub_row['substatus'] == 1) && is_logged_on()) {//don't even show these 2 options if the content is not shown. $query = "select status, bookmark from sub_user_assgnmt where subid = " . $id . " and userId = " . $user['id']; $result = do_mysqli_query($query); if(mysqli_num_rows($result) != 0) { $rowsua = mysqli_fetch_array($result); $complete_status = $rowsua['status']; $bookmark = $rowsua['bookmark']; } } $private_note = get_private_note($id, 2); //social buttons: if(strlen($tweeter_text) > 108) { $tweeter_text = substr($tweeter_text, 0, 108) . " ...."; } //next and previous: if($sub_row['subnumber'] > 1) { $previousId = get_subject_id($sub_row['rid'], $sub_row['subnumber'], "<"); } $nextId = get_subject_id($sub_row['rid'], $sub_row['subnumber'], ">"); //links: $link_study_all = build_study_all_link(); $link_topic = build_topic_link_title($sub_row['ssid']); $link_module = build_module_link_title($sub_row['rid']); $canonical_link = build_subject_link_title_from_subid($id); $last_item = "Subject " . $sub_row['subnumber'] . ". " . $sub_row['subvalue']; $breadcrumb = array(array($link_study_all, $level_label), array($link_topic, "Topic " . $sub_row['ssnumber'] . ". " . $sub_row['ssvalue']), array($link_module, "Learning Module " . $sub_row['rnumber'] . ". " . $sub_row['rvalue']), array("", $last_item)); print_page_header("CFA Study Preparation", $canonical_link); print_breadcrumb($breadcrumb); print_study_los_page(); function print_los_action_links() { global $num_bq, $id, $previousId, $nextId, $complete_status, $bookmark, $private_note; print_card_start_with_header("Actions"); echo "
" . $question_value . $row['value'] . "
"; $question_value = "" . $question_value . $row['answer'] . "
"; print_card_block($question_value); } print_card_section_end(); //side_column print_side_section_start(); print_rotating_image(); print_side_study_title_only("Study notes from a previous year's CFA exam:" . $subject['title']); print_side_section_end(); print_container_end(); print_footer(); } function get_study_los_jquery_js($id) { if(is_guest()) { return ""; } //the add note function did not work in safari and firefox. Indian helped. return ""; } ?>