<?php
/**
 * Template #1
 *
 * @package WordPress
 * @subpackage GiveASAP
 * @since GiveASAP 1.0
 */

$gallery_images = ! empty( $display['images'] ) ? $display['images'] : '';

giveasap_show_logo( $display );

?>

<div class="giveasap_box">
	<?php
		do_action( 'sg_box_header', $giveaway, $giveasap_front );

	if ( $giveasap_ended ) {
		giveasap_show_ended_alert();
	} elseif ( $giveaway_started ) {
		?>
		<div id="countdown" data-timezone="<?php echo esc_attr( $timezone ); ?>" data-end="<?php echo esc_attr( giveasap_get_end_time( $giveaway->get_id() ) ); ?>" class="giveasap_countdown"></div>
		<?php
	} else {
		$start = $ga_schedule->get_start_timestamp();
		?>
		<p class="giveasap-center"><?php esc_html_e( 'Starts in:', 'giveasap' ); ?></p>
		<div id="countdown" data-timezone="<?php echo esc_attr( $timezone ); ?>" data-end="<?php echo esc_attr( $start ); ?>" class="giveasap_countdown"></div>
		<?php
	}

	?>

	<?php giveasap_show_meta_info( $prize ); ?>

	<?php the_giveasap_gallery( $gallery_images ); ?>

	<?php if ( ! $giveasap_ended ) { ?>

		<?php giveasap_the_form( $giveasap_front, $giveasap_settings ); ?>

		<?php
	} else {
		giveasap_show_winners();
		giveasap_show_prize_instructions( $giveasap_front );
	}

	?>

	<?php
		do_action( 'giveasap_box_footer', $giveaway, $giveasap_front, $giveasap_settings );
	?>

</div>
