コード例 #1
0
 public static function __callStatic($name, $arguments)
 {
     if (strpos($name, 'from') !== 0) {
         throw new \Exception("Method {$name} not allowed");
     }
     return new self($arguments[0], toLower(substr($name, strlen('from'))), $arguments[1]);
 }
コード例 #2
0
 public function service($name)
 {
     $start = AetherTimer::getMicroTime();
     $memcache = new Memcache();
     $memcache->connect('localhost', 11211);
     $db = Config::getDb();
     $routeSearch = new RouteSearch();
     $cacheKey = "stops_";
     $filters = array();
     if (isset($_GET['term'])) {
         $query = toLower($_GET['term']);
         $filters['search'] = new MongoRegex("/^{$query}/i");
         $cacheKey .= $query;
     } elseif (isset($_GET['lat']) && isset($_GET['long'])) {
         $lat = $_GET['lat'];
         $long = $_GET['long'];
         $regex = '/^[0-9]+\\.[0-9]*$/';
         $cacheKey .= $lat . "," . $long;
         if (preg_match($regex, $lat) && preg_match($regex, $long)) {
             $filters['location'] = array('$near' => array((double) $lat, (double) $long));
         }
     }
     if (isset($_GET['from']) && !empty($_GET['from'])) {
         $from = toLower($_GET['from']);
         $filters['connectsFrom'] = $from;
     }
     $cacheKey .= r_implode(":", $filters);
     $result = $memcache->get($cacheKey);
     if ($result) {
         $result = unserialize($result);
     } else {
         // Find stops near me!!
         $db->routes->ensureIndex(array('search' => 1));
         $filters['active'] = true;
         $stops = $db->stops->find($filters);
         $result = array('stops' => array());
         while ($stop = $stops->getNext()) {
             $result['stops'][] = array('name' => $stop['name']);
         }
         $result['generated'] = time();
         $result['length'] = count($result['stops']);
         $memcache->set($cacheKey, serialize($result), false, 7200);
     }
     $time = AetherTimer::getMicroTime() - $start;
     $result['time'] = $time;
     if (isset($_GET['callback'])) {
         return new AetherJSONPResponse($result, $_GET['callback']);
     } else {
         return new AetherJSONResponse($result);
     }
 }
コード例 #3
0
ファイル: RouteSearch.php プロジェクト: nervetattoo/rutetid
 /**
  * Search for routes going from from to to
  * @return array
  * @param string $from
  * @param string $to
  * @param mixed $time
  */
 public function search($from, $to, $time = false, $weekday = false, $limit = 5, $offset = 0, $timer = false)
 {
     if ($timer) {
         $timer->tick("search", "Entering RouteSearch::search");
     }
     if (!$weekday) {
         $weekday = (int) date("w");
     }
     if ($weekday == 0) {
         // sunday, fix it
         $weekday = 7;
     }
     $cacheKey = $from . $to . $time . $weekday;
     $memcache = new Memcache();
     $memcache->connect('localhost', 11211);
     $hits = $memcache->get($cacheKey);
     if ($timer) {
         $timer->tick("search", "Fetched from memcache");
     }
     if ($hits) {
         $hits = unserialize($hits);
     }
     if (!is_array($hits) || count($hits) == 0) {
         $hits = array();
         /**
          * First find all buses having both stops in their path, kinda nice
          */
         if ($timer) {
             $timer->tick("search", "No cache");
         }
         $db = Config::getDb();
         $start = toLower($from);
         $end = toLower($to);
         if ($timer) {
             $timer->tick("search", "Lowercased input");
         }
         $buses = $db->routes->find(array('search' => array('$all' => array($start, $end))));
         if ($timer) {
             $timer->tick("search", "Search routes");
         }
         // Find some necessary data
         if (!$time) {
             $time = date("Hi");
         }
         //"0700";
         $minutes = (int) substr($time, -2);
         $hours = (int) substr($time, 0, -2);
         $searchFilters = array();
         $hitCount = 0;
         $timeSort = array();
         while ($route = $buses->getNext()) {
             // Iterate over stops and find the
             $startStop = null;
             $endStop = null;
             foreach ($route['stops'] as $stop) {
                 if (!$startStop && toLower($stop['name']) == $start) {
                     $startStop = $stop;
                 } elseif ($startStop && !$endStop && toLower($stop['name']) == $end) {
                     $endStop = $stop;
                 }
             }
             if ($startStop && $endStop) {
                 /**
                  * By now we have tested that we have both stops
                  * and in the correct order for this route
                  * Its time to generate the query to find departures
                  */
                 $minuteMark = $minutes - (int) $startStop['timeOffset'];
                 $latestStartTime = date("Hi", mktime($hours, $minuteMark));
                 $startOffset = (int) $startStop['timeOffset'];
                 $endOffset = (int) $endStop['timeOffset'];
                 $runningTime = $endOffset - $startOffset;
                 $filters = array('route' => $route['_id'], 'time' => array('$gte' => (int) $latestStartTime), 'days' => $weekday);
                 $departuresForRoute = $db->departures->find($filters)->sort(array('time' => 1))->limit(15);
                 /**
                  * Loop over each departure and calculate some times
                  */
                 while ($dep = $departuresForRoute->getNext()) {
                     $arrivalTime = (int) $dep['time'];
                     $startTime = Config::timeAdd($arrivalTime, $startOffset);
                     $startM = substr($startTime, -2);
                     $startH = substr($startTime, 0, -2);
                     $waitTime = ($startH - $hours) * 60 + ($startM - $minutes);
                     $arrivalTime = Config::timeAdd(str_replace(":", "", $startTime), $runningTime, "H:i");
                     while ($waitTime < 0) {
                         $waitTime += 1440;
                     }
                     $timeSort[] = $waitTime;
                     // Wait time should be arrival time minus specified search time
                     $hits[] = array('id' => $route['num'], 'name' => $route['dest'], 'runningTime' => $runningTime, 'startTime' => $startTime, 'wait' => $waitTime, 'arrivalTime' => $arrivalTime, 'arrivalSpan' => $runningTime + $waitTime);
                 }
             }
         }
         if ($timer) {
             $timer->tick("search", "Searched departures");
         }
         array_multisort($timeSort, SORT_ASC, $hits);
         $memcache->set($cacheKey, serialize($hits), false, 120);
     }
     $this->count = count($hits);
     return array_slice($hits, $offset, $limit);
 }
