Está en la página 1de 3

Original ok

function doGet(e) {
// Obtenemos el correo de la cuenta ejecutando el registro
const correo = Session.getActiveUser().getEmail();
// Registramos la asistencia usando el correo y los parámetros que vienen en la URL
registrarAsistencia(correo, e.parameter.id, e.parameter.nombre);
// Damos retroalimentación sobre lo que sucedió:
return HtmlService.createHtmlOutput(`
Asistencia registrada correctamente. <br><br>
Correo que registró: ${correo}<br>
Fecha: ${new Date()}<br>
ID: ${e.parameter.id}<br>
Nombre: ${e.parameter.nombre}`);
}
function registrarAsistencia(correo, id, nombre) {
// Debes cambiar este identificador por el de tu documento de hoja de cálculo
const sheet = SpreadsheetApp.openById("1qKFZM4Jck2uIa8B7PQb1QOisOohjnEJ-
pUDkNWHNTjs");
const asistencia = sheet.getSheetByName("Asistencia");
const lastRow = asistencia.getLastRow() + 1;
asistencia.getRange(lastRow, 1).setValue(correo);
asistencia.getRange(lastRow, 2).setValue(id);
asistencia.getRange(lastRow, 3).setValue(nombre);
asistencia.getRange(lastRow, 4).setValue(new Date());
}
function doGet(e) {
// Obtenemos el correo de la cuenta ejecutando el registro
const correo = Session.getActiveUser().getEmail();
// Registramos la asistencia usando el correo y los parámetros que vienen en la URL
registrarAsistencia(correo,e.parameter.id, e.parameter.nombre);
// Damos retroalimentación sobre lo que sucedió:
return HtmlService.createHtmlOutput(`
Asistencia registrada correctamente. <br><br>
Correo que registró: ${correo}<br>
Fecha: ${new Date()}<br>
ID: ${e.parameter.id}<br>
Nombre: ${e.parameter.nombre}`);
}
function registrarAsistencia(correo, id, nombre) {
// Debes cambiar este identificador por el de tu documento de hoja de cálculo
const sheet = SpreadsheetApp.openById("1qKFZM4Jck2uIa8B7PQb1QOisOohjnEJ-
pUDkNWHNTjs");
const asistencia = sheet.getSheetByName("Asistencia");
const lastRow = asistencia.getLastRow() + 1;
asistencia.getRange(lastRow, 1).setValue(correo);
asistencia.getRange(lastRow, 2).setValue(id);
asistencia.getRange(lastRow, 3).setValue(nombre);
asistencia.getRange(lastRow, 4).setValue(new Date());
}
QR ZONAS OK
function doGet(e) {
  // Obtenemos el correo de la cuenta ejecutando el registro
  const correo = Session.getActiveUser().getEmail();
  // Registramos la ALARMA usando el correo y los parámetros que vienen en la 
URL
  registrarAlarma(correo, e.parameter.id, e.parameter.zona);
  // Damos retroalimentación sobre lo que sucedió:
  return HtmlService.createHtmlOutput(`
   Alarma registrada correctamente. <br><br>
   Correo que registró: ${correo}<br>
   Fecha: ${new Date()}<br>
   ID: ${e.parameter.id}<br>
   Zona: ${e.parameter.zona}`);
}
function registrarAlarma(correo, id, zona) {
  // Debes cambiar este identificador por el de tu documento de hoja de cálcu
lo
  const sheet = SpreadsheetApp.openById("10LeUDzdusu5g4Ybk242_vnrF2jHJiIZXRyS
zXi-uH5w");
  const alarma = sheet.getSheetByName("Alarma");
  const lastRow = alarma.getLastRow() + 1;
  alarma.getRange(lastRow, 1).setValue(correo);
  alarma.getRange(lastRow, 2).setValue(id);
  alarma.getRange(lastRow, 3).setValue(zona);
  alarma.getRange(lastRow, 4).setValue(new Date());
}
function doGet(e) {
  // Obtenemos el correo de la cuenta ejecutando el registro
  const correo = Session.getActiveUser().getEmail();
  // Registramos la alarma usando el correo y los parámetros que vienen en la 
URL
  registrarAlarma(correo,e.parameter.id, e.parameter.zona);
    // Damos retroalimentación sobre lo que sucedió:
  return HtmlService.createHtmlOutput(`
   Alarma registrada correctamente. <br><br>
   Correo que registró: ${correo}<br>
   Fecha: ${new Date()}<br>
   ID: ${e.parameter.id}<br>
   Zona: ${e.parameter.nombre}`);
}
function registrarAlarma(correo, id, zona) {
  // Debes cambiar este identificador por el de tu documento de hoja de cálcu
lo
  const sheet = SpreadsheetApp.openById("10LeUDzdusu5g4Ybk242_vnrF2jHJiIZXRyS
zXi-uH5w");
  const alarma = sheet.getSheetByName("Alarma");
  const lastRow = alarma.getLastRow() + 1;
  alarma.getRange(lastRow, 1).setValue(correo);
  alarma.getRange(lastRow, 2).setValue(id);
  alarma.getRange(lastRow, 3).setValue(zona);
  alarma.getRange(lastRow, 4).setValue(new Date());
}

También podría gustarte