<div id="tab-container">
<div style="display: block;" id="general">
<div id="title_tab_pr">
<span>Личный кабинет</span>
</div>
<div class="tab_pr_conts">
тут текст
</div>
</div>
<div style="display: none;" id="participants">
<div id="title_tab_pr">
<span>Адрес доставки</span>
</div>
<div class="tab_pr_conts2">
тут текст
</div>
</div>
<div style="display: none;" id="order">
<div id="title_tab_pr">
<span>Заказы</span>
</div>
<div class="tab_pr_conts3">
тут текст
</div>
</div>
</div>
<div id="tab-headers">
<ul>
<li class="pr_chose_this"><a href="#general"><img src="/images/icons/personal/personal_icons.png" class="sidebar-button-icon" alt="личные данные" /><span id="before_pr_title">Личные данные</span></li>
<li class="pr_chose_this"><a href="#participants"><img src="/images/icons/personal/map_icons.png" class="sidebar-button-icon" alt="Адрес доставки" /><span id="before_pr_title">Адрес доставки</<span></li>
<li class="pr_chose_this"><a href="#order"><img src="/images/icons/personal/pay_icons.png" class="sidebar-button-icon" alt="Заказы" /><span id="before_pr_title">Заказы</<span></li>
</ul>
</div>
<script type="text/javascript">
$(document).ready(function(){
var tabContainers = $('#tab-container > div');
tabContainers.hide().filter(':first').show();
$('#tab-headers ul li a').click(function () {
tabContainers.hide();
tabContainers.filter(this.hash).show();
$('#tab-headers ul li').removeClass('selected');
$(this).parent().addClass('selected');
return false;
}).filter(':first').click();
});
</script>
<?
// Функция для изменения четных и не четных окончания товаров
function getTermination($num) {
$number = substr($num, -2);
if($number > 10 and $number < 15) {
$tem = "ра";
}
else {
$number = substr($number, -1);
if($number == 0) {$term = "ров";}
if($number == 1) {$term = "р";}
if($number > 1) {$term = "ра";}
if($number >4) {$term = "ров";}
}
echo $num.' това'.$term;
}
?>
// Вывод свойства товаров в заказе
<?
if (CModule::IncludeModule("sale"))
{
$arBasketItems = array();
$dbBasketItems = CSaleBasket::GetList(
array("NAME" => "ASC","ID" => "ASC"),
array("FUSER_ID" => CSaleBasket::GetBasketUserID(), "LID" => SITE_ID, "ORDER_ID" => "NULL"),
false,
false,
array("ID","MODULE","PRODUCT_ID","NAME","QUANTITY","CAN_BUY","PRICE","WEIGHT"));
while ($arItems=$dbBasketItems->Fetch())
{
$arItems=CSaleBasket::GetByID($arItems["ID"]);
$arBasketItems[]=$arItems;
$cart_num+=$arItems['QUANTITY'];
$cart_sum+=$arItems['PRICE']*$arItems['QUANTITY'];
$cart_name=$arItems['NAME'];
$cart_weight=$arItems['WEIGHT'];
$cart_disc=$arItems['DISCOUNT_PRICE'];
}
if (empty($cart_num))
$cart_num="0";
if (empty($cart_sum))
$cart_sum="0";
if(empty($cart_name))
$cart_name = "0";
if(empty($cart_weight))
$cart_weight = "0";
?>
<span>В вашей корзине <? getTermination ($cart_num);?><br/> <?=$cart_name?><br/>
<span>На сумму: <?=$cart_sum?> гривень</span>
<?
}
?>
</div>
<div class="pr_cont_but_logout">
Общий вес: <?=$cart_weight?><br/>
Товаров на: <?=$cart_sum?><br/>
Итого: <?=$cart_sum?>
</div>