<?php
/**
 * The template for displaying the footer
 *
 * Contains the closing of the #content div and all content after.
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package WordPress
 * @subpackage Twenty_Nineteen
 * @since 1.0.0
 */

?>
<?php
		if ( is_active_sidebar( 'sidebar-1' ) &&  get_post_type() == 'product'  ) {
			?>
					<div class="widget-column footer-widget-1 mt-4 mb-4 text-center ">
					<?php dynamic_sidebar( 'sidebar-1' ); ?>
					</div>
				<?php
		}
		?>
	</div>
</div>
<!--Main End-->

</div>
<script>
	jQuery(".wp-bootstrap-blocks-container").removeClass('container').addClass("container-small");
	jQuery(".woocommerce-button,.woocommerce-Button,button[type='submit']").removeClass('button').addClass("btn btn-dark ");
	jQuery(".woocommerce-page .wp-bootstrap-blocks-container").removeClass('container-small').addClass("container");
 jQuery("a.fagavellink").click(function(){
  jQuery("ul.submenu").toggle();
});
jQuery("div.slick-list .slick-track").addClass('d-flex align-items-center') ;
jQuery("div.imagewrapper img").attr('width','400') ;
jQuery(".woocommerce-MyAccount-navigation-link--my-auction").remove() ;
</script>
<!--Wrapper-->
<?php wp_footer();
                
global $product;
 ?>
 <script type='text/javascript' src='/wp-content/plugins/woocommerce-simple-auctions/js/jquery.countdown.min.js?ver=1.2.31'></script>
<script>
jQuery(document).ready(function($){
    setInterval(function(){
    jQuery.ajax({
		 type : "get",
		 url : '/wp-admin/admin-ajax.php?action=update_bid_winner&product_id=<?=$product->id;?>',
		 success: function(response) {
				jQuery(".auction-bid").html(response);	 
			}
		});
    }, 3000);
    
    setInterval(function(){
    jQuery.ajax({
		 type : "get",
		 url : '/wp-admin/admin-ajax.php?action=update_bid_timer&product_id=<?=$product->id;?>',
		 success: function(response) {
		jQuery("#countdown").html(response);
		$( ".auction-time-countdown" ).each(function( index ) {
		var time 	= $(this).data('time');
		var format 	= $(this).data('format');

		if(format == ''){
			format = 'yowdHMS';
		}
		if(data.compact_counter == 'yes'){
			compact	 = true;
		} else{
			compact	 = false;
		}
		var etext ='';
		if($(this).hasClass('future') ){
			var etext = '<div class="started">'+data.started+'</div>';
		} else{
			var etext = '<div class="over">'+data.checking+'</div>';
		}

		if ( ! $(' body' ).hasClass('logged-in') ) {
			time = $.SAcountdown.UTCDate(-(new Date().getTimezoneOffset()),new Date(time*1000));
		}

		$(this).SAcountdown({
			until: time,
			format: format,
			compact:  compact,

			onExpiry: closeAuction,
			expiryText: etext
		});

	});
			}
		});
    }, 3000);
});
</script>
<!-- Modal -->
<div class="modal fade" id="confirm_bid_model" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="vertical-alignment-helper">
        <div class="modal-dialog vertical-align-center">
            <div class="modal-content">
                <div class="modal-header">
                    <!--<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span>

                    </button>
                     <h4 class="modal-title" id="myModalLabel"></h4>
                     -->
                </div>
                <div class="modal-body">
                    <p>DO YOU WANT TO PLACE YOUR BID?</p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
                    <button type="button" class="btn btn-primary" id="place_bid_button" style="background-color:#000; border-color:#000;">Yes</button>
                    <!--<button type="button" class="btn btn-success" id="place_bid_and_remember_button">Yes and remember my choice</button>-->
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>
		 
 