/var/www/hkosl.com/waiyin/tc/view/event_list.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<!DOCTYPE html>
<html lang="en-HK" prefix="og: http://ogp.me/ns#">

<head>
    <title>活動回顧 - 慧妍雅集, WAI YIN ASSOCIATION</title>

    <!-- css -->
    <?php include 'inc/headlinks.php'?>
    <!-- js -->
    <?php include 'inc/link-js.php'?>
</head>

<body>
    <!-- header -->
    <?php include 'inc/navbar.php'?>
    <!-- end of header-->

    <!-- breadcrumb -->
    <div class="breadcrumb" style="background-image:url(../../assets/images/breadcrumbbg.jpg);">

        <div class="breadcrumbWrapper text-center">

            <p class="breadcrumbTitle mb-2 pt-4 h3 text-uppercase whiteFont">活動回顧
            </p>

            <div class="breadcrumbLink whiteFont">

                <a href="index.php" class="whiteFont"> 首頁</a> / <span class="whiteFont">活動回顧
                </span>

            </div>

        </div>

    </div>


    <section class="mainWrap">
        <div class="container">
            <div class="d-flex align-items-center mb-4">
                <label for="Year" class="nowrap mb-0 mr-2">活動回顧年份:</label>
                <div class="selectionSelecter">
                    <select class="form-control selecter" id="Year">
                        <option value="All">All</option>
                        <option value="2022">2022 - 2021</option>
                        <!-- <option value="2020">2020 - 2019</option>
                        <option value="2018">2018 - 2017</option>
                        <option value="2016">2016 - 2015</option>
                        <option value="2014">2014 - 2013</option>
                        <option value="2012">2012 - 2011</option>
                        <option value="2010">2010 - 2009</option>
                        <option value="2008">2008 - 2007</option>
                        <option value="2006">2006 - 2005</option>
                        <option value="2004">2004 - 2003</option>
                        <option value="2002">2002 - 2001</option>
                        <option value="2000">2000 - 1995</option>
                        <option value="1994">1994 - 1990</option>
                        <option value="1989">1989 - 1985</option>
                        <option value="1984">1984 - 1980</option> -->
                    </select>
                </div>
            </div>
            <div class="row eventlist">


            </div>

        </div>






    </section>
    <!-- end #section -->

    <!-- footer -->
    <?php include 'inc/footer.php'?>

    <script>
    $(function() {

        let selectVal = "";




        $.ajax({
            url: "../../assets/json/event_list.json",
            type: "get",

            data: {},
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            cache: false,

            success: function(result) {
                let data = result.tc;



                $.each(data, function(index, item) {
                    $(` <div class="col-lg-4 col-6 eventitem" data-year="${item.years}">
                    <a class="card newsCard" href="${item.link}">
                        <div class="cardImgWrap">
                            <div class="cardImg">
                               
                                <img src="${item.img}" alt="${item.title}" class="cardImgOver"
                                    title="${item.title}">

                            </div>
                            <span class="tag ${item.class}">${item.tag}</span>
                        </div>
                        <div class="card-body">
                            <p class="small grayFont mb-2">${item.date}</p>
                            <p class="card-text">${item.title}</p>
                        </div>
                    </a>

                </div>`).appendTo('.eventlist');
                });



            },
            error: function(xhr, status, errorThrown) {
                console.log(errorThrown + "\n" + status + "\n" + xhr.statusTex);
            },
        });

        $('#Year').change(function() {
            var filter = $(this).val();

            filterList(filter);

        });

        // Recruiters filter function
        function filterList(value) {
            //  alert(value);
            var list = $(".eventitem");
            $(list).hide();
            if (value == "All") {
                $(".eventitem").each(function(i) {
                    $(this).fadeIn();
                });
            } else {
                // *=" means that if a data-custom type contains multiple values, it will find them
                $(".eventlist").find(".eventitem[data-year=" + value + "]").each(function(i) {
                    // console.log($(this));
                    $(this).fadeIn();
                });
            }
        }



    });
    </script>

</body>

</html>