
<link rel='stylesheet' href='https://cdn.datatables.net/1.10.25/css/jquery.dataTables.min.css' type='text/css' media='all' />
<link rel='stylesheet' href='https://cdn.datatables.net/responsive/2.2.9/css/responsive.dataTables.min.css' type='text/css' media='all' />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
#map {
    width: 100%;
    height: 650px;
    background: #ccc;
    padding: 15px;
}
</style>
<div class="row gy-5 truck-washes">

    <div class="col-lg-4">
        <form method="GET" id="search-form">
            <div class="row">
                <div class="col-12">
                    <p class="fw-bold pt-2">Search:</p>
                </div>
                
                <!-- Name Input -->
                <div class="form-group col-md-12 py-1">
                    <input type="text" class="form-control" placeholder="Name" name="Name" id="Name" 
                        value="" />
                </div>

                <div class="form-group col-md-12 my-2">
                    
                    <!-- Community Establishments -->
                    <p class="fw-bold mt-2 mb-1">Community Establishments:</p>
                                                <div class="form-check pb-1">
                                <input class="form-check-input" type="checkbox" id="CategoryEruv" 
                                    name="Category[]" value="Eruv" >
                                <label class="form-check-label" for="CategoryEruv">
                                    Eruv                                </label>
                            </div>
                                                        <div class="form-check pb-1">
                                <input class="form-check-input" type="checkbox" id="CategoryGifts and Judaica" 
                                    name="Category[]" value="Gifts and Judaica" >
                                <label class="form-check-label" for="CategoryGifts and Judaica">
                                    Gifts and Judaica                                </label>
                            </div>
                                                        <div class="form-check pb-1">
                                <input class="form-check-input" type="checkbox" id="CategoryMikvah" 
                                    name="Category[]" value="Mikvah" >
                                <label class="form-check-label" for="CategoryMikvah">
                                    Mikvah                                </label>
                            </div>
                                                        <div class="form-check pb-1">
                                <input class="form-check-input" type="checkbox" id="CategorySchool" 
                                    name="Category[]" value="School" >
                                <label class="form-check-label" for="CategorySchool">
                                    School                                </label>
                            </div>
                                                        <div class="form-check pb-1">
                                <input class="form-check-input" type="checkbox" id="CategorySynagogue" 
                                    name="Category[]" value="Synagogue" >
                                <label class="form-check-label" for="CategorySynagogue">
                                    Synagogue                                </label>
                            </div>
                                                        <div class="form-check pb-1">
                                <input class="form-check-input" type="checkbox" id="CategoryThings to do in Chicago" 
                                    name="Category[]" value="Things to do in Chicago" >
                                <label class="form-check-label" for="CategoryThings to do in Chicago">
                                    Things to do in Chicago                                </label>
                            </div>
                            
                    <!-- Food Establishments -->
                    <p class="fw-bold mt-2 mb-1">Food Establishments:</p>
                                                <div class="form-check pb-1">
                                <input class="form-check-input" type="checkbox" id="CategoryRetail Bakery" 
                                    name="Category[]" value="Retail Bakery" >
                                <label class="form-check-label" for="CategoryRetail Bakery">
                                    Retail Bakery                                </label>
                            </div>
                                                        <div class="form-check pb-1">
                                <input class="form-check-input" type="checkbox" id="CategoryCandy &amp; Nut" 
                                    name="Category[]" value="Candy &amp; Nut" >
                                <label class="form-check-label" for="CategoryCandy &amp; Nut">
                                    Candy &amp; Nut                                </label>
                            </div>
                                                        <div class="form-check pb-1">
                                <input class="form-check-input" type="checkbox" id="CategoryGrocery" 
                                    name="Category[]" value="Grocery" >
                                <label class="form-check-label" for="CategoryGrocery">
                                    Grocery                                </label>
                            </div>
                                                        <div class="form-check pb-1">
                                <input class="form-check-input" type="checkbox" id="CategoryDairy" 
                                    name="Category[]" value="Dairy" >
                                <label class="form-check-label" for="CategoryDairy">
                                    Dairy                                </label>
                            </div>
                                                        <div class="form-check pb-1">
                                <input class="form-check-input" type="checkbox" id="CategoryMeat" 
                                    name="Category[]" value="Meat" >
                                <label class="form-check-label" for="CategoryMeat">
                                    Meat                                </label>
                            </div>
                                                        <div class="form-check pb-1">
                                <input class="form-check-input" type="checkbox" id="CategoryRestaurant" 
                                    name="Category[]" value="Restaurant" >
                                <label class="form-check-label" for="CategoryRestaurant">
                                    Restaurant                                </label>
                            </div>
                                                        <div class="form-check pb-1">
                                <input class="form-check-input" type="checkbox" id="CategoryHotel or Caterer" 
                                    name="Category[]" value="Hotel or Caterer" >
                                <label class="form-check-label" for="CategoryHotel or Caterer">
                                    Hotel or Caterer                                </label>
                            </div>
                                            </div>

                <!-- Form Buttons -->
                <div class="form-group col-md-12">
                    <button class="btn btn-sm btn-primary">Search</button> 
                    <a href="https://www.crcweb.org/community/jewish-chicago/" class="btn btn-sm btn-outline-primary">Clear</a>
                </div>
            </div>
        </form>

    </div>


    <div class="col-lg-8">
        <div id="map" class="map"></div>
		 <h5 class="mt-2 mt-lg-3 fw-bold">Please see the listings below.</h5>
    </div>
    

    
    <div class="col-lg-12">
        <p class="fw-600 mb-5 Eruv_msg"><strong>Chicago Eruv Information:</strong> There are a number of eruvim in the Chicago area. Maps of eruvin are included for the information of those planning on visiting Chicago for Shabbos. It is strongly advised that visitors check with the eruv hotline on Friday afternoons to verify that the eruv in the area one is staying is valid that Shabbos. We also urge visitors to check with local Rabbonim concerning the precise boundaries of each eruv if you will need to walk on any of the boundary streets.</p>
        <p class="fw-600 mb-5 Things_msg"><strong>Things to do in Chicago:</strong> This activities list is merely a representative sample of activity ideas that might interest visitors to Chicago. The cRc takes no responsibility for the Kashrut, Tzniut, suitability, organization, or anything else on this list. Some of the activities, such as the cruises, have numerous possible vendors. Enjoy your visit!</p>
        <table id="crcTable" class="table table-borderd responsive" style="width:100%">
            <thead>
                <tr>
                    <th width="15%">Image</th>  
                    <th>Details</th>  
                </tr>
            </thead>
        </table>
    </div>
