当前位置: 首页>>代码示例>>PHP>>正文


PHP CR3DCQuery::Close方法代码示例

本文整理汇总了PHP中CR3DCQuery::Close方法的典型用法代码示例。如果您正苦于以下问题:PHP CR3DCQuery::Close方法的具体用法?PHP CR3DCQuery::Close怎么用?PHP CR3DCQuery::Close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CR3DCQuery的用法示例。


在下文中一共展示了CR3DCQuery::Close方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: isSessionIDValid

function isSessionIDValid($config, $xsid)
{
    $bValid = false;
    //Instantiate the CR3DCQuery Class
    $oR3DCQuery = new CR3DCQuery($config);
    $oR3DCQuery->CheckSIDTimeout();
    if ($xsid != "") {
        if ($oR3DCQuery->CheckLogin($config, $xsid)) {
            $session = base64_decode($xsid);
            list($uniq, $player_id) = preg_split("/\\|/", $session);
            if ($uniq != "" && is_numeric($player_id)) {
                $bValid = true;
                $oR3DCQuery->UpdateSIDTimeout($config, $xsid);
                $oR3DCQuery->SetPlayerCreditsInit($player_id);
            }
        }
    }
    if ($oR3DCQuery->ELOIsActive()) {
        $oR3DCQuery->ELOCreateRatings();
    }
    $oR3DCQuery->MangeGameTimeOuts();
    $oR3DCQuery->Close();
    unset($oR3DCQuery);
    return $bValid;
}
开发者ID:robertohernando,项目名称:phpchess,代码行数:25,代码来源:getlastmove.php

示例2: ListByLetter

?>
layout.css" type="text/css">
<?php 
include $Root_Path . "includes/javascript.php";
?>

</head>
<body>

<script Language='javascript'>
function ListByLetter(strLetter){

  document.frmfindPlayer.txtSearch.value = strLetter;
  document.frmfindPlayer.submit();

}
</script>

<?php 
include "./skins/" . $SkinName . "/layout_cfg.php";
?>

</body>
</html>

<?php 
//////////////////////////////////////////////////////////////
$oR3DCQuery->Close();
unset($oR3DCQuery);
//////////////////////////////////////////////////////////////
ob_end_flush();
开发者ID:robertohernando,项目名称:phpchess,代码行数:31,代码来源:chess_find_player.php

示例3: mobile_movehmm