コード例 #4
0
ファイル: template.php プロジェクト: Satariall/izurit
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
$sticker = "";
if (array_key_exists("PROPERTIES", $arResult) && is_array($arResult["PROPERTIES"])) {
    foreach (array("SPECIALOFFER", "NEWPRODUCT", "SALELEADER") as $propertyCode) {
        if (array_key_exists($propertyCode, $arResult["PROPERTIES"]) && intval($arResult["PROPERTIES"][$propertyCode]["PROPERTY_VALUE_ID"]) > 0) {
            $sticker = toLower($arResult["PROPERTIES"][$propertyCode]["NAME"]);
            break;
        }
    }
}
?>
<div class="detail_item">
	<?php 
if (is_array($arResult["PREVIEW_PICTURE"]) || is_array($arResult["DETAIL_PICTURE"])) {
    ?>
		<div class="detail_item_img_container" <?php 
    if (!empty($arResult["PHOTO_GALLERY"])) {
        ?>
onclick="showPhoto(<?php 
        echo CUtil::PhpToJsObject($arResult["PHOTO_GALLERY"]);
        ?>
, '<?php 
        echo $arResult["NAME"];
        ?>
')"<?php 
    }
    ?>
コード例 #5
0
ファイル: import.php プロジェクト: nervetattoo/rutetid
 $a = $s->attributes();
 $fromHash = sha1(toLower((string) $a->from));
 $toHash = sha1(toLower((string) $a->to));
 $from = $stopsCache[$fromHash];
 $to = $stopsCache[$toHash];
 $route = array('num' => (string) $a->num, 'dest' => (string) $a->dest, 'hash' => (string) $a->hash, 'stops' => array(), 'from' => (string) $a->from, 'fromId' => $from['_id'], 'to' => (string) $a->to, 'toId' => $to['_id'], 'search' => array());
 foreach ($s->stops->stop as $st) {
     $sa = $st->attributes();
     $stophash = sha1(toLower((string) $sa->name));
     if (array_key_exists($stophash, $stopsCache)) {
         $stt = $stopsCache[$stophash];
     } else {
         exit("Failed to find stop: {$sa->name}");
     }
     $route['stops'][] = array('name' => (string) $sa->name, 'stopId' => $stt['_id'], 'timeDiff' => (int) $sa->timeDiff, 'timeOffset' => (int) $sa->timeOffset);
     $route['search'][] = toLower($sa->name);
 }
 $db->routes->insert($route);
 // Handle departures
 foreach ($s->departures->dep as $deps) {
     $da = $deps->attributes();
     $days = array();
     if ((string) $da->days != "") {
         foreach (explode(";", (string) $da->days) as $day) {
             $days[] = (int) $day;
         }
     } else {
         $days = array(1, 2, 3, 4, 5, 6, 7);
     }
     $db->departures->insert(array('route' => $route['_id'], 'days' => $days, 'time' => (int) $da->time));
 }
コード例 #6
0
" id="need_new_agr_<?php 
                    echo CUtil::JSEscape(htmlspecialcharsbx($arModuleTmp["@"]["ID"]));
                    ?>
" value="Y">
											<script>
												arModulesList[arModulesList.length] = '<?php 
                    echo CUtil::JSEscape($arModuleTmp["@"]["ID"]);
                    ?>
';
												BX("need_license").value = 'Y';
											</script>
											<?php 
                }
            } else {
                echo GetMessage("SUP_SULL_REF_N");
                if (toLower($myaddmodule) == toLower($arModuleTmp["@"]["ID"]) || strpos(toLower($myaddmodule), toLower($arModuleTmp["@"]["ID"])) !== false) {
                    ?>
											<script>
											BX("need_license").value = 'Y';
											BX("need_license_module").value = '<?php 
                    echo CUtil::JSEscape($arModuleTmp["@"]["ID"]);
                    ?>
';
											</script><?php 
                }
                $md = CUtil::JSEscape($arModuleTmp["@"]["ID"]);
                ?>
										<input type="hidden" name="md_name_<?php 
                echo $md;
                ?>
" id="md_name_<?php 
コード例 #7
0
?>
</a>

</div>

<?php 
$bNoOrder = true;
foreach ($arResult["ORDERS"] as $key => $val) {
    $bNoOrder = false;
    ?>
	<table class="equipment orders<?php 
    if ($val["ORDER"]["CANCELED"] == "Y") {
        ?>
 canceled<?php 
    } else {
        echo " " . toLower($val["ORDER"]["STATUS_ID"]);
    }
    ?>
" style="width:726px">
		<thead>
			<tr>
			<td>
				<span><?php 
    echo GetMessage("STPOL_ORDER_NO");
    echo $val["ORDER"]["ID"];
    ?>
&nbsp;<?php 
    echo GetMessage("STPOL_FROM");
    ?>
&nbsp;<?php 
    echo $val["ORDER"]["DATE_INSERT"];
コード例 #8
0
ファイル: fabric.php プロジェクト: spas-viktor/books
 public function calculate($parameters)
 {
     return toLower($this->parametersToString($parameters));
 }
コード例 #9
0
ファイル: class.php プロジェクト: mrdeadmouse/u136006
 public function makeSmartUrl($url, $apply)
 {
     $smartParts = array();
     if ($apply) {
         foreach ($this->arResult["ITEMS"] as $PID => $arItem) {
             $smartPart = array();
             //Prices
             if ($arItem["PRICE"]) {
                 if ($arItem["VALUES"]["MIN"]["HTML_VALUE"] || $arItem["VALUES"]["MAX"]["HTML_VALUE"]) {
                     if ($arItem["VALUES"]["MIN"]["HTML_VALUE"]) {
                         $smartPart["from"] = $arItem["VALUES"]["MIN"]["HTML_VALUE"];
                     }
                     if ($arItem["VALUES"]["MAX"]["HTML_VALUE"]) {
                         $smartPart["to"] = $arItem["VALUES"]["MAX"]["HTML_VALUE"];
                     }
                 }
             }
             if ($smartPart) {
                 array_unshift($smartPart, toLower("price-" . $arItem["CODE"]));
                 $smartParts[] = $smartPart;
             }
         }
         foreach ($this->arResult["ITEMS"] as $PID => $arItem) {
             $smartPart = array();
             if ($arItem["PRICE"]) {
                 continue;
             }
             //Numbers && calendar == ranges
             if ($arItem["PROPERTY_TYPE"] == "N" || $arItem["DISPLAY_TYPE"] == "U") {
                 if ($arItem["VALUES"]["MIN"]["HTML_VALUE"] || $arItem["VALUES"]["MAX"]["HTML_VALUE"]) {
                     if ($arItem["VALUES"]["MIN"]["HTML_VALUE"]) {
                         $smartPart["from"] = $arItem["VALUES"]["MIN"]["HTML_VALUE"];
                     }
                     if ($arItem["VALUES"]["MAX"]["HTML_VALUE"]) {
                         $smartPart["to"] = $arItem["VALUES"]["MAX"]["HTML_VALUE"];
                     }
                 }
             } else {
                 foreach ($arItem["VALUES"] as $key => $ar) {
                     if ($ar["CHECKED"] && $ar["URL_ID"]) {
                         $smartPart[] = $ar["URL_ID"];
                     }
                 }
             }
             if ($smartPart) {
                 if ($arItem["CODE"]) {
                     array_unshift($smartPart, toLower($arItem["CODE"]));
                 } else {
                     array_unshift($smartPart, $arItem["ID"]);
                 }
                 $smartParts[] = $smartPart;
             }
         }
     }
     if (!$smartParts) {
         $smartParts[] = array("clear");
     }
     return str_replace("#SMART_FILTER_PATH#", implode("/", $this->encodeSmartParts($smartParts)), $url);
 }
コード例 #10
0
 /**
  * @param $method
  * @param $args
  * @return $this
  */
 public function __call($method, $args)
 {
     if (strpos(toLower($method), 'is') === 0) {
         $this->setParam($type = 'bool', $method, $args);
     } else {
         $this->setParam($type = 'array', $method, $args);
     }
     return $this;
 }
コード例 #11
0
ファイル: Config.php プロジェクト: nervetattoo/rutetid
 /**
  * Parse a traffic days text and return an array over running days
  *
  * @return array Array of days this text implies, and in the future what exceptions it implies
  * @param string $text
  */
 public static function parseTrafficDaysText($text)
 {
     $text = str_replace("kjører ", "", $text);
     $parts = explode(" ", $text);
     $days = array('ma' => 1, 'ti' => 2, 'on' => 3, 'to' => 4, 'fr' => 5, 'lø' => 6, 'sø' => 7);
     $start = false;
     $end = false;
     $exceptions = false;
     foreach ($parts as $p) {
         $p = str_replace(array(".", ","), array("", ""), $p);
         $p = toLower($p);
         if (is_numeric($p)) {
             $exceptions[] = $p;
         } else {
             if (is_string($p) && array_key_exists($p, $days)) {
                 // This is a valid day
                 if (!$start) {
                     $start = $days[$p];
                 } elseif ($start && !$end && $p != "ikke") {
                     $end = $days[$p];
                 } elseif ($p == "ikke" && !$exceptions) {
                     break;
                 }
             }
         }
     }
     $return = array();
     if ($start) {
         if (!$end) {
             $end = $start;
         }
         for ($i = $start; $i <= $end; $i++) {
             $return[] = $i;
         }
     }
     return $return;
 }
コード例 #12
0
ファイル: BusStops.php プロジェクト: nervetattoo/rutetid
 /**
  * Import bus stops from a csv file fmor eiendomsprofil data
  *
  * @return int
  * @param string $file
  */
 public function import($file)
 {
     $db = Config::getDb();
     // Lat/long limits, should be converted
     $top = 60.60108;
     //lat
     $bottom = 59.90108;
     //lat
     $left = 5.005268;
     //long
     $right = 5.725268;
     //long
     $gPoint = new gPoint();
     $gPoint->setLongLat($left, $top);
     $gPoint->convertLLtoTM();
     $utmTop = (int) $gPoint->N();
     $utmLeft = (int) $gPoint->E();
     $gPoint->setLongLat($right, $bottom);
     $gPoint->convertLLtoTM();
     $utmBottom = (int) $gPoint->N();
     $utmRight = (int) $gPoint->E();
     $utmTop = 6800000;
     $utmBottom = 6600000;
     $utmRight = -15000;
     $utmLeft = -46000;
     $handle = fopen($file, "r");
     $i = 0;
     $db->stops->ensureIndex(array('location' => '2d'));
     if ($handle) {
         echo "Top: {$utmTop} Bottom: {$utmBottom} Left: {$utmLeft} Right: {$utmRight}<br>\n";
         fgets($handle, 4096);
         while (!feof($handle)) {
             $line = fgets($handle);
             if (strlen($line) > 10) {
                 $fields = explode(",", $line);
                 $name = substr($fields[3], 1, -1);
                 $x = (int) substr($fields[8], 1, -1);
                 $y = (int) substr($fields[9], 1, -1);
                 if ($x < $utmRight && $x > $utmLeft && $y < $utmTop && $y > $utmBottom) {
                     $i++;
                     $gPoint->setUTM($x, $y, "33V");
                     $gPoint->convertTMtoLL();
                     $lat = $gPoint->Lat();
                     $long = $gPoint->Long();
                     $location = array((double) $lat, (double) $long);
                     $stop = $db->stops->findOne(array('location' => $location));
                     if ($stop === null) {
                         $db->stops->insert(array('name' => $name, 'location' => $location, 'aliases' => array($name), 'search' => array(toLower($name)), 'connectsFrom' => array(), 'connectsTo' => array()));
                     } else {
                         if (array_key_exists('aliases', $stop)) {
                             $aliases = $stop['aliases'];
                         } else {
                             $aliases = array();
                         }
                         $aliases[] = $name;
                         $res = $db->stops->update(array("_id" => $stop['_id']), array('$set' => array('aliases' => $aliases)));
                     }
                     unset($stop);
                     //echo "$name lies as $lat,$long\n";
                 }
             }
         }
         fclose($handle);
         return $i;
     }
     return false;
 }
コード例 #13
0
ファイル: component.php プロジェクト: mrdeadmouse/u136006
    // reminders
    $arResult["REMINDERS"] = array();
    $rsReminders = CTaskReminders::GetList(array("date" => "asc"), array("USER_ID" => $loggedInUserId, "TASK_ID" => $arParams["TASK_ID"]));
    while ($arReminder = $rsReminders->Fetch()) {
        $arResult["REMINDERS"][] = array("date" => $arReminder["REMIND_DATE"], "type" => $arReminder["TYPE"], "transport" => $arReminder["TRANSPORT"]);
    }
} else {
    if ($arResult["IS_IFRAME"]) {
        ShowInFrame($this, true, GetMessage("TASKS_TASK_NOT_FOUND"));
    } else {
        ShowError(GetMessage("TASKS_TASK_NOT_FOUND"));
    }
    return;
}
$arResult['ALLOWED_ACTIONS'] = $arResult['TASK']['META:ALLOWED_ACTIONS'];
$sTitle = $arResult["TASK"]['TITLE'] . ' (' . toLower(str_replace("#TASK_NUM#", $arResult["TASK"]["ID"], GetMessage("TASKS_TASK_NUM"))) . ')';
if ($arParams["SET_TITLE"] == "Y") {
    $APPLICATION->SetTitle($sTitle);
}
if (!isset($arParams["SET_NAVCHAIN"]) || $arParams["SET_NAVCHAIN"] != "N") {
    if ($taskType == "user") {
        $APPLICATION->AddChainItem(CUser::FormatName($arParams["NAME_TEMPLATE"], $arResult["USER"]), CComponentEngine::MakePathFromTemplate($arParams["~PATH_TO_USER_PROFILE"], array("user_id" => $arParams["USER_ID"])));
        $APPLICATION->AddChainItem($sTitle);
    } else {
        $APPLICATION->AddChainItem($arResult["GROUP"]["NAME"], CComponentEngine::MakePathFromTemplate($arParams["~PATH_TO_GROUP"], array("group_id" => $arParams["GROUP_ID"])));
        $APPLICATION->AddChainItem($sTitle);
    }
}
if ($arResult["IS_IFRAME"]) {
    ShowInFrame($this);
} else {
コード例 #14
0
ファイル: Strings.php プロジェクト: phpfunct/funct
/**
 * Makes a case swapped version of the string
 * @param  string  $string the input string
 * @param  boolean $mb     to use or not to use multibyte character feature
 * @return string          case swapped version of the input string
 *
 * @author Rod Elias <*****@*****.**>
 */
function swapCase($string, $mb = false)
{
    return array_reduce(str_split($string), function ($carry, $item) use($mb) {
        return $carry .= isLower($item, $mb) ? toUpper($item, $mb) : toLower($item, $mb);
    }, '');
}
コード例 #15
0
ファイル: component.php プロジェクト: mrdeadmouse/u136006
     }
 }
 $arListParams = array('SELECT' => array('UF_*'));
 if (!$bExcel && $arParams['USERS_PER_PAGE'] > 0) {
     $arListParams['NAV_PARAMS'] = array('nPageSize' => $arParams['USERS_PER_PAGE'], 'bShowAll' => false);
 }
 if ($bDisable) {
     $dbUsers = new CDBResult();
     $dbUsers->InitFromArray(array());
 } else {
     if ($arFilter['LAST_NAME_RANGE']) {
         //input format: a-z (letter - letter)
         $letterRange = explode('-', $arFilter['LAST_NAME_RANGE'], 2);
         $startLetterRange = array_shift($letterRange);
         $endLetterRange = array_shift($letterRange);
         $arFilter[] = array('LOGIC' => 'OR', array('><F_LAST_NAME' => array(toUpper($startLetterRange), toUpper($endLetterRange))), array('><F_LAST_NAME' => array(toLower($startLetterRange), toLower($endLetterRange))));
         unset($arFilter['LAST_NAME_RANGE']);
     }
     $dbUsers = $obUser->GetList($sort_by = 'last_name', $sort_dir = 'asc', $arFilter, $arListParams);
 }
 $arDepartments = array();
 $strUserIDs = '';
 while ($arUser = $dbUsers->Fetch()) {
     $arResult['USERS'][$arUser['ID']] = $arUser;
     $strUserIDs .= ($strUserIDs == '' ? '' : '|') . $arUser['ID'];
 }
 //head
 $dbRes = CIBlockSection::GetList(array(), array('UF_HEAD' => array_keys($arResult['USERS']), 'IBLOCK_ID' => COption::GetOptionInt('intranet', 'iblock_structure')), false, array('ID', 'NAME', 'UF_HEAD'));
 while ($arSection = $dbRes->Fetch()) {
     $arResult['USERS'][$arSection['UF_HEAD']]["DEP_HEAD"][$arSection["ID"]] = $arSection["NAME"];
 }
