<?php
	require_once($_SERVER['DOCUMENT_ROOT'] . '/common/constants.php');
?>
<?php include_once($_SERVER['DOCUMENT_ROOT'] . "/admin/inc/sessionStartGeneral.php") ?>
<?php
  function strtotitle($title, $separator){
	$smallwordsarray = array('of','a','the','and','an','or','nor','but','is','if','then','else','when',	'at','from','by','on','off','for','in','out','over','to','into','with');
	
	$words = explode($separator, $title);
	
	foreach ($words as $key => $word){
	  if ($key == 0 or !in_array($word, $smallwordsarray))
	  $words[$key] = ucwords($word);
	}
	
	$newtitle = implode(' ', $words);
	
	return $newtitle;
  }
  
  $theSiteParts = explode(".", $_SERVER['HTTP_HOST']);
  $theSite = $theSiteParts[0];
  
  $pageTitle = "To Go";
  $pageDescription = "Shop for groceries online.";
  $pageKeywords = "Fresh Market, Online grocery shopping";
?>
<?php
  include_once($_SERVER['DOCUMENT_ROOT'] . "/common/header.php"); 
?>
<script src="/Kickstrap/js/jquery.h5validate.js" type="text/javascript"></script>
<style>
#mainContent.row .span12 {
    width: 97%;
}

#departmentOffset .row .span9 {
    width: 64%;
    margin-right: 1%;
    /* border: 1px solid #085977; */
}


#departmentOffset .row .span3 {
    width: 28%;
    margin-top: -81px;
}

fieldset input,
fieldset textarea,
fieldset select {
    width: 93%;
}

table tr td {
    padding: 3px 12px 12px 0;
}

#anywhere2 {
    margin-top: -25px;
}

.anywhereSection {
    min-height: 200px;
    color: #213f9a;
    font-weight: bold;
}

.anywhereSection.noHeightLimit {
    min-height: 0;
}

.anywhereSection h2,
h4,
p {
    margin-top: 0;
    color: #213f9a;
    padding: 0 10px 0 10px;
}

.rosieimg{
    margin-top: 72px;
}

.oneReason {
    width: 46%;
    margin: 0 2% 20px;
    float: left;
}

.oneReason img {
    width: 54px;
    margin-right: 15px;
    margin-bottom: 10px;
    float: left;
}

.oneReason h4 {
    margin: 0;
    font-weight: bold;
}

.sidebarSection {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: dashed 1px #65c8c6;
}

.sidebarSection h3, .anywhereSection h3{
    font-weight: bold;
    font-size: 19px;
}

p.majorPadding {
    padding: 0 10%;
    font-size: 14px;
    line-height: 1.5em;
}

#startshoppingbtn {
    width: 100%;
    margin-top: 10px;
}

.sidebarSection .btn {
    width: 83.5%;
}

h3.extraPadBottom {
    padding-bottom: 6px;
}

#introTextContain {
    float: right;
    margin-right: 4%;
    margin-top: -214px;
    z-index: 10000;
    position: relative;
}

.btn-green {
    background: #5e733b;
    color: #8dc549;
    text-shadow: none;
    -webkit-border-radius: 18px;
    border-radius: 18px;
}

.btn-green:hover {
    color: #5e733b;
    background: #8dc549;
    text-shadow: none;
    -webkit-border-radius: 18px;
    border-radius: 18px;
}

body #bodyPadding #mainContent #departmentOffset .sidebarSection h4 {
    margin-top: -5px;
    margin-bottom: 10px;
}

.flexShoppingBtn {
    display: flex;
    flex-direction: row;
    padding-bottom: 20px;
    justify-content: center;
    padding-left: 10px;
}
</style>

<?php require($_SERVER['DOCUMENT_ROOT'] . '/common/mainNav.php'); ?>

