@extends('site.index')   
@section('content')
@php
use App\Models\ProductUnits;
use App\Models\Countris;
use App\Models\Coins;
    if(empty(session()->get('ChangeCountryy'))) {
    
         $Coin=Coins::where('Draw',1)->first();
    $Country=Countris::where('Coin',$Coin->id)->first();
    session()->put('ChangeCountryy',$Country->id);  
      }
$Ses=Countris::find(session()->get('ChangeCountryy'));

use App\Models\MainEComDesign;
use App\Models\SupPagesWishCompEComDesign;
$main=MainEComDesign::orderBy('id','desc')->first();
$sub=SupPagesWishCompEComDesign::orderBy('id','desc')->first();
@endphp

 <style>
.page-title-area {
    background-color: {{$main->Breadcumb_BG_Color}} !important;
}
     
    .compare-area {
      background-color: {{$main->Sub_Page_BG_Color}} !important;
} 
     
     .products-compare-table table tr td .remove-btn a{
         
         color:  {{$sub->Compare_Box_Delete_Txt_Color}} !important
     }
     
     .products-compare-table table tr td{
             color:  {{$sub->Compare_Box_Txt_Color}} !important
         
     }
     
     .products-compare-table table tr:first-child td{
         
            color:  {{$sub->Compare_Box_Txt_Color}} !important
     }
     
     .single-arrivals-products .arrivals-products-content h3{
            color:  {{$sub->Compare_Box_Txt_Color}} !important
         
     }
     
     
     .single-arrivals-products .arrivals-products-content h3 a {
              color:  {{$sub->Compare_Box_Txt_Color}} !important
     }
     
     .single-arrivals-products .arrivals-products-content span{
         
           color:  {{$sub->Compare_Box_Txt_Color}} !important
     }
     
       .single-arrivals-products .arrivals-products-content span:hover{
         
           color:  {{$sub->Compare_Box_Price_Hover_Color}} !important
     }
</style>




        <title>{{trans('admin.Compare')}}</title>

        <!-- Start Page Banner -->
        <div class="page-title-area">
            <div class="container">
                <div class="page-title-content">
                    <h2 style="color: {{$main->Breadcumb_Txt_Color}} !important">{{trans('admin.Compare')}}</h2>

                    <ul>
                        <li><a style="color: {{$main->Breadcumb_Txt_Color}} !important" href="{{url('/')}}">{{trans('admin.Home')}}</a></li>
                        <li style="color: {{$main->Breadcumb_Txt_Color}} !important">{{trans('admin.Compare')}}</li>
                    </ul>
                </div>
            </div>
        </div>
        <!-- End Page Banner -->

        <!-- Start Compare Area -->
        <section class="compare-area ptb-50">
            <div class="container">
                <div class="products-compare-table table-responsive">
                    <table class="table table-bordered" style="background: {{$sub->Compare_Box_BG_Color}};">
                        <tbody>
             
                            
                            <tr class="text-center">
                                <td class="text-center">{{trans('admin.Product')}}</td>
                                
                                @foreach($Comps as $comp)      
                                <td class="text-center">
                                    <div class="remove-btn">
                                        <a href="{{url('DeleteCompare/'.$comp->id)}}" class="remove">{{trans('admin.Delete')}}</a>
                                    </div>

                                    <div class="single-arrivals-products">
                                        <div class="arrivals-products-image">
                                                @if(!empty($comp->Product()->first()->Image))
                                            <a href="{{url('ProductDetails/'.$comp->Product)}}">
                                                <img src="{{URL::to($comp->Product()->first()->Image)}}" alt="image">
                                            </a>
                                                @endif  
                                        </div>
            
                                        <div class="arrivals-products-content">
                                            <h3>
                 <a href="{{url('ProductDetails/'.$comp->Product)}}">{{app()->getLocale() == 'ar' ?$comp->Product()->first()->P_Ar_Name :$comp->Product()->first()->P_En_Name}}   </a>
                                            </h3>
                                            <ul class="rating">
                                                
                                                   @if(empty($comp->Product()->first()->rate))
   @elseif($comp->Product()->first()->rate == 1) 
                                                        <li><i class='bx bxs-star'></i></li>
                            
        @elseif($comp->Product()->first()->rate == 2)  
                                                        <li><i class='bx bxs-star'></i></li>
                                                <li><i class='bx bxs-star'></i></li>
                                   
           @elseif($comp->Product()->first()->rate == 3) 
                                                        <li><i class='bx bxs-star'></i></li>
                                                <li><i class='bx bxs-star'></i></li>
                                                <li><i class='bx bxs-star'></i></li>
                                  
            @elseif($comp->Product()->first()->rate == 4)  
                                                        <li><i class='bx bxs-star'></i></li>
                                                <li><i class='bx bxs-star'></i></li>
                                                <li><i class='bx bxs-star'></i></li>
                                                <li><i class='bx bxs-star'></i></li>
                                   
          @elseif($comp->Product()->first()->rate == 5)
                                                        <li><i class='bx bxs-star'></i></li>
                                                <li><i class='bx bxs-star'></i></li>
                                                <li><i class='bx bxs-star'></i></li>
                                                <li><i class='bx bxs-star'></i></li>
                                                <li><i class='bx bxs-star'></i></li>
      @endif   
                                                
                                        
                                            </ul>
                                            <span>
                                          @php  $Price=ProductUnits::where('Product',$comp->Product)->where('Def',1)->first();   @endphp       
                                   @if($comp->Product()->first()->Offer == 1)
