suseendhiran
This commit is contained in:
parent
4d251e0e7f
commit
5caa5e2cdf
8
app/controllers/googlesheet.code-workspace
Normal file
8
app/controllers/googlesheet.code-workspace
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "../.."
|
||||
}
|
||||
],
|
||||
"settings": {}
|
||||
}
|
||||
@ -162,8 +162,8 @@ exports.addRow = async (req, res) =>
|
||||
const row = rows[index];
|
||||
await sheet.addRow(row);
|
||||
}
|
||||
if (rows[0].Gatnayak == tempData[0]['Sl.'] ) { res.send({'status':200 , message:"Success." ,'data': "success" , 'statusCode' : 1 }); }
|
||||
else{ res.send({'status':200 , message:"Success." ,'data': "success", 'statusCode' : 0 }); }
|
||||
if (rows[0]['Gatnayak'] == tempData[0].email ) {res.send({'status':200 , message:"Success." ,'data': "success" , 'statusCode' : 1 }); }
|
||||
else{res.send({'status':200 , message:"Success." ,'data': "success", 'statusCode' : 0 }); }
|
||||
} catch(err) {
|
||||
res.status(500).send({'status':404,
|
||||
message: err.message || "Some error occurred while inserting statements." ,'data': "No data"
|
||||
|
||||
@ -750,9 +750,9 @@ select , option {
|
||||
<div class="modal-body">
|
||||
<label>Ganavesh</label>
|
||||
<select id="new11" type="text" class="input" name="Ganavesh">
|
||||
<option class="dropdown-item" value=''></option>
|
||||
<option class="dropdown-item" value='Y'>Y</option>
|
||||
<option class="dropdown-item" value='N'>N</option>
|
||||
<% dropdown.ganavesh_2w_4w_basg.forEach(function(data , index ) { %>
|
||||
<option class="dropdown-item" value="<%=data %>"><%=data %></option>
|
||||
<% }) %>
|
||||
</select>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@ -769,19 +769,19 @@ select , option {
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<label>2W</label>
|
||||
<select id="new14" type="text" class="input" name="2W">
|
||||
<option class="dropdown-item" value=''></option>
|
||||
<option class="dropdown-item" value='Y'>Y</option>
|
||||
<option class="dropdown-item" value='N'>N</option>
|
||||
</select>
|
||||
<select id="new13" type="text" class="input" name="2W">
|
||||
<% dropdown.ganavesh_2w_4w_basg.forEach(function(data , index ) { %>
|
||||
<option class="dropdown-item" value="<%=data %>"><%=data %></option>
|
||||
<% }) %>
|
||||
</select>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<label>4W</label>
|
||||
<select id="new15" type="text" class="input" name="4W">
|
||||
<option class="dropdown-item" value=''></option>
|
||||
<option class="dropdown-item" value='Y'>Y</option>
|
||||
<option class="dropdown-item" value='N'>N</option>
|
||||
</select>
|
||||
<select id="new14" type="text" class="input" name="4W">
|
||||
<% dropdown.ganavesh_2w_4w_basg.forEach(function(data , index ) { %>
|
||||
<option class="dropdown-item" value="<%=data %>"><%=data %></option>
|
||||
<% }) %>
|
||||
</select>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<label>Pada Sanchalan 2022</label>
|
||||
@ -790,9 +790,9 @@ select , option {
|
||||
<div class="modal-body">
|
||||
<label>Bagh Sanghik</label>
|
||||
<select id="new17" type="text" class="input" name="Bagh Sanghik">
|
||||
<option class="dropdown-item" value=''></option>
|
||||
<option class="dropdown-item" value='Y'>Y</option>
|
||||
<option class="dropdown-item" value='N'>N</option>
|
||||
<% dropdown.ganavesh_2w_4w_basg.forEach(function(data , index ) { %>
|
||||
<option class="dropdown-item" value="<%=data %>"><%=data %></option>
|
||||
<% }) %>
|
||||
</select>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@ -841,7 +841,7 @@ $(document).on("click", "#last", function(){
|
||||
|
||||
// Add new data in sheet
|
||||
$(document).on("click", "#add-new", function(){
|
||||
for (let i = 0; i < 20; i++) {
|
||||
for (let i = 0; i < 22; i++) {
|
||||
newValue.push($(`#new${i}`).val())
|
||||
}
|
||||
// add data in googlesheet using ajax
|
||||
@ -850,27 +850,15 @@ $(document).on("click", "#add-new", function(){
|
||||
url: ''+ window.location.origin +'/gsheet/api/addRow',
|
||||
data: { data : newValue },
|
||||
success: function(response) {
|
||||
if (response.status == 200 && response.statusCode == 1) {
|
||||
// Get the first form with the name
|
||||
// Usually the form name is not repeated
|
||||
// but duplicate names are possible in HTML
|
||||
// Therefore to work around the issue, enforce the correct index
|
||||
if (response.statusCode == 1) {
|
||||
var frm = document.getElementsByName('contact-form')[0];
|
||||
frm.submit(); // Submit the form
|
||||
frm.reset(); // Reset all form data
|
||||
return false; // Prevent page refresh
|
||||
alert("Data added successfully");
|
||||
window.location.reload()
|
||||
}
|
||||
else if(response.status == 200 && response.statusCode == 0){
|
||||
// Get the first form with the name
|
||||
// Usually the form name is not repeated
|
||||
// but duplicate names are possible in HTML
|
||||
// Therefore to work around the issue, enforce the correct index
|
||||
else{
|
||||
var frm = document.getElementsByName('contact-form')[0];
|
||||
frm.submit(); // Submit the form
|
||||
frm.reset(); // Reset all form data
|
||||
return false; // Prevent page refresh
|
||||
alert("Data added successfully");
|
||||
window.location.reload()
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user