<?php
/**
 * @var $notifications
 * @var $i
 */
?>

<div class="antiscroll-wrap">

	<div class="antiscroll-inner">

		<?php if ( count( $notifications ) > 0 ) {

			foreach ( $notifications as $row ) { $i++;

				$notifications_arr = wpj_get_notification_message_by_id( $row->id );

				if ( $i == 1 ) { ?><ul><?php } ?>

					<li class="<?php echo $row->rd_receiver == 0 ? 'unread' : 'read'; ?>">

						<a href="<?php echo wpj_get_order_link( $row->oid ); ?>">

							<div class="nh-notification-icon <?php echo $notifications_arr['icon_class']; ?>"></div>

							<div class="nh-notification-right">

								<div class="nh-notification-content"><?php echo $notifications_arr['content']; ?></div>

								<div class="nh-notification-date"><?php echo $notifications_arr['date']; ?></div>

							</div>

						</a>

					</li>

			<?php }

			if ( $i >= 1 ) { ?>

				<ul>

			<?php } else { ?>

				<p><?php _e( "You don't have any unread notifications.", "wpjobster" ); ?></p>

			<?php }

		} else { ?>

			<p><?php _e( "You don't have any unread notifications.", "wpjobster" ); ?></p>

		<?php } ?>

	</div>

	<div class="wpj-view-all-cnt" data-count="<?php echo $i; ?>">

		<a href="<?php echo get_permalink( wpj_get_option( 'wpjobster_my_account_all_notifications_page_id' ) ); ?>"><?php _e( 'View all notifications', 'wpjobster' ); ?></a>

	</div>

</div>