<div class="services">
<?php foreach ($link->spec() as $item) { ?>
<div class="item">
<div class="s1"><?php echo $item->{$lang.'name'}; ?> <a href="javascript:void(0)" class="help ttip" title="<?php echo $item->page->{$lang.'anotation'}; ?>">?</a></div>
<div class="s2"><?php if ($item->service->period) { ?><?php echo $item->service->period; ?> <?php echo __('.'); ?><?php } else { ?> <?php } ?></div>
<div class="s3"><?php if ($item->service->price) { ?><?php echo $item->service->price; ?> <?php echo __(''); ?><?php } else { ?> <?php } ?></div>
</div>
<?php } ?>
</div>
<?php
$items = $link->spec();
usort ( $items , function($i1, $i2){ if ($i1->service->price == $i2->service->price) {return 0;} return ($i1->service->price < $i2->service->price) ? -1 : 1; } );
?>
<div class="services">
<?php foreach ($items as $item) { ?>
<div class="item">
<div class="s1"><?php echo $item->{$lang.'name'}; ?> <a href="javascript:void(0)" class="help ttip" title="<?php echo $item->page->{$lang.'anotation'}; ?>">?</a></div>
<div class="s2"><?php if ($item->service->period) { ?><?php echo $item->service->period; ?> <?php echo __('.'); ?><?php } else { ?> <?php } ?></div>
<div class="s3"><?php if ($item->service->price) { ?><?php echo $item->service->price; ?> <?php echo __(''); ?><?php } else { ?> <?php } ?></div>
</div>
<?php } ?>
</div>