PageSourceSearch

https://tracuudiem.me/wp-content/themes/tracuu/assets/js/main.js?v=2.10

js tracuudiem.me collected 2026-10-10 02:23:51 UTC 18,151 bytes, 417 lines download raw bytes

1function checkSubmit() {
2    var phone = $('#phone').val().trim();
3    var name = $('#name').val().trim();
4    var tinh = $('#sl_tinh').val();
5    var pw = $('#pw');
6    var token = $('#csrf').val();
7    var dob = $('#dob').val();
8    var check_pw = '';
9    if(phone ==='' || token==='')
10    {
11        $('#notifyAlert').html('Vui lòng nhập SĐT của Phụ huynh hoặc  Mã học sinh.');
12        $('#phone').focus().addClass('warning');
13        return false;
14    }
15    if(tinh == '0')
16    {
17        $('#notifyAlert').html('Vui lòng chọn tỉnh thành cần tra cứu!');
18        $('#sl_tinh').focus().addClass('warning');
19        return false;
20    }
21    if(name ==='')
22    {
23        $('#notifyAlert').html('Vui lòng nhập Họ tên học sinh cần tra cứu.');
24        $('#name').focus().addClass('warning');
25        return false;
26    }
27
28    if (pw.length > 0)
29    {
30        check_pw = pw.val().trim();
31        if (check_pw === '')
32        {
33            $('#notifyAlert').html('Vui lòng nhập mật khẩu tài khoản vnedu.');
34            $('#pw').focus().addClass('warning');
35            return false;
36        }
37    }
38
39    disableButton();
40    $('#process').show();
41    $('#bangdiem').html('');
42    $('#reSearch').html('');
43    $.ajax({
44        type: "post",
45        contentType: 'application/json',
46        url: 'tracuu.php?phone='+phone+'&pw='+check_pw+'&name='+name+'&tinh_id='+tinh+'&dob='+dob+'&token='+token,
47        dataType: "json",
48        success: function(res){
49            $('#process').hide();
50            $('#csrf').val(res.token);
51            var res_html =  res.html.datahk1 + res.html.data;
52            if(res.stt ==1  ){
53
54                $('#reSearch').append('<a href="https://www.facebook.com/sharer/sharer.php?u=https://tracuudiem.me/share.php?key='+res.share+'" target="_blank"><span  style="background: #0452a0;color: white; display: inline-block;padding: 10px 20px;border-radius: 10px;">Chia sẻ lên Facebook</span></a>');
55                //$('#reSearch').append('<p class="wl100 mgt20" style="text-transform: none; color: #F44336;">CẢNH BÁO!!! <br/>Duy nhất tại <b>tracuudiem.me</b> và <b>vnedu.vn</b> có thể tra cứu điểm. Tất cả website khác đều mạo danh và có thể đánh cắp dữ liệu người dùng.<br/></p>');
56                //console.log(res_html);
57
58                var info = '<table class="tbl-info" style="border-collapse: collapse; width: 100%;">'+
59                    '<tbody>'+
60                    '<tr>'+
61                    '<td colspan="5">Thông tin cá nhân</td>'+
62                    '</tr>'+
63                    '<tr>'+
64                    '       <td style="width: 20%;">Họ tên</td>'+
65                    '       <td style="width: 20%;">Lớp</td>'+
66                    '       <td style="width: 20%;">Trường</td>'+
67                    '        <td style="width: 20%;">Huyện</td>'+
68                    '       <td style="width: 20%;">Tỉnh</td>'+
69                    '   </tr>'+
70                    '   <tr>'+
71                    '       <td style="width: 20%;">'+res.info['fullname']+'</td>'+
72                    '       <td style="width: 20%;">'+res.info['lop']+'</td>'+
73                    '       <td style="width: 20%;">'+res.info['truong']+'</td>'+
74                    '       <td style="width: 20%;">'+res.info['huyen']+'</td>'+
75                    '       <td style="width: 20%;">'+res.info['tinh']+'</td>'+
76                    '   </tr>'+
77                    '</tbody>'+
78                    '</table>';
79                //'<p class="mgt20">*Nếu có bất kì thắc mắc nào về kết quả tra cứu. Vui lòng tra cứu lại tại vnedu.vn</p>';
80                $('#notifyAlert').html(info);
81
82                //var cap1 = checkFirstNumberInRange(res.info['lop']);
83                //var tableHTML = tcdiem(res_html,cap1);
84                $('#bangdiem').html(res_html);
85                changeImg();
86
87                if(res_html.success === false)
88                {
89                    $('#notifyAlert').append('<p class="wl100 mgt20">'+res_html.msg+'</p>');
90                    //$('#notifyAlert').append('<p class="wl100 mgt20"><b>'+res.info['fullname']+' : </b> Bảng điểm đang được cập nhật. Vui lòng quay lại Tra Cứu sau.</p>');
91                    //$('#notifyAlert').delay(3000).append('<p class="wl100 mgt20">Bảng điểm đang được cập nhật. Vui lòng quay lại Tra Cứu sau.</p>');
92                }
93            }
94            else{
95                $('#notifyAlert').delay(1000).html(res.mess);
96                //$('#notifyAlert').append('<p class="wl100 mgt20"><b>'+res.info['fullname']+' : </b> Bảng điểm đang được cập nhật. Vui lòng quay lại Tra Cứu sau.</p>')
97                //$('#notifyAlert').delay(3000).append('<p class="wl100 mgt20"><b>Bảng điểm đang được cập nhật. Vui lòng quay lại Tra Cứu sau.</p>');
98            }
99
100        },
101        error: function(xhr, status, error) {
102            $('#notifyAlert').delay(3000).append('<p class="wl100 mgt20"><b>Bảng điểm đang được cập nhật. Vui lòng quay lại Tra Cứu sau.</p>');
103        }
104
105    });
106    var recheck = '<a href="#phone"><span style="background: #59871b;color: white;display: inline-block;padding: 10px 20px;border-radius: 10px;margin-right: 20px;">Tra cứu lại</span></a>';
107
108    $('#reSearch').append(recheck);
109
110    $('#reSearch').fadeIn(2000);
111    $('#checkloi').fadeIn(2000);
112    $('#process').fadeOut(5000);
113
114    $('#notifyAlert').fadeIn(2000).html('Dữ liệu đang được cập nhật...');
115
116    return true;
117
118}
119
120function checkFirstNumberInRange(str) {
121    const numberMatch = str.match(/^\d+/); // Tìm chuỗi số ở đầu chuỗi
122    if (numberMatch) {
123        const firstNumber = parseInt(numberMatch[0], 10); // Chuyển đổi chuỗi số đầu tiên thành số nguyên
124        return firstNumber >= 1 && firstNumber <= 5; // Kiểm tra xem số có nằm trong khoảng 1-5 không
125        alert(numberMatch);
126    }
127    return false;
128}
129
130
131
132const monHocData = {
133    "1": "Toán Học",
134    "2": "Ngữ Văn",
135    "3": "Vật lí",
136    "4": "Hóa học",
137    "5": "Lịch sử",
138    "6": "Địa lí",
139    "7": "Sinh học",
140    "8": "Ngoại ngữ",
141    "9": "GDCD",
142    "10": "Công nghệ",
143    "11": "Tin học",
144    "12": "Thể dục",
145    "13": "Âm nhạc",
146    "14": "Mĩ thuật",
147    "15": "GDQP",
148    "16": "Kĩ thuật",
149    "17": "Nghề PT",
150    "18": "Ngoại ngữ 2",
151    "33": "Tự chọn 1",
152    "34": "Tiếng dân tộc",
153    "35": "Tự chọn 2",
154    "36": "Tự chọn 3",
155    "50": "Tiếng Việt",
156    "51": "Toán",
157    "52": "Khoa học",
158    "53": "Lịch sử và Địa lí",
159    "54": "Tiếng Anh",
160    "55": "Tin học",
161    "56": "Đạo đức",
162    "57": "TN-XH",
163    "58": "Âm nhạc",
164    "59": "Mĩ thuật",
165    "60": "Kĩ thuật",
166    "61": "Thủ công",
167    "62": "Thể dục",
168    "63": "Sức khỏe",
169    "64": "Nghệ thuật",
170    "65": "Tự chọn 4",
171    "66": "Tự chọn 5",
172    "67": "Tự chọn 6",
173    "68": "Tự chọn 7",
174    "69": "Tự chọn 8",
175    "70": "Tự chọn 9",
176    "71": "Ôn toán",
177    "72": "Ôn Tiếng Việt",
178    "73": "Luyện VCĐ",
179    "74": "Kỹ năng sống",
180    "75": "Đọc sách",
181    "76": "HĐ tập thể",
182    "77": "Erobic",
183    "78": "Cờ vua",
184    "79": "Tự chọn 10",
185    "80": "Tự chọn 11",
186    "81": "Khoa học tự nhiên",
187    "82": "Khoa học xã hội",
188    "83": "Hoạt động giáo dục",
189    "84": "Tự chọn 12",
190    "85": "Tự chọn 13",
191    "86": "Tự chọn 14",
192    "87": "Tự chọn 15",
193    "88": "Tự chọn 16",
194    "89": "TC nhận xét 1",
195    "90": "TC nhận xét 2",
196    "91": "TC nhận xét 3",
197    "92": "TC nhận xét 4",
198    "93": "TC nhận xét 5",
199    "94": "TC nhận xét 6",
200    "95": "TC nhận xét 7",
201    "96": "TC nhận xét 8",
202    "97": "Giáo dục thể chất",
203    "98": "Hoạt động trải nghiệm",
204    "99": "Tin học và Công nghệ",
205    "100": "Ngoại ngữ 1",
206    "102": "Hoạt động trải nghiệm, hướng nghiệp",
207    "103": "Giáo dục quốc phòng và an ninh",
208    "104": "Nội dung giáo dục của địa phương",
209    "105": "Giáo dục kinh tế và pháp luật",
210    "106": "Công nghệ trồng trọt",
211    "107": "Tin học và Công nghệ (Công nghệ)",
212    "110": "Ngoại ngữ 1",
213    "113": "Tin học và Công nghệ (Tin học)"
214};
215
216function createStudentResultHTML(studentData, subjectData) {
217    let html = '';
218
219    // Học kỳ 1
220    html += '<table style="border-collapse: collapse; width: 100%;">';
221    html += '<tr><th colspan="2" style="background-color: #007BBF; color: white;">Kết quả học tập trong học kỳ 1</th></tr>';
222    html += '<tr><td>Điểm trung bình</td><td>' + (studentData.hoc_ky_1.tong_ket.diem_trung_binh[1] ?? '...') + '</td></tr>';
223    html += '<tr><td>Học lực</td><td>' + (studentData.hoc_ky_1.tong_ket.hoc_luc[1] ?? '...') + '</td></tr>';
224    html += '<tr><td>Hạnh kiểm</td><td>' + (studentData.hoc_ky_1.tong_ket.hanh_kiem[1] ?? '...') + '</td></tr>';
225    html += '<tr><td>Xếp hạng</td><td>' + (studentData.hoc_ky_1.tong_ket.xep_hang[1] ?? '...') + '</td></tr>';
226    html += '</table>';
227
228    html += '<h3>Bảng điểm các môn học kỳ 1</h3>';
229    html += '<table>';
230    html += '<tr style="background-color: #007BBF; color: white;"><th>Môn học</th><th>Điểm ĐG thường xuyên</th><th>Điểm giữa kỳ</th><th>Điểm cuối kỳ</th><th>Điểm TBM</th></tr>';
231    for (const subjectId in studentData.hoc_ky_1.diem_tk_mon[1]) {
232        const subjectName = subjectData[subjectId];
233        const scores = studentData.hoc_ky_1.diem_tp[1][subjectId];
234        const regularScore = scores && scores[2] ? scores[2].split(';').map(score => '<span style="display: inline-grid;
234width: 20px; text-align: center;">' + score + '</span>').join('') : 'Trống';
235        const midtermScore = scores && scores[3] ? scores[3] : '...';
236        const finalScore = scores && scores[4] ? scores[4] : '...';
237        const tbm = studentData.hoc_ky_1.diem_tk_mon[1][subjectId] ?? '...';
238        html += '<tr><td>' + subjectName + '</td><td>' + regularScore + '</td><td>' + midtermScore + '</td><td>' + finalScore + '</td><td>' + tbm + '</td></tr>';
239    }
240    html += '</table>';
241
242    // Học kỳ 2
243    html += '<table style="border-collapse: collapse; width: 100%;">';
244    html += '<tr><th colspan="2" style="background-color: #007BBF; color: white;">Kết quả học tập trong học kỳ 2</th></tr>';
245    html += '<tr><td>Điểm trung bình</td><td>' + (studentData.hoc_ky_2.tong_ket.diem_trung_binh[1] ?? '...') + '</td></tr>';
246    html += '<tr><td>Học lực</td><td>' + (studentData.hoc_ky_2.tong_ket.hoc_luc[1] ?? '...') + '</td></tr>';
247    html += '<tr><td>Hạnh kiểm</td><td>' + (studentData.hoc_ky_2.tong_ket.hanh_kiem[1] ?? '...') + '</td></tr>';
248    html += '<tr><td>Xếp hạng</td><td>' + (studentData.hoc_ky_2.tong_ket.xep_hang[1] ?? '...') + '</td></tr>';
249    html += '</table>';
250    html += '<h3>Bảng điểm các môn học kỳ 2</h3>';
251    html += '<table>';
252    html += '<tr style="background-color: #007BBF; color: white;"><th>Môn học</th><th>Điểm ĐG thường xuyên</th><th>Điểm giữa kỳ</th><th>Điểm cuối kỳ</th><th>Điểm TBM</th></tr>';
253    for (const subjectId in studentData.hoc_ky_2.diem_tk_mon[2]) {
254        const subjectName = subjectData[subjectId];
255        const scores = studentData.hoc_ky_2.diem_tp[2][subjectId];
256        const regularScore = scores &&  scores[2] ? scores[2].split(';').map(score => '<span style="display: inline-grid;width: 20px; text-align: center;">' + score + '</span>').join('') : 'Trống';
257        const midtermScore = scores && scores[3] ? scores[3] : '...';
258        const finalScore = scores && scores[4] ? scores[4] : '...';
259        const tbm = studentData.hoc_ky_2.diem_tk_mon[2][subjectId] ?? '...';
260        html += '<tr><td>' + subjectName + '</td><td>' + regularScore + '</td><td>' + midtermScore + '</td><td>' + finalScore + '</td><td>' + tbm + '</td></tr>';
261    }
262    html += '</table>';
263
264    html += '<table style="border-collapse: collapse; width: 100%;">';
265    html += '<tr><th colspan="2" style="background-color: #007BBF; color: white;">Kết quả học tập cả năm</th></tr>';
266    html += '<tr><td>Điểm trung bình</td><td>' + (studentData.ca_nam.tong_ket.diem_trung_binh[1] ?? '...') + '</td></tr>';
267    html += '<tr><td>Học lực</td><td>' + (studentData.ca_nam.tong_ket.hoc_luc[1] ?? '...') + '</td></tr>';
268    html += '<tr><td>Hạnh kiểm</td><td>' + (studentData.ca_nam.tong_ket.hanh_kiem[1] ?? '...') + '</td></tr>';
269    html += '<tr><td>Xếp hạng</td><td>' + (studentData.ca_nam.tong_ket.xep_hang[1] ?? '...') + '</td></tr>';
270    html += '</table>';
271    html += '<h3>Bảng điểm các môn học cả năm</h3>';
272    html += '<table>';
273    html += '<tr style="background-color: #007BBF; color: white;"><th>Môn học</th><th>Điểm TBM</th></tr>';
274    if (studentData.ca_nam.diem_tk_mon) {
275        for (const subjectId in studentData.ca_nam.diem_tk_mon[0]) {
276            const subjectName = subjectData[subjectId];
277            if (studentData.ca_nam.diem_tk_mon[0] && studentData.ca_nam.diem_tk_mon[0][subjectId]) {
278                const tbm = studentData.ca_nam.diem_tk_mon[0][subjectId] ?? '...';
279                html += '<tr><td>' + subjectName + '</td><td>' + tbm + '</td></tr>';
280            } else {
281                html += '<tr><td>' + subjectName + '</td><td>...</td></tr>';
282            }
283        }
284    } else {
285        html += '<tr><td colspan="5">Không có dữ liệu</td></tr>';
286    }
287    html += '</table>';
288
289    return html;
290}
291
292function disableButton() {
293
294    const submitButton = document.getElementById("btnCheck");
295
296
297    const originalText = submitButton.value;
298    const originalColor = submitButton.style.backgroundColor;
299
300
301    submitButton.disabled = true;
302    submitButton.style.backgroundColor = "gray";
303
304
305    let countdown = 9;
306    submitButton.value = `Chờ ${countdown}s`;
307
308
309    const interval = setInterval(() => {
310        countdown--;
311        submitButton.value = `Chờ ${countdown}s`;
312
313
314        if (countdown === 0) {
315            clearInterval(interval);
316            submitButton.value = originalText;
317            submitButton.style.backgroundColor = originalColor;
318            submitButton.disabled = false;
319        }
320    }, 1000);
321}
322
323function changeImg()
324{
325    // 1. Khai báo chuỗi cần tìm và chuỗi mới để thay thế
326    const chuoiMoi = "https://tracuudiem.me/wp-content/themes/tracuu/assets/css/"; // <-- Điền đường dẫn mới
327
328    // 2. Chọn phần tử cha chứa các ảnh
329    const container = document.getElementById("bangdiem");
330
331    // Kiểm tra xem phần tử cha có tồn tại không để tránh lỗi
332    if (!container) {
333        console.log("Lỗi: Không tìm thấy phần tử với ID 'bangdiem'.");
334        return;
335    }
336
337    // 3. Lấy tất cả các thẻ <img> bên trong phần tử cha đó
338    const images = container.querySelectorAll("img");
339
340    // 4. Duyệt qua từng thẻ <img> và thực hiện thay thế
341    images.forEach((img) => {
342        const srcHienTai = img.getAttribute("src");
343     // Chỉ thay thế phần 'chuoiCu' bằng 'chuoiMoi' trong src hiện tại
344     img.src = chuoiMoi+srcHienTai;
345    });
346}
347
348
349
350
351function closeBanner() {
352    var now = Date.now();
353    var banner = document.getElementById('mobile-bottom-banner');
354    if (banner) banner.style.display = 'none';
355    localStorage.setItem('bannerClosedTime', now);
356}
357
358document.addEventListener('DOMContentLoaded', function() {
359    const SHOPEE_URL = "https://s.shopee.vn/9paazyjedt";
360    const LIST_FILE_PATH = 'wp-content/uploads/2026/list.json';
361    const DEFAULT_TIKTOK = "https://vt.tiktok.com/ZSHTbhkkdMLRb-cu3bd";
362    const TWO_HOURS = 2 * 60 * 60 * 1000;
363    const TIKTOK_KEY = 'lastTikTokTime';
364    const BANNER_KEY = 'bannerClosedTime';
365    const boxSearchDiv = document.getElementById('boxSearchDiv');
366
367    function isMobileDevice() {
368        return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
369    }
370
371    if (!isMobileDevice() || !boxSearchDiv) return;
372
373    let currentTikTokUrl = DEFAULT_TIKTOK;
374    fetch(LIST_FILE_PATH)
375        .then(response => response.ok ? response.text() : null)
376    .then(text => {
377        if (!text) return;
378    const links = text.split(/\r?\n/).map(line => line.trim()).filter(line => line.length > 0);
379    if (links.length > 0) {
380        currentTikTokUrl = links[Math.floor(Math.random() * links.length)];
381    }
382}).catch(() => {});
383
384const handleClicks = function() {
385    const now = Date.now();
386    const lastTikTok = parseInt(localStorage.getItem(TIKTOK_KEY) || '0');
387    const lastShopee = parseInt(localStorage.getItem(BANNER_KEY) || '0');
388
389    if (now - lastTikTok > TWO_HOURS) {
390        window.open(currentTikTokUrl, '_blank', 'noopener,noreferrer');
391        localStorage.setItem(TIKTOK_KEY, now);
392        return;
393    }
394
395    if (now - lastTikTok <= TWO_HOURS && now - lastShopee > TWO_HOURS) {
396        if (now - lastTikTok < 5000) return;
397
398        window.open(SHOPEE_URL, '_blank', 'noopener,noreferrer');
399        closeBanner();
400        boxSearchDiv.removeEventListener('click', handleClicks, true);
401    }
402};
403
404const now = Date.now();
405const lastTikTok = parseInt(localStorage.getItem(TIKTOK_KEY) || '0');
406const lastShopee = parseInt(localStorage.getItem(BANNER_KEY) || '0');
407
408if (now - lastTikTok > TWO_HOURS || now - lastShopee > TWO_HOURS) {
409    boxSearchDiv.addEventListener('click', handleClicks, true);
410}
411});
412
413$(function () {
414    $('#reSearch').hide();
415});
416
417

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.