本文整理汇总了PHP中getItems函数的典型用法代码示例。如果您正苦于以下问题:PHP getItems函数的具体用法?PHP getItems怎么用?PHP getItems使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getItems函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: p16012_pack_rework
/**
* 2007-2015 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2015 PrestaShop SA
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
function p16012_pack_rework()
{
Db::getInstance()->execute('INSERT INTO `' . _DB_PREFIX_ . 'configuration` (`id_configuration`, `name`, `value`, `date_add`, `date_upd`) VALUES (NULL, "PS_PACK_STOCK_TYPE", "0", NOW(), NOW())');
$all_product_in_pack = Db::getInstance()->ExecuteS('SELECT `id_product_item` FROM ' . _DB_PREFIX_ . 'pack GROUP BY `id_product_item`');
foreach ($all_product_in_pack as $value) {
Db::getInstance()->execute('UPDATE ' . _DB_PREFIX_ . 'pack
SET `id_product_attribute_item` = ' . (getDefaultAttribute($value['id_product_item']) ? getDefaultAttribute($value['id_product_item']) . ' ' : '0 ') . '
WHERE `id_product_item` = ' . $value['id_product_item']);
}
$all_product_pack = Db::getInstance()->ExecuteS('SELECT `id_product_pack` FROM ' . _DB_PREFIX_ . 'pack GROUP BY `id_product_pack`');
foreach ($all_product_pack as $value) {
$work_with_stock = 1;
$lang = Db::getInstance()->ExecuteS('SELECT value FROM ' . _DB_PREFIX_ . 'configuration WHERE `id_shop` = NULL AND `id_shop_group` = NULL AND `name` = "PS_LANG_DEFAULT"');
$products = getItems($value['id_product_pack']);
foreach ($products as $product) {
if ($product != 1) {
$work_with_stock = 0;
break;
}
}
if ($work_with_stock) {
Db::getInstance()->execute('UPDATE ' . _DB_PREFIX_ . 'product SET `pack_stock_type` = 1 WHERE `id_product` = ' . (int) $value['id_product_pack']);
}
}
}
示例2: createFile
function createFile($file, $submodule, $start)
{
$str = "/* Automatically built from PHP version: " . phpversion() . " */\n";
$constants = get_defined_constants(true);
getItems($constants[$submodule], $str, $start);
$fp = fopen($file, 'w');
fwrite($fp, $str);
fclose($fp);
}
示例3: getSocialUser
function getSocialUser()
{
global $twitterFollowers;
global $facebookFriends;
global $relationshipStatus;
global $politicalViews;
global $logFileHandle;
$thisUser = getUserBasics();
$yob = substr($thisUser["birthday"], 0, 4);
$age = date("Y") - $yob;
$userValues["domain"] = getDomain();
fwrite($logFileHandle, "<p>The domain is " . $userValues["domain"]);
$userValues["identifier"] = getIdentifier($userValues["domain"]);
/******************* Facebook ************************/
if ($userValues["domain"] == "facebook.com") {
if ($age > 18 && rand(1, 100) > 20) {
$userValues["profile"]["relationshipStatus"] = getRelationshipStatus($age);
}
// if (!empty($relStatus)) { $userValues["profile"]["relationshipStatus"] = $relStatus; }
// get political views
if ($thisUser["primaryAddress"]["country"] == "United States") {
if (rand(1, 100) > 61) {
$polViews = getRandomValue($politicalViews);
$userValues["profile"]["politicalViews"] = skewPoliticalViews($polViews, $age, $thisUser["gender"], $thisUser["primaryAddress"]["stateAbbreviation"]);
}
}
$range = getRandomValue($facebookFriends);
$numberOfFBfriends = rand($range["min"], $range["max"]);
fwrite($logFileHandle, "<p>The number of friends is: " . $numberOfFBfriends);
$userValues["friends"] = getFriendsOrFollowersArray($numberOfFBfriends, $userValues["domain"]);
//*************** Interests, Movies, Books, Music **************/
// parameters: &attribute_name=profiles%23181683&uuid=ea1bc321-4320-4fbb-8f07-fb939b90cf46&value={"profile":{"interests":[{"interest":"scrapbooking"},{"interest":"cats"},{"interest":"dogs"}],"movies":[{"movie":"Platoon"},{"movie":"Star+Trek+Into+Darkness"}],"books":[{"book":"Call+It+Sleep"},{"book":"The+Death+of+the+Heart"},{"book":"The+French+Lieutenant%27s+Woman"}],"music":[{"music":"Britney+Spears"}]}}
$psychInfoTypes = array("interests" => "interest", "movies" => "movie", "books" => "book", "music" => "music");
foreach ($psychInfoTypes as $categoryName => $itemName) {
$numberOfItems = getNumberOfItems($itemName);
$itemString = $itemName . "s";
if ($itemName == "music") {
$itemString = $itemName . " artists";
}
fwrite($logFileHandle, "<p>The number of {$itemString} is: " . $numberOfItems);
if ($numberOfItems > 0) {
$userValues["profile"][$categoryName] = getItems($itemName, $numberOfItems);
}
}
}
/********************* Twitter ***********************/
if ($userValues["domain"] == "twitter.com") {
$range = getRandomValue($twitterFollowers);
$numberOfTWfollowers = rand($range["min"], $range["max"]);
fwrite($logFileHandle, "<p>The number of followers is: " . $numberOfTWfollowers);
$userValues["followers"] = getFriendsOrFollowersArray($numberOfTWfollowers, $userValues["domain"]);
}
$thisUser["profiles"] = array();
$thisUser["profiles"][] = $userValues;
return $thisUser;
}
示例4: main
function main()
{
for ($i = 1;; $i++) {
sleep(1000);
$baseUri = "http://www.dianping.com/search/category/2/45/g146p" . $i;
$urls = getItems($baseUri);
$urls = removeRepeit($urls);
if ($urls <= 0) {
break;
}
for ($j = 0; $j < count($urls); $j++) {
$result = getItemdetails($urls[$j]);
saveData($result);
}
}
}
示例5: main
function main()
{
//for($i = 1; ;$i++){
//sleep(1000);
$baseUri = "http://sports.qq.com/kbsweb/#nba";
$urls = getItems($baseUri);
echo $urls;
//$urls = removeRepeit($urls);
//if($urls<= 0){
// break;
// }
//for($j = 0; $j < count($urls); $j++){
// $result = getItemdetails($urls[$j]);
// saveData($result);
// }
//}
}
示例6: getMosaicItems
function getMosaicItems($qstId)
{
//echo "getMosaicItems()";
$items = getItems($qstId);
// filter 'more' item
$more = getItemMore($items);
//if(is_object($more)) $more = (Array)$more;
if (count($items) > 0 && empty($more)) {
echo "QST ID " . $qstId . " | MORE ({$more}) ID " . $more["item"]["id"];
print_r($items);
die("ERROR > Warning, no more item returned");
}
$list = array();
foreach ($items as $item) {
//if(is_object($item)) $item = (Array)$item;
//echo $item["id"].",".$more["id"];
if ($item->id != $more["id"]) {
$list[] = $item;
}
//else echo "found item more id : ".$more["id"];
}
return $list;
}
示例7: array
return;
}
if (!isset($userId)) {
$resp = array("status" => "fail", "reason" => "no user id");
echo json_encode($resp);
return;
}
switch ($action) {
case "add":
$resp = addItem($inputArr);
echo json_encode($resp);
break;
case "remove":
$resp = deleteItem($itemId);
echo json_encode($resp);
break;
case "get":
$resp = getItems($photoId);
echo json_encode($resp);
break;
default:
$resp = array("status" => "fail", "reason" => "please send a valid action");
echo json_encode($resp);
break;
}
/* debug */
//$resp = addItem(array("name"=>"mike idea", "brand"=>"Ralph Lauren"));
//$resp = deleteItem('');
//$resp = getItems("");
//$resp = getFeatItems('kitchen');
//print_r($resp);
示例8: getItems
<div id="mscldiv" class="showit">
<div class="rowDiv">
<label for="ms0_col"> <span class="pad10"> <?php echo $l->m('ms_004'); ?> </span> </label>
<input class="fldsm" onChange="selColor(this);" type="text" name="ms0_col" id="ms0_col" size="7" value="#ffffff" maxlength="7" onKeyUp="RemoveInvalidChars(this, '[^#A-Fa-f0-9]'); return false;" />
<input onClick="selColor(this);" class="fldCol" type="button" name="ms0_icol" id="ms0_icol" value="" style="background-color: #ffffff;" alt="<?php echo $l->m('im_097'); ?>" title="<?php echo $l->m('im_097'); ?>" />
<span class="frmText"> (<?php echo $l->m('to_098'); ?>: #ffffff) </span>
</div>
</div>
<div id="msPrevDiv" class="showit">
<div class="mtop10">
<div class="rowDiv">
<div class="btnRight">
<img onClick="fullSizeView('ms'); return false;" src="images/prev_off.gif" onMouseOver="this.src='images/prev.gif';" onMouseOut="this.src='images/prev_off.gif';" alt="<?php echo $l->m('in_007'); ?>" title="<?php echo $l->m('in_007'); ?>" width="16" height="16" border="0" />
</div>
<div class="imgtbl">
<?php echo getItems($cfg['mask'], 'ms', $cfg['valid']); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<!- // msDiv -->
<!- wizard ----------------------------------------------------------- -->
<div id="wzDiv" class="hideit">
<div class="floatWrap">
<!- wizard menu bar -------------------------------------------------- -->
<div id="wzMenuBarDiv">
<ul>
<li class="btnUp" id="btn_wzsl"><img src="images/wzsl.gif" alt="<?php echo $l->m('wz_004'); ?>" title="<?php echo $l->m('wz_002'); ?>" width="16" height="16" /></li>
<li class="btnUp" id="btn_wzbe"><img src="images/wzbe.gif" alt="<?php echo $l->m('wz_004'); ?>" title="<?php echo $l->m('wz_004'); ?>" width="16" height="16" /></li>
示例9: deleteAll
//Move to index
$submit = $es->index(['index' => $toIndex, 'type' => $toType, 'id' => $item['_id'], 'body' => $item['_source']]);
}
}
function deleteAll($items, $index, $type)
{
global $es;
foreach ($items as $item) {
$delete = $es->delete(['index' => $index, 'type' => $type, 'id' => $item['_id']]);
}
}
if (isset($_SESSION['email']) && $_SESSION['email'] === 'komcdo@gmail.com') {
if (!empty($origIndex)) {
if (!empty($origType)) {
//Get items in current index/type
$items = getItems($origIndex, $origType);
if (isset($items['hits']['hits'])) {
echo "Backing up " . $items['hits']['total'] . " items<br>";
//Backup and delete current items
$items = $items['hits']['hits'];
duplicate($items, $newIndex, $newType);
echo "Deleting items in original index<br>";
deleteAll($items, $origIndex, $origType);
//Delte original index
echo "Deleting original index<br>";
$delete = $es->indices()->deleteMapping(['index' => $origIndex, 'type' => $origType]);
echo $origIndex . "/" . $origType . " successfully moved to " . $newIndex . "/" . $newType . "<br>";
echo "<a href='moveIndex.php?origIndex=" . $newIndex . "&origType=" . $newType . "&newIndex=" . $origIndex . "&newType=" . $origType . "'>Undo move</a>";
} else {
echo "No documents found";
}
示例10: foreach
echo "<hr>QUESTIONS<hr>";
foreach ($qsts as $q) {
var_dump($q);
echo "<br/><br/>";
}
echo "<hr>EACH QUESTIONS<hr>";
foreach ($qsts as $q) {
var_dump($q["id"]);
echo "<br/>";
}
echo "<hr>QUESTION 76<hr>";
var_dump(getQuestion(76));
echo "<hr>CURRENT QUESTION<hr>";
var_dump(getCurrentQuestion());
echo "<hr>ITEMS<hr>";
$items = getItems(76);
var_dump($items);
echo "<hr>ITEM index 2<hr>";
$item = $items[2];
var_dump($item);
echo "<hr>ITEM MORE OF ITEMS<hr>";
$more = getItemMore($items);
var_dump($more);
echo "<hr>ITEM RATE<hr>";
$voteCount = getItemRate($item);
var_dump($voteCount);
echo "<hr>ITEM COMMENTS<hr>";
$voteCount = getItemComments($item);
var_dump($voteCount);
echo "<hr>SPECIFIC ITEM COMMENTS<hr>";
$item = getItem(79, 1367);
示例11: quickItem
function quickItem($item)
{
$q1 = "SELECT * FROM `itemList` WHERE itemId = '" . $item[0] . "'";
$r1 = $GLOBALS['mysqli']->query($q1);
$b1 = $r1->fetch_assoc();
$itemVal = $b1['itemValue'];
$itemName = $b1['itemName'];
$itemLoc = $item[2];
for ($i = 0; $i < count($item[1]); $i++) {
$q2 = "SELECT * FROM `modifiers` WHERE modId = '" . $item[1][$i] . "'";
$r2 = $GLOBALS['mysqli']->query($q2);
$b2 = $r2->fetch_assoc();
$itemVal += $b2['value'];
$itemName .= ", " . $b2['name'];
}
if ($GLOBALS['ibMarkup'] != 0) {
$markup = $GLOBALS['ibMarkup'] / 100;
$mVal = $itemVal * $markup;
$iVal = $itemVal + $mVal;
} else {
$iVal = $itemVal;
}
$q3 = "INSERT INTO `treasure` (`tName`,`tValue`,`tQty`,`tLoc`,`changeBy`, `vaultID`) values ('" . $itemName . "','" . $itemVal . "','1','" . $itemLoc . "','" . $GLOBALS['user'] . "', '" . $GLOBALS['vault'] . "')";
$r3 = $GLOBALS['mysqli']->query($q3);
$q4 = "INSERT INTO `treasure_log` (`tName`,`tValue`,`tQty`,`tLoc`,`changeBy`, `vaultID`) values ('" . $itemName . "','" . $itemVal . "','1','" . $itemLoc . "','" . $GLOBALS['user'] . "', '" . $GLOBALS['vault'] . "')";
$r4 = $GLOBALS['mysqli']->query($q4);
if ($item[4] == 1) {
$insertVal = $iVal * -1;
$q1 = "INSERT INTO `coinNew` (`vaultID`,`vcID`,`value`,`changeBy`) VALUES ( '" . $GLOBALS['vault'] . "','" . $GLOBALS['comCurID'] . "' ? ,'" . $GLOBALS['user'] . "')";
$stmt = $GLOBALS['mysqli']->prepare($q1);
$stmt->bind_param('i', $insertVal);
$stmt->execute();
}
getItems();
}
示例12: getItems
<td><input id="duration" style="width: 300px;" type="text" name="duration" /></td>
<input type="hidden" id="pid" />
</tr>
</table>
<div style="margin-left: 220px">
<button id="submit">Submit</button>
</div>
</div>
</div>
</div>
<div id="wrapper" >
<div id="coloumns" >
<?php
$result = getItems(30, "problems", null);
while ($row = mysql_fetch_array($result)) {
?>
<div class="pin">
<div class="problemName">নামঃ<?php
echo $row['name'];
?>
</div>
<div class="problemDesc">বর্ণনাঃ<?php
echo $row['description'];
?>
</div>
<div class="problemRating">রেটিংঃ<?php
echo $row['rating'];
?>
</div>
示例13: header
table { margin-top: 0.75em;}
th { font-size: 1.2em; text-align: center; border: none 0px; padding-right: 15px; }
td { padding: 0.25em 2em 0.25em 0em; border: 0 none; }
</style>
</head>
<body>
<h1>My ToDo List</h1>
<?php
header('Cache-Control: no-cache');
header('Pragma: no-cache');
require_once "getitems.php";
$items = getItems();
if (!empty($items)) {
echo "<table border='1'>\n\t\t\t\t<tr>\n\t\t\t\t\t<th>Name</th>\n\t\t\t\t\t<th>Category</th>\n\t\t\t\t\t<th>Date</td>\n\t\t\t\t\t<th>Complete</th>\n\t\t\t\t\t<th>Mark Complete?</th>\n\t\t\t\t\t<th>Delete?</th>\n\t\t\t\t</tr>";
foreach ($items as $item) {
echo "<tr>\n\t\t\t\t\t\t<td>" . $item[1] . "</td>\n\t\t\t\t\t\t<td>" . $item[2] . "</td>\n\t\t\t\t\t\t<td>" . $item[3] . "</td>";
if ($item[4] == 0) {
echo "<td>No</td>";
echo "<td><a href='markitemcomplete.php?id=" . $item[0] . "'>Mark complete</a></td>";
} else {
echo "<td>Yes</td>";
echo "<td>N/A</td>";
}
echo "<td><a href='deleteitem.php?id=" . $item[0] . "'>Delete</a></td>";
echo "</tr>";
}
echo "</table>";
示例14: getItems
}
}
}
function getItems()
{
if ($_SESSION['items']) {
return $_SESSION['items'];
} else {
return array();
}
}
if ($_GET['artikel']) {
addItem($_GET['artikel']);
header("Location: warenkorb.php");
}
$wako = getItems();
?>
<html>
<head>
<?php
include "res/head.php";
?>
<title>
Einkaufen in Europa
</title>
</head>
<body>
<h1>Ihr Warenkorb</h1>
<?php
/*
示例15: date
}
break;
}
}
////////////////////////////////
// Put it all together
////////////////////////////////
print $css;
$results = "\n<div id=\"wrap\">\n<div id=\"header\">\n\t<div id=\"logo\"><img src=\"{$AssetPath}/images/admin/logo.gif\" border=\"0\" class=\"logo\"/></div>\n\t<div id=\"title_text\"><h1>Activity for the week ending " . date("F j, Y") . "</h1></div>\n</div>\n<div id=\"newsletter\">\n\t<div id=\"inshort\">\n\t\t<a href=\"#records\">Records</a> \n\t\t<a href=\"#guides\">Research Guides </a> \n\t\t<a href=\"#faqs\">FAQs</a> \n\t\t<a href=\"#tb\">TalksBack</a> \n\t</div>\n<p><img src=\"{$AssetPath}/images/icons/required.png\"> = New this week</p>\n<div id=\"main-col\">\n<a name=\"records\"></a><h2>Records: New & Modified</h2>\n";
$results .= getItems($records);
$results .= "<a name=\"guides\"></a><h2>Research Guides: New & Modified</h2>\n";
$results .= getItems($research_guide);
$results .= "<a name=\"faqs\"></a><h2>FAQs</h2>\n";
$results .= getItems($faq);
$results .= "<a name=\"tb\"></a><h2>TalksBack</h2>\n";
$results .= getItems($talkback);
$results .= "\n{$reports} \n\n</div>\n\n<div id=\"sidebar\">\n{$eres}\n{$search_terms}\n</div>\n</div>";
//////////////////////////
// Print out results
//////////////////////////
print $results;
///////////////////////////
// Email results
///////////////////////////
print "<p>recipients are: {$recipients}</p>";
normanMailer($results, $recipients);
/////////////////////////////////
// Some functions
/////////////////////////////////
function getItems($array)
{