<section class="container">
    <div id="blankBuffer"></div>
    <section class="row" id="mainContent">
        <div class="span12">
            <div id="departmentOffset" class="clearfix">
                <div class="row">
                    <?php
					
					$storeName = "Dicks Market";
					$shoppingType = "online";
					$photoHeader = "/Kickstrap/img/online/AFM_DicksOnline_Centerville_550.jpg";
					$photoHowWorks = "/Kickstrap/img/togo/FM-Landing-Page-HowitWorks.png";
					$storesList = "at the following " . $storeName . " stores:";
					$onClickCode = "";
					$videoLink = "";
					$pickupType = "curbside or in-store pickup";
					$tagline = "";
					$contactEmail = "online@dicksmarket.com";
					$faqLink = "/online-faq";
					$siteURL = "dicksmarket.com/";
					$rosieLink = "http://rosieapp.com/shopstore/dicksmarketcenterville";
					$onClickCode = "norosie();";
					?>
					<script>
						function norosie(){
							$("#RosieButtonmodal").modal("show");
						}
					</script>
					
					<style>
						#RosieButtonmodal,
						#RosieButtonmodal .modal-footer {
						  background: none;
						  border: none;
						  box-shadow: none;
						  text-align: center;
						}
						
						#RosieButtonmodal .modal-footer .btn {
						  display: block;
						  margin: 0 auto;
						  float: left;
						}
					
						#RosieButtonmodal .modal-footer .btn-group {
						  margin:0 auto;
						  width:inherit;
						  display: inline-block;
						  text-align: center;
						}
						.modal-body{
							border: 1px solid beige;
							background-color: white;
							font-weight: bold;
							text-align: initial;
							padding: 46px;
						   font-size: 12pt;
						}
					</style>
					<div id="RosieButtonmodal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
						<div class="modal-body">
							We apologize for any inconvenience, but due to the current COVID-19 situation, our online shopping sites have been temporarily disabled.  We hope to be back online soon.  Thank you!
						</div>
						<div class="modal-footer">
							<div class="btn-group">
								<a id="RosieButtonModalClose" class="btn btn-large" data-dismiss="modal" aria-hidden="true">Close</a>
							</div>
						</div>
					</div>
                    <div class="span9 flexShoppingBtn" style="border: none;">
                        <div style="width: 50%">
                            <a href="<?php echo $rosieLink; ?>" style="width: 80%;" class="btn btn-large btn-danger">
                                SHOP FOR PICKUP OR DELIVERY
                            </a>
                        </div>
                    </div>
                    <br><br>
                    <div class="span9">

                        <div id="anywhere1" class="anywhereSection">
                            <style>
                            .majorPadding {
                                padding: 0 10%;
                            }
                            </style>


                            <img src="<?php echo $photoHeader; ?>" width="100%"
                                alt="<?php echo $storeName . " " . $shoppingType; ?> gets you groceries anytime, anywhere">

                            <br>
                            <br>
                            <h3>SHOP ONLINE FOR CONVENIENT CURBSIDE PICKUP OR DELIVERY!</h3>
                            <p>Welcome to our new online grocery shopping service.  With our partners at Rosie, online shopping is now easier and more convenient than ever! Simply create an account, add items to your cart, select a time to pick up or have them delivered and you are all set!</p>
                            <br/>
                            <h3>FIRST TIME SHOPPERS SAVE!</h3>
                            <p>Use the following promo code NEWSHOPPERSAVE at checkout and get $5.00 OFF your first online order. Limited to first time shoppers only. Minimum $30 purchase.</p>
                        </div>

                    </div>

                    <div class="span3">
                        <div id="downloadApp" class="sidebarSection">
                            <a href="<?php echo $rosieLink; ?>" target="_blank">
                                <img class="rosieimg" src="/Kickstrap/img/online/DicksOnline_Rosie.png" alt="Dicks Fresh Market">
                            </a>
                            <hr style="border-bottom: dashed 1px #65c8c6;">
                            <h3>Download the Rosie App</h3>
                            <h4>For in-store pickup and delivery</h4>
                            <p>
                                <a href="https://itunes.apple.com/us/app/rosie/id798869911?ls=1&mt8&mc_cid=b416b5eb5e&mc_eid=9c6314b1b3"
                                    class="shoppingBtn"><img src="//afsshareportal.com/Kickstrap/img/appleAppStore.png"
                                        width="48%" alt="Get it on the Apple App Store"></a>
                                <a href="https://play.google.com/store/apps/details?id=com.rosieapp.main&hl=en"
                                    class="shoppingBtn"><img
                                        src="//afsshareportal.com/Kickstrap/img/Google-play-logo.png" width="48%"
                                        alt="Get it on the Google Play Store"></a>
                            </p>
                        </div>
                        <!-- <div class="sidebarSection">
                            <div style="text-align: center;">
                                <img src="/Kickstrap/img/togo/grocerygirl-logo.png" alt="Grocery girl logo">
                            </div>
                            <br>
                            <p><strong>Online shopping with grocery delivery is available in Park City through Grocery
                                    Girls.
                            </p>
                            <p>
                                Click <a href="https://www.thegrocerygirls.com/" target="_blank">HERE</a> to learn
                                more.</strong></p>
                            </p>
                        </div> -->
                        <div class=" sidebarSection">
                            <h3 class="extraPadBottom">Questions or Feedback?</h3>
                            <a href="/customer-service" class="btn btn-large btn-primary">Contact Us</a>
                        </div>

                        <div class="sidebarSection">
                            <a href="<?php echo $faqLink; ?>" class="btn btn-large btn-primary">FAQs</a>
                        </div>
                    </div>


                    <script>
                    $(document).ready(function() {
                        $("#missingItemsBtn").on("click", function(e) {
                            e.preventDefault();
                            $("#requestForm").toggleClass("hideObject");
                        });
                    });
                    </script>

                </div>
            </div>
        </div>



    </section>

</section>



<script>
function getStoreLocations() {
    $.ajax({
        type: "POST",
        url: "/admin/lookUp.php",
        data: "action=getStoreLocations",
        dataType: "json",
        success: function(theResponse) {
            var theHTML = "";
            theHTML += "<option>Choose Location</option>";
            //console.log("num locations: " + theResponse.length);
            //console.log(theResponse);

            var alreadyHas = ["12"];
            if (theResponse.length > 1) {
                $.each(theResponse, function() {
                    if ($.inArray(this.store_id, alreadyHas) != -1) {
                        theHTML += "<option>" + this.store_name + "</option>";
                    }
                });

                $("#location").append(theHTML);
            } else {
                $("#location").closest("div").remove();
            }
        }
    });
}

getStoreLocations();

$('#contactForm').h5Validate();

$("#contactForm").submit(function(event) {
    event.preventDefault();

    var myResult = validateForm("contactForm");

    var theLocation = $("#location").val();

    if (myResult == true) {
        var self = $(this);
        self.unbind('submit').submit()
    }
});
</script>
<?php require($_SERVER['DOCUMENT_ROOT'] . '/common/footer.php'); ?>
