@extends('layouts.heading-page')

@section('title')
    Support -
@endsection

@section('seo_keywords')
@endsection

@section('seo_description')
@endsection

@section('css')
    <link href="assets/css/page.css" rel="stylesheet"/>
@endsection

@section('breadcrumbs')
    <a href="/support-technical">Support</a><span>/</span>Distribution Partners
@endsection

@section('page-main')
        <!-- 資料內容 -->
        <div class="content-wrap support-wrap">
            <div class="container">
                <div class="contact-form mb-5">
                    <h2 class="h2-title">Distribution Partners</h2>
                    <div class="support-top">
                        <p>CRI collaborates with trusted distributors and value-added resellers across continents, ensuring the rapid delivery of our solutions worldwide.</p>
                        <p>Arrange the list in alphabetical order.</p>
                    </div>
                    <div class="support-tabs support-03">
                        <ul class="nav nav-tabs tabs">
                            @php
                                foreach ($catalogRows as $row)
                                {
                            @endphp
                            <li><a class="{{ $row->id == $catalogCurrentId ? 'active' : '' }}" href="?cid={{ $row->id }}">{{ $row->name }}</a></li>
                            @php
                                }
                            @endphp
                        </ul>
                        <div class="tab-content">
                            <div class="tab-pane in active">
                                <!-- Partner 資料 -->
                                @php
                                    foreach ($dataRows as $row)
                                    {
                                        $img_memo = '';
                                        $img_src = '/assets/img/support-03-a01.png';
                                        $imgs = $row->photos;
                                        // $imgs = array_filter($row['photos'], function($v) {
                                        //        return $v['is_selected'] == true;
                                        //    });
                                        if (count($imgs) > 0) 
                                        {
                                            foreach($imgs as $img)
                                            {
                                                //$img_memo = $img['comment'];
                                                $img_src = URL::asset('/storage/'.$img['file_path']);
                                                break;
                                            }
                                        }
                                @endphp
                                <div class="support-post">
                                    <div class="row align-items-center">
                                        <div class="col-sm-3 col-12">
                                            <div class="support-img">
                                                <img src="{{ $img_src }}" alt="" class="img-fluid">
                                            </div>
                                        </div>
                                        <div class="col-sm-9 col-12">
                                            <div class="support-info">
                                                <h4>{{ $row->title }}</h4>
                                                <p>{{ $row->description }}</p>
                                                <div class="link">Web Site : <a href="{{ $row->website }}" target="_blank">{{ $row->website }}</a></div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                @php
                                    }
                                @endphp
                                <!-- 分頁 -->
                                @php
                                    if ($dataTotalCount > $dataPerPageItems)
                                    {
                                @endphp
                                <nav aria-label="Page navigation" class="page-ex2">
                                    <ul class="pagination pagination-sm justify-content-center">
                                        <li class="page-item">
                                            <a class="page-link prev" href="?cid={{ $catalogCurrentId }}&p={{ ($dataCurrentPage - 1) < 1 ? 1 : ($dataCurrentPage - 1) }}" aria-label="Previous">
                                                <span aria-hidden="true">«</span>
                                            </a>
                                        </li>
                                        @php
                                            for ($i = 1; $i < ($dataTotalCount / $dataPerPageItems + 1); $i++)
                                            {
                                        @endphp
                                        <li class="page-item {{ $dataCurrentPage == $i ? 'active' : '' }}"><a class="page-link" href="?cid={{ $catalogCurrentId }}&p={{ $i }}">{{ $i }}</a></li>
                                        @php
                                            }
                                        @endphp
                                        <li class="page-item">
                                            <a class="page-link next" href="?cid={{ $catalogCurrentId }}&p={{ ($dataCurrentPage + 1) > floor($dataTotalCount / $dataPerPageItems + 1) ? floor($dataTotalCount / $dataPerPageItems + 1) : ($dataCurrentPage + 1) }}" aria-label="Next">
                                                <span aria-hidden="true">»</span>
                                            </a>
                                        </li>
                                    </ul>
                                </nav>
                                @php
                                    }
                                @endphp
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
@endsection

@section('script')
    <script type="text/javascript">
		
	</script>
@endsection