<commit_before><?php

include 'connection.php';
function CheckAccess($pagename)
{
    global $mysqli;

    $sql = "Select
				access_power
			From
				Access
			Where
				access_page = '".$pagename."'";

        $result = $mysqli->query($sql);
        $RankResult = mysqli_fetch_assoc($result);
        Return $RankResult['access_power'];

}

function CheckOpActive($opID)
{
    global $mysqli;

    $sql = "SELECT
                LiveOp_Active
            FROM
                LiveOps
            WHERE
                LiveOp_ID = ".$opID;

    $result = $mysqli->query($sql);
    $isactive= mysqli_fetch_assoc($result);

    if ($isactive['Liveop_Active'] == 1){
        return true;
    }else{
        return false;
    }

}

function LeaveOp($opID, $memberID)
{
    global $mysqli;

    $sql = "CALL sp_LeaveLiveOp(" . $opID. ", " . $memberID . ")";

    if($mysqli->query($sql) === TRUE){
        //player has left op, unset session variable
        unset($_SESSION["current_op"]);
    }
}
function JoinOp($opID, $memberID)
{
    global $mysqli;

    $sql = "CALL sp_JoinLiveOp(" . $opID. ", " . $memberID . ")";
    //echo $sql;
    if($mysqli->query($sql) === TRUE){
        $_SESSION["current_op"] = memebrID;
        //echo $_SESSION["current_op"]."set";
    }
    $sql = "CALL sp_LeaveLiveOp(" . $opID. ", " . $memberID . ")";

    if($mysqli->query($sql) === TRUE){
        //player has left op, unset session variable
        unset($_SESSION["current_op"]);
    }
}
?><commit_msg>fixed liveop active check to not be bad<commit_after><?php

include 'connection.php';
function CheckAccess($pagename)
{
    global $mysqli;

    $sql = "Select
				access_power
			From
				Access
			Where
				access_page = '".$pagename."'";

        $result = $mysqli->query($sql);
        $RankResult = mysqli_fetch_assoc($result);
        Return $RankResult['access_power'];

}

function CheckOpActive($opID)
{
    global $mysqli;
    $sql = "SELECT
                LiveOp_Active
            FROM
                LiveOps
            WHERE
                LiveOp_ID = ".$opID;
    $result = $mysqli->query($sql);
    $isactive= $result -> fetch_row();
    if ($isactive[0] == 1){
        return true;
    }else{
        return false;
    }

}

function LeaveOp($opID, $memberID)
{
    global $mysqli;


    $sql = "CALL sp_LeaveLiveOp(" . $opID. ", " . $memberID . ")";

    if($mysqli->query($sql) === TRUE){
        //player has left op, unset session variable
        unset($_SESSION["current_op"]);
    }
}
function JoinOp($opID, $memberID)
{
    global $mysqli;

    $sql = "CALL sp_JoinLiveOp(" . $opID. ", " . $memberID . ")";
   // echo $sql;
    if($mysqli->query($sql) === TRUE){
        $_SESSION["current_op"] = $opID;
        echo $_SESSION["current_op"]."set";
    }
    $sql = "CALL sp_LeaveLiveOp(" . $opID. ", " . $memberID . ")";

}
?>
{'fraction_non_alphanumeric': 0.16830639494026703, 'fraction_numerical': 0.0010541110330288123, 'mean_word_length': 2.287528868360277, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '292003', 'n_tokens_mistral': 1016, 'n_tokens_neox': 971, 'n_words': 194}