//.........这里部分代码省略.........
        $bturn = $oR3DCQuery->IsPlayersTurn($config, $player_id, $_GET['gameid']);
        echo "FEN: {$fen}<br/>";
        ChessHelper::load_chess_game($_GET['gameid']);
        $turn = $fen = ChessHelper::$CB->GetFENForCurrentPosition();
        echo "FEN: {$fen}<br/>";
        if ($bturn) {
            //check to see if the move is valid
            if (is_Move_legal($fen, $movestr2)) {
                $oR3DCQuery->CurrentGameMovePiece($config, $_GET['gameid'], $xsid, $player_id, $movestr);
                $initiator = "";
                $w_player_id = "";
                $b_player_id = "";
                $status = "";
                $completion_status = "";
                $start_time = "";
                $next_move = "";
                $oR3DCQuery->GetGameInfoByRef($config, $_GET['gameid'], $initiator, $w_player_id, $b_player_id, $status, $completion_status, $start_time, $next_move);
                //checkmate
                if (get_GameState() == 1) {
                    //if($w_player_id == $player_id){
                    if ($next_move == 'w') {
                        ///////////////////////////////////////////////////////////////////////
                        //ELO Point Calculation
                        if ($oR3DCQuery->ELOIsActive() && $oR3DCQuery->IsGameRated($_GET['gameid'])) {
                            $bcurpoints = $oR3DCQuery->ELOGetRating($b_player_id);
                            $wcurpoints = $oR3DCQuery->ELOGetRating($w_player_id);
                            //Calculate black player
                            $bnewpoints = $oR3DCQuery->ELOCalculation($bcurpoints, $wcurpoints, 1, 1, $oR3DCQuery->GetPlayerGameCount($b_player_id));
                            //Calculate white player
                            $wnewpoints = $oR3DCQuery->ELOCalculation($wcurpoints, $bcurpoints, 0, 1, $oR3DCQuery->GetPlayerGameCount($w_player_id));
                            //update points
                            $oR3DCQuery->ELOUpdateRating($b_player_id, $bnewpoints);
                            $oR3DCQuery->ELOUpdateRating($w_player_id, $wnewpoints);
                        }
                        ///////////////////////////////////////////////////////////////////////
                        $oR3DCQuery->UpdateGameStatus($config, $_GET['gameid'], "C", "B");
                    } else {
                        ///////////////////////////////////////////////////////////////////////
                        //ELO Point Calculation
                        if ($oR3DCQuery->ELOIsActive() && $oR3DCQuery->IsGameRated($_GET['gameid'])) {
                            $bcurpoints = $oR3DCQuery->ELOGetRating($b_player_id);
                            $wcurpoints = $oR3DCQuery->ELOGetRating($w_player_id);
                            //Calculate black player
                            $bnewpoints = $oR3DCQuery->ELOCalculation($bcurpoints, $wcurpoints, 0, 1, $oR3DCQuery->GetPlayerGameCount($b_player_id));
                            //Calculate white player
                            $wnewpoints = $oR3DCQuery->ELOCalculation($wcurpoints, $bcurpoints, 1, 1, $oR3DCQuery->GetPlayerGameCount($w_player_id));
                            //update points
                            $oR3DCQuery->ELOUpdateRating($b_player_id, $bnewpoints);
                            $oR3DCQuery->ELOUpdateRating($w_player_id, $wnewpoints);
                        }
                        ///////////////////////////////////////////////////////////////////////
                        $oR3DCQuery->UpdateGameStatus($config, $_GET['gameid'], "C", "W");
                    }
                    $oR3DCQuery->CachePlayerPointsByPlayerID($b_player_id);
                    $oR3DCQuery->CachePlayerPointsByPlayerID($w_player_id);
                } else {
                    if (get_GameState() == 2) {
                        ///////////////////////////////////////////////////////////////////////
                        //ELO Point Calculation
                        if ($oR3DCQuery->ELOIsActive() && $oR3DCQuery->IsGameRated($_GET['gameid'])) {
                            $bcurpoints = $oR3DCQuery->ELOGetRating($b_player_id);
                            $wcurpoints = $oR3DCQuery->ELOGetRating($w_player_id);
                            //Calculate black player
                            $bnewpoints = $oR3DCQuery->ELOCalculation($bcurpoints, $wcurpoints, 0.5, 1, $oR3DCQuery->GetPlayerGameCount($b_player_id));
                            //Calculate white player
                            $wnewpoints = $oR3DCQuery->ELOCalculation($wcurpoints, $bcurpoints, 0.5, 1, $oR3DCQuery->GetPlayerGameCount($w_player_id));
                            //update points
                            $oR3DCQuery->ELOUpdateRating($b_player_id, $bnewpoints);
                            $oR3DCQuery->ELOUpdateRating($w_player_id, $wnewpoints);
                        }
                        ///////////////////////////////////////////////////////////////////////
                        $oR3DCQuery->UpdateGameStatus($config, $_GET['gameid'], "C", "D");
                        $bmove_error = false;
                        $oR3DCQuery->CachePlayerPointsByPlayerID($b_player_id);
                        $oR3DCQuery->CachePlayerPointsByPlayerID($w_player_id);
                    }
                }
            } else {
                $bmove_error = true;
            }
        } else {
            $bmove_error = true;
        }
        $oR3DCQuery->Close();
        unset($oR3DCQuery);
    } else {
        $bmove_error = true;
    }
    if ($bmove_error) {
        echo "<RESPONSE>\n";
        echo "<MOVE>false</MOVE>\n";
        echo "</RESPONSE>\n";
    } else {
        echo "<RESPONSE>\n";
        echo "<MOVE>true</MOVE>\n";
        mobile_get_full_game_update();
        echo "<LASTMOVE>" . ChessHelper::get_last_move() . "</LASTMOVE>";
        echo "</RESPONSE>\n";
    }
}
开发者ID:robertohernando,项目名称:phpchess,代码行数:101,代码来源:mobile.php

示例4: CheckPlayerBillingTerm

