indexSuccess.php 5.29 KB
Newer Older
Яков's avatar
first  
Яков committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
slot('title', __('Каталог'));
include_partial('main/breadcrumbs');
echo '<h1 class="content_title">' . __('Каталог') . '</h1>';
?>
<div class="catalog_wrap">
    <?php
    if (count($catalogs) > 0) {
        foreach ($catalogs as $cat) {
            ?><div class="catalog_category_item">
                <table class="to_div" cellpadding="0" cellspacing="0" width="100%" height="100%">
                    <tbody align="left" valign="top">
                    <tr>
                        <td width="1" class="mobile_hide">
                            <?php
                            if (strlen($cat['photo']) > 3) {
                                echo '<a href="' . url_for('@catalog_show?alias=' . $cat['alias']) . '" style="border-bottom:none;"><img src="/i/n.gif" style="background-image: url(/u/i/' . Page::replaceImageSize($cat['photo'], 'S') . ');" /></a>';
                            } else {
                                echo '<a href="' . url_for('@catalog_show?alias=' . $cat['alias']) . '" style="border-bottom:none;"><img src="/i/n.gif" style="background-image: url(/i/no_photo.png);" /></a>';
                            }
                            ?>
                        </td>
                        <td width="24"></td>
                        <td class="align_center">
                            <?php echo '<a href="' . url_for('@catalog_show?alias=' . $cat['alias']) . '" class="catalog_category_item__title black_link">' . $cat['Translation'][$culture]['title'] . '</a>'; ?>

                            <div class="mobile">
                                <i class="br20"></i>
                                <?php if (strlen($cat['photo']) > 3) {
                                    echo '<a href="' . url_for('@catalog_show?alias=' . $cat['alias']) . '" style="border-bottom:none;"><img src="/i/n.gif" style="background-image: url(/u/i/' . Page::replaceImageSize($cat['photo'], 'S') . ');" /></a>';
                                } else {
                                    echo '<a href="' . url_for('@catalog_show?alias=' . $cat['alias']) . '" style="border-bottom:none;"><img src="/i/n.gif" style="background-image: url(/i/no_photo.png);" /></a>';
                                } ?>
                            </div>

                            <?php $products_html = '';

                            if (strpos($cat['alias'], 'kamen') !== false && count($cat['Products']) > 0) {
                                $counter = 0;
                                foreach ($cat['Products'] as $product){
                                    if($product['offer_count'] == 0 || !$product['is_detail']){
                                        continue;
                                    }
                                    $products_html .= '<td><a href="' . url_for('@product_show?alias=' . $product['alias']) . '" class="black_link">' . $product['Translation'][$culture]['title'] . '</a></td>';
                                    if ($counter > 0) {
                                        $products_html .= '</tr><tr>';
                                        $counter = 0;
                                    } else {
                                        $products_html .= '<td width="24"></td>';
                                        $counter++;
                                    }
                                }
                                if($products_html != ''){
                                    echo '<table cellspacing="0" cellpadding="0" class="catalog_category_item__childs align_left">';
                                    echo '<tbody valign="top" align="left">';
                                    echo '<tr>' . $products_html . '</tr>';
                                    echo '</tbody>';
                                    echo '</table>';
                                }
                            }

                            if(count($cat['Children']) > 0) {
                                $counter = 0;
                                foreach ($cat['Children'] as $child){
                                    $products_html .= '<td><a href="' . url_for('@catalog_show?alias=' . $child['alias']) . '" class="black_link">' . $child['Translation'][$culture]['title'] . '</a></td>';
                                    if ($counter > 0) {
                                        $products_html .= '</tr><tr>';
                                        $counter = 0;
                                    } else {
                                        $products_html .= '<td width="24"></td>';
                                        $counter++;
                                    }
                                }
                                if($products_html != ''){
                                    echo '<table cellspacing="0" cellpadding="0" class="catalog_category_item__childs">';
                                    echo '<tbody valign="top" align="left">';
                                    echo '<tr>' . $products_html . '</tr>';
                                    echo '</tbody>';
                                    echo '</table>';
                                }
                            }
                            ?>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div><?php
        }
    }
    ?>
</div>