File "junior_urdu_question.php"

Full Path: /home/ccipcixf/public_html/hirepro/assets/extra-libs/taskboard/css/junior_urdu_question.php
File size: 8.93 KB
MIME-type: text/x-php
Charset: utf-8

<?php
session_start();

// Check if the user is not an Admin, redirect them to index.php
if (!isset($_SESSION["admin_role"]) ||  $_SESSION["admin_role"] !== "Admin") {
    echo '<script type="text/javascript">window.location.href = "index.php";</script>';
    exit(); // Add an exit to stop further execution after redirection
}
include "menu.php";
include "config.php"; // Include your database connection code.
?>

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>HirePro</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8sh+Wyb4Q4N/bvAgOVgmvwA2hXDDlBOoaFQI5k" crossorigin="anonymous">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.7.0/chart.min.js"></script>

    <style>
        .card.s {
            width: 250px;
            background: linear-gradient(#0052D4, #2B32B2);
        }

        .card.s.ems:hover {
            background: linear-gradient(#023a94, #000bd7);
        }

        .card.ems {
            background: linear-gradient(#0052D4, #2B32B2);
        }

        .card.s.d {
            width: 250px;
            background: linear-gradient(#ff6f05, #b22b2b);
        }


        .card hr {
            color: #1c3cbd;
            width: 135px;
        }

        .newcolor {
            color: white !important;
        }

        .newcolora {
            color: #d2d2d2 !important;
        }

        .card.ss {
            width: auto;
            background: transparent;
        }

        i.bx.bx-arrow-back {
            margin-bottom: 2px;
        }



        hr.b {
            width: 170px !important;
        }

        hr.c {
            width: 290px !important;
        }

        .corner-text {
            position: absolute;
            top: 90;
            right: 205;
            font-size: 14px;
            /* Adjust the font size as needed */
            color: #fff;
            /* Adjust the text color as needed */
        }

        .corner-texts {
            position: absolute;
            top: 90;
            right: 205;
            font-size: 14px;
            /* Adjust the font size as needed */
            color: #fff;
            /* Adjust the text color as needed */
        }

        .corner-textsg {
            position: absolute;
            top: 90;
            right: 205;
            font-size: 14px;
            /* Adjust the font size as needed */
            color: #fff;
            /* Adjust the text color as needed */
        }

        .corner-textsu {
            position: absolute;
            top: 90;
            right: 205;
            font-size: 14px;
            /* Adjust the font size as needed */
            color: #fff;
            /* Adjust the text color as needed */
        }

        .wtg {
            margin-top: 10px;
            padding-top: 20px;
        }
    </style>
</head>

<body>

    <?php if ($_SESSION["admin_role"]  || $_SESSION["admin_role"] == "Admin") : ?>
        <!-- Status -->
        <div class="container mt-2">

            <div class="page-breadcrumb">

                <!-- -----------------------Junior Level------------------------- -->
                <!-- -----------------------Junior Level------------------------- -->
                <div class="row ">
                    <div class="col-md-12 mt-3 px-5">
                        <a href="show_junior_questions.php"><button class=" btn btn-primary  float-end mt-3 " style="background: linear-gradient(#0052D4, #2B32B2 );">English Questions</button></a>
                        <a href="Junior_level.php"><button class=" btn btn-primary  float-end mt-3 " style="background: linear-gradient(#0052D4, #2B32B2 );">Add Question</button></a>
                        <h4 class="fw-bold py-1 mt-4"><span class="text-muted fw-light">Junior Level Questions</h4>
                    </div>
                    <?php
                    if (session_status() == PHP_SESSION_NONE) {
                        session_start();
                    }

                    include("config.php");

                    // Fetch questions from the database
                    $sql = "SELECT `question_level`, `competency`,`question_id`, `question_eng`,`question_ur`, `answer_1_eng`, `answer_1_ur`,`rating_1`, `answer_2_eng`, `answer_2_ur`, `rating_2`, `answer_3_eng`, `answer_3_ur`,`rating_3` FROM `questions_junior`";
                    $result = mysqli_query($conn, $sql);

                    if ($result) {
                        // Output the question and answers dynamically
                        while ($row = mysqli_fetch_assoc($result)) { ?>
                            <div class="row col-6 mt-4 px-4 ">
                                <form class="bg-white px-4 p-2 border border-secondary rounded">
                                    <div class="row">
                                        <div class="col-12 ">
                                            <p class="fw-bold "><?php echo $row['competency'] ?> </p>
                                            <p class="fw-bold ">Question: <?php echo $row['question_id'] ?> </p>
                                        </div>
                                    </div>

                                    <div class="row">
                                      
                                        <div class="col-12">
                                            <p class="fw-bold float-end"><?php echo $row['question_ur'] ?> </p>
                                        </div>
                                    </div>

                                    <div class="form-check mb-2 ">
                                        <input class="form-check-input" type="radio" name="exampleForm" id="radioExample1" />
                                        <label class="form-check-label d-flex justify-content-between align-items-center" for="radioExample1">
                                            <div>
                                                <span class="px-2"><?php echo $row['answer_1_ur'] ?></span>
                                            </div>
                                            <div class="fw-bold"><?php echo $row['rating_1'] ?> Rating</div>
                                        </label>
                                    </div>
                                    <div class="form-check mb-2">
                                        <input class="form-check-input" type="radio" name="exampleForm" id="radioExample2" />
                                        <label class="form-check-label d-flex justify-content-between align-items-center" for="radioExample2">
                                            <div>
                                                <span class="px-2"><?php echo $row['answer_2_ur'] ?></span>
                                            </div>
                                            <div class="fw-bold"><?php echo $row['rating_2'] ?> Rating</div>

                                        </label>
                                    </div>
                                    <div class="form-check mb-2">
                                        <input class="form-check-input" type="radio" name="exampleForm" id="radioExample3" />
                                        <label class="form-check-label d-flex justify-content-between align-items-center" for="radioExample3">
                                            <div>
                                                <span class="px-2"><?php echo $row['answer_3_ur'] ?></span>
                                            </div>
                                            <div class="fw-bold"><?php echo $row['rating_3'] ?> Rating</div>

                                        </label>
                                    </div>

                                    <div class="mt-3 float-end">
                                        <a class="btn btn-success" href="question_edit.php?id=<?php echo $row["question_id"] ?>">Edit</a>
                                        <a class="btn btn-danger" href="question_delete.php?id=<?php echo $row["question_id"] ?>">Delete</a>


                                    </div>
                                </form>
                            </div>
                    <?php }
                    } else {

                        echo "Error: " . mysqli_error($conn);
                    }

                    // Close the database connection
                    mysqli_close($conn);
                    ?>





                </div>
                <!-- -----------------------EMS------------------------- -->
            </div>
            <!-- Status -->
        <?php endif; ?>
        <!-- EMS ADMIN -->
</body>

</html>

<!-- Your HTML and CSS imports here -->