本文整理汇总了PHP中utils::mysqli_result方法的典型用法代码示例。如果您正苦于以下问题:PHP utils::mysqli_result方法的具体用法?PHP utils::mysqli_result怎么用?PHP utils::mysqli_result使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utils
的用法示例。
在下文中一共展示了utils::mysqli_result方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: api_remove_table
function api_remove_table($activeUser, $con, $character_get)
{
if (isset($_GET['rm'])) {
$remove = mysqli_real_escape_string($con, $_GET['rm']);
$remove_name = utils::mysqli_result(mysqli_query($con, "SELECT name FROM characters WHERE eve_idcharacter = '{$remove}'"), 0, 0);
//character is only dissossiated with the account, not removed from the database
$remove_character_account = mysqli_query($con, "DELETE FROM aggr WHERE user_iduser = (SELECT iduser FROM user WHERE username = '{$activeUser}') AND character_eve_idcharacter = '{$remove}'") or die(mysqli_error($con));
//$remove_character = mysqli_query($con, "DELETE FROM characters WHERE eve_idcharacter = '$remove'") or die(mysqli_error($con));
echo "Character " . $remove_name . " removed successfully.";
return;
} else {
$charsKeys = mysqli_query($con, "SELECT character_eve_idcharacter, name, username, apikey FROM v_user_characters WHERE username = '{$activeUser}'") or die(mysqli_error($con));
?>
<table class='table table-striped table-bordered table-hover' id='dataTables-api'>
<tr><th align="center">Character</th>
<th align="center">API Key</th>
<th></th>
<?php
while ($chars = mysqli_fetch_array($charsKeys)) {
$name = $chars['name'];
$api = $chars['apikey'];
$charid = $chars['character_eve_idcharacter'];
$imgpath = "https://image.eveonline.com/Character/" . $charid . "_32.jpg";
echo "<tr><td>" . "<img src=" . $imgpath . ">" . " " . $name . "</td><td >" . $api . "</td><td align='center'>" . "<a href= 'api_remove.php?character={$character_get}&rm={$charid}'<button type='button' class='btn btn-danger'>Remove</button>" . "</td></tr>";
}
?>
</table>
<?php
}
}
示例2: val_email_form
function val_email_form($character_get, $con, $username)
{
if (isset($_POST['Send'])) {
$new_email = mysqli_real_escape_string($con, $_POST['email']);
$password = mysqli_real_escape_string($con, $_POST['password']);
//check if password is correct, check if email is valid
$get_password = utils::mysqli_result(mysqli_query($con, "SELECT password FROM user WHERE username = '{$username}'"), 0, 0);
$get_salt = utils::mysqli_result(mysqli_query($con, "SELECT salt FROM user WHERE username = '{$username}'"), 0, 0);
//hash provided pw with salt
$newpassword_hash = crypt($password, $get_salt);
if ($newpassword_hash == $get_password) {
//passwords match, check if email is valid (again)
if (!filter_var($new_email, FILTER_VALIDATE_EMAIL)) {
echo "Invalid email format";
return;
} else {
//email is valid, password is valid, proceed to change
$update_email = mysqli_query($con, "UPDATE user SET email = '{$new_email}' WHERE username ='{$username}' ");
if ($update_email) {
echo "Email changed sucessfully";
} else {
echo "There was an error processing your request. Try again later.";
}
}
} else {
echo "Wrong password";
return;
}
//validation goes here
} else {
drawForm($character_get, $username);
}
}
示例3: val_password_form
function val_password_form($character_get, $username, $con)
{
if (isset($_POST['Send'])) {
$oldpassword = $_POST['oldpassword'];
$newpassword1 = $_POST['newpassword1'];
$newpassword2 = $_POST['newpassword2'];
$user = $_POST['user'];
//hash the provided password with the salt and match it against the one stored in the database
$salt = utils::mysqli_result(mysqli_query($con, "SELECT salt FROM user WHERE username = '{$user}'"), 0, 0);
$oldpassword_crypt = crypt($oldpassword, $salt);
$find_current_password = utils::mysqli_result(mysqli_query($con, "SELECT password FROM user WHERE username = '{$user}'"), 0, 0);
if ($find_current_password != $oldpassword_crypt) {
echo "Incorrect password";
} else {
if ($newpassword1 != $newpassword2) {
echo "The new passwords provided don't match";
} else {
//passwords match.
//generate new salt
//hash the new password and store it in the database
$cost = 10;
$new_salt = strtr(base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM)), '+', '.');
$new_salt = sprintf("\$2a\$%02d\$", $cost) . $new_salt;
$newpassword_hash = crypt($newpassword1, $new_salt);
$update_password = mysqli_query($con, "UPDATE user SET password = '{$newpassword_hash}', salt = '{$new_salt}' WHERE username = '{$username}'") or die(mysqli_error(${$con}));
if ($update_password) {
echo "Password successfully changed";
}
}
}
//validation goes here
} else {
drawForm($character_get, $username);
}
}
示例4: drawAssetsTable
function drawAssetsTable($con, $filter, $getAssetsSignificant, $getAssets)
{
?>
<div class="dataTable_wrapper">
<table class="table table-striped table-bordered table-hover" id="dataTables-assets">
<thead>
<tr>
<th>Item</th>
<th>Q</th>
<th>Location</th>
<th>Est. Value (unit)</th>
<th>Est. Value (stack)</th>
</tr>
</thead>
<tbody>
<?php
if ($filter == "yes") {
$getAssetsReal = $getAssetsSignificant;
} else {
$getAssetsReal = $getAssets;
}
while ($assetList = mysqli_fetch_array($getAssetsReal, MYSQLI_ASSOC)) {
$itemID = $assetList['item_eve_iditem'];
$itemName = utils::mysqli_result(mysqli_query($con, "SELECT name FROM item WHERE eve_iditem = '{$itemID}'"), 0, 0);
$imgpath = "../Types/" . $itemID . "_32.png";
$quantity = $assetList['quantity'];
$locationID = $assetList['locationID'];
$value = utils::mysqli_result(mysqli_query($con, "SELECT price_evecentral FROM item_price_data WHERE item_eve_iditem = '{$itemID}'"), 0, 0);
$value_stack = $assetList['price_stack'];
if (utils::startsWith($locationID, "6")) {
//item is in a station
$getStationName = mysqli_query($con, "SELECT name FROM station WHERE eve_idstation = '{$locationID}'") or die(mysqli_error($con));
if (mysqli_num_rows($getStationName) < 1) {
$locationName = utils::mysqli_result(mysqli_query($con, "SELECT name FROM outposts WHERE eve_idoutposts = '{$locationID}'"), 0, 0);
} else {
$locationName = utils::mysqli_result($getStationName, 0, 0);
}
} else {
if (utils::startsWith($locationID, "3")) {
$locationName = utils::mysqli_result(mysqli_query($con, "SELECT name FROM system WHERE eve_idsystem = '{$locationID}'"), 0, 0);
}
}
echo "<tr>" . "<td><img src='{$imgpath}'>" . " " . $itemName . "</td>" . "<td align = 'right'>" . $quantity . "</td>" . "<td>" . $locationName . "</td>" . "<td align = 'right'>" . number_format($value) . "</td>" . "<td align = 'right'>" . number_format($value_stack) . "</td>" . "</tr>";
}
?>
</tbody>
</table>
</div>
<?php
}
示例5: tableMarketOrders
function tableMarketOrders($con, $getActiveMarketOrders, $tablename)
{
?>
<div class="dataTable_wrapper">
<table class="table table-striped table-bordered table-hover" id="<?php
echo $tablename;
?>
">
<thead>
<tr>
<th>Time</th>
<th>Item</th>
<th align = 'right'>Q</th>
<th align = 'right'>ISK/unit</th>
<th>Station</th>
<th>State</th>
</tr>
</thead>
<tbody>
<?php
while ($orders = mysqli_fetch_array($getActiveMarketOrders)) {
$time = $orders['date'];
$itemID = $orders['eve_item_iditem'];
$itemName = utils::mysqli_result(mysqli_query($con, "SELECT name FROM item WHERE eve_iditem = '{$itemID}'"), 0, 0);
$stationID = $orders['station_eve_idstation'];
$stationName = utils::mysqli_result(mysqli_query($con, "SELECT name FROM station WHERE eve_idstation = '{$stationID}'"), 0, 0);
$price_unit = $orders['price'];
$volume = $orders['volume_remaining'];
$state = $orders['order_state'];
/*$regionName = utils::mysqli_result(mysqli_query($con, "SELECT name FROM region "
. "WHERE eve_idregion = "
. "(SELECT region_eve_idregion FROM system WHERE eve_idsystem = "
. "(SELECT system_eve_idsystem FROM station WHERE eve_idstation = '$stationID'))"),0,0);*/
echo "<tr><td>" . $time . "</td>" . "<td>" . "<img src= '../Types/" . $itemID . "_32.png'>" . $itemName . "</td>" . "<td align = 'right'>" . number_format($volume) . "</td>" . "<td align = 'right'>" . number_format($price_unit) . "</td>" . "<td>" . $stationName . "</td>" . "<td>" . $state . "</td></tr>";
}
?>
</tbody>
</table>
</div>
<?php
}
示例6: forgot_username
function forgot_username($con)
{
if (isset($_POST['Submit'])) {
$email = $_POST['email'];
$check_email_exists = $con->prepare("SELECT username FROM user WHERE email = ?");
$check_email_exists->bind_param("s", $email);
$check_email_exists->execute();
$check_email_exists->store_result();
//$data = $check_email_exists->fetch_array();
//$username = $data['username'];
//$user_r = mysqli_stmt_get_result($check_email_exists);
//$user = mysqli_fetch_array($user_r, MYSQLI_ASSOC);
//$username = $user['username'];
//$check_email_exists = mysqli_query($con, "SELECT username FROM user WHERE email = '$email' ");
$username = utils::mysqli_result(mysqli_query($con, "SELECT username FROM user WHERE email = '{$email}'"), 0, 0);
if ($check_email_exists->num_rows >= 1) {
$mail = smtpmailer($email, "noreply@etm.com", "ETM Automated mail", "Eve Trade Master - login details", "You have recently requested your login details at www.evetrademaster.com. Your username is '{$username}'");
} else {
echo "Email not found in our records";
echo "<meta http-equiv='refresh' content='2; url=../pages/forgot_username.php'>";
}
} else {
echo "Forgot your username? Just type the e-mail associated to your account and we'll send it to you:" . "<br><br>";
?>
<form method="POST" action="forgot_username.php" ><fieldset>
<div class="form-group">
<input class="form-control" type = "text" size="30" name="email">
</div>
<div class="form-group">
<p align='center'><input type ="Submit" name="Submit" value="Submit" class="btn btn-lg btn-success"></p>
</fieldset></form>
<?php
}
}
示例7: getLastWeekProfits
function getLastWeekProfits($ids_string, $con)
{
$profits = array();
$margins = array();
$dates = array();
$total_profit = 0;
$total_margin = 0;
echo "<table border ='1'>";
echo "<tr><th>Day</th><th>Profit</th><th>Margin</th></tr>";
/* $getLastWeekProfits = mysqli_query($con, "SELECT DATE(timestamp_sell) as date, SUM(profit.quantity_profit * profit.profit_unit) as profit, (AVG( profit.profit_unit / transaction.price_unit ) *100) as margin
FROM profit
JOIN transaction ON profit.transaction_idbuy_buy = transaction.idbuy
WHERE `characters_eve_idcharacters_OUT` = '$ids_string'
and date(timestamp_sell) = DATE_SUB( NOW( ) , INTERVAL $i" );*/
for ($i = 0; $i <= 7; $i++) {
$q1 = "SELECT SUM( profit.quantity_profit * profit.profit_unit ) AS profit\n FROM profit\n JOIN transaction ON profit.transaction_idbuy_buy = transaction.idbuy\n WHERE `characters_eve_idcharacters_OUT` \n IN {$ids_string}\n AND DATE( timestamp_sell ) = DATE( DATE_SUB( NOW( ) , INTERVAL '{$i}' DAY ) )" or die(mysqli_error($con));
$q2 = "select (sum(price_unit_sell*profit_quantity)-sum(price_unit_buy*profit_quantity))/sum(price_unit_buy*profit_quantity)*100\n from v_profit_details where character_sell_id IN {$ids_string}\n AND DATE(time_sell) = DATE( DATE_SUB( NOW( ) , INTERVAL '{$i}' DAY ) )" or die(mysqli_error($con));
$q3 = "SELECT days from calendar where days = DATE( DATE_SUB( NOW( ),INTERVAL '{$i}' DAY ))";
$value1 = utils::mysqli_result(mysqli_query($con, $q1), 0);
if (empty($value1)) {
$value1 = 0;
}
$value2 = utils::mysqli_result(mysqli_query($con, $q2), 0);
if (empty($value2)) {
$value2 = 0;
}
// $lastdate = $value3;
$pqp = mysqli_query($con, $q3);
$value3 = utils::mysqli_result(mysqli_query($con, $q3), 0, 0);
array_push($profits, $value1);
array_push($margins, $value2);
array_push($dates, $value3);
$total_profit = $total_profit + $profits[$i];
$total_margin = $total_margin + $margins[$i];
echo "<tr><td>" . $dates[$i] . "</td><td>" . number_format($profits[$i]) . "</td><td>" . number_format($margins[$i], 2) . " %" . "</td></tr>";
}
//echo $total_profit;
echo "<tr><td>Total/avg</td><td><b>" . number_format($total_profit) . "</b></td><td><b>" . number_format($total_margin / 7, 2) . " %" . "</b></td></tr>";
echo "</table>";
}
示例8: getAccountingLevel
public function getAccountingLevel()
{
return $this->level_acc = utils::mysqli_result(mysqli_query($this->con, "SELECT accounting " . "FROM characters " . "WHERE eve_idcharacter = '{$this->character_get}'"), 0, 0);
}
示例9: fetchTransactions
function fetchTransactions($apikey, $vcode, $refID, $idcharacter, $con)
{
$pheal4 = new Pheal($apikey, $vcode, "char", $refID);
$wallet_response = $pheal4->WalletTransactions(array("characterID" => $idcharacter));
if ($refID != 0) {
$wallet_response = $pheal4->WalletTransactions(array("fromID" => $refID));
}
$i = -1;
//get the Eve transaction ID for the latest transaction (this might need some tweaking when they decide to recycle ids)
$getLatestTransaction = utils::mysqli_result(mysqli_query($con, "SELECT MAX(transkey) AS val FROM transaction WHERE character_eve_idcharacter = '{$idcharacter}'"), 0, 0);
//var_dump($getLatestTransaction);
if (!isset($getLatestTransaction)) {
$latestTransaction = 0;
} else {
$latestTransaction = $getLatestTransaction;
}
// var_dump($latestTransaction);
$arrayfinal = array();
$array_refs = array();
$null = (string) "NULL";
foreach ($wallet_response->transactions as $row2) {
$transkey = $row2->transactionID;
$typeid = $row2->typeID;
$dateTime = $row2->transactionDateTime;
$quantity = $row2->quantity;
$price_unit = $row2->price;
$transactionType = $row2->transactionType;
$station = $row2->stationName;
$price_total = $price_unit * $quantity;
$station_id = $row2->stationID;
$clientName = $row2->clientName;
array_push($array_refs, $transkey);
if ($transkey > $latestTransaction) {
$i++;
$item[$i] = array("{$null}", "'" . $dateTime . "'", "'" . $quantity . "'", "'" . $price_unit . "'", "'" . $price_total . "'", "'" . $transactionType . "'", "'" . $idcharacter . "'", "'" . $station_id . "'", "'" . $typeid . "'", "'" . $transkey . "'", "'" . str_replace("'", ".", $clientName) . "'");
}
}
for ($j = 0; $j <= $i; $j++) {
$arrayfinal[$j] = $item[$j];
}
$values_transactions = array();
foreach ($arrayfinal as $rowValues) {
foreach ($rowValues as $key => $rowValue) {
$rowValues[$key] = $rowValues[$key];
}
//this array contains all transactions in this format: (x,y,z),(a,b,c),...
$values_transactions[] = "(" . implode(', ', $rowValues) . ")";
}
if (!empty($values_transactions)) {
//var_dump($values);
$query_insert = "INSERT IGNORE INTO `trader`.`transaction` (`idbuy`, `time`, `quantity`, `price_unit`, `price_total`, `transaction_type`, `character_eve_idcharacter`, `station_eve_idstation`, `item_eve_iditem`, `transkey`, `client`) " . "VALUES " . implode(', ', $values_transactions);
$insert_transactions = mysqli_query($con, $query_insert) or die(mysqli_error($con));
return $newTransactions = mysqli_affected_rows($con);
if (count($array_refs) == 2560) {
$refID = end($array_refs);
fetchTransactions($apikey, $vcode, $refID, $idcharacter, $con);
}
} else {
return $newTransactions = 0;
$insert_transactions = False;
}
}
示例10: link
<?php
require_once '/var/www/html/pages/scripts/class/link.php';
require_once '/var/www/html/pages/scripts/class/utils.php';
$link = new link();
$con = $link->connect();
//Updates the total sales and purchases for each day for every character since 24/10/2015
$getCharacters = mysqli_query($con, "SELECT eve_idcharacter FROM characters") or die(mysqli_error($con));
while ($chars = mysqli_fetch_array($getCharacters, MYSQLI_ASSOC)) {
$characterID = $chars['eve_idcharacter'];
//iterate dates from 24/10/2015
$getDates = mysqli_query($con, "SELECT days FROM calendar WHERE days > '2015-10-24' AND days <= '2016-01-27'") or die(mysqli_error($con));
while ($days = mysqli_fetch_array($getDates, MYSQLI_ASSOC)) {
$date = $days['days'];
//get sum of sales
$getSalesSum = mysqli_query($con, "SELECT SUM(price_total) FROM transaction\n WHERE character_eve_idcharacter = '{$characterID}' AND transaction_type = 'Sell' AND date(time) = '{$date}'");
$salesSumVal = utils::mysqli_result($getSalesSum, 0, 0);
//get sum of purchases
$getPurchasesSum = mysqli_query($con, "SELECT SUM(price_total) FROM transaction\n WHERE character_eve_idcharacter = '{$characterID}' AND transaction_type = 'Buy' AND date(time) = '{$date}'");
$purchasesSumVal = utils::mysqli_result($getPurchasesSum, 0, 0);
$getProfitsSum = mysqli_query($con, "SELECT SUM(profit_unit*quantity_profit) FROM profit WHERE date(timestamp_sell) = '{$date}'\n AND characters_eve_idcharacters_OUT = '{$characterID}'");
$profitsSumVal = utils::mysqli_result($getProfitsSum, 0, 0);
$getMargin = mysqli_query($con, "select (sum(profit_total))/sum(price_unit_buy*profit_quantity)*100\n from v_profit_details where character_sell_id = '{$characterID}'\n AND DATE(time_sell) = '{$date}'") or die(mysqli_error($con));
$marginSumVal = utils::mysqli_result($getMargin, 0, 0);
$addSales = mysqli_query($con, "REPLACE INTO history (idhistory, characters_eve_idcharacters, date, total_buy, total_sell, total_profit, margin)\n VALUES(NULL, '{$characterID}', '{$date}', '{$purchasesSumVal}', '{$salesSumVal}', '{$profitsSumVal}', '{$marginSumVal}')") or die(mysqli_error($con));
echo "Updated " . $characterID . " for " . $date . "<br>";
}
}
?>
示例11: unset
//remove active characters from array
for ($i = 0; $i < count($characters) - 1; $i++) {
if ($character_get_name == $characters[$i]) {
unset($characters[$i]);
// echo $characters[$i];
}
}
?>
<i class="fa fa-thumb-tack fa-fw"></i>
<?php
if ($ids_string == "") {
$ids_string = "(" . $character_get . ")";
}
!empty($typeid) ? $itemIDString = "AND item_id = '{$typeid}'" : ($itemIDString = "");
$getTotalProfit = utils::mysqli_result(mysqli_query($con, "SELECT SUM(profit_total) FROM v_profit_details WHERE (character_buy_id IN {$ids_string} or character_sell_id IN {$ids_string})" . $itemIDString . " AND time_sell>= DATE_SUB(NOW(), INTERVAL {$last_filter} HOUR) "), 0, 0);
$getTotalProfit == "" ? $getTotalProfit = 0 : ($getTotalProfit = $getTotalProfit);
echo "Currently showing results for <b>" . implode(",", $aggregation) . "</b>" . $text_filter . "<br>";
$number = 0;
echo "Characters: " . "<input type='checkbox' onclick='return false;'checked> <b>{$characterName}</b>" . " ";
foreach ($characters as $row2) {
$number = $number + 1;
echo "<input type = 'checkbox' name='characters{$number}' value='{$row2}'>" . " " . $row2 . " ";
}
//echo "<br>";
// "<form accept-charset='utf-8' name='filters' method='POST' action='profit.php?character=$character_get'>";
?>
<input type="Submit" class="btn btn-success" name="Submit" value="Submit">
<br>
</form>
示例12: link
<?php
require_once 'scripts/class/link.php';
require_once 'scripts/class/utils.php';
$link = new link();
$con = $link->connect();
//create DB connection
$user = $username = "";
if (!isset($_SESSION)) {
session_start();
}
//if no cookie is found, start a normal session which expires in 1 hour
if (isset($_COOKIE['name']) && isset($_COOKIE['password'])) {
$cookiename = $_COOKIE['name'];
$cookiepw = $_COOKIE['password'];
$test_password_db = utils::mysqli_result(mysqli_query($con, "SELECT password FROM user WHERE username = '{$cookiename}'"), 0, 0);
//check if password is correct
if ($test_password_db == $cookiepw) {
if (!isset($_SESSION)) {
session_start();
}
$_SESSION['user'] = $cookiename;
}
}
if (isset($_SESSION['user'])) {
$user = $_SESSION['user'];
$username = $_SESSION['user'];
}
?>
示例13: drawContractsTable
function drawContractsTable($con, $getContracts, $tablename)
{
?>
<div class="dataTable_wrapper">
<table class="table table-striped table-bordered table-hover" id="<?php
echo $tablename;
?>
">
<thead>
<tr>
<th>Creation</th>
<th>Issuer</th>
<th>Acceptor</th>
<th>Avail.</th>
<th>Price/Reward</th>
<th>Type</th>
<th>Station</th>
</tr>
</thead>
<tbody>
<?php
while ($contracts = mysqli_fetch_array($getContracts)) {
$issuerID = $contracts['issuer_id'];
$acceptorID = $contracts['acceptor_id'];
$status = $contracts['status'];
$availability = $contracts['availability'];
$price = number_format($contracts['price']);
$reward = number_format($contracts['reward']);
$price_reward = max($price, $reward);
$collateral = number_format($contracts['colateral']);
$stationFrom = $contracts['fromStation_eve_idstation'];
$stationTo = $contracts['toStation_eve_idstation'];
$type = $contracts['type'];
$date = $contracts['creation_date'];
$stationNameFrom = utils::mysqli_result(mysqli_query($con, "SELECT name FROM station WHERE eve_idstation = '{$stationFrom}'"), 0, 0);
$stationNameTo = utils::mysqli_result(mysqli_query($con, "SELECT name FROM station WHERE eve_idstation = '{$stationTo}'"), 0, 0);
if ($availability == 'Public') {
$iconAv = "<i class='fa fa-user fa-fw'></i>";
} else {
if ($availability == 'Private') {
$iconAv = "<i class='fa fa-unlock-alt fa-fw '></i>";
}
}
if ($type == 'Courier') {
$iconType = "<i class='fa fa-truck fa-fw'></i>";
} else {
if ($type == 'ItemExchange') {
$iconType = "<i class='fa fa-euro fa-fw'></i>";
} else {
if ($type == 'Loan') {
$iconType = "<i class='fa fa-credit-card fa-fw'></i>";
} else {
if ($type == 'Auction') {
$iconType = "<i class='fa fa-bank fa-fw'></i>";
}
}
}
}
if ($issuerID != 0) {
$search_issuer_name = mysqli_query($con, "SELECT name FROM characters_public WHERE eve_idcharacters = '{$issuerID}'") or die(mysqli_error($con));
if (mysqli_num_rows($search_issuer_name) == 1) {
$issuerName = utils::mysqli_result($search_issuer_name, 0, 0);
$issuerPic = "https://image.eveonline.com/Character/" . $issuerID . "_32.jpg";
} else {
$getIssuerName = "https://api.eveonline.com/eve/CharacterName.xml.aspx?ids=" . $issuerID;
$xml = simplexml_load_file($getIssuerName);
foreach ($xml->result->rowset->row as $r) {
$issuerName = $r['name'];
$insert_name = mysqli_query($con, "INSERT INTO `trader`.`characters_public` (`eve_idcharacters`, `name`) VALUES ('{$issuerID}', '{$issuerName}')");
$issuerPic = "https://image.eveonline.com/Character/" . $issuerID . "_32.jpg";
}
}
} else {
$issuerName = "n/a";
$issuerPic = "";
}
if ($acceptorID != 0) {
$search_acceptor_name = mysqli_query($con, "SELECT name FROM characters_public WHERE eve_idcharacters = '{$acceptorID}'") or die(mysqli_error($con));
if (mysqli_num_rows($search_acceptor_name) == 1) {
$acceptorName = utils::mysqli_result($search_acceptor_name, 0, 0);
$acceptorPic = "https://image.eveonline.com/Character/" . $acceptorID . "_32.jpg";
} else {
$getacceptorName = "https://api.eveonline.com/eve/CharacterName.xml.aspx?ids=" . $acceptorID;
$xml = simplexml_load_file($getacceptorName);
foreach ($xml->result->rowset->row as $r) {
$acceptorName = $r['name'];
$insert_name = mysqli_query($con, "INSERT INTO `trader`.`characters_public` (`eve_idcharacters`, `name`) VALUES ('{$acceptorID}', '{$acceptorName}')");
$acceptorPic = "https://image.eveonline.com/Character/" . $acceptorID . "_32.jpg";
}
}
} else {
$acceptorName = "n/a";
$acceptorPic = "";
}
echo "<tr><td>" . $date . "</td><td>" . $issuerName . "</td>" . "<td>" . $acceptorName . "</td>" . "<td>" . $iconAv . $availability . "</td>" . "<td align = 'right'>" . $price_reward . "</td>" . "<td>" . $iconType . $type . "</td>" . "<td>" . $stationNameFrom . "</td></tr>";
}
?>
//.........这里部分代码省略.........
示例14: session_start
<?php
session_start();
require_once "scripts/class/link.php";
require_once "scripts/class/utils.php";
$link = new link();
$con = $link->connect();
if (isset($_GET['user'])) {
$user_get = strtolower($_GET['user']);
}
if (isset($_GET['email'])) {
$email_get = strtolower($_GET['email']);
}
$useremail = utils::mysqli_result(mysqli_query($con, "SELECT email FROM user WHERE username = '{$user_get}'"), 0, 0);
if ($useremail == $email_get && isset($email_get)) {
$unsub = mysqli_query($con, "UPDATE user SET reports = 'none' WHERE username = '{$user_get}'") or die(mysqli_error($con));
if ($unsub) {
echo "You have unsubscribed from the Eve Trade Master mailing report. <br> You can return anytime in your account settings.";
} else {
echo "Comunication error. Try again";
}
} else {
echo "Invalid request.";
}
?>
示例15: mysqli_query
$api_q = mysqli_query($con, "SELECT api_apikey AS api FROM `characters` WHERE eve_idcharacter = '{$character_get}'") or die(mysqli_error($con));
$api_a = mysqli_fetch_array($api_q, MYSQLI_ASSOC);
$apikey = $api_a['api'];
$vcode_q = mysqli_query($con, "SELECT vcode FROM api WHERE apikey = '{$apikey}'") or die(mysqli_error($con));
$vcode_a = mysqli_fetch_array($vcode_q);
$vcode = $vcode_a['vcode'];
//don't allow spying
$check_char_belong_session = mysqli_query($con, "SELECT * FROM v_user_characters\n WHERE username = '{$username}' AND character_eve_idcharacter = '{$character_get}'") or die(mysqli_error($con));
if (mysqli_num_rows($check_char_belong_session) == 0) {
$session_state = 0;
echo "Sneaky sneaky";
session_destroy();
echo "<meta http-equiv='refresh' content='1; url=../pages/login.php'>";
exit;
}
$characterName = utils::mysqli_result(mysqli_query($con, "SELECT name FROM characters WHERE eve_idcharacter = '{$character_get}'"), 0, 0);
$getCharacterPortrait = "https://image.eveonline.com/Character/" . $character_get . "_64.jpg";
$getCharacterList = mysqli_query($con, "SELECT name, character_eve_idcharacter\n FROM v_user_characters WHERE username = '{$username}'\n AND character_eve_idcharacter != '{$character_get}'") or die(mysqli_error($con));
/*$characterList = array();
$characterids = array();
while ($row = mysqli_fetch_array($getCharacterList, MYSQLI_ASSOC))
{
array_push($characterList, $row['name']);
array_push($characterids, $row['character_eve_idcharacter']);
}
*/
//var_dump($characterList);
$getCharacterInfo = mysqli_fetch_array(mysqli_query($con, "SELECT * FROM characters " . "WHERE eve_idcharacter = '{$character_get}'"), MYSQLI_ASSOC);
$accountBalance = $getCharacterInfo['balance'];
$networth = $getCharacterInfo['networth'];
$escrow = $getCharacterInfo['escrow'];