コード例 #16
0
ファイル: ajax.php プロジェクト: mrdeadmouse/u136006
$webdav = $arResult['webdav'];
?>
<script type="text/javascript">
	function historyShowMoreEditUsers(elem)
	{
		if(BX('hidden-feed-com-editing-more'))
		{
			BX.show(BX('hidden-feed-com-editing-more'), 'inline');
			BX.hide(BX(elem));
		}
	}
</script>
<div id="feed-file-history-cont" class="feed-file-history-cont">
	<div class="feed-file-history-top">
		<span class="feed-file-history-icon feed-file-history-icon-<?php 
echo htmlspecialcharsbx(toLower(GetFileExtension($webdav->arParams['file_name'])));
?>
"></span>
		<div class="feed-file-hist-name">
			<div class="feed-com-file-wrap">
				<span class="feed-con-file-name-wrap">
					<span class="feed-com-file-name"><a class="feed-com-file-name-text" href="#" onclick="if(wdufCurrentIdDocument){BX.fireEvent(BX(wdufCurrentIdDocument), 'click');}return false;"><?php 
echo $webdav->arParams['file_name'];
?>
</a><span class="feed-com-file-size"><?php 
echo CFile::FormatSize(intval($webdav->arParams["file_size"]));
?>
</span></span>
				</span>
				<?php 
