function sortItems($itemPrices)
{
    foreach ($itemPrices as $number => $retail) {
        $items[] = $number;
    }
    $i = 0;
    while (count($items) > 0) {
        $bestItem = maxPrice($items, $itemPrices);
        $orderedItems[$i] = $bestItem;
        $array_to_remove = array($bestItem);
        $items = array_diff($items, $array_to_remove);
        $i = $i + 1;
    }
    return $orderedItems;
}
Ejemplo n.º 2
0
        ?>
</a></td>
                <td><?php 
        echo $arVehicle['YEAR'];
        ?>
</td>
                <td><?php 
        echo $arVehicle['ENGINE_VOLUME'];
        ?>
&nbsp;см&#179;</td>
                <td><?php 
        echo number_format($arVehicle['DISTANCE'], '0', '.', ' '), ' ', 'km' == $arVehicle['DISTANCE_UNIT'] ? 'км' : 'миль';
        ?>
</td>
                <td><?php 
        echo maxPrice($arVehicle['PRICE'], $arVehicle['PRICE_UNIT']);
        ?>
</td>
            </tr>
        <?php 
    }
    ?>
    </table>

    <br />

    <?php 
    if ($arResult['PAGER'] && 1 < $arResult['PAGER']['TOTAL']) {
        ?>
        <div class="page_navigation">
            <?php 
Ejemplo n.º 3
0
    ?>
                <tr><td><?php 
    echo GetMessage('MAX_OLD_PRICE');
    ?>
</td><td><span class="element_old_price"><?php 
    echo maxPrice($arResult['PRICE_OLD'], $arResult['PRICE_UNIT']);
    ?>
</span></td></tr>
            <?php 
}
?>
            <tr><td><?php 
echo GetMessage('MAX_PRICE');
?>
</td><td><span class="element_price"><?php 
echo maxPrice($arResult['PRICE'], $arResult['PRICE_UNIT']);
?>
</span></td></tr>
            <?php 
if ('Y' == $arParams['SHOW_MARK_MODEL']) {
    ?>
                <tr><td><?php 
    echo GetMessage('MAX_MARK');
    ?>
</td><td><?php 
    echo $arResult['MARK_NAME'];
    ?>
</td></tr>
                <tr><td><?php 
    echo GetMessage('MAX_MODEL');
    ?>