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 formSubmit(e) { | |
let info = e.namedValues | |
let pdfFile = createPDF(info) | |
let entryRow = e.range.getRow() | |
let ws = SpreadsheetApp.getActive().getSheets()[0] | |
let userMail = ws.getRange(entryRow, 2).getValue() | |
ws.getRange(entryRow, 6).setValue(pdfFile.getUrl()) | |
sendEmail(userMail, pdfFile) | |
} | |
function sendEmail(email, pdfFile){ |
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
* { | |
padding: 0; | |
margin: 0; | |
box-sizing: border-box; | |
} | |
body { | |
font-family: 'Poppins', sans-serif; | |
background-color: #f0f2f5; |
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
// ฟอร์มเว็บแอปแบบครบทุก input | |
function doGet() { | |
return HtmlService.createTemplateFromFile('index') | |
.evaluate() | |
.addMetaTag('viewport', 'width=device-width, initial-scale=1') | |
.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL) | |
} | |
function saveData(obj) { | |
var bdate = obj.data4.split("-") | |
var thaiDate = LanguageApp.translate(Utilities.formatDate(new Date(bdate[0], parseInt(bdate[1]) - 1, parseInt(bdate[2])), 'GMT+7', 'dd-MMMM-yyyy'), 'en', 'th').split('-').map((a, i) => { if (i != 2 || parseInt(a) > 2100) { return a }; a = parseInt(a) + 543; return a }).join(' ') |
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> | |
<base target="_top"> | |
<style> | |
body{ | |
height: 100vh; | |
display: flex; | |
justify-content: center; | |
align-items: center; |
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> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" | |
integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" | |
crossorigin="anonymous"> | |
<title>this is my web page</title> | |
<style> | |
body{ |
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 swal_html = ` | |
<div class="panel" style="background:aliceblue;font-weight:bold"> | |
<div class="panel-body"> | |
<div class="text-center"> | |
<table class="table"> | |
<tbody> | |
<tr> | |
<th scope="row">รหัสนักเรียน :</th> | |
<td>${result[0][0]}</td> | |
</tr> |
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> | |
<base target="_top"> | |
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" | |
integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous"> | |
<style> |
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(); | |
} | |
var ss= SpreadsheetApp.getActiveSpreadsheet(); | |
function getStudents(){ | |
var studentValues = ss.getSheets()[0].getDataRange().getValues(); | |
return studentValues; | |
} |
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(){ | |
return HtmlService.createTemplateFromFile('index').evaluate() | |
} | |
function formatMailBody(obj,order) { | |
var result = ""; | |
for (var idx in order) { | |
var key = order[idx]; | |
result += "<h4 style='text-transform: capitalize; margin-bottom: 0'>" + key + "</h4><div>" + sanitizeInput(obj[key]) + "</div>"; | |
} | |
return 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
function onOpen(){ | |
var ui = SpreadsheetApp.getUi(); | |
ui.createMenu('ส่งอีเมล') | |
.addItem('ส่งอีเมลพร้อมแนบไฟล์', 'sendPDFForm') | |
.addItem('ส่งอีเมลให้ทุกคน', 'sendFormToAll') | |
.addToUi(); | |
} | |
function sendPDFForm(){ | |
var row = SpreadsheetApp.getActiveSheet().getActiveCell().getRow(); |