if (!empty($arResult['editService'])) {
コード例 #17
0
echo GetMessage("SUP_SU_RECOMEND");
?>
</td>
						</tr>
						<?
					}

					if (isset($arUpdateList["MODULE"]))
					{
						for ($i = 0, $cnt = count($arUpdateList["MODULE"]); $i < $cnt; $i++)
						{
							$checked = " checked";
							$arModuleTmp = $arUpdateList["MODULE"][$i];
							if(strlen($myaddmodule) > 0)
							{
								if(toLower($myaddmodule) != toLower($arModuleTmp["@"]["ID"]))
									$checked = "";
							}
							$strTitleTmp = $arModuleTmp["@"]["NAME"]." (".$arModuleTmp["@"]["ID"].")\n".$arModuleTmp["@"]["DESCRIPTION"]."\n";
							if (is_array($arModuleTmp["#"]) && array_key_exists("VERSION", $arModuleTmp["#"]) && count($arModuleTmp["#"]["VERSION"]) > 0)
								for ($j = 0, $cntj = count($arModuleTmp["#"]["VERSION"]); $j < $cntj; $j++)
									$strTitleTmp .= str_replace("#VER#", $arModuleTmp["#"]["VERSION"][$j]["@"]["ID"], GetMessage("SUP_SULL_VERSION"))."\n".$arModuleTmp["#"]["VERSION"][$j]["#"]["DESCRIPTION"][0]["#"]."\n";
							$strTitleTmp = htmlspecialcharsbx(preg_replace("/<.+?>/i", "", $strTitleTmp));
							?>
							<tr title="<?php 
echo $strTitleTmp;
?>
" ondblclick="ShowDescription('<?php 
echo CUtil::JSEscape($arModuleTmp["@"]["ID"]);
?>
')">
コード例 #18
0
ファイル: funkcije.php プロジェクト: herettix/root
function generirajUpit()
{
    $listaUpit = array();
    if (!empty($_REQUEST['oib'])) {
        $listaUpit[] = 'contains(oib, "' . $_REQUEST['oib'] . '")';
    }
    if (!empty($_REQUEST['naziv'])) {
        $listaUpit[] = 'contains(' . toLower('naziv') . ', "' . mb_strtolower($_REQUEST['naziv']) . '")';
    }
    if (!empty($_REQUEST['kategorija'])) {
        $kategorijaUpit = array();
        foreach ($_REQUEST['kategorija'] as $kategorija) {
            $kategorijaUpit[] = '@kategorija="' . $kategorija . '"';
        }
        if (!empty($kategorijaUpit)) {
            $listaUpit[] = '(' . implode(' or ', $kategorijaUpit) . ')';
        }
    }
    $telefonUpit = array();
    if (!empty($_REQUEST['broj'])) {
        $telefonUpit[] = 'contains(broj, "' . $_REQUEST['broj'] . '")';
    }
    if (!empty($_REQUEST['pozivni'])) {
        $telefonUpit[] = '@pozivni="' . $_REQUEST['pozivni'] . '"';
    }
    if (!empty($telefonUpit)) {
        $listaUpit[] = 'telefon[' . implode(' and ', $telefonUpit) . ']';
    }
    $adresaUpit = array();
    if (!empty($_REQUEST['ulica'])) {
        $adresaUpit[] = 'contains(' . toLower('ulica') . ', "' . mb_strtolower($_REQUEST['ulica']) . '")';
    }
    if (!empty($_REQUEST['kucnibr'])) {
        $adresaUpit[] = 'contains(kucnibr, "' . $_REQUEST['kucnibr'] . '")';
    }
    if (!empty($_REQUEST['mjesto'])) {
        $adresaUpit[] = 'contains(' . toLower('mjesto') . ', "' . mb_strtolower($_REQUEST['mjesto']) . '")';
    }
    if (!empty($_REQUEST['postbr'])) {
        $adresaUpit[] = 'mjesto[contains(@postbr, "' . $_REQUEST['postbr'] . '")]';
    }
    if (!empty($_REQUEST['drzava'])) {
        $adresaUpit[] = 'contains(' . toLower('drzava') . ', "' . mb_strtolower($_REQUEST['drzava']) . '")';
    }
    if (!empty($adresaUpit)) {
        $listaUpit[] = 'adresa[' . implode(' and ', $adresaUpit) . ']';
    }
    $otvorenoUpit1 = array();
    #$otvorenoUpit2 = array();
    #$pom = 24;
    if (!empty($_REQUEST['dan']) and !empty($_REQUEST['radvr'])) {
        $otvorenoUpit1[] = '@dan="' . $_REQUEST['dan'] . '" and (' . $_REQUEST['radvr'] . ' >= radp and ' . $_REQUEST['radvr'] . ' < radk)';
        if (!empty($otvorenoUpit1)) {
            $listaUpit[] = 'radvr[' . implode(' and ', $otvorenoUpit1) . ']';
        }
        #$otvorenoUpit1[] = '@dan="' . $_REQUEST['dan'] . '" and (('. $_REQUEST['radvr'] . ' >= radp and ' .$_REQUEST['radvr'] . ' < radk) and
        #(/podaci/mjesta[@kategorija="izletiste"] or /podaci/mjesta[@kategorija="kafic"] or /podaci/mjesta[@kategorija="restoran"]))';
        #		if (!empty($otvorenoUpit1)) { $listaUpit[] = 'radvr[' . implode(' or ', $otvorenoUpit1) . ']'; }
        #$otvorenoUpit2[] = '@dan="' . $_REQUEST['dan'] . '" and ((( '.$_REQUEST['radvr'] . ' >= radp and ' .$_REQUEST['radvr'] . ' < sum(radk;24)))
        #and (/podaci/mjesta[@kategorija="nocniklub"]))';
        #if (!empty($otvorenoUpit2)) { $listaUpit[] = 'radvr[' . implode(' or ', $otvorenoUpit2) . ']'; }
    }
    if (!empty($_REQUEST['email'])) {
        $listaUpit[] = 'contains(' . toLower('email') . ', "' . mb_strtolower($_REQUEST['email']) . '")';
    }
    if (!empty($_REQUEST['webstr'])) {
        $listaUpit[] = 'contains(' . toLower('webstr') . ', "' . mb_strtolower($_REQUEST['webstr']) . '")';
    }
    if (!empty($_REQUEST['tipprivatsnoti'])) {
        $listaUpit[] = '@tipprivatsnoti="' . $_REQUEST['tipprivatsnoti'] . '"';
    }
    if (!empty($_REQUEST['parking'])) {
        $listaUpit[] = '@parking="' . $_REQUEST['parking'] . '"';
    }
    $strUpit = implode(' and ', $listaUpit);
    if (empty($strUpit)) {
        return '/podaci/mjesta';
    } else {
        return '/podaci/mjesta[' . $strUpit . ']';
    }
}
コード例 #19
0
ファイル: template.php プロジェクト: webgksupport/alpina
    ?>
	<li id="<?php 
    echo $this->GetEditAreaId($arElement['ID']);
    ?>
" onclick="app.openNewPage('<?php 
    echo $arElement["DETAIL_PAGE_URL"];
    ?>
')">
		<?php 
    $this->AddEditAction($arElement['ID'], $arElement['EDIT_LINK'], CIBlock::GetArrayByID($arParams["IBLOCK_ID"], "ELEMENT_EDIT"));
    $this->AddDeleteAction($arElement['ID'], $arElement['DELETE_LINK'], CIBlock::GetArrayByID($arParams["IBLOCK_ID"], "ELEMENT_DELETE"), array("CONFIRM" => GetMessage('CT_BCS_ELEMENT_DELETE_CONFIRM')));
    $sticker = "";
    if (array_key_exists("PROPERTIES", $arElement) && is_array($arElement["PROPERTIES"])) {
        foreach (array("SPECIALOFFER", "NEWPRODUCT", "SALELEADER") as $propertyCode) {
            if (array_key_exists($propertyCode, $arElement["PROPERTIES"]) && intval($arElement["PROPERTIES"][$propertyCode]["PROPERTY_VALUE_ID"]) > 0) {
                $sticker = toLower($arElement["PROPERTIES"][$propertyCode]["NAME"]);
                break;
            }
        }
    }
    ?>
		<table>
			<tr>
				<td>
				<?php 
    if (is_array($arElement["PREVIEW_PICTURE"])) {
        ?>
					<a href="<?php 
        echo $arElement["DETAIL_PAGE_URL"];
        ?>
" class="item_list_img"><span><img src="<?php 
コード例 #20
0
ファイル: storeassist.php プロジェクト: webgksupport/alpina
        ?>
				<?php 
        if (!empty($arBlock["TYPE"]) && $arBlock["TYPE"] == "ONE") {
            ?>
				<div class="adm-s-setting-content-block">
					<div class="posr">
				<?php 
        }
        ?>
				<div class="adm-s-setting-content-block <?php 
        if (!empty($arBlock["TYPE"])) {
            echo $arBlock["TYPE"] == "ONE" ? "one" : "one two";
        }
        ?>
" id="<?php 
        echo toLower($stepCode . "_" . $block);
        ?>
">
					<!-- BLOCK CONTENT container title -->
					<div class="adm-s-setting-content-block-title-container">
						<div class="adm-s-setting-content-block-line"></div>
						<div class="adm-s-setting-content-block-point"></div>
						<div class="adm-s-setting-content-block-title"><?php 
        echo GetMessage("STOREAS_STEPS_" . $stepCode . "_" . toUpper($block));
        ?>
</div>
						<!-- BLOCK CONTENT status -->
						<div class="adm-s-setting-content-block-status-container">
							<div class="adm-s-setting-content-block-status red"></div>
							<div class="adm-s-setting-content-block-status orange"></div>
							<div class="adm-s-setting-content-block-status yellow"></div>
コード例 #21
0
 /**
  * @param $method
  * @return string
  */
 public function getFinanceToken($method)
 {
     $login = toLower(str_replace('.', '-', $this->getLogin()));
     $masterToken = $this->getMasterToken();
     $financeNum = intval($this->getFinancialNum() + 1);
     $financeToken = hash("sha256", $masterToken . $financeNum . $method . $login);
     return $financeToken;
 }
コード例 #22
0
ファイル: class.php プロジェクト: mrdeadmouse/u136006
 protected function fillFilter()
 {
     if (CModule::IncludeModule('extranet') && CExtranet::IsExtranetSite()) {
         $this->fillFilterByExtranet();
     } else {
         $this->fillFilterByIntranet();
     }
     if ($this->arParams['FILTER_1C_USERS'] == 'Y') {
         $this->arFilter['UF_1C'] = 1;
     }
     if ($this->externalValues['UF_DEPARTMENT']) {
         $this->arFilter['UF_DEPARTMENT'] = $this->arParams['FILTER_SECTION_CURONLY'] == 'N' ? CIntranetUtils::GetIBlockSectionChildren($this->externalValues['UF_DEPARTMENT']) : $this->externalValues['UF_DEPARTMENT'];
     } elseif ((!CModule::IncludeModule('extranet') || !CExtranet::IsExtranetSite()) && $this->arParams["SHOW_USER"] != "all") {
         // only employees for an intranet site
         if ($this->arParams["SHOW_USER"] == "extranet") {
             $this->arFilter["UF_DEPARTMENT"] = false;
         } elseif ($this->arParams["SHOW_USER"] != "inactive" && $this->arParams["SHOW_USER"] != "fired") {
             $this->arFilter["!UF_DEPARTMENT"] = false;
         }
     }
     //items equal to FALSE (see converting to boolean in PHP) will be removed (see array_filter()). After merge with $this->arFilter
     $this->arFilter = array_merge($this->arFilter, array_filter(array('WORK_POSITION' => $this->externalValues['POST'], 'WORK_PHONE' => $this->externalValues['PHONE'], 'UF_PHONE_INNER' => $this->externalValues['UF_PHONE_INNER'], 'WORK_COMPANY' => $this->externalValues['COMPANY'], 'EMAIL' => $this->externalValues['EMAIL'], 'NAME' => $this->externalValues['FIO'], 'KEYWORDS' => $this->externalValues['KEYWORDS'], 'LAST_NAME' => $this->externalValues['LAST_NAME'], 'LAST_NAME_RANGE' => $this->externalValues['LAST_NAME_RANGE'])));
     if ($this->externalValues['IS_ONLINE'] == 'Y') {
         $this->arFilter['LAST_ACTIVITY'] = static::LAST_ACTIVITY;
     }
     if ($this->externalValues['LAST_NAME']) {
         $this->arFilter['LAST_NAME_EXACT_MATCH'] = 'Y';
     }
     $isEnoughFiltered = (bool) array_intersect(array_keys($this->arFilter), array('WORK_POSITION', 'WORK_PHONE', 'UF_PHONE_INNER', 'WORK_COMPANY', 'EMAIL', 'NAME', 'KEYWORDS', 'LAST_NAME', 'LAST_NAME_RANGE', 'LAST_ACTIVITY', 'UF_DEPARTMENT'));
     if ($this->arFilter['LAST_NAME_RANGE']) {
         //input format: a-z (letter - letter)
         $letterRange = explode('-', $this->arFilter['LAST_NAME_RANGE'], 2);
         $startLetterRange = array_shift($letterRange);
         $endLetterRange = array_shift($letterRange);
         $this->arFilter[] = array('LOGIC' => 'OR', array('><F_LAST_NAME' => array(toUpper($startLetterRange), toUpper($endLetterRange))), array('><F_LAST_NAME' => array(toLower($startLetterRange), toLower($endLetterRange))));
         unset($this->arFilter['LAST_NAME_RANGE']);
     }
     return $isEnoughFiltered;
 }