This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name = "viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0,viewport-fit=cover"> | |
<title>ทดสอบ LIFF</title> | |
</head> | |
<body id = "body"> | |
<section id="profile"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function myFunction() { | |
var ss =SpreadsheetApp.getActiveSpreadsheet().getSheetByName('เช็คชื่อเข้าเรียน') | |
var names = ss.getRange(1, 2,1,ss.getLastColumn()).getValues()[0] | |
var check = ss.getRange(ss.getLastRow(), 2,1,ss.getLastColumn()).getDisplayValues()[0] | |
var date = Utilities.formatDate(new Date(), 'GMT+7', 'dd/MM/'); | |
var thaiyear = Number(Utilities.formatDate(new Date(), "GMT+7", "yyyy"))+543; | |
var index =1; | |
var count = check.filter(col=> col == "ขาด" || col == "ลา").length |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onFormSubmit() { | |
var token = "xxx"; // **ใส่ token** | |
var form = FormApp.openById('xxx'); // **ใส่ form id** | |
var fRes = form.getResponses(); | |
var formResponse = fRes[fRes.length - 1]; | |
var itemResponses = formResponse.getItemResponses(); | |
var message = '💊 บันทึกการใช้ห้องพยาบาล';//+ | |
for (var i = 0; i < itemResponses.length; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function myFunction() { | |
var ss = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('xxxxx') | |
var names = ss.getRange(1, 2, 1, ss.getLastColumn()).getValues()[0] | |
var check = ss.getRange(ss.getLastRow(), 2, 1, ss.getLastColumn()).getValues()[0] | |
var date = Utilities.formatDate(new Date(), 'GMT+7', 'dd/MM/')//วันที่ | |
var year = Number(Utilities.formatDate(new Date(), 'GMT+7', 'yyyy'))+543 //พศ. | |
var index = 1 //รันลำดับที่ | |
var count = check.filter(col=> col =="ขาด" || col == "ลา").length //นับจำนวน | |
var result = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" | |
content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0,viewport-fit=cover"> | |
<title>ครูอภิวัฒน์"สอนสร้างสื่อ"</title> | |
<style> | |
body {padding: 25px;background-color: #46abb0;color: yellow;} | |
.button {width: 60%;padding: 8px 0;margin: 2px auto;font-size: 16px;border-radius: 10px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function myFunction() { | |
var ss = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('เช็คชื่อ') | |
var names = ss.getRange(1, 2, 1, ss.getLastColumn()).getValues()[0] | |
var check = ss.getRange(ss.getLastRow(), 2, 1, ss.getLastColumn()).getValues()[0] | |
var std = names.length-1 | |
var date = Utilities.formatDate(new Date(), 'GMT+7', 'dd/MM/')//วันที่ | |
var year = Number(Utilities.formatDate(new Date(), 'GMT+7', 'yyyy'))+543 //พศ. | |
var index = 1 //รันลำดับที่ | |
var countNo = check.filter(col=> col =="ขาด" || col == "ลา").length //นับจำนวน ขาดและลา |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-----ครูอภิวัฒน์ สอนสร้างสื่อ------------ | |
function myFunction() { | |
var ss = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("xxx") | |
var names = ss.getRange(1, 2, 1, ss.getLastColumn()).getValues()[0] //ชื่อนักเรียน | |
var check = ss.getRange(ss.getLastRow(), 2, 1, ss.getLastColumn()).getValues()[0] | |
var std = names.length-1 | |
var date = Utilities.formatDate(new Date(), "GMT+7", "dd/MM/") | |
var year = Number(Utilities.formatDate(new Date(), "GMT+7", "yyyy"))+543 | |
var index = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dailyEventMessage() { | |
var googleCalendarId = "Your google calendar id"; | |
var calendar = CalendarApp.getCalendarById(googleCalendarId); | |
var today = new Date(); | |
var dailyEventList = calendar.getEventsForDay(today); | |
//Logger.log(dailyEventList); | |
var message = ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doGet(e) { | |
return HtmlService.createTemplateFromFile("index").evaluate() | |
} | |
function userClick(data) { | |
let ss = SpreadsheetApp.openById('xxx'); | |
let sheet = ss.getSheets()[0]; | |
let response = Maps.newGeocoder().reverseGeocode(data.lat, data.lon); | |
let geoAddress = response.results[0].formatted_address; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sheetId = "xxx" | |
var formId = "xxx" | |
function myFunction() { | |
var ss = SpreadsheetApp.openById(sheetId) | |
var sheet = ss.getSheetByName("xxx") | |
var form = FormApp.openById(formId) | |
var data = [...new Set(sheet.getDataRange().getDisplayValues().map(row=> row[1]))].join('|') | |
var item = form.getItems().filter(item=>item.getTitle() == 'รหัสนักเรียน')[0].asTextItem() | |
var pattern = `(${data})` |
OlderNewer