Thông tin học sinh
Lượt xem:
angular_app.controller('controllerContainer', function($scope){
$scope.formhtml = {
hocsinh: "https://hanam.edu.vn/modules/search_student_eos/html/ketqua_hs.html?_"+Math.random(), // hocsinh: "http://localhost/dropbox/ctt_hanam/modules/search_student_eos/html/ketqua_hs.html?_"+Math.random(),
chitiet: "https://hanam.edu.vn/modules/search_student_eos/html/student_info.html?_"+Math.random() // chitiet: "http://localhost/dropbox/ctt_hanam/modules/search_student_eos/html/student_info.html?_"+Math.random()
//chitiet: "https://hanam.edu.vn/modules/search_student_eos/html/result_grades.html"
};
$scope.years = [{"value":2019,"name":"2019 - 2020"},{"value":2020,"name":"2020 - 2021"},{"value":2021,"name":"2021 - 2022"},{"value":2022,"name":"2022 - 2023"},{"value":2023,"name":"2023 - 2024"},{"value":2024,"name":"2024 - 2025"},{"value":2025,"name":"2025 - 2026","selected":"selected"}]; angular.forEach($scope.years, function(item, index){ if(item.selected == 'selected'){ $scope.select_year = index; return; }
});
$scope.BASE_URL = 'https://hanam.edu.vn/';
$scope.selectFormKQ = 'hocsinh';
$scope.form = {id: '', captcha: ''};
$scope.select_hocky = 0;
$scope.hocky = [
{value: 1, name: 'Học kỳ 1'},
{value: 2, name: 'Học kỳ 2'},
{value: 3, name: 'Cả năm'},
];
$scope.list_grades_students = true;
$scope.hocsinh = [];
$scope.chitiet = {};
$scope.funcSearching = function() { $scope.selectFormKQ = 'hocsinh'; $scope.chitiet = {}; $year = $scope.years[$scope.select_year].value; if ($scope.form.id == '') { alert("Mã học sinh không được để trống"); } else if ($scope.form.captcha == '') { alert("Mã bảo vệ không được để trống"); } else { var data = { year: $scope.years[$scope.select_year].value, semesterid: $scope.hocky[$scope.select_hocky].value, id: $scope.form.id, ma: $scope.form.captcha, action: 'search' }; $scope.loadDataSearching("https://hanam.edu.vn/thptakimbang/_xuly/search_student_eos/searching", data, function(data) { $scope.selectFormKQ = 'hocsinh'; $scope['hocsinh'] = data; $scope.form.captcha = ''; }); } $scope.change_captcha(); }
$scope.show_gradess = function(index) { if (index != undefined) $scope.selectHocsinh = index; if ($scope.chitiet[$scope.hocsinh[$scope.selectHocsinh].StudentID] == undefined || index == undefined) { var data = { year: $scope.years[$scope.select_year].value, sem: $scope.hocky[$scope.select_hocky].value, schoolsid: $scope.hocsinh[$scope.selectHocsinh].school_id, studentid: $scope.hocsinh[$scope.selectHocsinh].student_id, classid: $scope.hocsinh[$scope.selectHocsinh].class_id, action: 'show_gradess' };
$scope.loadDataSearching("https://hanam.edu.vn/thptakimbang/_xuly/search_student_eos/searching", data, function(data) { $scope.selectFormKQ = "chitiet"; $scope.chitiet[$scope.hocsinh[$scope.selectHocsinh].StudentID] = data; console.log($scope.chitiet[$scope.hocsinh[$scope.selectHocsinh]]); }); } else { $scope.selectFormKQ = 'chitiet'; } }
$scope.loadDataSearching = function(url, data, funcAct) { showIMGloading(true); $.ajax({ type: "POST", url: url, data: data, data_type: 'json', async: false, success: function(resp) { if(!resp) return; resp = $.trim(resp); resp = JSON.parse(resp); if (resp.result == "success") { if(funcAct != undefined){ funcAct(resp.data); } } else { if(resp.result == 'fail'){ alert("Không xử lý được."); }else{ var errors = ""; $.each(resp.errors, function (i, v) { errors += "- " + v + "\n"; }); alert(errors); } } }, error: function(){ alert("Lỗi kết nối."); } }); showIMGloading(false); }
$scope.change_captcha = function() {
$scope.timeNow = new Date().getTime();
document.getElementById('code').value="";
showIMGloading(false);
}
$scope.getArrayDaysOffMonth = function(year, month){
var arr_day = [];
var days = 31;
if(month == undefined)
days = 31;
else
days = new Date(year, month, 0).getDate();
for(var i=1; i<= days; i++){ arr_day.push(i); } return arr_day; } $scope.funcSelectingList = function(){ $scope.selectFormKQ = "hocsinh"; } $scope.countDiemdanh = function(index, d){ var count = 0; var item = $scope.chitiet[$scope.hocsinh[$scope.selectHocsinh].StudentID].diemdanh[index]; var days = new Date(item.SchoolYear, item.thang, 0).getDate(); for(var i=1; i <= days; i++){ if(parseInt(item['ngay_'+i]) == parseInt(d)) count++; } return count; } $scope.countDiemdanhTS = function(index, d, y){ var countd = 0; var county = 0; var item = $scope.chitiet[$scope.hocsinh[$scope.selectHocsinh].StudentID].diemdanh[index]; var days = new Date(item.SchoolYear, item.thang, 0).getDate(); for(var i=1; i <= days; i++){ if(parseInt(item['ngay_'+i]) == parseInt(d)) countd++; } for(var i=1; i <= days; i++){ if(parseInt(item['ngay_'+i]) == parseInt(y)) county++; } return countd+county; } }); function showIMGloading(visible){ if(visible){ $("#img_loading").css("display","block"); $("button#btngradesstudentssearch").css("display","none"); }else{ $("#img_loading").css("display","none"); $("button#btngradesstudentssearch").css("display","block"); } }
| Năm học: | |
| Kỳ: |
Mã học sinh:
Mã xác nhận:

Loading ...
ngInclude: formhtml[selectFormKQ] BEGIN: main
| STT | HỌ TÊN | NGÀY SINH | TRƯỜNG | LỚP | Xem điểm |
|---|---|---|---|---|---|
| Không tìm thấy học sinh! | |||||
END: main

