@if( isset( $pendingads ) && count( $pendingads ) ) @foreach( $pendingads as $pending ) @php $imagePath = null; if($pending->module_id == 1){ $imageUrl = asset('business/'.$pending->featured_image); $imagePath = public_path( 'business/'.$pending->featured_image ); $viewUrl = route('ad.details',['moduleSlug' => $pending->module->slug, 'adSlug' => $pending->slug ?? 'default'] ); } if($pending->module_id == 2){ $imageUrl = asset('home-business/'.$pending->featured_image); $imagePath = public_path( 'home-business/'.$pending->featured_image ); $viewUrl = route('ad.details',['moduleSlug' => $pending->module->slug, 'adSlug' => $pending->slug ?? 'default'] ); } if($pending->module_id == 3){ $imageUrl = asset('non-profit/'.$pending->featured_image); $imagePath = public_path('non-profit/'.$pending->featured_image); $viewUrl = route('ad.details',['moduleSlug' => $pending->module->slug, 'adSlug' => $pending->slug ?? 'default'] ); } if($pending->module_id == 5){ $imageUrl = asset('event/'.$pending->featured_image); $imagePath = public_path('event/'.$pending->featured_image); $viewUrl = route('event.detail',$pending->slug); } if($pending->module_id == 6){ $imageUrl = asset('fundrazier/'.$pending->featured_image); $imagePath = public_path('fundrazier/'.$pending->featured_image); $viewUrl = route('fundrazier.detail',$pending->slug); } if($pending->module_id == 11){ $imageUrl = asset('flyers/'.$pending->featured_image); $imagePath = public_path('flyers/'.$pending->featured_image); $viewUrl = route('flyers.detail',$pending->slug); } if($pending->module_id == 12){ $imageUrl = asset('menu/'.$pending->featured_image); $imagePath = public_path('menu/'.$pending->featured_image); $viewUrl = route('menu.detail',$pending->slug); } if($pending->module_id == 4){ $imageUrl = asset('classified/'.$pending->featured_image); $imagePath = public_path('classified/'.$pending->featured_image); $viewUrl = route('classified.detail',$pending->slug); } if($pending->module_id == 8){ $imageUrl = asset('help-wanted/'.$pending->featured_image); $imagePath = public_path('help-wanted/'.$pending->featured_image); $viewUrl = route('help-wanted.detail',$pending->slug); } @endphp
@if(isset($pending->post_status) && $pending->post_status == 2)
Renew
@elseif(isset($pending->post_status) && $pending->post_status == 3 && $pending->module_id != 5)
Upgrade
@else
New
@endif @if( isset( $pending->featured_image ) && file_exists( $imagePath ) ) @else @endif
@if(isset($pending->post_status) && $pending->post_status == 2) @if( isset( $pending->renew_date ) )

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

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

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

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

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

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

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

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

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

@endif
@endforeach @else

No ads yet!

@endif