function teachattend() { $("#page_main_div").load( "../html_modules/uploadteachattend.html?", function () { document.getElementById("display_module_name").innerHTML = "Upload Teacher Attendance"; document.getElementById("module_name_for_save").value = "Upload Teacher Attendance"; getDefaultHeadFooterLinks("Upload Teacher Attendance"); loadteachattendance(); } ); } function loadteachattendance() { $.ajax({ type: "POST", url: $host_url + "loadteachattendance", success: function (response) { var encode = JSON.parse(response); var teachlist = ""; var teachattend = ""; teachlist = "https://teachattendance.s3.ap-south-1.amazonaws.com/" + encode.data.fteachlist; teachattend = "https://teachattendance.s3.ap-south-1.amazonaws.com/" + encode.data.fteachattend; var tabteach = `
Sl. No. Description Upload View Uploaded Date
1 Upload Teacher List Upload View ${encode.data.flistdate}
2 Upload Teacher Attendance Upload View ${encode.data.fattenddate}
`; $("#tabtechdet").html(tabteach); if (encode.data.fteachlist == "") { $("#teachlist").hide(); } else { $("#teachlist").show(); } if (encode.data.fteachattend == "") { $("#teachattend").hide(); } else { $("#teachattend").show(); } }, }); } function uplteachlist() { var file_data = $("#doclist").prop("files")[0]; var form_data = new FormData(); form_data.append("file", file_data); if ($("#doclist")[0].files.length === 0) { alert("No files selected"); return; } $.ajax({ url: "uploadteachlist.php", dataType: "text", cache: false, contentType: false, processData: false, data: form_data, type: "post", success: function (response) { var response = JSON.parse(response); console.log(response); if (response.err_code == -2) { alert(response.msg); loadteachattendance(); return; } if (response.err_code == 0) { $.ajax({ type: "POST", data: "&file=" + response.teachlistdoc, url: $host_url + "teachlist_AWS", success: function (response) { var encode = JSON.parse(response); if (encode.error_code == 0) { alert(encode.data.msg); loadteachattendance(); } else { alert(encode.data.msg); return; } }, }); } }, }); } function uplteachattend() { var file_data = $("#docattend").prop("files")[0]; var form_data = new FormData(); form_data.append("file", file_data); if ($("#docattend")[0].files.length === 0) { alert("No files selected"); return; } $.ajax({ url: "uploadteachattend.php", dataType: "text", cache: false, contentType: false, processData: false, data: form_data, type: "post", success: function (response) { var response = JSON.parse(response); console.log(response); if (response.err_code == -2) { alert(response.msg); loadteachattendance(); return; } if (response.err_code == 0) { $.ajax({ type: "POST", data: "&file=" + response.teachattenddoc, url: $host_url + "teachattend_AWS", success: function (response) { var encode = JSON.parse(response); if (encode.error_code == 0) { alert(encode.data.msg); loadteachattendance(); } else { alert(encode.data.msg); return; } }, }); } }, }); }