This file contains hidden or 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
SELECT | |
E.FIRST_NAME || ' ' || E.LAST_NAME AS "Employee", | |
EJ.JOB_TITLE AS "Employee Job Title", | |
ED.DEPARTMENT_NAME AS "Employee Department", | |
EDLC.COUNTRY_NAME AS "Employee Country", | |
E.SALARY AS "Employee Salary", | |
M.FIRST_NAME || ' ' || M.last_name AS "Manager", | |
-- MJ.JOB_TITLE as "Manager Job Title", | |
(SELECT count(X.EMPLOYEE_ID) | |
FROM EMPLOYEES X |
This file contains hidden or 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> | |
<title>Web Form</title> | |
<link rel='stylesheet' type='text/css' href='stylesheet.css'/> | |
<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'> | |
</head> | |
<body> | |
<div id="header"><h1>Contact Us!</h1></div> | |
<div id="wrapper"> |
This file contains hidden or 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 Declined = false; | |
if(Notice < 3){ | |
Declined = true; | |
} else if (Notice <6){ | |
NewSubmission["Notice"] = Notice.toString() + " days - £5 Fast track surcharge"; | |
} else { | |
NewSubmission["Notice"] = Notice.toString() + " days - No surcharge"; | |
} | |
This file contains hidden or 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
// create Javascript Date Object of Date entered | |
var OrderFor = new Date(NewSubmission["Month"] + " " + NewSubmission["Day"] + ", " + NewSubmission["Year"]); | |
var Submitted = new Date(e.values[0]); | |
// milliseconds between two dates divided by milliseconds in a day, rounded down | |
var Notice = Math.floor((OrderFor.getTime() - Submitted.getTime()) / (1000 * 60 * 60 * 24)); |
This file contains hidden or 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 logIncomingEmails() { | |
var EmailLog = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Email Log") | |
var rows = EmailLog.getDataRange(); | |
var numEmailRows = rows.getNumRows(); | |
var Unlogged = GmailApp.getUserLabelByName("Unlogged") | |
var Logged = GmailApp.getUserLabelByName("Logged") | |
var UnloggedThreads = Unlogged.getThreads(0,50); // Returns an array of the first 50 unlogged threads. Hopefully there won't be more than 50 per minute! | |
This file contains hidden or 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
// Create string version of date entered to be read by humans | |
NewSubmission["Delivery Date"] = NewSubmission["Day"] + "-" + NewSubmission["Month"] + "-" + NewSubmission["Year"]; | |
// create Javascript Date instance from date string | |
var OrderFor = new Date(NewSubmission["Month"] + " " + NewSubmission["Day"] + ", " + NewSubmission["Year"]); | |
// These properties aren't needed as we have NewSubmission["Delivery Date"] which is DD-MM-YYYY | |
delete NewSubmission["Day"]; | |
delete NewSubmission["Month"]; |
This file contains hidden or 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
/* ----- CREATE NEWSUBMISSION OBJECT ----- */ | |
var NewSubmission = {}; | |
var Properties = ["Section One: Product Details","Size","Style","Filling","Topping","Decoration", | |
"Section Two: Delivery Details","First name","Family name","Email Address","Address","Delivery","Day","Month","Year"]; | |
var i = 0; | |
var iSkip = 0; | |
This file contains hidden or 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
/* ----- BUILD HTML RESPONSE TABLE ----- */ | |
var HTMLtable = "<table style=\"border:2px solid black;width:500\" >"; | |
var rowCount = 0; | |
for (var property in NewSubmission) { | |
if(NewSubmission[property].length != 0){ | |
if(property.substring(0,7) === "Section"){ | |
HTMLtable += "<tr><th colspan=\"2\" bgcolor=\"#c7ced4\">"+ property +"</th></tr>"; | |
} else { |
This file contains hidden or 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 CakeOrder(e){ | |
/* ----- CREATE NEWSUBMISSION OBJECT ----- */ | |
var NewSubmission = {}; | |
This file contains hidden or 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
<table style="border:2px solid black;width:500"> | |
<tbody> | |
<tr><th colspan="2" bgcolor="#c7ced4">Section One: Product Details</th></tr> | |
<tr bgcolor="#d0eaf9"><td>Size</td><td>10" - £25</td></tr> | |
<tr><td>Style</td><td>Victoria Sponge Cake</td></tr> | |
<tr bgcolor="#d0eaf9"><td>Filling</td><td>Strawberry Jam</td></tr> | |
<tr><td>Topping</td><td>Buttercream</td></tr> | |
<tr bgcolor="#d0eaf9"><td>Decoration</td><td>Marshmallows, Strawberries, "Happy Birthday!"</td></tr> | |
<tr><th colspan="2" bgcolor="#c7ced4">Section Two: Delivery Details</th></tr> | |
<tr bgcolor="#d0eaf9"><td>First name</td><td>Joe</td></tr> |