<del>{{$Ses->Coin()->first()->Symbol}}{{round($Price->Price / $Ses->Coin()->first()->Draw)}}</del>
{{$Ses->Coin()->first()->Symbol}}{{round($comp->Product()->first()->OfferPrice / $Ses->Coin()->first()->Draw)}}
            @else                                    
{{$Ses->Coin()->first()->Symbol}}{{round($Price->Price / $Ses->Coin()->first()->Draw)}}
          @endif               
                                            
                                            </span>
                                        </div>
                                    </div>
                                </td>
                                @endforeach
                            
                            </tr>

                            <tr class="text-center">
                                <td class="text-center">{{trans('admin.Category')}}</td>
                                
                                @foreach($Comps as $comp)      
                                <td class="text-center">
        
                                    <div class="single-arrivals-products">
                            
            
                                        <div class="arrivals-products-content">
                                            <h3>
               {{app()->getLocale() == 'ar' ?$comp->Product()->first()->Group()->first()->Name :$comp->Product()->first()->Group()->first()->NameEn}}
                                            </h3>
                                      
                                        </div>
                                    </div>
                                </td>
                                @endforeach
                            
                            </tr>
                            
                                       <tr class="text-center">
                                <td class="text-center">{{trans('admin.Brand')}}</td>
                                
                                @foreach($Comps as $comp)      
                                <td class="text-center">
        
                                    <div class="single-arrivals-products">
                            
            
                                        <div class="arrivals-products-content">
                                    @if(!empty($comp->Product()->first()->Brand))        
                                            <h3>
               {{app()->getLocale() == 'ar' ?$comp->Product()->first()->Brand()->first()->Name :$comp->Product()->first()->Brand()->first()->NameEn}}
                                            </h3>
                                      @endif
                                        </div>
                                    </div>
                                </td>
                                @endforeach
                            
                            </tr>
                            
                            
                            <tr class="text-center">
                                <td class="text-center">{{trans('admin.Description')}}</td>
                                
                                @foreach($Comps as $comp)      
                                <td style="width: 50%" class="text-center">
        
                                    <div class="single-arrivals-products">
                            
            
                                        <div class="arrivals-products-content">
                                    @if(!empty($comp->Product()->first()->Ar_Desc))        
                                            <h3>
               {!!app()->getLocale() == 'ar' ?$comp->Product()->first()->Ar_Desc :$comp->Product()->first()->En_Desc!!}
                                            </h3>
                                      @endif
                                        </div>
                                    </div>
                                </td>
                                @endforeach
                            
                            </tr>
                            
                             <tr class="text-center">
                                <td class="text-center">{{trans('admin.Add_to_Cart')}}</td>
                                
                                @foreach($Comps as $comp)      
                                <td class="text-center">
        
                                    <div class="single-arrivals-products">
                            
            
                                        <div class="arrivals-products-content">
                                      
                                            <h3>
                 <a href="{{url('ProductDetails/'.$comp->Product)}}"><i class="bx bx-cart-alt"></i></a>
                                            </h3>
                                   
                                        </div>
                                    </div>
                                </td>
                                @endforeach
                            
                            </tr>
                            
                        </tbody>
                    </table>
                </div>
            </div>
        </section>
        <!-- End Compare Area -->
        

@endsection