function CheckPlayerBillingTerm($config)
{
    include $config;
    $db = mysql_connect($conf['database_host'], $conf['database_login'], $conf['database_pass']) or die("Couldn't connect to the database.");
    mysql_select_db($conf['database_name']) or die("Couldn't select the database");
    /************/
    //$result = mysql_query("SELECT * FROM c4m_playerorders WHERE o_orderstatus = 'p' AND DATE_FORMAT('2005-05-07 18:18:18','%Y-%m-%d') >= DATE_FORMAT(o_datedue,'%Y-%m-%d')") or die("Couldn't Check The End Dates.");
    $result = mysql_query("SELECT * FROM c4m_playerorders WHERE o_orderstatus = 'p' AND DATE_FORMAT(NOW(),'%Y-%m-%d') >= DATE_FORMAT(o_datedue,'%Y-%m-%d')") or die("Couldn't Check The End Dates.");
    /***********/
    $num = mysql_numrows($result);
    $i = 0;
    while ($i < $num) {
        $o_id = mysql_result($result, $i, "o_id");
        $o_username = mysql_result($result, $i, "o_username");
        $o_firstname = mysql_result($result, $i, "o_firstname");
        $o_lastname = mysql_result($result, $i, "o_lastname");
        $o_address = mysql_result($result, $i, "o_address");
        $o_citytown = mysql_result($result, $i, "o_citytown");
        $o_country = mysql_result($result, $i, "o_country");
        $o_provincestatearea = mysql_result($result, $i, "o_provincestatearea");
        $o_postalcode = mysql_result($result, $i, "o_postalcode");
        $o_email = mysql_result($result, $i, "o_email");
        $o_phonea = mysql_result($result, $i, "o_phonea");
        $o_phoneb = mysql_result($result, $i, "o_phoneb");
        $o_phonec = mysql_result($result, $i, "o_phonec");
        $o_redemptioncode = mysql_result($result, $i, "o_redemptioncode");
        $o_dateoforder = mysql_result($result, $i, "o_dateoforder");
        $o_paymentterm = mysql_result($result, $i, "o_paymentterm");
        $o_datepaid = mysql_result($result, $i, "o_datepaid");
        $o_datedue = mysql_result($result, $i, "o_datedue");
        $o_orderstatus = mysql_result($result, $i, "o_orderstatus");
        //echo "[".$o_id."] ".$o_username." - ".$o_datedue." - ".$o_orderstatus."<br>";
        // set order to finished
        $update = "UPDATE c4m_playerorders SET o_orderstatus = 'f' WHERE o_id=" . $o_id;
        mysql_query($update, $db) or die(mysql_error());
        // create new order
        $insert = "INSERT INTO c4m_playerorders VALUES(NULL, '" . $o_username . "',  '" . $o_firstname . "', '" . $o_lastname . "', '" . $o_address . "', '" . $o_citytown . "', '" . $o_country . "', '" . $o_provincestatearea . "', '" . $o_postalcode . "', '" . $o_email . "', '" . $o_phonea . "', '" . $o_phoneb . "', '" . $o_phonec . "', '', NOW(), '" . $o_paymentterm . "', NULL, NULL, 'u')";
        mysql_query($insert, $db) or die(mysql_error());
        //Select the new Order ID
        $query1 = "SELECT o_id FROM c4m_playerorders WHERE o_username = '" . $o_username . "' AND o_orderstatus='u' ORDER BY o_id DESC LIMIT 1";
        $return1 = mysql_query($query1, $db) or die(mysql_error());
        $num1 = mysql_numrows($return1);
        $orderid = 0;
        if ($num1 != 0) {
            $orderid = mysql_result($return1, 0, 0);
        }
        // Send email
        $query2 = "SELECT * FROM c4m_emailmessageconfig";
        $return2 = mysql_query($query2, $db) or die(mysql_error());
        $num2 = mysql_numrows($return2);
        if ($num2 != 0) {
            $o_regover = mysql_result($return2, 0, "o_regover");
            $subject = "Chess Membership Renewal";
            // configure message body
            $body = $o_regover;
            $body = str_replace("[NAME]", $o_firstname . " " . $o_lastname, $body);
            $body = str_replace("[OID]", $orderid, $body);
            $body = str_replace("[UNAME]", $o_username, $body);
            //Instantiate theCR3DCQuery Class
            $oR3DCQuery = new CR3DCQuery($config);
            $oR3DCQuery->SendEmail($o_email, $conf['registration_email'], $conf['site_name'], $subject, $body);
            $oR3DCQuery->Close();
            unset($oR3DCQuery);
        }
        $i++;
    }
}
开发者ID:robertohernando,项目名称:phpchess,代码行数:67,代码来源:cron.php


注:本文中的CR3DCQuery::Close方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。