本文整理匯總了PHP中city::initiate_transaction方法的典型用法代碼示例。如果您正苦於以下問題:PHP city::initiate_transaction方法的具體用法?PHP city::initiate_transaction怎麽用?PHP city::initiate_transaction使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類city
的用法示例。
在下文中一共展示了city::initiate_transaction方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: server
if (!$server) {
$server = new server($_REQUEST['server_id']);
}
$current_user = new user($LOGIN_DATA['user_id'], $server);
$cities = preg_split('/[\\s\\+]+/', $_REQUEST['attack_id']);
if ($cities[0]) {
$tocity = new city($cities[0], $server);
}
if ($cities[1]) {
$fromcity = new city($cities[1], $server);
}
if ($fromcity && $fromcity->getValue('user')->getValue('userid') != $LOGIN_DATA['user_id']) {
die('Invalid from city.');
}
if ($_POST['attack_id']) {
$message = $fromcity->initiate_transaction(intval($_POST['attack_id']), intval($_POST['attack_count']), intval($_POST['attack_destination']));
if (!$message) {
header('Location: ' . dirname(dirname($_SERVER['SCRIPT_URI'])), true, 303);
exit;
}
}
//end if POST attack_id
?>
<head>
<title>The Project - Attack/Move</title>
<?php
$xhtmlSite->metaType();
?>
<link rel="stylesheet" href="/styles/main.css" type="text/css" media="screen" />
</head>