function SearchData($catid, $vendor, $string) { $pIFACE = content_lookup(config_get('document-root') . '/price')->GetData(); $words = explode(' ', preg_replace('/\\s+/', ' ', strtolower($string))); $result = array(); if (!isNumber($catid)) { return $result; } $subcats = $pIFACE->GetCatalogueData(1, $catid); $vendor = strtolower(trim($vendor)); for ($j = 0, $m = count($subcats); $j < $m; ++$j) { $data = $pIFACE->GetCatalogueData(2, $subcats[$j]['uid']); for ($i = 0, $n = count($data); $i < $n; ++$i) { $it = $data[$i]; if ($vendor != '' && strtolower($it['vendor']) != $vendor) { continue; } $found = true; $name = strtolower($it['name']); for ($k = 0, $l = count($words); $k < $l; ++$k) { if (trim($words[$k]) == '') { continue; } if (strpos($name, $words[$k]) == false) { $found = false; break; } } if ($found) { $result[] = $it; } } } return $result; }
function CMarketBasket() { if (user_id() == -1) { session_start(); } $this->items = array(); $this->removeUnwanted(); $this->priceIFACE = content_lookup(config_get('document-root') . '/price')->GetData(); $this->itemsFromBase(); }
/** * Gate - Wiki engine and web-interface for WebTester Server * * Edit script for publication * * Copyright (c) 2008-2009 Sergey I. Sharybin <*****@*****.**> * * This program can be distributed under the terms of the GNU GPL. * See the file COPYING. */ if ($PHP_SELF != '') { print 'HACKERS?'; die; } global $self, $wiki, $action, $id; $content = content_lookup(dirname($self)); if ($content != null) { if (!$content->GetAllowed('EDIT')) { header('Location: .'); } else { ?> <div id="navigator">Редактирование статьи</div> <div class="contentSub">Статья: «<a href="."><?php echo $content->GetName(); ?> </a>»</div> ${information} <?php if (user_id() < 0) { add_info('Вы не представились системе. Выйдите из этого раздела, если вы не нуждаетесь во внесении изменений в эту статью. ' . 'Так или иначае, Ваш IP-адрес протрассирован и сохранен, все Ваши действия журналируются. Если Вы совершите противозаконные действия, оговорённые УК РФ, то мы оставляем за собой право сообщить об этих действиях в правоохранительные органы.'); }