</div>


<div class="modal" id="postModal">
    <div class="modal-dialog modal-xl">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="postModalLabel"></h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body"></div>
        </div>
    </div>
</div>

 
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.2.9/js/dataTables.responsive.min.js"></script>
<!--<script src="https://polyfill.io/v3/polyfill.min.js?features=default"></script>-->
<script src="https://maps.googleapis.com/maps/api/js?sensor=false&key=AIzaSyA-fNOxi7iZu9ANIwM01wqBl1v5kZbK5js&libraries=places"></script>
<script src="https://www.crcweb.org/community/wp-content/plugins/crc_load_map/js/app.js?v=4.4"></script>

<script>
    function addhttp(url) {
        if (!/^(?:f|ht)tps?\:\/\//.test(url)) {
            url = "http://" + url;
        }
        return url;
    }
    $(document).ready(function () {
        $(".Eruv_msg").hide();
        $(".Things_msg").hide();
        var locations = [];
        var Name = $("#Name").val();
        var checkboxValues = [];
        var CatIn = 0;
        $('input[type="checkbox"]:checked').each(function (index, elem) {
            checkboxValues.push($(elem).val());
            if ($(elem).val() == "Eruv") {
                CatIn = 1;
                $(".Eruv_msg").show();
            }

            if ($(elem).val() == "Things to do in Chicago") {
                $(".Things_msg").show();
            }
        });
        var url = "https://www.crcweb.org/community/wp-content/plugins/crc_load_map/includes/json.php?Name=" + Name + "&Category="  + encodeURIComponent(checkboxValues.join(","));
        $.ajax({
            url: url,
            dataType: "json",
            async: false,
            success: function (data) {
                $.each(data, function (key, val) {
                    locations.push(val);
                });
                mapLoad(locations, CatIn);
            },
        });

        $("body").on("click", ".view-post", function () {
            var dataID = $(this).data("id");
            var url = "https://www.crcweb.org/community/wp-content/plugins/crc_load_map/includes/modal_data.php?id=" + dataID;
            $.ajax({
                url: url,
                dataType: "json",
                async: false,
                success: function (response) {
                    $("#postModal .modal-body").html('<img src="/community/combined-pdfs/' + response["data"][0]["pdf_link"] + '" class="img-fluid">');
                },
            });
            var postModal = new bootstrap.Modal(document.getElementById("postModal"));
            postModal.show();
        });

        function validateEmail(email) {
            const re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
            return re.test(String(email).toLowerCase());
        }

        oOverviewTable = $("#crcTable").DataTable({
            searching: true,
            pageLength: 25,
            responsive: true,
            ajax: {
                url: "https://www.crcweb.org/community/wp-content/plugins/crc_load_map/includes/json.php?Name=" + Name + "&Category=" + encodeURIComponent(checkboxValues.join(",")),
                type: "GET",
            },
            columns: [
              {
                  data: null,
                  render: function (data, type, row) {
                      if (data.logo) {
                          return "<img width='175'src='/community/combined-logos/" + data.logo + "' onerror='this.onerror=null;this.src=`http://via.placeholder.com/175x150`;'>";
                     } else {
                           //return "<img src='http://via.placeholder.com/175x150'>";
						   return "";
                     }
                  },
               },
                {
                    data: null,
                    render: function (data, type, row) {
                        var htmlData = '<div id="printSection">';
					

                        htmlData += '<div class="text-secondary fs-5 fw-bold pb-3">' + data.name + "</div>";
                        if (data.category || data.subtype1 || data.subtype2) {
                            htmlData += '<div class="mb-1"><i class="fa fa-check" style="width: 30px;"></i> ';
                            if (data.category) {
                                htmlData += data.category + ", ";
                            }
                            if (data.category != data.subtype1) {
                                htmlData += "<span>" + data.subtype1 + ",</span> ";
                            }
                            if (data.subtype2) {
                                htmlData += data.subtype2;
                            }
                            htmlData += "</div>";
                        }
                        if (data.notes) {
                            htmlData += '<div class="my-1"><i class="fa fa-check" style="width: 30px;"></i> ' + data.notes + "</div>";
                        }
                        if (data.nusach) {
                            htmlData += '<div class="my-1"><i class="fa fa-check" style="width: 30px;"></i> Nusach: ' + data.nusach + "</div>";
                        }
                        if (data.pdf_link) {
                            htmlData += '<div class="my-1"><i class="fa fa-map-o" style="width: 30px;"></i> <a href="javascript:void(0)" data-id="' + data.id + '"  class="link-inherit text-primary view-post">See Eruv Border</a></div>';
                        }
                        if (data.website) {
                            htmlData += '<div class="my-1"><i class="fa fa-globe" style="width: 30px;"></i> <a href="' + addhttp(data.website) + '" target="blank" class="link-inherit text-primary">Visit Website</a></div>';
                        }
                        if (data.phone != "") {
                            htmlData += '<div class="mb-1"><i class="fa fa-phone" style="width: 30px;"></i> <a href="tel:' + data.phone + '" class="link-inherit text-primary">' + data.phone + "</a></div>";
                        }
                        if (data.neighborhood) {
                            htmlData += '<div class="mb-1"><i class="fa fa-home" style="width: 30px;"></i> ' + data.neighborhood + "</div>";
                        }
                        if (data.address) {
                            htmlData +=
                                '<div class="mb-1"><i class="fa fa-map-marker"  style="width: 30px;"></i> <a href="https://www.google.com/maps/place/' +
                                data.address +
                                ", " +
                                data.city +
                                ", " +
                                data.state +
                                ", " +
                                data.zipcode +
                                '" target="_blank" class="link-inherit text-primary">' +
                                data.address +
                                ", " +
                                data.city +
                                ", " +
                                data.state +
                                " " +
                                data.zipcode +
                                "</a></div>";
                        }
                        if (data.chalav_yisrael) {
                            htmlData += '<div class="mb-1"><strong>Chalav Yisrael:</strong> ' + data.chalav_yisrael + "</div>";
                        }
                        if (data.pas_yisrael) {
                            htmlData += '<div class="mb-1"><strong>Pas Yisrael:</strong> ' + data.pas_yisrael + "</div>";
                        }
                        if (data.yoshon) {
                            htmlData += '<div class="mb-1"><strong>Yoshon:</strong> ' + data.yoshon + "</div>";
                        }

                        if (data.email) {
                            if (validateEmail(data.email)) {
                                htmlData += '<div class="mb-1"><i class="fa fa-envelope" style="width: 30px;"></i> Email: <a href="mailto:' + data.email + '" class="link-inherit text-primary">' + data.email + "</a></div>";
                            } else {
                                htmlData += '<div class="mb-1"><i class="fa fa-envelope" style="width: 30px;"></i> Email: <a href="' + addhttp(data.email) + '" target="blank" class="link-inherit text-primary">' + data.email + "</a></div>";
                            }
                        }

                        if (data.supervising_agent) {
                            htmlData += '<div class="mb-1"><i class="fa fa-check" style="width: 30px;"></i> Supervision: ' + data.supervising_agent + "</div>";
                        }
                        if (data.schedule) {
                            htmlData += '<div class="mb-1"><i class="fa fa-check" style="width: 30px;"></i>  <a href="' + addhttp(data.schedule) + '" target="blank" class="link-inherit text-primary">View Schedule</a></div>';
                        }

                        htmlData += "</div>";

                        return htmlData;
                    },
                },
            ],
        });

        $("#crcTable").on("page.dt", function () {
            var targetOffset = $("#crcTable_wrapper").offset().top + -100;
            $("html,body").animate({ scrollTop: targetOffset }, 100);
        });
    });

    function printElement(elem) {
        var domClone = elem.cloneNode(true);
        var $printSection = document.getElementById("printSection");
        if (!$printSection) {
            var $printSection = document.createElement("div");
            $printSection.id = "printSection";
            document.body.appendChild($printSection);
        }
        $printSection.innerHTML = "";
        $printSection.appendChild(domClone);
        window.print();
    }
</script>


{"id":13,"date":"2021-07-05T13:50:38","date_gmt":"2021-07-05T13:50:38","guid":{"rendered":"http:\/\/crccommunity.azrmg.com\/?page_id=13"},"modified":"2022-02-25T12:33:26","modified_gmt":"2022-02-25T12:33:26","slug":"jewish-chicago","status":"publish","type":"page","link":"https:\/\/www.crcweb.org\/community\/jewish-chicago\/","title":{"rendered":"Establishments &#038; Resources"},"content":{"rendered":"\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":5,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-13","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.crcweb.org\/community\/wp-json\/wp\/v2\/pages\/13","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.crcweb.org\/community\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.crcweb.org\/community\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.crcweb.org\/community\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.crcweb.org\/community\/wp-json\/wp\/v2\/comments?post=13"}],"version-history":[{"count":10,"href":"https:\/\/www.crcweb.org\/community\/wp-json\/wp\/v2\/pages\/13\/revisions"}],"predecessor-version":[{"id":269,"href":"https:\/\/www.crcweb.org\/community\/wp-json\/wp\/v2\/pages\/13\/revisions\/269"}],"wp:attachment":[{"href":"https:\/\/www.crcweb.org\/community\/wp-json\/wp\/v2\/media?parent=13"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}