HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-31-18-78 6.17.0-1017-aws #17~24.04.1-Ubuntu SMP Tue May 26 21:09:53 UTC 2026 aarch64
User: ubuntu (1000)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: /var/www/selfanalyse/personality-test/test-report.php
<?php

/**
 *
 * Title : Test Report
 * Developer : Rohit Kashyap
 * Date : 17 Mar,2020
 * Description : User test report and their sten score with highchart.
 */
// ini_set('dsiplay_errors', 1);
// error_reporting(E_ALL);
include_once('../wp-config.php');

if (is_user_logged_in()) {
    $user_id = $current_user->ID;


    global $wpdb;
    $PSY_EXAMS = $wpdb->prefix . PSY_EXAMS;
    $PSY_ABILITY = $wpdb->prefix . PSY_ABILITY;
    $PSY_ABILITY_CLASS = $wpdb->prefix . PSY_ABILITY_CLASS;
    $PSY_ABILITY_STEN_DESC = $wpdb->prefix . PSY_ABILITY_STEN_DESC;
    $PSY_USERS_DETAILS = $wpdb->prefix . PSY_USERS_DETAILS;
    $PSY_SP_OPTION_VALUE = $wpdb->prefix . PSY_SP_OPTION_VALUE;
    $PSY_ABILITY_RAW_SCORE = $wpdb->prefix . PSY_ABILITY_RAW_SCORE;
    $PSY_TEST_GEN_TEST_TAKEN = $wpdb->prefix . PSY_TEST_GEN_TEST_TAKEN;
    $PSY_TEST_GEN_TEST_TAKEN_QUESTION_ANSWER = $wpdb->prefix . PSY_TEST_GEN_TEST_TAKEN_QUESTION_ANSWER;

    $testID = $_REQUEST['testId'];

    $curDate = date('Y-m-d H:i:s');

    if (is_numeric($testID) && strlen($testID) <= 5) {

        $checkTest = $wpdb->get_var("SELECT count(test_taken_id) FROM $PSY_TEST_GEN_TEST_TAKEN where test_taken_id='$testID' and user_id='$user_id' and test_type='PER' and status='Y'");

        if ($checkTest != '0') {



            $userData = $wpdb->get_row("SELECT ud.first_name,ud.last_name,ud.date_of_birth,cl.class_name FROM $PSY_USERS_DETAILS as ud left join $PSY_ABILITY_CLASS as cl on cl.class_id=ud.current_education_level where ud.user_id='$user_id'");

            $studentName = $userData->first_name . ' ' . $userData->last_name;
            $dob = date('d F, Y', strtotime($userData->date_of_birth));
            $class = $userData->class_name;



            $getTestDetails = $wpdb->get_row("SELECT tt.total_questions,tt.class_id,tt.exam_category_id,tt.time_taken_in_seconds,tt.start_date,e.category_name,cl.class_name FROM $PSY_TEST_GEN_TEST_TAKEN as tt LEFT JOIN $PSY_EXAMS as e on e.exam_category_id=tt.exam_category_id LEFT JOIN $PSY_ABILITY_CLASS as cl on cl.class_id=tt.class_id where tt.test_taken_id='$testID' and tt.status='Y'");

            $exam_id = $getTestDetails->exam_category_id;
            $class_id = $getTestDetails->class_id != '0' ? $getTestDetails->class_id : '13';

            $dateAttempt = date('d F, Y', strtotime($getTestDetails->start_date));
            $seconds = $getTestDetails->time_taken_in_seconds;
            $testDate = date('Y-m-d H:i:s', strtotime($getTestDetails->start_date));
            $date1 = str_replace('-', '/', $testDate);
            $tomorrow = date('Y-m-d H:i:s', strtotime($date1 . '+1 days'));

            $parent_subject = $wpdb->get_var("SELECT exam_category_id FROM $PSY_EXAMS where parent_id='$exam_id'");

            $getsubject = $wpdb->get_results("SELECT e.category_name,e.exam_category_id from $PSY_EXAMS as e LEFT JOIN $PSY_ABILITY as ab on ab.ref_id=e.exam_category_id where e.parent_id='$parent_subject' and e.exam_category_id NOT IN('48308','48352') order by e.exam_category_id");


?>
            <!DOCTYPE html>
            <html <?php language_attributes(); ?>>

            <head>
                <title>Personality Test Report - Selfanalyse</title>
                <link rel="stylesheet" href="/aptitude-test/css/bootstrap.min.css">
                <link rel="icon" type="image/png" sizes="32x32" href="/wp-content/themes/psychometrics/images/favicon.png">
                <script src="/aptitude-test/js/jquery.min.js"></script>
                <script src="/aptitude-test/js/bootstrap.min.js"></script>
                <script src="/aptitude-test/js/highcharts.js"></script>
            </head>

            <body>
                <style>
                    body {
                        background: rgb(204, 204, 204);
                    }

                    .coverA4 {
                        margin: 0 auto;
                        margin-bottom: 20px;
                        box-shadow: 0 0 0.5cm rgba(0, 0, 0, 0.5);
                        width: 50%;
                        background-image: url('pdf-image/bg-cover.jpg');
                        background-repeat: no-repeat;
                        background-size: 100% 100%;
                        height: 100vh;
                        display: flex;
                        align-items: center;
                        justify-content: space-between;
                        flex-direction: column;
                    }

                    .cover-footer {
                        background-color: #fac237a6;
                        color: #000;
                        font-family: arial;
                        text-align: center;
                        padding: 16px 0;
                        font-weight: 700;
                        font-style: italic;
                        font-size: 20px;
                        width: 100%;
                        margin-bottom: 20px;
                    }

                    .pageA4 {
                        margin: 0 auto;
                        margin-bottom: 20px;
                        box-shadow: 0 0 0.5cm rgba(0, 0, 0, 0.5);
                        width: 50%;
                        height: 100%;
                        background-image: url('pdf-image/bg-page-cover.jpg');
                        display: flex;
                        justify-content: space-between;
                        flex-direction: column;
                    }

                    .footer {
                        background-color: #fac237a6;
                        color: #000;
                        font-family: arial;
                        text-align: center;
                        padding: 16px 20px;
                        font-weight: 700;
                        font-style: italic;
                        font-size: 16px;
                        margin-bottom: 20px;
                        display: flex;
                        align-items: center;
                        justify-content: space-between;
                        margin-top: 20px;
                    }

                    .header {
                        display: flex;
                        align-items: center;
                        justify-content: space-between;
                        padding: 10px 20px;
                    }

                    @media print {

                        body,
                        .coverA4 {
                            margin: 0;
                            box-shadow: 0;
                        }

                        .pageA4 {
                            margin: 0;
                            box-shadow: 0;
                        }
                    }

                    .cover-logo img {
                        background: #fdf3de;
                        width: 70%;
                        padding: 30px;
                        margin: 0 auto -10em;
                        display: block;
                    }

                    .cover-title {
                        font-family: arial;
                        color: #fac237;
                        text-align: center;
                        font-size: 36px;
                        margin: 0;
                        padding-bottom: 10px;
                    }

                    .cover-subtitle {
                        font-family: arial;
                        color: #01516a;
                        text-align: center;
                        font-size: 30px;
                        margin: 0;
                        letter-spacing: 1.9px;
                    }

                    .cover-mid {
                        text-align: center;
                        padding: 20px 0;
                    }

                    .cover-brand {
                        background-color: #fdf3de;
                        padding: 20px;
                        width: 80px;
                        height: auto;
                        border-radius: 80px;
                        overflow: initial;
                    }

                    .cover-brand-title {
                        font-family: arial;
                        font-weight: 700;
                        margin: 0;
                        font-size: 14px;
                        padding: 10px 0;
                    }

                    .page-body {
                        padding: 0 20px;
                    }

                    .page-title {
                        font-family: arial;
                        color: #fac237;
                        font-size: 28px;
                        margin: 0;
                    }

                    .page-content {
                        font-family: arial;
                        line-height: 24px;
                        font-size: 14px;
                        margin-top: 10px;
                    }

                    .page-title-blue {
                        font-family: arial;
                        color: #01516a;
                        font-size: 20px;
                        margin: 0;
                        margin-top: 20px;
                    }

                    .VerbalAptitudeFlexBox {
                        display: flex;
                        justify-content: space-between;
                        align-items: center;
                        margin-bottom: 40px;
                    }

                    .VerbalAptitudeFlexBox .section-left-yellow {
                        border-radius: 0px 10px 10px 0px;
                        background: #fff2d7;
                        padding: 10px 20px;
                        margin-left: -20px;
                        margin-top: 10px;
                        margin-bottom: 10px;
                        font-size: 13px;
                        line-height: 20px;
                        font-weight: 500;
                    }

                    .section-right-yellow-image {
                        width: 150px;
                        object-fit: contain;
                        margin-left: 20px;
                    }

                    .section-left-blue {
                        border-radius: 10px 0px 0px 10px;
                        background: #cbdde1;
                        width: 70%;
                        padding: 10px 20px;
                        margin-right: -20px;
                        margin-top: 0;
                        margin-bottom: 10px;
                        font-size: 13px;
                        line-height: 20px;
                        font-weight: 500;
                    }

                    .section-right-blue-image {
                        width: 140px;
                        height: 140px;
                        object-fit: contain;
                        margin-left: 20px;
                    }

                    .section-title {
                        font-size: 16px;
                        color: #01516a;
                        margin: 0;
                        margin-top: 30px;
                    }

                    .CareerGuidanceProgramFlex {
                        display: flex;
                        justify-content: space-between;
                        /* margin-top: 10px; */
                    }

                    .CareerGuidanceProgramFlex .page-content-footerimg img {
                        width: 80%;
                        margin: 0 auto;
                        display: block;
                    }

                    .page-body .StenScoresRangeBox h2 {
                        font-family: arial;
                        color: #303030;
                        font-size: 28px;
                        margin: 0;
                    }

                    .page-body .StenScoresRangeBox .StenScoresRangeheaderflex {
                        display: flex;
                        align-items: center;
                        justify-content: space-between;
                        background: rgb(0 0 0 / 8%);
                        border-radius: 20px;
                        padding: 30px;
                        margin-top: 10px;
                        margin-bottom: 30px;
                    }

                    .page-body .StenScoresRangeBox .StenScoresRangeheaderflex .StenScoresheaderbox {
                        background: linear-gradient(270deg, #ffca69, rgb(255 245 226 / 61%));
                        border-left: 8px solid #ee9f10;
                        width: 22%;
                        padding: 10px 14px;
                        border-radius: 0 6px 6px 0;
                    }

                    .page-body .StenScoresRangeBox .StenScoresRangeheaderflex .StenScoresheaderbox h3 {
                        font-family: arial;
                        color: #303030;
                        font-size: 14px;
                        margin: 0;
                    }

                    .page-body .StenScoresRangeBox .StenScoresRangeheaderflex .StenScoresheaderbox h4 {
                        font-family: arial;
                        color: #dea133;
                        font-size: 12px;
                        margin: 0;
                        padding-top: 4px;
                    }

                    .page-body .StenScoresRangeBox .StenScoresRangeheaderflex span {
                        display: block;
                        line-height: normal;
                        font-size: 30px;
                        font-weight: 800;
                        color: #0ece0e;
                    }

                    .page-body .StenScoresRangeBox h3 {
                        font-family: arial;
                        color: #303030;
                        font-size: 18px;
                        margin: 0;
                    }

                    .page-body .StenScoresRangeBox table {
                        margin-top: 10px;
                        margin-bottom: 30px;
                    }

                    .page-body .StenScoresRangeBox table tr th {
                        background: #3f76b2;
                        color: #fff;
                        font-family: arial;
                        padding: 10px;
                        font-size: 14px;
                    }

                    .page-body .StenScoresRangeBox table tr td {
                        background: #e8e8e8;
                        color: #656565;
                        font-family: arial;
                        padding: 10px;
                        font-size: 13px;
                        font-weight: 700;
                        line-height: 18px;
                    }

                    .YourStenScoreBox {
                        padding: 20px;
                        background: rgb(0 0 0 / 8%);
                        border-radius: 4px;
                        margin: 20px auto;
                    }

                    .YourStenScoreBox h2 {
                        margin: 0;
                        text-align: center;
                        font-size: 18px;
                        font-family: arial;
                    }

                    .YourStenScoreBox h2 b {
                        font-weight: 700;
                        color: #446282;
                    }

                    .YourStenScoreBox p {
                        margin: 0;
                        text-align: center;
                        font-family: arial;
                        font-size: 12px;
                        line-height: 20px;
                        background: rgb(9 88 146 / 22%);
                        padding: 10px 20px;
                        border-radius: 10px;
                        margin-top: 10px;
                        font-weight: 600;
                        color: #535353;
                    }

                    .download-btn {
                        background-color: #005067;
                        border: none;
                        padding: 8px 12px;
                        border-radius: 4px;
                        color: #fff;
                        position: absolute;
                        top: 2em;
                        right: 32em;
                    }
                </style>

                <!-- TOP TABLE SECTION -->
                <!----User details--->
                <div class="coverA4">
                    <div class="cover-logo">
                        <img src="pdf-image/shine-logo.png">
                    </div>
                    <div class="cover-body">
                        <h2 class="cover-title">PSYCHOMETRIC TEST</h2>
                        <h2 class="cover-subtitle">REPORT</h2>

                        <form method="post" action="pdf.php">
                            <input type="hidden" name="test" value="<?php echo $testID; ?>" />
                            <button class="download-btn">Download</button>
                        </form>

                        <div class="cover-mid">
                            <img class="cover-brand" src="/wp-content/themes/psychometrics/images/per-assessment.png" width="75" height="75">
                            <h2 class="cover-brand-title">Personality Test Report</h2>
                        </div>
                    </div>
                    <div class="cover-footer">
                        <div>www.selfanalyse.com</div>
                    </div>
                </div>
                <?php
                if ($curDate >= $tomorrow) {

                ?>
                    <!-- Page-1 -->
                    <div class="pageA4">
                        <div class="header">
                            <div class="headerlogo-left"><img src="pdf-image/shine-logo.png" width="150" /></div>
                            <div class="headerlogo-right"><img src="pdf-image/second-logo.png" width="120" /></div>
                        </div>
                        <div class="page-body">
                            <h1 class="page-title">PERSONAL DETAILS</h1>
                            <h4 style="color:#005068;font-size: 18px;font-family: arial;border-left: 5px solid #005068;margin: 40px 0;font-weight: 500;">&nbsp;&nbsp;Name : <span style="font-weight: bold;"> <?php echo $studentName; ?> </span></h4>
                            <h4 style="color:#005068;font-size: 18px;font-family: arial;border-left: 5px solid #005068;margin: 40px 0;font-weight: 500;">&nbsp;&nbsp;Gender : <span style="font-weight: bold;"> <?php echo $gender; ?> </span></h4>
                            <h4 style="color:#005068;font-size: 18px;font-family: arial;border-left: 5px solid #005068;margin: 40px 0;font-weight: 500;">&nbsp;&nbsp;Date of Birth : <span style="font-weight: bold;"> <?php echo $dob; ?> </span></h4>
                            <h4 style="color:#005068;font-size: 18px;font-family: arial;border-left: 5px solid #005068;margin: 40px 0;font-weight: 500;">&nbsp;&nbsp;Current Level of Education : <span style="font-weight: bold;"> Class <?php echo $class; ?> </span></h4>
                            <h4 style="color:#005068;font-size: 18px;font-family: arial;border-left: 5px solid #005068;margin: 40px 0;font-weight: 500;">&nbsp;&nbsp;Test Taken on : <span style="font-weight: bold;"> <?php echo $dateAttempt; ?> </span></h4>
                            <h4 style="color:#005068;font-size: 18px;font-family: arial;border-left: 5px solid #005068;margin: 40px 0;font-weight: 500;">&nbsp;&nbsp;Email Address : <span style="font-weight: bold;"><?php echo $email; ?> </span></h4>
                            <h4 style="color:#005068;font-size: 18px;font-family: arial;border-left: 5px solid #005068;margin: 40px 0;font-weight: 500;">&nbsp;&nbsp;Phone No : <span style="font-weight: bold;"> <?php echo $mobileno; ?> </span></h4>
                        </div>
                        <div class="footer">
                            <div class="footer-text-left">www.selfanalyse.com</div>
                            <div class="footer-text-right">source : PsyCom Sevices, New Delhi</div>
                        </div>
                    </div>
                    <!-- Page-2 -->
                    <div class="pageA4">
                        <div class="header">
                            <div class="headerlogo-left"><img src="pdf-image/shine-logo.png" width="150" /></div>
                            <div class="headerlogo-right"><img src="pdf-image/second-logo.png" width="120" /></div>
                        </div>

                        <div class="page-body">
                            <h1 class="page-title">ABOUT US</h1>
                            <div class="page-content">
                                We are a team of working professionals with diverse Work experience in the fields of teaching, training, communication and Career Guidance counselling, spanning over six decades. We wanted to do what we love and believe in. We strongly believe that every human being is intelligent. Intelligence is the ability to acquire knowledge and skills. Infact the reare multiple inteligence and everyone can find theirs. than based on societal pressures and preconceived notions. Knowing and understanding our true potential and capability, helps to find a profession which is just right for us. Most Importantly it helps us to find inner peace, which leads to happiness and helps us to accept ourselves. work towards the happiness of youth, society and nation at large
                            </div>
                            <h1 class="page-title-blue">Career Guidance Program</h1>
                            <div class="CareerGuidanceProgramFlex">
                                <div class="page-content">
                                    Relevant information to the students at the right time of the development cycle helps them move from crystallization of career choices to specification and implementation. Informed career choices help them make smart and correct choices that lead to success in life.
                                    <br>
                                    The aim of our career guidance program is not only to provide suitable career choices but also to help an individual to increase selfawareness about his/her strength and weaknesses and provide opportunity for assessment of aptitude and interests. Relating one’s aptitude and interests to choice of subjects and streams can help one carve out his/ her career path.
                                </div>
                                <div class="page-content-footerimg"><img src="pdf-image/career-guidance.png" width="300"></div>
                            </div>
                        </div>
                        <div class="footer">
                            <div class="footer-text-left">www.selfanalyse.com</div>
                            <div class="footer-text-right">source : PsyCom Sevices, New Delhi</div>
                        </div>
                    </div>
                    <!-- Page-3 -->
                    <div class="pageA4">
                        <div class="header">
                            <div class="headerlogo-left"><img src="pdf-image/shine-logo.png" width="150" /></div>
                            <div class="headerlogo-right"><img src="pdf-image/second-logo.png" width="120" /></div>
                        </div>

                        <div class="page-body">
                            <h1 class="page-title">ABOUT PSYCHOMETRIC TEST</h1>
                            <div class="page-content">
                                Psychometric testing are scientific instruments for measurement and study of individual differences, intelligences, aptitudes and interests. The tool used for measuring the aptitude/abilities of a student is a standardized test which measures and assesses the abilities along seven different domains. The abilities are quantified and analyzed. The scores are interpreted and represented graphically to present a picture of one's individual abilities.
                                <br>
                                The interest is assessed using an inventory that brings out the interest along ten different areas. This reveals the main interest areas of the individual which if pursued are likely to lead to success.
                                <br>
                                A good understanding of one's interest and aptitude and matching it up with credible and authentic career information can help student carve his/her own career path towards success.
                            </div>
                            <div class="CareerGuidanceProgramFlex">
                                <div class="page-content">
                                    Psychometric test report should be viewed in totality. Co-relation between different areas of aptitude and interest is important to obtain a complete picture of the areas of strength and areas for improvement.
                                    <br>
                                    Aptitude test scores alone are not indicative of a candidate's success in a particular area. Practice, effort, skill development and interest along with aptitude will help a candidate actualize his/her true potential.
                                    <br>
                                    Correct interpretation of the test report is important to pave the correct pathway. The counselor plays an important role in helping the candidate increase his/her self -awareness and make informed choices of subjects, streams and courses.
                                    <br>
                                    <strong>This helps turn dreams to success stories!</strong>
                                </div>
                                <div class="page-content-footerimg"><img src="pdf-image/psychometric-tests.png" width="300"></div>
                            </div>
                        </div>

                        <div class="footer">
                            <div class="footer-text-left">www.selfanalyse.com</div>
                            <div class="footer-text-right">source : PsyCom Sevices, New Delhi</div>
                        </div>
                    </div>
                    <!-- Page-5 -->
                    <div class="pageA4">
                        <div class="header">
                            <div class="headerlogo-left"><img src="pdf-image/shine-logo.png" width="150" /></div>
                            <div class="headerlogo-right"><img src="pdf-image/second-logo.png" width="120" /></div>
                        </div>
                        <div class="page-body">
                            <h4 class="page-title" style="font-size: 20px; margin: 0px;">DESCRIPTION OF PERSONALITY DIMENSIONS</h4>
                            <div class="page-content">
                                Personality is the combination of characteristics or qualities that form an individual's distinctive character. These characteristics are called dimensions of personality.
                            </div>
                            <!-- 1 -->
                            <div class="page-content section-div">
                                <h4 class="section-title">Academic Achievement</h4>
                                <div class="VerbalAptitudeFlexBox">
                                    <div class="section-left-yellow">
                                        This dimension refers to a student's attitude towards 'learning' and his ambition to succeed. It usually reflects the amount of skill that a student has and his inclination to learn more and succeed more. High score in this dimension indicates that a student is extremely interested in learning, in his position in school or class, is ambitious and involved in various aspects of school life.
                                    </div>
                                    <div class="section-right-yellow">
                                        <img class="section-right-yellow-image" src="pdf-image/academic-chievement.png">
                                    </div>
                                </div>
                            </div>
                            <!-- 2 -->
                            <div class="page-content section-div">
                                <h4 class="section-title" style="text-align: right;margin-bottom: 10px;">Adaptability</h4>
                                <div class="VerbalAptitudeFlexBox">
                                    <div class="section-right-blue">
                                        <img class="section-right-blue-image" src="pdf-image/adaptability.png">
                                    </div>
                                    <div class="section-left-blue">
                                        Adaptability - this refers to an individual's ability to respond in an appropriate manner to changed circumstances. A high score for this dimension indicates that a persons is able to adapt easily to his/her surroundings and hence is able to work and learn better. This usally results in harmony and peace within. Individuals with a high score are usually do not stress over changes in their environment and are able to perform better.
                                    </div>
                                </div>
                            </div>
                            <!-- 3 -->
                            <div class="page-content section-div">
                                <h4 class="section-title">Boldness</h4>
                                <div class="VerbalAptitudeFlexBox">
                                    <div class="section-left-yellow">
                                        Boldness - this dimension refers to the willingness to take risks and act innovatively. High scores indicate confidence or courage. Such individuals will be adventurous, energetic and will enjoy being center of attention. Usually high performing athletes, successful sales people score above average in this dimension. High scorers usually can be described as quick decision makers (though may not always be right) who like to enjoy life.
                                    </div>
                                    <div class="section-right-yellow">
                                        <img class="section-right-yellow-image" src="pdf-image/boldness.png">
                                    </div>
                                </div>
                            </div>
                            <!-- 3 -->
                        </div>
                        <div class="footer">
                            <div class="footer-text-left">www.selfanalyse.com</div>
                            <div class="footer-text-right">source : PsyCom Sevices, New Delhi</div>
                        </div>
                    </div>
                    <!-- Page-6 -->
                    <div class="pageA4">
                        <div class="header">
                            <div class="headerlogo-left"><img src="pdf-image/shine-logo.png" width="150" /></div>
                            <div class="headerlogo-right"><img src="pdf-image/second-logo.png" width="120" /></div>
                        </div>
                        <div class="page-body">
                            <!-- 1 -->
                            <div class="page-content section-div">
                                <h4 class="section-title">Competition</h4>
                                <div class="VerbalAptitudeFlexBox">
                                    <div class="section-left-yellow">
                                        Competition - this dimension refers to an individual's assertiveness. High scores are usually indicative of a dominant and at times aggressive temperament. Such individuals like to implement their own ideas and like to get their own way. They are forceful and generally very direct in their relations with other people. Sports persons and Judges tend to score higher in this dimension.
                                    </div>
                                    <div class="section-right-yellow">
                                        <img class="section-right-yellow-image" src="pdf-image/Competition.png">
                                    </div>
                                </div>
                            </div>
                            <!-- 2 -->
                            <div class="page-content section-div">
                                <h4 class="section-title" style="text-align: right;margin-bottom: 10px;">Enthusiasm</h4>
                                <div class="VerbalAptitudeFlexBox">
                                    <div class="section-right-blue">
                                        <img class="section-right-blue-image" src="pdf-image/Enthusiasm.png">
                                    </div>
                                    <div class="section-left-blue">
                                        Enthusiasm - this dimension refers to the level of exuberance in an individual. High scorers usually have a "happy-golucky" attitude. They are lively and tend to have more friends than most others. They enjoy going out to parties and shows. They usually tend to take up jobs that offers variety and opportunities for travel. Generally, people in the hospitality industry, cabin crew of airlines, tour operators tend to score high in this dimension.
                                    </div>
                                </div>
                            </div>
                            <!-- 3 -->
                            <div class="page-content section-div">
                                <h4 class="section-title">General Ability</h4>
                                <div class="VerbalAptitudeFlexBox">
                                    <div class="section-left-yellow">
                                        General Ability - this dimension refers to the learning capacity of individuals. High scorers are usually "fast-learners", are insightful and intellectually inclined. They generally have high observation ability and tend to show better judgement than most people around them. They are good at abstract thinking and problem solving and do well in intellectual pursuits.
                                    </div>
                                    <div class="section-right-yellow">
                                        <img class="section-right-yellow-image" src="pdf-image/general-ability.png">
                                    </div>
                                </div>
                            </div>
                            <!-- 3 -->
                        </div>
                        <div class="footer">
                            <div class="footer-text-left">www.selfanalyse.com</div>
                            <div class="footer-text-right">source : PsyCom Sevices, New Delhi</div>
                        </div>
                    </div>
                    <!-- Page-7 -->
                    <div class="pageA4">
                        <div class="header">
                            <div class="headerlogo-left"><img src="pdf-image/shine-logo.png" width="150" /></div>
                            <div class="headerlogo-right"><img src="pdf-image/second-logo.png" width="120" /></div>
                        </div>
                        <div class="page-body">
                            <div class="page-content section-div">
                                <!-- 1 -->
                                <h4 class="section-title">Guilt Proneness</h4>
                                <div class="VerbalAptitudeFlexBox">
                                    <div class="section-left-yellow">
                                        Guilt Proneness - this dimension refers tothe level of 'worrying' and 'taking on guilt' in an individual. High scorers are usually quiet and shy. They are sometimes proneto sleeplessness due to worrying. They get easily downhearted and feelremorseful. Many a time they do not feel accepted and prefer a small group of friends and are more inclined towards books and quieter interests.
                                    </div>
                                    <div class="section-right-yellow">
                                        <img class="section-right-yellow-image" src="pdf-image/guilt-proneness.png">
                                    </div>
                                </div>
                            </div>
                            <div class="page-content section-div">
                                <!-- 2 -->
                                <h4 class="section-title" style="text-align: right;margin-bottom: 10px;">Creativity</h4>
                                <div class="VerbalAptitudeFlexBox">
                                    <div class="section-right-blue">
                                        <img class="section-right-blue-image" src="pdf-image/Creativity.png">
                                    </div>
                                    <div class="section-left-blue">
                                        Creativity - This dimension refers to the ability to use imagination or come up with original ideas to create solutions/things. A high scoreb indicates that the individual is likely to be scholastically inclined and high in his/her mental abilities. He/she is able to apply scientific reasoning and experimental thinking. A high scorer usually does well in areas requiring critical thinking.
                                    </div>
                                </div>
                            </div>
                            <div class="page-content section-div">
                                <!-- 3 -->
                                <h4 class="section-title">Innovation</h4>
                                <div class="VerbalAptitudeFlexBox">
                                    <div class="section-left-yellow">
                                        Innovation - this dimension refers to the level of 'out-of-the-box' thinking of an individual. High scorers are usually analytical, liberal and innovative. They prefer logic over emotions and are focused on problem solving. People who score above average in this dimension are usually very progressive in their thoughts and like to experiment and move away from established way of doing things. Executives, Directors, Scientific Researchers usually score high in this dimension.
                                    </div>
                                    <div class="section-right-yellow">
                                        <img class="section-right-yellow-image" src="pdf-image/innovation.png">
                                    </div>
                                </div>
                                <!-- 3 -->
                            </div>
                        </div>
                        <div class="footer">
                            <div class="footer-text-left">www.selfanalyse.com</div>
                            <div class="footer-text-right">source : PsyCom Sevices, New Delhi</div>
                        </div>
                    </div>
                    <!-- Page-8 -->
                    <div class="pageA4">
                        <div class="header">
                            <div class="headerlogo-left"><img src="pdf-image/shine-logo.png" width="150" /></div>
                            <div class="headerlogo-right"><img src="pdf-image/second-logo.png" width="120" /></div>
                        </div>
                        <div class="page-body">
                            <div class="page-content section-div">
                                <!-- 1 -->
                                <h4 class="section-title">Leadership</h4>
                                <div class="VerbalAptitudeFlexBox">
                                    <div class="section-left-yellow">
                                        Leadership – this dimension refers to the ability of an individual to be able to control and direct the actions and attitudes of others. High scoring individuals usually find themselves in commanding positions or positions of authority. They are mostly alert to their surroundings and to the people around them. They are confident and possess a strong will power.
                                    </div>
                                    <div class="section-right-yellow">
                                        <img class="section-right-yellow-image" src="pdf-image/Leadership.png">
                                    </div>
                                </div>
                            </div>
                            <div class="page-content section-div">
                                <!-- 2 -->
                                <h4 class="section-title" style="text-align: right;margin-bottom: 10px;">Maturity</h4>
                                <div class="VerbalAptitudeFlexBox">
                                    <div class="section-right-blue">
                                        <img class="section-right-blue-image" src="pdf-image/Maturity.png">
                                    </div>
                                    <div class="section-left-blue">
                                        Maturity this dimension is taken as an index of stress tolerance of an individual. Higher the score, lesser the probability of feeling anxious. The high scorers are usually not easily fazed by the challenges thrown at them on a day to day basis. They do not get easily annoyed by things or people. Teachers, Engineers, Firemen usually score above average in this dimension.
                                    </div>
                                </div>
                            </div>
                            <div class="page-content section-div">
                                <!-- 3 -->
                                <h4 class="section-title">Mental Health</h4>
                                <div class="VerbalAptitudeFlexBox">
                                    <div class="section-left-yellow">
                                        Mental Health - this dimension refers to the level of self-actualization of an individual. It is a very positive dimension and the high scoring individuals are well adjusted and have a zest for life. They tend to have harmonious relationships in a group and are emotionally stable. These individuals do not get easily distracted and are able to reach personal goals without much difficulty.
                                    </div>
                                    <div class="section-right-yellow">
                                        <img class="section-right-yellow-image" src="pdf-image/Mental-Health.png">
                                    </div>
                                </div>
                                <!-- 3 -->
                            </div>
                        </div>
                        <div class="footer">
                            <div class="footer-text-left">www.selfanalyse.com</div>
                            <div class="footer-text-right">source : PsyCom Sevices, New Delhi</div>
                        </div>
                    </div>
                    <!-- Page-9 -->
                    <div class="pageA4">
                        <div class="header">
                            <div class="headerlogo-left"><img src="pdf-image/shine-logo.png" width="150" /></div>
                            <div class="headerlogo-right"><img src="pdf-image/second-logo.png" width="120" /></div>
                        </div>
                        <div class="page-body">
                            <!-- 1 -->
                            <div class="page-content section-div">
                                <h4 class="section-title">Morality</h4>
                                <div class="VerbalAptitudeFlexBox">
                                    <div class="section-left-yellow">
                                        Morality - this dimension refers to the level of 'regard for moral standards' in an individual. High scorers are usually more respectful of authority and live by the rules. They do not like chaos and like to stay away from anything messy. Extremely high scores sometimes indicate inflexibility. In such case, individuals set very high standards for themselves as well as others and feel very stressful when they themselves or the people around them are unable to meet those standards.
                                    </div>
                                    <div class="section-right-yellow">
                                        <img class="section-right-yellow-image" src="pdf-image/Morality.png">
                                    </div>
                                </div>
                            </div>
                            <!-- 2 -->
                            <div class="page-content section-div">
                                <h4 class="section-title" style="text-align: right;margin-bottom: 10px;">Self Control</h4>
                                <div class="VerbalAptitudeFlexBox">
                                    <div class="section-right-blue">
                                        <img class="section-right-blue-image" src="pdf-image/Self-control.png">
                                    </div>
                                    <div class="section-left-blue">
                                        Self-Control this dimension refers to the ability to control anxiety. High scores usually indicate a strong control over emotions and also behavior. They exhibit objectivity in most situations and are usually balanced and are decisive. Such individuals are usually well respected and tend to be successful as executives, administrators, mathematicians etc.
                                    </div>
                                </div>
                            </div>
                            <!-- 3 -->
                            <div class="page-content section-div">
                                <h4 class="section-title">Sensitivity</h4>
                                <div class="VerbalAptitudeFlexBox">
                                    <div class="section-left-yellow">
                                        Sensitivity - this dimension refers to the level of feeling offended or hurt in an individual. High scorers are usually fond of travelling and new experiences. They despise anything that is not beautiful (according to their sensibilities). They have an imaginative aesthetic mind and sometimes prone to impractical behavior. They generally do not perform well in groups or team activities. Artists, musicians etc. score high in this dimension.
                                    </div>
                                    <div class="section-right-yellow">
                                        <img class="section-right-yellow-image" src="pdf-image/Sensitivity.png">
                                    </div>
                                </div>
                            </div>
                            <!-- 3 -->
                        </div>
                        <div class="footer">
                            <div class="footer-text-left">www.selfanalyse.com</div>
                            <div class="footer-text-right">source : PsyCom Sevices, New Delhi</div>
                        </div>
                    </div>
                    <!-- Page-10 -->
                    <div class="pageA4">
                        <div class="header">
                            <div class="headerlogo-left"><img src="pdf-image/shine-logo.png" width="150" /></div>
                            <div class="headerlogo-right"><img src="pdf-image/second-logo.png" width="120" /></div>
                        </div>
                        <div class="page-body">

                            <!-- 1 -->
                            <div class="page-content section-div">
                                <h4 class="section-title">Excitability</h4>
                                <div class="VerbalAptitudeFlexBox">
                                    <div class="section-left-yellow">
                                        Excitability - This dimension is a combination of temperamental attitude and distractibility. Individuals who score high in this dimension are usually prone to impulsive behavior and are easily hurt and jealous when not given importance. They exhibit difficulty in focusing diligently on a particular task as they get easily distracted by outside stimuli and sometimes by their own thoughts.
                                    </div>
                                    <div class="section-right-yellow">
                                        <img class="section-right-yellow-image" src="pdf-image/Excitability.png">
                                    </div>
                                </div>
                            </div>
                            <!-- 2 -->
                            <div class="page-content section-div">
                                <h4 class="section-title" style="text-align: right;margin-bottom: 10px;">Self Sufficiency</h4>
                                <div class="VerbalAptitudeFlexBox">
                                    <div class="section-right-blue">
                                        <img class="section-right-blue-image" src="pdf-image/self-sufficiency.png">
                                    </div>
                                    <div class="section-left-blue">
                                        Self-sufficiency - This dimension refers to the level of an individual's dependence on others, to be able to handle things on their own. High scoring individuals on this dimension prefer to be alone. They work better individually rather than in group. They prefer to handle their problems on their own rather than sharing it with others. Executives, scientists, explorers etc. score high in this dimension.
                                    </div>
                                </div>
                            </div>
                            <!-- 3 -->
                            <div class="page-content section-div">
                                <h4 class="section-title">Social Warmth</h4>
                                <div class="VerbalAptitudeFlexBox">
                                    <div class="section-left-yellow">
                                        Social Warmth high score in this dimension indicates a warm-hearted person who is very easy to get along with. They love interacting with people and do well in areas which involve human interaction. They are more likely to share their feelings and adapt their moods according to others. Teachers, social workers tend to score higher than others in this dimension.
                                    </div>
                                    <div class="section-right-yellow">
                                        <img class="section-right-yellow-image" src="pdf-image/Social-Warmth.png">
                                    </div>
                                </div>
                            </div>
                            <!-- 3 -->
                        </div>
                        <div class="footer">
                            <div class="footer-text-left">www.selfanalyse.com</div>
                            <div class="footer-text-right">source : PsyCom Sevices, New Delhi</div>
                        </div>
                    </div>
                    <!-- Page-11 -->
                    <div class="pageA4">
                        <div class="header">
                            <div class="headerlogo-left"><img src="pdf-image/shine-logo.png" width="150" /></div>
                            <div class="headerlogo-right"><img src="pdf-image/second-logo.png" width="120" /></div>
                        </div>
                        <div class="page-body">
                            <!-- 1 -->
                            <div class="page-content section-div">
                                <h4 class="section-title">Tension</h4>
                                <div class="VerbalAptitudeFlexBox">
                                    <div class="section-left-yellow">
                                        Tension - this dimension refers to the level of mental strain in an individual. High scorers are usually short tempered and are irritated very easily. They are more likely to suffer from sleep disturbance and hypertension. They do not gel well in groups and are less likely to be chosen as leaders. People like waiters, journalists etc. who are not allowed much selfexpression and have to face environmental demands score high in this dimension.
                                    </div>
                                    <div class="section-right-yellow">
                                        <img class="section-right-yellow-image" src="pdf-image/Tension.png">
                                    </div>
                                </div>
                            </div>
                            <!-- 2 -->
                            <div class="page-content section-div">
                                <h4 class="section-title" style="text-align: right;margin-bottom: 10px;">Individualism</h4>
                                <div class="VerbalAptitudeFlexBox">
                                    <div class="section-right-blue">
                                        <img class="section-right-blue-image" src="pdf-image/Individualism.png">
                                    </div>
                                    <div class="section-left-blue">
                                        Individualism- This dimension refers to an individual's trait of internalizing behavior. High scoring individuals usually like to do things on their own. They do not like to be part of a group and even if they are, they prefer to keep their thoughts to themselves. They overthink their mistakes and find it difficult to forgive people who they think have hurt them.
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="footer">
                            <div class="footer-text-left">www.selfanalyse.com</div>
                            <div class="footer-text-right">source : PsyCom Sevices, New Delhi</div>
                        </div>
                    </div>
                    <!-- Page-13 -->
                    <div class="pageA4">
                        <div class="header">
                            <div class="headerlogo-left"><img src="pdf-image/shine-logo.png" width="150" /></div>
                            <div class="headerlogo-right"><img src="pdf-image/second-logo.png" width="120" /></div>
                        </div>
                        <div class="page-body">
                            <div class="page-content">
                                <div class="chart-box">
                                    <figure class="highcharts-figure">
                                        <div id="container_bar" style="height: 500px;"></div>
                                    </figure>
                                </div>

                                <div class="chart-box">
                                    <figure class="highcharts-figure">
                                        <div id="container" style="height: 370px;"></div>
                                    </figure>
                                </div>
                                <?php
                                $data = array();
                                foreach ($getsubject as $sub) {
                                    $subject = $sub->exam_category_id;
                                    $abilityData = $wpdb->get_row("SELECT short_name, ability_id, instruction, full_name FROM $PSY_ABILITY where ref_id='$subject'");
                                    $ability_id = $abilityData->ability_id;
                                    $ability_desc = $abilityData->instruction;
                                    $abltName = $abilityData->full_name . " (" . $abilityData->short_name . ")";
                                    $getTestSummary = $wpdb->get_row("SELECT SUM(CASE WHEN qa.answer=1 THEN so.option_1 WHEN qa.answer=2 THEN so.option_2 WHEN qa.answer=3 THEN so.option_3 END) as correctQn, count(CASE WHEN qa.answer!=0 THEN 1 end) as attepmt,count(CASE WHEN qa.answer=0 THEN 1 end) as unAttemptQn from $PSY_TEST_GEN_TEST_TAKEN_QUESTION_ANSWER as qa Inner join $PSY_SP_OPTION_VALUE as so on so.question_id = qa.test_question_id where qa.test_taken_id='$testID' and qa.module_id='$subject'");
                                    $correctQn = (int) $getTestSummary->correctQn;
                                    $rawScore = $wpdb->get_var("SELECT sten_score FROM $PSY_ABILITY_RAW_SCORE where $correctQn BETWEEN raw_score_start and raw_score_end and class_id='$class_id' and ability_id='$ability_id'");
                                    $stenScore = (int) $rawScore;
                                    $data[] = array("y" => $stenScore, "name" => $abltName, "ability_id" => $ability_id, "topic_id" => $sub->exam_category_id);
                                    //color condition for raw score
                                    if ($rawScore <= 3 && $rawScore >= 0) {
                                        $backColor = '#e4d354';
                                    } else if ($rawScore <= 7 && $rawScore >= 4) {
                                        $backColor = '#f7a35c';
                                    } else if ($rawScore <= 10 && $rawScore >= 8) {
                                        $backColor = '#90ed7d';
                                    }
                                }
                                ?>
                                <!-- chart-box -->


                                <!-- <div class="ability-desc-box" id="abilityDesc">
                                </div> -->
                                <!-- chart-box -->
                            </div>
                        </div>
                        <div class="footer">
                            <div class="footer-text-left">www.selfanalyse.com</div>
                            <div class="footer-text-right">source : PsyCom Sevices, New Delhi</div>
                        </div>
                    </div>
                    <!-- Page-13 -->
                    <?php foreach (array_chunk($data, 7) as $group) { ?>
                        <div class="pageA4">
                            <div class="header">
                                <div class="headerlogo-left"><img src="/wp-content/themes/psychometrics/images/shine-logo.png" width="100"></div>
                                <div class="headerlogo-right"><img src="pdf-image/second-logo.png" width="100"></div>
                            </div>
                            <div class="page-body">
                                <?php foreach ($group as $d) {

                                    $abilityId = $d['ability_id'];
                                    $stenScores = $d['y'];
                                    $stenDesc = $wpdb->get_row("SELECT description from $PSY_ABILITY_STEN_DESC where ability_id='$abilityId' and FIND_IN_SET($stenScores,sten_scores)"); ?>
                                    <div class="YourStenScoreBox">
                                        <h2>Your STEN Score in <b><?= $d['name'] ?> :<?= $d['y'] ?></b></h2>
                                        <p><?= $stenDesc->description; ?></p>
                                    </div>
                                <?php } ?>
                            </div>
                            <div class="footer">
                                <div class="footer-text-left">www.selfanalyse.com</div>
                                <div class="footer-text-right">source : PsyCom Sevices, New Delhi</div>
                            </div>
                        </div>
                    <?php } ?>
                    <!-- Page-13 -->
                    <div class="pageA4">
                        <div class="header">
                            <div class="headerlogo-left"><img src="/wp-content/themes/psychometrics/images/shine-logo.png" width="100"></div>
                            <div class="headerlogo-right"><img src="pdf-image/second-logo.png" width="100"></div>
                        </div>
                        <div class="page-body">
                            <p style="margin: 0;font-family: arial;font-size: 13px;line-height: 20px;border-radius: 10px;margin-top: 10px;font-weight: 300;">
                                <b>Disclaimer:</b>
                                I It is to be noted that these test scores do not provide any kind of diagnosis. The cognitive functioning is a result of “Nature and Nurture”. This mean show an individual think is a result of his innate nature as well as his
                                environment. The scores should be taken in the right perspective. These scores indicate an individual’s ability to perform a particular task right now (at the moment of taking the test).Adding extra skill or training in that are a may improve the scores.
                            </p>
                        </div>
                        <div class="footer">
                            <div class="footer-text-left">www.selfanalyse.com</div>
                            <div class="footer-text-right">source : PsyCom Sevices, New Delhi</div>
                        </div>
                    </div>
                    <script>
                        function popOut(pageURL, pageTitle,
                            popupWinWidth, popupWinHeight) {
                            var left = (screen.width - popupWinWidth) / 2;
                            var top = (screen.height - popupWinHeight) / 4;

                            var myWindow = window.open(pageURL, pageTitle,
                                'resizable=yes, width=' + popupWinWidth +
                                ', height=' + popupWinHeight + ', top=' +
                                top + ', left=' + left);
                        }
                        // Load the fonts
                        Highcharts.createElement('link', {
                            href: 'https://fonts.googleapis.com/css?family=Ubuntu:400,700',
                            rel: 'stylesheet',
                            type: 'text/css'
                        }, null, document.getElementsByTagName('head')[0]);
                        // Add the background image to the container
                        Highcharts.addEvent(Highcharts.Chart, 'afterGetContainer', function() {
                            // eslint-disable-next-line no-invalid-this
                            this.container.style.background =
                                'url(https://www.highcharts.com/samples/graphics/sand.png)';
                        });
                        Highcharts.theme = {

                            chart: {
                                backgroundColor: null,
                                style: {
                                    fontFamily: 'Ubuntu, sans-serif'
                                }
                            },
                            title: {
                                style: {
                                    color: 'black',
                                    fontSize: '16px',
                                    fontWeight: 'bold'
                                }
                            },
                            subtitle: {
                                style: {
                                    color: 'black'
                                }
                            },
                            tooltip: {
                                borderWidth: 0
                            },
                            labels: {
                                style: {
                                    color: '#6e6e70'
                                }
                            },
                            legend: {
                                backgroundColor: '#E0E0E8',
                                itemStyle: {
                                    fontWeight: 'bold',
                                    fontSize: '13px'
                                }
                            },
                            xAxis: {
                                labels: {
                                    style: {
                                        color: '#6e6e70'
                                    }
                                }
                            },
                            yAxis: {
                                labels: {
                                    style: {
                                        color: '#6e6e70'
                                    }
                                }
                            },
                            plotOptions: {
                                series: {
                                    shadow: true
                                },
                                candlestick: {
                                    lineColor: '#404048'
                                },
                                map: {
                                    shadow: false
                                }
                            },
                            // Highstock specific
                            navigator: {
                                xAxis: {
                                    gridLineColor: '#D0D0D8'
                                }
                            },
                            rangeSelector: {
                                buttonTheme: {
                                    fill: 'white',
                                    stroke: '#C0C0C8',
                                    'stroke-width': 1,
                                    states: {
                                        select: {
                                            fill: '#D0D0D8'
                                        }
                                    }
                                }
                            },
                            scrollbar: {
                                trackBorderColor: '#C0C0C8'
                            }
                        };
                        // Apply the theme
                        Highcharts.setOptions(Highcharts.theme);


                        //pie chart
                        var options_pie = {
                            chart: {
                                plotBackgroundColor: null,
                                plotBorderWidth: null,
                                plotShadow: false,
                                type: 'pie'
                            },
                            title: {
                                text: 'Multiple Dimensions of Personality'
                            },
                            tooltip: {
                                pointFormat: '{series.name}: <b>{point.y}</b>'
                            },
                            accessibility: {
                                point: {
                                    valueSuffix: '%'
                                }
                            },
                            plotOptions: {
                                pie: {
                                    allowPointSelect: true,
                                    cursor: 'pointer',
                                    dataLabels: {
                                        enabled: true,
                                        format: '<b>{point.name}</b>: {point.y}'
                                    }
                                },
                                series: {
                                    cursor: 'pointer',
                                    colorByPoint: true,
                                    point: {
                                        events: {
                                            click: function() {
                                                // alert(this.options.ability_id);
                                                $.ajax({
                                                    type: "POST",
                                                    url: "/aptitude-test/test_ability_description.php",
                                                    dataType: 'html',
                                                    data: {
                                                        "ability_id": this.options.ability_id,
                                                        "score": this.options.y,
                                                        "topic_name": this.options.name
                                                    },
                                                    success: function(data) {
                                                        $("#abilityDesc").html(data);
                                                    }
                                                });

                                            }
                                        }
                                    }
                                }
                            },
                            series: [{
                                name: 'Score',
                                colorByPoint: true,
                                data: <?php echo json_encode($data); ?>
                            }]
                        }
                        var chart_pie = Highcharts.chart('container', options_pie);

                        //bar chart
                        var options_bar = {
                            chart: {
                                type: 'column'
                            },
                            title: {
                                text: 'Multiple Dimensions of Personality',
                                align: 'center',
                                y: 20
                            },
                            xAxis: {
                                type: 'category'
                            },
                            yAxis: {
                                title: {
                                    text: ''
                                },
                                max: 10,
                                min: 0,
                                tickInterval: 1

                            },
                            tooltip: {
                                pointFormat: '{series.name}: <b>{point.y}</b>'
                            },
                            accessibility: {
                                point: {
                                    valueSuffix: '%'
                                }
                            },
                            plotOptions: {
                                series: {
                                    cursor: 'pointer',
                                    colorByPoint: true,
                                    point: {
                                        events: {
                                            click: function() {
                                                // alert(this.options.ability_id);
                                                $.ajax({
                                                    type: "POST",
                                                    url: "/aptitude-test/test_ability_description.php",
                                                    dataType: 'html',
                                                    data: {
                                                        "ability_id": this.options.ability_id,
                                                        "score": this.options.y,
                                                        "topic_name": this.options.name
                                                    },
                                                    success: function(data) {
                                                        $("#abilityDesc").html(data);
                                                    }
                                                });

                                            }
                                        }
                                    },
                                    dataLabels: {
                                        enabled: true,
                                        format: '<b>{point.y}'
                                    }
                                }
                            },
                            series: [{
                                name: 'Score',
                                data: <?php echo json_encode($data); ?>

                            }]
                        }
                        var chart_bar = Highcharts.chart('container_bar', options_bar);
                    </script>
                    <?php
                    $image_name = $testID . '-bar.png';
                    $path = '/var/www/selfanalyse/personality-test/chart_images/' . $image_name;
                    if (file_exists($path)) {
                        echo "";
                    } else {
                    ?>
                        <script>
                            //save image
                            var options_bar_image = {
                                infile: {
                                    "chart": {
                                        "type": 'column'
                                    },
                                    "title": {
                                        "text": 'Multiple Dimensions of Personality',
                                        "align": 'center',
                                        "y": 20
                                    },
                                    "xAxis": {
                                        "type": 'category'
                                    },
                                    "yAxis": {
                                        "title": {
                                            "text": ''
                                        },
                                        "max": 10,
                                        "min": 0,
                                        "tickInterval": 1

                                    },
                                    "tooltip": {
                                        "pointFormat": '{series.name}: <b>{point.y}</b>'
                                    },
                                    "accessibility": {
                                        "point": {
                                            "valueSuffix": '%'
                                        }
                                    },
                                    "plotOptions": {
                                        "series": {
                                            "cursor": 'pointer',
                                            "colorByPoint": true,
                                            "dataLabels": {
                                                "enabled": true,
                                                "format": '<b>{point.y}'
                                            }
                                        }
                                    },
                                    "series": [{
                                        "name": 'Score',
                                        "data": <?php echo json_encode($data); ?>

                                    }]
                                },
                                width: 650,
                                height: 600,
                                b64: true
                            }
                            //save image
                            var exportUrl = 'https://export.highcharts.com/';
                            $.ajax({
                                type: 'POST',
                                data: JSON.stringify(options_bar_image),
                                url: exportUrl,
                                headers: {
                                    'Content-Type': 'application/json'
                                },
                                success: function(data) {
                                    saveImageforserverBar(data);
                                },
                                error: function(err) {}
                            });

                            function saveImageforserverBar(data_image) {
                                $.ajax({
                                    type: "POST",
                                    url: "/personality-test/save_image.php",
                                    dataType: 'JSON',
                                    data: {
                                        "type": "bar",
                                        "test_id": <?php echo $testID ?>,
                                        "image": data_image
                                    },
                                    success: function(data) {

                                    }
                                });
                            }

                            //pie
                            //save image
                            var options_pie_image = {
                                infile: {
                                    "chart": {
                                        "plotBackgroundColor": null,
                                        "plotBorderWidth": null,
                                        "plotShadow": false,
                                        "type": 'pie'
                                    },
                                    "title": {
                                        "text": 'Multiple Dimensions of Personality'
                                    },
                                    "tooltip": {
                                        "pointFormat": '{series.name}: <b>{point.y}</b>'
                                    },
                                    "accessibility": {
                                        "point": {
                                            "valueSuffix": '%'
                                        }
                                    },
                                    "plotOptions": {
                                        "pie": {
                                            "allowPointSelect": true,
                                            "cursor": 'pointer',
                                            "dataLabels": {
                                                "enabled": true,
                                                "format": '<b>{point.name}</b>: {point.y}'
                                            }
                                        },
                                        "series": {
                                            "cursor": 'pointer',
                                            "colorByPoint": true
                                        }
                                    },
                                    "series": [{
                                        "name": 'Score',
                                        "colorByPoint": true,
                                        "data": <?php echo json_encode($data); ?>
                                    }]
                                },
                                width: 650,
                                height: 600,
                                b64: true
                            }
                            var exportUrl = 'https://export.highcharts.com/';
                            $.ajax({
                                type: 'POST',
                                data: JSON.stringify(options_pie_image),
                                url: exportUrl,
                                headers: {
                                    'Content-Type': 'application/json'
                                },
                                success: function(data) {
                                    saveImageforserverPie(data);
                                },
                                error: function(err) {}
                            });

                            function saveImageforserverPie(data_pie) {
                                $.ajax({
                                    type: "POST",
                                    url: "/personality-test/save_image.php",
                                    dataType: 'JSON',
                                    data: {
                                        "type": "pie-one",
                                        "test_id": <?php echo $testID ?>,
                                        "image": data_pie
                                    },
                                    success: function(data) {

                                    }
                                });
                            }
                        </script>
                    <?php } ?>
                <?php
                } else {
                ?>
                    <div class="row">
                        <div class="chart-header-box" style="background: #d8e6f1;text-align: center;">

                            <h6>Thank you for taking test. You will get your reports within next 24 hours. Keep checking for the updates. In case you wish to schedule an oline counselling session with one of the counsellors you may book one through book appointment.</h6>

                            <a href="/test">
                                <h3 class="back-home-btn"><i class="fas fa-angle-double-left"></i> Back to Home</h3>
                            </a>

                        </div>
                    </div>
                <?php
                }
                ?>

                <!-- END TOP TABLE SECTION -->
            </body>
            <div style="display: none;">
                <?php
                $path = '/var/www/selfanalyse/personality-test/pdf-html/pdf-' . $testID . '.html';
                if (file_exists($path)) {
                    echo "";
                } else {
                    ob_start();
                    include_once('personality-test-report-html.php');
                    $html = ob_get_contents();
                    file_put_contents('/var/www/selfanalyse/personality-test/pdf-html/pdf-' . $testID . '.html', $html);
                    ob_flush();
                }
                ?>
            </div>
<?php
        } else {
            echo "Error : No test id found.";
        }
    } else {
        echo "Error : Invalid Test Id.";
    }
} else {
    echo "Error : Please login to view report.";
}
?>