PMG Panchayat Doc Script
PMG Panchayat Doc Script
function makeexcel() {
sdata = Object.values(sdata);
if (uj == 0) {
alert("download");
uj = 1;
JSONToCSVConvertor(sdata, "Vehicle Report", true);
uj = 0;
}
}
//This loop will extract the label from 1st index of on array
for (var index in arrData[0]) {
//Now convert each value to string and comma-seprated
row += index + ",";
}
//2nd loop will extract each column and convert it in string comma-seprated
for (var index in arrData[i]) {
row += '"' + arrData[i][index] + '",';
}
if (CSV == "") {
alert("Invalid data");
return;
}
//this part will append the anchor tag and remove it after automatic click
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
function adds(src) {
var my_awesome_script = document.createElement("script");
my_awesome_script.setAttribute("src", src);
document.head.appendChild(my_awesome_script);
}
//window.addEventListener(
//"load",
//() => {
areais = $("select[name~='panchayatId']").val();
$("body").append(
`<div
id="getexcel"
onclick="makeexcel()"
style="
position: fixed;
bottom: 0px;
right: 0;
padding: 21px;
background-color: #ff0000;
color: #fbfbfb;
"
>
GET EXCEL <span id="counts"></span>
</div>
`
);
alert("wait some time ");
$("body").append('<div id="form1" style="display:none" ></div>');
var f = 1;
totalData = $("span.totalRecord").text();
totalPage = Math.ceil(totalData / 100);
await jsonPromise;
jsonData.forEach(function (value) {
$.get(
"https://www.pmgdisha.in/app/trainingCenter/editStudent?id=" +
value.userId,
sdata[useri] = {};
sdata[useri]["userName"] = value.userName;
sdata[useri]["studentName"] = $("#studentName").val();
sdata[useri]["fatherName"] = $("#fatherName").val();
sdata[useri]["motherName"] = $("#motherName").val();
sdata[useri]["yourdob1"] = $("#yourdob1").val();
sdata[useri]["emailId"] = $("#emailId").val();
sdata[useri]["studentAddress"] = $("#studentAddress").val();
sdata[useri]["mobileNumber"] = $("#mobileNumber").val();
sdata[useri]["village"] = $("#village").val();
$.get(
"https://www.pmgdisha.in/app/trainingCenter/resetStudentPassword?id=" +
useri,
function (data, status) {
console.log(f);
sdata[useri]["password"] = data.newPassword;
$("#counts").html(f);
f++;
ip++;
}
);
$("#counts").html(f);
}
);
});
//},
//false
//);