@if( isset( $approvedads ) && count( $approvedads ) ) @foreach( $approvedads as $approve ) @php $imagePath = null; if($approve->module_id == 1) { $imageUrl = asset('business/'.$approve->featured_image); $imagePath = public_path( 'business/'.$approve->featured_image ); $viewUrl = route('ad.details',['moduleSlug' => $approve->module->slug, 'adSlug' => $approve->slug ?? 'default'] ); } if($approve->module_id == 2) { $imageUrl = asset('home-business/'.$approve->featured_image); $imagePath = public_path( 'home-business/'.$approve->featured_image ); $viewUrl = route('ad.details',['moduleSlug' => $approve->module->slug, 'adSlug' => $approve->slug ?? 'default'] ); } if($approve->module_id == 3) { $imageUrl = asset('non-profit/'.$approve->featured_image); $imagePath = public_path('non-profit/'.$approve->featured_image); $viewUrl = route('ad.details',['moduleSlug' => $approve->module->slug, 'adSlug' => $approve->slug ?? 'default'] ); } if($approve->module_id == 5){ $imageUrl = asset('event/'.$approve->featured_image); $imagePath = public_path('event/'.$approve->featured_image); $viewUrl = route('event.detail',$approve->slug); } if($approve->module_id == 6){ $imageUrl = asset('fundrazier/'.$approve->featured_image); $imagePath = public_path('fundrazier/'.$approve->featured_image); $viewUrl = route('fundrazier.detail',$approve->slug); } if($approve->module_id == 11){ $imageUrl = asset('flyers/'.$approve->featured_image); $imagePath = public_path('flyers/'.$approve->featured_image); $viewUrl = route('flyers.detail',$approve->slug); } if($approve->module_id == 12){ $imageUrl = asset('menu/'.$approve->featured_image); $imagePath = public_path('menu/'.$approve->featured_image); $viewUrl = route('menu.detail',$approve->slug); } if($approve->module_id == 4){ $imageUrl = asset('classified/'.$approve->featured_image); $imagePath = public_path('classified/'.$approve->featured_image); $viewUrl = route('classified.detail',$approve->slug); } if($approve->module_id == 8){ $imageUrl = asset('help-wanted/'.$approve->featured_image); $imagePath = public_path('help-wanted/'.$approve->featured_image); $viewUrl = route('help-wanted.detail',$approve->slug); } $now = time(); // or your date as well $your_date = date('Y-m-d',strtotime($approve->expiry_date)); $datediff = strtotime($your_date) - $now; $expiredDayRemaining = round($datediff / (60 * 60 * 24)); @endphp
@if(isset($approve->post_status) && $approve->post_status == 2)
Renew
@elseif(isset($approve->post_status) && $approve->post_status == 3 && $approve->module_id != 5)
Upgrade
@else
New
@endif @if( isset( $approve->featured_image ) && file_exists( $imagePath ) ) @else @endif
@if(isset($approve->post_status) && $approve->post_status == 2) @if( isset( $approve->renew_date ) )

Renewed: {{ date('Y-m-d', strtotime( $approve->renew_date ) ) }}

@endif @elseif(isset($approve->post_status) && $approve->post_status == 3) @if( isset( $approve->upgrade_date ) )

Upgraded: {{ date('Y-m-d', strtotime( $approve->upgrade_date ) ) }}

@endif @else @if( isset( $approve->created_at ) )

Posted: {{ date('Y-m-d', strtotime( $approve->created_at ) ) }}

@endif @endif @if( isset( $approve->expiry_date ) )

Expiry: {{ date('Y-m-d', strtotime( $approve->expiry_date ) ) }}

@endif @if(isset($approve->featured_expired) && $approve->featured_expired != '0000-00-00 00:00:00' )

Featured Expiry: {{ date('Y-m-d', strtotime( $approve->featured_expired ) ) }}

@endif
  • View
  • @if( $approve->added_by == 'admin' && !isset($approve->product) )
  • Edit
  • @endif @if( $approve->sort_by_promote_ad_type == 2 && $expiredDayRemaining <= 3 || ( $approve->added_by == 'admin' && $approve->sort_by_promote_ad_type == 2) ) @if(in_array($approve->module_id,[1,2,3]))
  • Upgrade
  • @endif @endif
@endforeach @else

No ads yet!

@endif