/** * 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 <*****@*****.**> * @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']); } } }
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); }
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; }
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); } } }
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); // } //} }
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; }
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);
<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>
//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'] === '*****@*****.**') { 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"; }
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);
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(); }
<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>
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>";
} } } 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 /*
} 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) {
echo "</tr>\n"; echo "<tr>\n"; echo "<td class=\"FacetFieldCaptionTD\">".$script_transl['rate_new']."</td><td class=\"FacetDataTD\">\n"; $gForm->selectFromDB('aliiva','rate_new','codice',$form['rate_new'],false,false,'-','descri','rate_new'); echo "</tr>\n"; echo "\t<tr class=\"FacetFieldCaptionTD\">\n"; echo "<td align=\"left\"><input type=\"submit\" name=\"return\" value=\"".$script_transl['return']."\">\n"; echo '<td align="right"> <input type="submit" accesskey="i" name="preview" value="'; echo $script_transl['view']; echo '" tabindex="100" >'; echo "\t </td>\n"; echo "\t </tr>\n"; echo "</table>\n"; if (isset($_POST['preview']) and $msg=='') { $m=getItems($form['rate_obj'],$form['cm_ini'],$form['cm_fin'],$form['art_ini'],$form['art_fin']); $new = gaz_dbi_get_row($gTables['aliiva'],'codice',$form['rate_new']); echo "<table class=\"Tlarge\">"; if (sizeof($m) > 0) { if ($form['rate_new']=='0') { $name_bas='preacq'; } elseif ($form['rate_new']=='web') { $name_bas='web_price'; } else { $name_bas='preve'.$form['rate_new']; } if ($form['rate_obj']=='0') { $name_obj='preacq'; } elseif ($form['rate_obj']=='web') { $name_obj='web_price'; } else {
$str = trim($str, "-"); $str = mb_convert_encoding($str, 'UTF-8'); return $str; } foreach ($feeds as $feedName => &$feedParts) { $tempItems = array(); $items = array(); foreach ($feedParts as &$feedPart) { $search = array_keys($feedPart); array_push($search, '%select_is_dealer%', '%group_by_is_dealer%'); $replace = array_values($feedPart); $sql = str_replace($search, $replace, $sqlTemp); array_push($tempItems, getItems($sql)); array_push($replace, 'IF(l_isdealer=1,"new","used") as `type`,', ',l_isdealer'); $sql = str_replace($search, $replace, $sqlTemp); array_push($tempItems, getItems($sql)); } foreach ($tempItems as &$item) { $items = array_merge($items, $item); } prepareItems($items); printLog('Filling feed for ' . $feedName); $writer = new XMLWriter(); $writer->openURI(FILE_PATH . 'context_rk_auto_' . $feedName . '.xml'); $writer->startDocument('1.0', 'UTF-8'); $writer->setIndent(TRUE); $writer->startElement('root'); $writer->writeElement('creation-date', date('c', time())); writeOffers($items, $writer); $writer->endDocument(); $writer->flush();
function my_repeat_function_rss() { // do here what needs to be done automatically as per your schedule $rss = setUpRss(); $items = getItems($rss); $items = array_reverse($items); foreach ($items as $item) { writePost($item); } }
* AIT WordPress Theme * * Copyright (c) 2012, Affinity Information Technology, s.r.o. (http://ait-themes.com) */ // directory search $latteParams['type'] = isset($_GET['dir-search']) ? true : false; if ($latteParams['type']) { // show all items on map if (isset($aitThemeOptions->search->searchShowMap)) { $radius = array(); if (isset($_GET['geo'])) { $radius[] = $_GET['geo-radius']; $radius[] = $_GET['geo-lat']; $radius[] = $_GET['geo-lng']; } $latteParams['items'] = getItems(intval($_GET['categories']), intval($_GET['locations']), $GLOBALS['wp_query']->query_vars['s'], $radius); } $posts = $wp_query->posts; foreach ($posts as $item) { $item->link = get_permalink($item->ID); $image = wp_get_attachment_image_src(get_post_thumbnail_id($item->ID)); if ($image !== false) { $item->thumbnailDir = getRealThumbnailUrl($image[0]); } else { $item->thumbnailDir = getRealThumbnailUrl($GLOBALS['aitThemeOptions']->directory->defaultItemImage); } $item->optionsDir = get_post_meta($item->ID, '_ait-dir-item', true); $item->excerptDir = aitGetPostExcerpt($item->post_excerpt, $item->post_content); $item->packageClass = getItemPackageClass($item->post_author); $item->rating = get_post_meta($item->ID, 'rating', true); }
if ($pic_size[1] == 350) { $size = 360; } if ($pic_size[1] == 400) { $size = 400; } if ($pic_size[1] == 450) { $size = 460; } if ($pic_size[1] == 570) { $size = 570; } //echo $ids=$_MODULE['items']; $categoryId = $_MODULE['cates']; $items_cnt = $_MODULE['items_cnt'] ? $_MODULE['items_cnt'] : 20; $items = getItems($_MODULE['items'], $_MODULE['cates'], $_MODULE['keys'], $sortType = $_MODULE['orderby'], $num = $items_cnt, $itemData = $_MODULE['select_type']); foreach ($items as $k => $item) { //echo $item['title']; if (is_array($zdy_pic)) { if ($zdy_pic[$k]) { $items[$k][pic400] = $zdy_pic[$k]; } } } ?> <div class="tb-module tshop-um tshop-um-jp" style="margin-bottom:<?php echo $_MODULE['mod_mb']; ?> px;"> <?php /**
function hideloadmessage() { document.getElementById('dialogLoadMessage').style.display = 'none' } --> </script> <title>Image list</title> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $l->getCharset(); ?>"> </head> <body onload="init(); hideloadmessage();" dir="<?php echo $l->getDir(); ?>"> <?php include 'loadmsg.php'; ?> <form id="rfiles" name="rfiles" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data" target="_self"> <input type="hidden" name="lang" value="<?php echo $l->lang; ?>" /> <input type="hidden" id= "action" name="action" value="<?php echo $action; ?>" /> <div id="ovSelDiv"> <?= getItems($cfg['root_dir'] . $clib, $cfg['valid']); ?> </div> </form> </body> </html> <?php // get images function getItems($dir, $valid) { global $clib; // current library global $cfg; global $l; $retstr = ''; if ($handle = opendir($dir)) { $files = array(); $valids = implode('|', $valid); while (($file = readdir($handle)) !== false) {
*/ error_reporting(E_ALL); require_once 'AWSSDKforPHP/sdk.class.php'; require_once 'include/cloudfunctions.inc.php'; // Get city and state from request if (isset($_GET['city']) && isset($_GET['state']) && preg_match("/^[A-Za-z\\+ ]{1,}\$/", $_GET['city']) && preg_Match("/^[A-Z]{2}\$/", $_GET['state'])) { $currentCity = urldecode($_GET['city']); $currentState = urldecode($_GET['state']); } else { $currentCity = null; $currentState = null; } // Create access object $sdb = new AmazonSDB(); // Fetch city list $cities = getCities($sdb); // If City and State supplied, generate list of items $itemCat = array(); if ($currentCity != '' && $currentState != '') { // Fetch list of items $items = getItems($sdb, $currentCity, $currentState); // Reorganize by category foreach ($items as $key => $attrs) { $category = $attrs['Category']; if (!isset($itemCat[$category])) { $itemCat[$category] = array(); } $itemCat[$category][$key] = $attrs; } } include 'include/cloudlist.html.php';
/** * Enter description here... * default :run weekly * @param unknown_type $nextrun: time next run * @param unknown_type $id : tempdata * @param unknown_type $name: tempdata * @param unknown_type $timerun:time run * @return unknown */ function writeFileCirculatory($nextrun = 604800, $id = 2, $name = 'weekly', $timerun = 0) { global $javconfig; $url = JURI::root(); $temp = getTempData(" AND name='{$name}' "); if ($temp) { $time = time(); if ($time > intval($temp->value) + intval($nextrun)) { //write file to send mail weekly $path = JPATH_COMPONENT_SITE . DS . "asset" . DS . "emails" . DS . "change"; $filename = $path . DS . "emails_{$name}" . "_" . time() . '.ini'; //$model_items = & JModel::getInstance ( 'items', 'javoiceModel' ); $where = " AND i.create_date BETWEEN {$temp->value} AND {$timerun} AND i.published=1"; $items = getItems($where, ' i.create_date DESC '); $model_voice_types =& JModel::getInstance('voicetypes', 'javoiceModel'); $where = " AND t.published = 1 "; $voice_types = $model_voice_types->getItems($where, " t.title ", 0, 1000); $users = getListUser("%{$name}=1%"); if (!$voice_types || !$items || !$users) { updateNextRun($id, $name, $timerun, $temp); return FALSE; } $items = parseVoiceTypes($voice_types, $items); $helper = new JAVoiceHelpers(); $header = $helper->getEmailTemplate("mailheader"); $footer = $helper->getEmailTemplate("mailfooter"); $email = "Javnotify_to_user_new_voice_{$name}"; $mail = $helper->getEmailTemplate($email); $mailcontent = $header->content . "\n" . $mail->content . "\n\n" . $footer->content; $filters = $helper->getFilterConfig(); $details = ""; $details .= '<UL>'; foreach ($voice_types as $voice_type) { if ($items[$voice_type->id]->list) { $details .= "<LI>"; $details .= "<STRONG>" . $voice_type->title . "</STRONG>"; $details .= "<OL>"; foreach ($items[$voice_type->id]->list as $item) { $details .= "<LI>"; $link = $url; $link .= "index.php?option=com_javoice&view=items&layout=item&cid={$item->id}&type={$item->voice_types_id}&forums={$item->forums_id}"; $details .= "<a href=\"{$link}\">" . $item->title . "</a>"; $integrate = $javconfig['integrate'] ? $javconfig['integrate']->get('run_system', '') : ''; $details .= "<span style='color:#7F7F7F'>("; $details .= JText::_("CREATE_DATE") . ": " . date('d/M/Y', $item->create_date); $params = class_exists('JRegistry') ? new JRegistry($item->data) : new JParameter($item->data); $system_total = $integrate . "_total"; if ($params->get($system_total)) { $details .= ", " . JText::_("TOTAL_COMMENTS") . ": "; $details .= $params->get($system_total); } $details .= ")</span>"; } $details .= "</OL>"; } } $details .= "</UL>"; $filters['{ITEM_DETAILS}'] = $details; if (is_array($filters)) { foreach ($filters as $key => $value) { $subject = str_replace($key, $value, $mail->subject); $mailcontent = str_replace($key, $value, $mailcontent); } } $mailcontent = str_replace("\n", "###", $mailcontent); $content[] = "mailcontent=" . $mailcontent; $content[] = "subject=" . $subject; $user = implode(",", $users); $content[] = "user_id={$user}"; $contents = implode("\n", $content); $model_sendmail = JModel::getInstance('sendmail', 'javoiceModel'); $model_sendmail->writeLogFileChange($contents, $filename); updateNextRun($id, $name, $timerun, $temp); } } return TRUE; }
<!DOCTYPE html> <html> <?php include "includes.php"; $question = getCurrentQuestion(); //MC-bJSOzCRo-V $moreItem = getItemMore(getItems($question["id"])); $moreId = $moreItem["id"]; $url = getItemMediaId($moreItem); $info = $moreItem["description"]; // echo($moreId . "--> url" . $url . "--> description" . $info); $temp = explode("-", $info); $author = $temp[0]; $description = $temp[1]; //echo "MORE ID = ".$moreId; ?> <head> <title>Question : <?php echo $question["content"]; ?> </title> <?php include "head.php"; ?> <link rel="stylesheet" type="text/css" href="styles/mosaicQuestion.css?v=1" /> <script type="text/javascript" src="js/loading.js?v=1"></script> </head> <body> <div class="all" id="all-question"> <?php displayMenuHeader($question, $question["content"]);
<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(10, "solutions", $pid); 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>
//print_r($q); $text = ""; $nbTem = 0; $nbComTem = 0; $votePlusQu = 0; $voteMoinsQu = 0; $nbAudio = 0; $nbVideo = 0; $nbTexte = 0; $nbImage = 0; $outputCsv .= "\r\n\r\n"; // Sauter 2 lignes avant de commencer la question $outputCsv .= ";" . $q["content"] . "\r\n"; // Titre de la question $outputCsv .= "Id;Titre de la contribution;Descriptif de la contribution;Nom Tag;Contenu tag;Vote favorables;Vote défavorables;Média;Commentaires\r\n"; $medias = getItems($q["id"]); if (count($medias) > 0) { $nbTem = count($medias); // TEMOIGNAGES foreach ($medias as $m) { $votePlus = 0; $voteMoins = 0; $datas = api__getDatas($m->id); foreach ($datas['Vote'] as $vote) { if (intval($vote->rate) > 0) { $votePlus++; } elseif (intval($vote->rate) < 0) { $voteMoins++; } } $votePlusQu += $votePlus;
echo "Markup"; } else { echo "Discount"; } ?> on Sales">Sell: <?php echo $GLOBALS['isMarkup']; ?> %</span> <button type='button' title="Minimize Item & Equipment List" class='minimize btn btn-success'><span class='glyphicon glyphicon-chevron-up'></span></button> <button type='button' rel='itemList' ref="getItems" title="Reload Item & Equipment List" class='refresh btn btn-success'><span class='glyphicon glyphicon-refresh'></span></button> </div> </div> <div class="panel-body" id="itemList"> <?php getItems($GLOBALS['vault']); ?> </div> </div> <?php } ?> </div> <div class="col-xs-6"> <?php if ($GLOBALS['coinPerm'] == TRUE) { ?> <div class="panel panel-primary"> <div class="panel-heading"> <span class="panel-title">Add Currency</span>
} } } //header('Content-Type: text/html; charset=utf-8'); printLog('Starting with big cities feeds ...'); foreach ($bigCities as $cityId => &$cityData) { $itemsMetro = array(); $itemsNeigh = array(); $items = getItems($cityId, $db); $items = prepareItems($items, $cityId); if ($cityData['metro'] === true) { $itemsMetro = getItems($cityId, $db, true); $itemsMetro = prepareItemsMetro($itemsMetro, $cityId, $db); } if ($cityData['neigh'] === true) { $itemsNeigh = getItems($cityId, $db, false, true); $itemsNeigh = prepareItemsNeigh($itemsNeigh, $cityId, $db); } printLog('Filling feed for ' . $cityData['sufix']); $writer = new XMLWriter(); $writer->openURI($file_path . 'context_rk_realty_' . $cityData['sufix'] . '.xml'); $writer->startDocument('1.0', 'UTF-8'); $writer->setIndent(TRUE); $writer->startElement('root'); $writer->writeElement('creation-date', date("d/m/y : H:i:s", time())); writeOffers($items, $writer); writeOffers($itemsMetro, $writer); writeOffers($itemsNeigh, $writer); $writer->endDocument(); $writer->flush(); printLog('Finished feed for ' . $cityData['sufix']);
<form id="rfiles" name="rfiles" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?> " enctype="multipart/form-data" target="_self"> <input type="hidden" name="lang" value="<?php echo $l->lang; ?> " /> <input type="hidden" id= "action" name="action" value="<?php echo $action; ?> " /> <div id="iselDiv"> <ul> <?php echo getItems($cfg['root_dir'] . $clib, $cfg['valid'], $list); ?> </ul> </div> </form> </body> </html> <?php // get images function getItems($path, $valid, $list) { global $cfg; global $l; $path = str_replace('//', '/', $path); // remove double slash in path if any $retstr = '';
) [bread] => Array ( [quantity] => 1 [price] => 20 [sum] => 20 ) ) */ function getItems($prices, $list) { $items = array(); // TODO this is for you to complete return $items; } $items = getItems($prices, $list); print_r($items); /* Task B) Write a function that lists the maximum number of different products we can buy from a given amount of money. Given a $money amount, list as many different products from $prices as possible, that can be purchased from that amount. We can buy at most one from the same product (for example, from a sum of 15, we can buy 1 banana and 1 apple but we cannot buy 3 apples). The output should be name and price for each product, followed by a line with the sum spent amount at the end. Hint: you need to order the contents of $prices by value, then iterate through the products, starting with the cheapest. For example, getMost($prices, 30) should output: banana 5 apple 10