本文整理汇总了PHP中getItem函数的典型用法代码示例。如果您正苦于以下问题:PHP getItem函数的具体用法?PHP getItem怎么用?PHP getItem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getItem函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getData
function getData($moving_limit, $final_limit, $averages, $values, $max_height)
{
$data = array();
for ($index = $moving_limit; $index < $final_limit; $index++) {
$data[$index] = getItem($index, $averages, $values, $max_height);
}
return $data;
}
示例2: getItems
function getItems($rss)
{
$channel = getChannel($rss);
$items = array();
foreach ($channel->getElementsByTagName('item') as $domItem) {
$items[] = getItem($domItem);
}
return $items;
}
示例3: getSkillFromItemID
function getSkillFromItemID($id)
{
if ($id == 0) {
return SKILL_UNARMED;
}
$item = getItem($id);
if ($item == 0) {
return SKILL_UNARMED;
}
if ($item['class'] != 2) {
return SKILL_UNARMED;
}
switch ($item['subclass']) {
case 0:
return SKILL_AXES;
case 1:
return SKILL_TWO_HANDED_AXE;
case 2:
return SKILL_BOWS;
case 3:
return SKILL_GUNS;
case 4:
return SKILL_MACES;
case 5:
return SKILL_TWO_HANDED_MACES;
case 6:
return SKILL_POLEARMS;
case 7:
return SKILL_SWORDS;
case 8:
return SKILL_TWO_HANDED_SWORDS;
case 10:
return SKILL_STAVES;
// case 11: return ;//One-Handed Exotics
// case 12: return ;//Two-Handed Exotics
// case 11: return ;//One-Handed Exotics
// case 12: return ;//Two-Handed Exotics
case 13:
return SKILL_FIST_WEAPONS;
// case 14: return ;//Miscellaneous
// case 14: return ;//Miscellaneous
case 15:
return SKILL_DAGGERS;
case 16:
return SKILL_THROWN;
// case 17: return ;//Spears
// case 17: return ;//Spears
case 18:
return SKILL_CROSSBOWS;
case 19:
return SKILL_WANDS;
// case 20: return ;//Fishing Pole
}
return SKILL_UNARMED;
}
示例4: getToken
public function getToken($userId, $itemId, $qty, $mobile)
{
$itemObj = getItem($itemId);
$itemObj['qty'] = $qty;
$dirRoot = sprintf("http://%s%s/", $_SERVER['SERVER_NAME'], dirname($_SERVER['PHP_SELF']));
$postDetails = array(USER => UID, PWD => PASSWORD, SIGNATURE => SIG, METHOD => "SetExpressCheckout", VERSION => VER, PAYMENTREQUEST_0_CURRENCYCODE => "USD", PAYMENTREQUEST_0_AMT => $itemObj['qty'] * $itemObj['amt'], PAYMENTREQUEST_0_TAXAMT => "0", PAYMENTREQUEST_0_DESC => "JS Wars", PAYMENTREQUEST_0_PAYMENTACTION => "Sale", L_PAYMENTREQUEST_0_ITEMCATEGORY0 => $itemObj['category'], L_PAYMENTREQUEST_0_NAME0 => $itemObj['name'], L_PAYMENTREQUEST_0_NUMBER0 => $itemObj['number'], L_PAYMENTREQUEST_0_QTY0 => $itemObj['qty'], L_PAYMENTREQUEST_0_TAXAMT0 => "0", L_PAYMENTREQUEST_0_AMT0 => $itemObj['amt'], L_PAYMENTREQUEST_0_DESC0 => $itemObj['desc'], PAYMENTREQUEST_0_SHIPPINGAMT => "0", PAYMENTREQUEST_0_SHIPDISCAMT => "0", PAYMENTREQUEST_0_TAXAMT => "0", PAYMENTREQUEST_0_INSURANCEAMT => "0", PAYMENTREQUEST_0_PAYMENTACTION => "sale", L_PAYMENTTYPE0 => "sale", PAYMENTREQUEST_0_CUSTOM => sprintf("%s,%s", $this->userId, $itemObj['number']), RETURNURL => "{$dirRoot}success.php?data=" . $itemObj['qty'] * $itemObj['amt'] . "|{$userId}|{$itemId}", CANCELURL => "{$dirRoot}cancel.php");
$arrPostVals = array_map(create_function('$key, $value', 'return $key."=".$value."&";'), array_keys($postDetails), array_values($postDetails));
$postVals = rtrim(implode($arrPostVals), "&");
$response = parseString(runCurl(URLBASE, $postVals));
//forward the user to login and accept transaction
if ($mobile === "true") {
$URL = URLREDIRECT;
} else {
$URL = URLREDIRECTINCONTEXT;
}
$redirect = sprintf("%s?&useraction=commit&token=%s", $URL, urldecode($response["TOKEN"]));
$returnObj = array(success => true, redirecturl => $redirect);
echo json_encode($returnObj);
}
示例5: getToken
public function getToken($userId, $itemId, $qty, $mobile)
{
$itemObj = getItem($itemId);
$itemObj['qty'] = $qty;
$dirRoot = sprintf("http://%s%s/", $_SERVER['SERVER_NAME'], dirname($_SERVER['PHP_SELF']));
$tax = round(0.01 * $itemObj['taxamt'] * $itemObj['qty'] * $itemObj['amt'], 2);
$postDetails = array('USER' => UID, 'PWD' => PASSWORD, 'SIGNATURE' => SIG, 'METHOD' => "SetExpressCheckout", 'VERSION' => VER, 'PAYMENTREQUEST_0_CURRENCYCODE' => $itemObj['currency'], 'PAYMENTREQUEST_0_AMT' => $itemObj['qty'] * $itemObj['amt'] + $tax, 'PAYMENTREQUEST_0_ITEMAMT' => $itemObj['qty'] * $itemObj['amt'], 'PAYMENTREQUEST_0_TAXAMT' => $tax, 'PAYMENTREQUEST_0_DESC' => $itemObj['name'], 'PAYMENTREQUEST_0_PAYMENTACTION' => "Sale", 'L_PAYMENTREQUEST_0_ITEMCATEGORY0' => $itemObj['category'], 'L_PAYMENTREQUEST_0_NAME0' => $itemObj['name'], 'L_PAYMENTREQUEST_0_NUMBER0' => $itemObj['number'], 'L_PAYMENTREQUEST_0_QTY0' => $itemObj['qty'], 'L_PAYMENTREQUEST_0_AMT0' => $itemObj['amt'], 'L_PAYMENTREQUEST_0_TAXAMT0' => round(0.01 * $itemObj['taxamt'] * $itemObj['amt'], 2), 'PAYMENTREQUEST_0_SHIPPINGAMT' => "0", 'PAYMENTREQUEST_0_SHIPDISCAMT' => "0", 'PAYMENTREQUEST_0_INSURANCEAMT' => "0", 'PAYMENTREQUEST_0_PAYMENTACTION' => "sale", 'L_PAYMENTTYPE0' => "sale", 'PAYMENTREQUEST_0_CUSTOM' => sprintf("%s,%s", $this->userId, $itemObj['number']), 'RETURNURL' => "{$dirRoot}success.php?data=" . round($itemObj['qty'] * $itemObj['amt'] * (1 + 0.01 * $itemObj['taxamt']), 2) . "|{$userId}|{$itemId}", 'CANCELURL' => "{$dirRoot}cancel.php");
$arrPostVals = array_map(create_function('$key, $value', 'return $key."=".$value."&";'), array_keys($postDetails), array_values($postDetails));
$postVals = rtrim(implode($arrPostVals), "&");
$response = parseString(runCurl(URLBASE, $postVals));
//forward the user to login and accept transaction
if ($mobile === "true") {
$URL = URLREDIRECT;
} else {
$URL = URLREDIRECTINCONTEXT;
}
$redirect = sprintf("%s?useraction=commit&token=%s", $URL, urldecode($response["TOKEN"]));
$returnObj = array('success' => true, 'redirecturl' => $redirect);
echo json_encode($returnObj);
}
示例6: getLowerItem
function getLowerItem($item)
{
$parent_id = $item["parentID"];
$cursort = $item["sort"];
print "cursort: " . $cursort . "<br>";
$galitems_q = mysql_query("SELECT * FROM newcms2_gallerypicture WHERE parentID = " . $parent_id . "") or die(mysql_error());
$nearestlow = 999999999999.0;
while ($galitem = mysql_fetch_array($galitems_q)) {
print "isort: " . $galitem["sort"] . "<br>";
if ($galitem["sort"] > $cursort && $galitem["sort"] < $nearestlow) {
$nearestlow = $galitem["sort"];
$found = $galitem["ID"];
}
}
if (isset($found) && $found > 0) {
return getItem($found);
} else {
return 0;
}
}
示例7: allItems
function allItems($field, $options = array())
{
if ($options['data'] == 'option') {
$items = get_option($field);
} else {
$items = get_post_meta(get_the_ID(), $field);
}
$i = 0;
if ($items !== false && !empty($items)) {
if ($options['data'] == 'option') {
foreach ($items as $detail) {
// set the count
$options['i'] = $i;
// set the value
$options['value'] = $detail;
getItem($field, $options);
// getItem($field, $options['fields'], $options['i'], $options['value']);
$i++;
}
} else {
foreach ($items as $the_item => $details) {
foreach ($details as $detail) {
// set the count
$options['i'] = $i;
// set the value
$options['value'] = $detail;
getItem($field, $options);
// getItem($field, $options['fields'], $options['i'], $options['value']);
$i++;
}
}
}
} else {
// there aren't any items, so let's add one blank one to start out
// give value a value so it doesn't give us a notice
$options['value'] = NULL;
$options['i'] = $i;
getItem($field, $options);
// getItem($field, $options['fields'], $options['i']);
}
}
示例8: foreach
echo "<tr><td colspan=4 class=head>{$lang['item_set']}</td></tr>\n";
// Делаем ссылку для сортировки
$SortRefrence = $FindRefrence;
if ($page > 1) {
$SortRefrence .= "&page={$page}";
}
echo "<tr>";
echo "<th><a href=\"{$SortRefrence}\">{$lang['set_name']}</a></th>";
echo "<th width=260px>Items</th>";
echo "<th>Info</th>";
echo "</tr>\n";
foreach ($rows as $set) {
$items = array();
$item = 0;
if ($set['item_1']) {
$item = getItem($set['item_1']);
} else {
$items = $dDB->select("SELECT `entry`, `AllowableClass`, `displayid` FROM `item_template` WHERE `itemset` = ?d", $set['id']);
if ($items) {
$item = $items[0];
}
}
echo "<tr>";
echo "<td>{$set['name']}</td>";
echo "<td>";
if ($set['item_1']) {
for ($i = 1; $i < 18; $i++) {
if ($itemid = $set['item_' . $i]) {
show_item($itemid, 0, 'set');
}
}
示例9: getItem
<?php
require "inc/init.php";
$user = getItem('username', $_REQUEST, getItem('username', $_SESSION, ''));
if (!getItem('user', $_REQUEST, false) && $user) {
header("Location: {$contextpath}/run/{$user}/");
exit;
}
$result = mysql_queryf("SELECT name FROM clients, useragents WHERE clients.id=%u AND useragents.id=useragent_id LIMIT 1;", $client_id);
if ($row = mysql_fetch_array($result)) {
$useragent_name = $row[0];
}
$title = "Run the Test Swarm";
$scripts = "";
if ($client_id) {
$scripts = "<script type='text/javascript'>var client_id = {$client_id};</script>";
}
$scripts .= '<script type="text/javascript" src="' . $GLOBALS['contextpath'] . '/js/jquery.js"></script>' . '<script type="text/javascript" src="' . $GLOBALS['contextpath'] . '/js/run.js?' . time() . '"></script>';
示例10: abs
$id = abs(clrInt($_GET[id]));
delItem('items', $id);
header('Location: admin.php');
}
if (isset($_GET[order_id])) {
$id = clrStr($_GET[order_id]);
delItem('orders', $id);
header('Location: admin.php');
}
if ($_SERVER[REQUEST_METHOD] == "POST") {
$name = clrStr($_POST['name']);
$price = clrInt($_POST['price']);
$photo = $_FILES['f']['name'];
$quantity = clrInt($_POST['quantity']);
$tmp_name = $_FILES['f']['tmp_name'];
if (getItem($name, $price, $photo, $quantity)) {
if (move_uploaded_file($tmp_name, "{$upload_dir}/{$photo}")) {
header('Location: admin.php');
echo "Товар успешно добавлен!</br>";
}
} else {
echo "произошла ошибка!";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Админка сайта</title>
<meta
charset = "UTF-8"
示例11: list_item
function list_item($catalog)
{
global $host;
global $user;
global $password;
global $database;
global $limit;
$arr = array();
// подключаемся к SQL серверу
$link = mysqli_connect($host, $user, $password, $database) or die("Ошибка " . mysqli_error($link));
$query = 'select link, parent_id from bitrixshop.load_catalog where id_cat = "' . $catalog . '"' . $limit;
//Не забыть убрать ЛИМИТ
$result = mysqli_query($link, $query);
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
//echo $row['s3'] . "<br>";
$arr_art = getItem($row['link'], $catalog);
$parent_id = $row['parent_id'];
for ($j = 0; $j < count($arr_art); $j++) {
$s1 = $arr_art[$j]["tovar_id"];
$s2 = $arr_art[$j]["catalog_id"];
$s3 = $arr_art[$j]["link"];
$s4 = $parent_id;
$arr[] = array("tovar_id" => $s1, "catalog_id" => $s2, "link" => $s3, "parent_id" => $s4);
}
}
//Закрываем соединение с БД
mysqli_close($link);
return $arr;
}
示例12: swarmpath
$name = "Linux";
}
}
}
}
}
}
}
}
}
}
echo "<li><img src='" . swarmpath("/") . "images/{$engine}.sm.png' class='{$engine}'/> <strong class='name'>{$browser_name} {$name}</strong><br>Connected <span title='{$since}' class='pretty'>{$since}</span></li>";
}
echo "</ul>";
}
$job_search = preg_replace("/[^a-zA-Z ]/", "", getItem("job", $_REQUEST, ""));
$job_search .= "%";
$search_result = mysql_queryf("SELECT jobs.name, jobs.status, jobs.id FROM jobs, users WHERE jobs.name LIKE %s AND users.name=%s AND jobs.user_id=users.id ORDER BY jobs.created DESC LIMIT 15;", $job_search, $search_user);
if (mysql_num_rows($search_result) > 0) {
echo '<br/><h3>Recent Jobs:</h3><table class="results"><tbody>';
$output = "";
$browsers = array();
$addBrowser = true;
while ($row = mysql_fetch_array($search_result)) {
$job_name = $row[0];
$job_status = get_status(intval($row[1]));
$job_id = $row[2];
$output .= '<tr><th><a href="' . swarmpath("job/{$job_id}/") . '">' . strip_tags($job_name) . "</a></th>\n";
$results = array();
$states = array();
$result = mysql_queryf("SELECT runs.id as run_id, runs.url as run_url, runs.name as run_name, useragents.engine as browser, useragents.name as browsername, useragents.id as useragent_id, run_useragent.status as status FROM run_useragent, runs, useragents WHERE runs.job_id=%u AND run_useragent.run_id=runs.id AND run_useragent.useragent_id=useragents.id ORDER BY run_id, browsername;", $job_id);
示例13: DataAccess
<?php
require_once 'DataAccess.php';
require_once 'includes/functions.php';
$star = $_POST['star'];
$data = new DataAccess('photo');
$userID = rand(1, 10);
$itemID = $_POST['id'];
$table = $_POST['table'];
$newtime = getCurrentDateTime();
$theItem = getItem($itemID, $table);
$totStar = $theItem['stars'] + $star;
$total = $theItem['like_count'] + 1;
$rating = (int) $totStar / $total;
$table2 = $table . "_votes";
$sql = "UPDATE {$table} SET like_count='{$total}', stars='{$star}', last_liked='{$newtime}', rating={$rating} WHERE id={$itemID}";
$result = $data->executeQuery($sql);
if ($result) {
$sql = "INSERT INTO {$table2} VALUES ({$userID}, {$star}, '{$newtime}',{$itemID} )";
$result2 = $data->executeQuery($sql);
if ($result2) {
echo "success";
} else {
echo "fail3";
}
} else {
echo "fail2";
}
$data->dispose();
示例14: delete
function delete($item_id, $item_table, $table = false)
{
global $CFG;
$table = $table ? $table : 'cart';
$item = DB::getRecord($item_table, $item_id, false, true);
$item_name = $item['name'];
if (User::isLoggedIn()) {
$result = getItem($item_id, $item_table, $table);
if ($result) {
DB::delete($result['id']);
$messages[$item_name] = $CFG->cart_delete_message;
Messages::merge($messages);
}
} else {
unset($_SESSION['cart'][$item_table . '_' . $item_id]);
$messages[$item_name] = $CFG->cart_delete_message;
Messages::merge($messages);
}
}
示例15: foreach
<?php
if ($cartCount == 0) {
echo '<h1>Ваша корзина пуста</h1>';
} else {
echo '<table align="center" border="1" style="margin-top: 50px;" >
<tr>
<td style="padding: 0 30px 0 30px;">Наименование</td>
<td style="padding: 0 30px 0 30px;">Кол-во</td>
<td style="padding: 0 30px 0 30px;">Цена</td>
<td style="padding: 0 30px 0 30px;">Больше</td>
<td style="padding: 0 30px 0 30px;">Меньше</td>
<td style="padding: 0 30px 0 30px;">Удалить</td>
</tr>';
foreach ($_SESSION['cart'] as $itemId => $count) {
echo '<tr>';
$item = getItem($itemId)[0];
echo '<td style="padding: 0 30px 0 30px;">' . $item['name'] . '</td>';
echo '<td style="padding: 0 30px 0 30px;">' . $count . '</td>';
echo '<td style="padding: 0 30px 0 30px;">' . $item['price'] . '</td>';
echo '<td style="padding: 0 30px 0 30px;"><a href="?type=4&id=' . $itemId . '">' . 'Больше' . '</td>';
echo '<td style="padding: 0 30px 0 30px;"><a href="?type=7&id=' . $itemId . '">' . 'Меньше' . '</td>';
echo '<td style="padding: 0 30px 0 30px;"><a href="?type=8&id=' . $itemId . '">' . 'Удалить' . '</td>';
echo '</tr>';
}
echo '
</table>
<p style="margin-top: 20px; font-size: 20px;">Итого: ' . $cartSum . ' рублей </p>
<a class="search-submit" style="text-align: center; width: 200px;" href="?type=5">Очистить корзину</a>';
echo '<form action="/?type=6" method="post">
<p>