Having to paste my flow in two different posts, as my flow has too man characters for me to post.
[{"id":"96fd6a7d.c63498","type":"tab","label":"Insert Data","disabled":false,"info":""},{"id":"f1d7872.a535978","type":"tab","label":"Update Room Service Details","disabled":false,"info":""},{"id":"4b79a9e1.930808","type":"tab","label":"Update Job Status","disabled":false,"info":""},{"id":"59723f02.6eb58","type":"tab","label":"Delete Job","disabled":false,"info":""},{"id":"c0c65810.b182e8","type":"tab","label":"Delete Multiple Job","disabled":false,"info":""},{"id":"8f30f009.b5868","type":"tab","label":"Job Sheet View","disabled":false,"info":""},{"id":"89e61aba.e37948","type":"tab","label":"Room Details View","disabled":false,"info":""},{"id":"60521f83.f8f7b","type":"tab","label":"Logo/Clock","disabled":false,"info":""},{"id":"e33cf5ce.702c38","type":"tab","label":"Print Room Details","disabled":false,"info":""},{"id":"f9150fa9.cd9d9","type":"ui_tab","z":"","name":"Insert Data Form","icon":"dashboard"},{"id":"9209fcda.2a276","type":"ui_tab","z":"","name":"Update Job Status Form","icon":"dashboard"},{"id":"2f16bd17.730e62","type":"ui_group","z":"","name":"Update Job Status Form","tab":"9209fcda.2a276","disp":true,"width":"10","collapse":false},{"id":"286accf2.0a2684","type":"ui_group","z":"","name":"Insert Data Form","tab":"f9150fa9.cd9d9","disp":true,"width":"18","collapse":false},{"id":"b6e1647e.b46cf8","type":"ui_tab","z":"","name":"Delete Job(s)","icon":"dashboard"},{"id":"f7845451.ab1928","type":"ui_group","z":"","name":"Delete Job(s)","tab":"b6e1647e.b46cf8","disp":true,"width":"6","collapse":false},{"id":"d3b284a4.4789d8","type":"ui_group","z":"","name":"Delete Range of Jobs","tab":"b6e1647e.b46cf8","disp":true,"width":"6","collapse":false},{"id":"4249f4b5.c1e67c","type":"ui_base","theme":{"name":"theme-custom","lightTheme":{"default":"#0094CE","baseColor":"#0094CE","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":true,"reset":false},"darkTheme":{"default":"#097479","baseColor":"#097479","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":true,"reset":false},"customTheme":{"name":"Untitled Theme 1","default":"#4B7930","baseColor":"#4B7930","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","reset":false},"themeState":{"base-color":{"default":"#4B7930","value":"#4B7930","edited":true},"page-titlebar-backgroundColor":{"value":"#4B7930","edited":false},"page-backgroundColor":{"value":"#ffffff","edited":true},"page-sidebar-backgroundColor":{"value":"#000000","edited":false},"group-textColor":{"value":"#6db046","edited":false},"group-borderColor":{"value":"#ffffff","edited":true},"group-backgroundColor":{"value":"#ffffff","edited":true},"widget-textColor":{"value":"#000000","edited":true},"widget-backgroundColor":{"value":"#4b7930","edited":true},"widget-borderColor":{"value":"#ffffff","edited":true},"base-font":{"value":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"}}},"site":{"name":"Node-RED Test","hideToolbar":"false","allowSwipe":"false","dateFormat":"DD/MM/YYYY","sizes":{"sx":48,"sy":48,"gx":6,"gy":6,"cx":6,"cy":6,"px":0,"py":0}}},{"id":"2295c3a9.1f063c","type":"ui_tab","z":"","name":"View Job List","icon":"dashboard"},{"id":"1cd4729b.9f3d3d","type":"ui_group","z":"","name":"View Job List","tab":"2295c3a9.1f063c","disp":false,"width":"45","collapse":false},{"id":"d953186c.a7d5c8","type":"ui_group","z":"","name":"IMAGE TEST","tab":"f9150fa9.cd9d9","disp":false,"width":"10","collapse":false},{"id":"4d1b2b02.436164","type":"sqldbsdatabase","z":"","host":"92.19.221.177","port":"58970","db":"Node-Red-Test","dialect":"mssql"},{"id":"2a3481b.b28c27e","type":"ui_tab","z":"","name":"Home","icon":"dashboard"},{"id":"8b75b2f1.a3a93","type":"ui_tab","z":"","name":"Home","icon":"dashboard"},{"id":"d7fcbd21.6b69","type":"ui_group","z":"","name":"Default","tab":"481d99b4.0944b8","order":1,"disp":false,"width":"24","collapse":false},{"id":"481d99b4.0944b8","type":"ui_tab","z":"","name":"Home","icon":"dashboard"},{"id":"9d3bde2e.93e0e","type":"ui_group","z":"","name":"Default","tab":"60481216.c7f81c","order":1,"disp":false,"width":"24","collapse":false},{"id":"60481216.c7f81c","type":"ui_tab","z":"","name":"Home","icon":"dashboard"},{"id":"48cdc586.7ea4cc","type":"sqldbsdatabase","z":"","host":"den1.mssql1.gear.host","port":"","db":"NodeRED","dialect":"mssql"},{"id":"8774aa52.582258","type":"ui_group","z":"","name":"Refresh Table Button","tab":"2295c3a9.1f063c","disp":true,"width":"6","collapse":false},{"id":"fe8ed0e.7d4c23","type":"ui_group","z":"","name":"testhtmltable","tab":"2295c3a9.1f063c","disp":true,"width":"6","collapse":false},{"id":"7fa153e8.0fe2ac","type":"ui_group","z":"60521f83.f8f7b","name":"Test","tab":"cc6b2063.6309a","disp":true,"width":"6"},{"id":"cc6b2063.6309a","type":"ui_tab","z":"60521f83.f8f7b","name":"Tableau","icon":"dashboard"},{"id":"ce9ab745.f7e638","type":"ui_tab","z":"","name":"TEST HTML","icon":"dashboard"},{"id":"ea45c694.e08838","type":"ui_group","z":"","name":"TEST HTML","tab":"ce9ab745.f7e638","disp":true,"width":"24","collapse":false},{"id":"52d57e96.19ad2","type":"ui_group","z":"","name":"testbutton","tab":"ce9ab745.f7e638","disp":true,"width":"6","collapse":false},{"id":"2c7b3846.112ef8","type":"ui_group","z":"8f30f009.b5868","name":"Test","tab":"6ab1c155.0ba37","disp":true,"width":"6"},{"id":"6ab1c155.0ba37","type":"ui_tab","z":"8f30f009.b5868","name":"Tableau","icon":"dashboard"},{"id":"7acb1847.eb0198","type":"ui_group","z":"8f30f009.b5868","name":"Test","tab":"7bce3531.10e80c","disp":true,"width":"6"},{"id":"7bce3531.10e80c","type":"ui_tab","z":"8f30f009.b5868","name":"Tableau","icon":"dashboard"},{"id":"9658156f.6123a8","type":"ui_group","z":"","name":"html test insert data","tab":"d823f2d.c619a1","disp":true,"width":"16","collapse":false},{"id":"d823f2d.c619a1","type":"ui_tab","z":"","name":"formtest","icon":"dashboard"},{"id":"2ed1fbb9.386894","type":"sqldbsdatabase","z":"","host":"den1.mssql4.gear.host","port":"","db":"passwordstore1","dialect":"mssql"},{"id":"da5b4143.bafe2","type":"ui_tab","z":"","name":"Update Room Verification Details","icon":"dashboard"},{"id":"f52915c8.50e0d8","type":"ui_group","z":"","name":"Update Room Verification Details","tab":"da5b4143.bafe2","disp":true,"width":"14","collapse":false},{"id":"fd6bd779.9718a8","type":"ui_tab","z":"","name":"Room Details View","icon":"dashboard"},{"id":"e9326d39.818f3","type":"ui_group","z":"","name":"Room Details View","tab":"fd6bd779.9718a8","disp":false,"width":"18","collapse":false},{"id":"727d1296.809b7c","type":"ui_tab","z":"","name":"Print Room Details","icon":"dashboard"},{"id":"69501d5f.4e7c24","type":"ui_group","z":"","name":"Print Room Details","tab":"727d1296.809b7c","disp":true,"width":"12","collapse":false},{"id":"621a532f.312ebc","type":"serial-port","z":"","serialport":"/dev/ttyUSB0","serialbaud":"9600","databits":"8","parity":"none","stopbits":"1","newline":"\\n","bin":"false","out":"char","addchar":false},{"id":"19ba3e9a.8622c1","type":"serial-port","z":"","serialport":"/dev/ttyS0","serialbaud":"9600","databits":"8","parity":"none","stopbits":"1","newline":"\\n","bin":"false","out":"char","addchar":false},{"id":"42ad1cb1.442a54","type":"serial-port","z":"","serialport":"/dev/ttyUSB0","serialbaud":"115200","databits":"8","parity":"none","stopbits":"1","newline":"\\n\\r","bin":"false","out":"char","addchar":false},{"id":"8bfc3ba5.33b868","type":"ui_group","z":"","name":"SMS","tab":"4fb130cf.66888","order":1,"disp":true,"width":"6"},{"id":"39690297.acfb5e","type":"serial-port","z":"","serialport":"/dev/ttyUSB0","serialbaud":"115200","databits":"8","parity":"none","stopbits":"1","newline":"\\n\\r","bin":"false","out":"char","addchar":false},{"id":"4fb130cf.66888","type":"ui_tab","z":"","name":"SMS","icon":"dashboard"},{"id":"497925b0.375a6c","type":"serial-port","z":"","serialport":"/dev/ttyACM1","serialbaud":"57600","databits":"8","parity":"none","stopbits":"1","newline":"\\n\\r","bin":"false","out":"char","addchar":false},{"id":"2b410239.157a8e","type":"debug","z":"96fd6a7d.c63498","name":"","active":true,"console":"false","complete":"false","x":1230,"y":340,"wires":[]},{"id":"56795fca.e675b","type":"sqldbs","z":"96fd6a7d.c63498","mydb":"48cdc586.7ea4cc","querytype":"Insert","name":"","x":1080,"y":340,"wires":[["2b410239.157a8e"]]},{"id":"46df93bf.0dbb4c","type":"function","z":"96fd6a7d.c63498","name":"Insert Data","func":"msg.topic = \"INSERT INTO dbo.NodeREDData (Topic, JobType, Information, Timestamp, Status) VALUES ('Job', '\" + msg.payloaddata[\"Room Number\"] + \"', '\" + msg.payloaddata[\"Insert Room Service Items\"] + \"', current_timestamp, 'Not Completed')\";\nreturn msg ;","outputs":1,"noerr":0,"x":950,"y":400,"wires":[["56795fca.e675b"]]},{"id":"2b579eb.7793a62","type":"debug","z":"96fd6a7d.c63498","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":230,"y":60,"wires":[]},{"id":"ea5b69a8.194a78","type":"debug","z":"4b79a9e1.930808","name":"","active":true,"console":"false","complete":"false","x":1110,"y":340,"wires":[]},{"id":"43825bb1.896a24","type":"function","z":"4b79a9e1.930808","name":"Update Status","func":"msg.topic = \" UPDATE dbo.NodeREDData SET Status ='\" + msg.payload[\"Job Status\"] + \"' WHERE id =\" + msg.payload.ID + \" \" ;\nreturn msg;","outputs":1,"noerr":0,"x":520,"y":260,"wires":[["8cceb9c.5468b48"]]},{"id":"8cceb9c.5468b48","type":"sqldbs","z":"4b79a9e1.930808","mydb":"48cdc586.7ea4cc","querytype":"update","name":"","x":920,"y":240,"wires":[["ea5b69a8.194a78"]]},{"id":"8ad69a4e.381c98","type":"sqldbs","z":"59723f02.6eb58","mydb":"48cdc586.7ea4cc","querytype":"delete","name":"","x":474,"y":145,"wires":[["46e6435c.0b612c"]]},{"id":"80833bc8.63da68","type":"function","z":"59723f02.6eb58","name":"Delete Job","func":"msg.topic = \"DELETE FROM dbo.NodeREDData WHERE id='\" + msg.payload[\"Delete Job ID\"] + \"' \"\nreturn msg;","outputs":1,"noerr":0,"x":302,"y":104,"wires":[["8ad69a4e.381c98"]]},{"id":"46e6435c.0b612c","type":"debug","z":"59723f02.6eb58","name":"","active":true,"console":"false","complete":"false","x":670,"y":200,"wires":[]},{"id":"4e6eb0fa.1d64d","type":"sqldbs","z":"c0c65810.b182e8","mydb":"48cdc586.7ea4cc","querytype":"delete","name":"","x":610,"y":180,"wires":[["75aaf0e0.42043"]]},{"id":"8876730c.5a39b","type":"function","z":"c0c65810.b182e8","name":"Delete Multiple Jobs","func":"var from = parseInt(msg.payload.From);\nvar to = parseInt(msg.payload.To);\n\nif (!isNaN(from) && !isNaN(to) && from <= to) {\n var myIdArray = [];\n for (var i = from; i <= to; i++) {\n myIdArray.push(i);\n }\n \n var list = \"'\"+myIdArray.join(\"','\")+\"'\";\n msg.topic = \"DELETE FROM dbo.NodeREDData WHERE id in ( \" + list + \" )\";\n} else {\n \n}\nreturn msg;","outputs":1,"noerr":0,"x":400,"y":400,"wires":[["4e6eb0fa.1d64d","c7924919.64a208"]]},{"id":"c7924919.64a208","type":"debug","z":"c0c65810.b182e8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"topic","x":640,"y":440,"wires":[]},{"id":"75aaf0e0.42043","type":"debug","z":"c0c65810.b182e8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":830,"y":100,"wires":[]},{"id":"5e8bed59.6ae074","type":"ui_form","z":"96fd6a7d.c63498","name":"","label":"","group":"286accf2.0a2684","order":0,"width":0,"height":0,"options":[{"label":"Room Number","value":"Room Number","type":"number","required":true},{"label":"Password","value":"Password","type":"password","required":true},{"label":"Email","value":"Email","type":"email","required":true},{"label":"Please Enter Room Service Items","value":"Insert Room Service Items","type":"text","required":true}],"formValue":{"Room Number":"","Password":"","Email":"","Insert Room Service Items":""},"payload":"","topic":"","x":70,"y":60,"wires":[["2b579eb.7793a62","8fc65b7a.001d18"]]},{"id":"e91de804.7760f8","type":"ui_form","z":"59723f02.6eb58","name":"","label":"Delete Job","group":"f7845451.ab1928","order":0,"width":0,"height":0,"options":[{"label":"Please Enter Job ID","value":"Delete Job ID","type":"text","required":true}],"formValue":{"Delete Job ID":""},"payload":"","topic":"","x":80,"y":80,"wires":[["80833bc8.63da68"]]},{"id":"64f71f6f.adf67","type":"ui_form","z":"4b79a9e1.930808","name":"","label":"Update Job Status Form","group":"2f16bd17.730e62","order":0,"width":0,"height":0,"options":[{"label":"Please Enter Job ID","value":"ID","type":"text","required":true},{"label":"Please Enter Job Status","value":"Job Status","type":"text","required":true}],"formValue":{"ID":"","Job Status":""},"payload":"","topic":"","x":130,"y":220,"wires":[["43825bb1.896a24"]]},{"id":"d2710457.11ce48","type":"ui_form","z":"c0c65810.b182e8","name":"","label":"Delete Range of Job(s)","group":"d3b284a4.4789d8","order":0,"width":0,"height":0,"options":[{"label":"From ID (Lowest)","value":"From","type":"text","required":true},{"label":"To ID (Highest)","value":"To","type":"text","required":true}],"formValue":{"From":"","To":""},"payload":"","topic":"msg.payload","x":140,"y":120,"wires":[["8876730c.5a39b"]]},{"id":"6096793e.844ff8","type":"ui_template","z":"60521f83.f8f7b","group":"9d3bde2e.93e0e","name":"Logo / Clock","order":0,"width":0,"height":0,"format":"<script id=\"clockScript1\" type=\"text/javascript\">\n var clockInterval;\n $(function () {\n if (clockInterval) return;\n\n //add logo\n var div1 = $('<div/>');\n var logo = new Image();\n\n logo.src = '/logo.png'\n logo.height = 60;\n div1[0].style.margin = '4px auto';\n\n div1.append(logo);\n\n //add clock\n var div2 = $('<div/>');\n var p = $('<p/>');\n\n div2.append(p);\n div2[0].style.margin = '5px';\n\n function displayTime() {\n p.text(new Date().toLocaleString());\n }\n \n clockInterval = setInterval(displayTime, 1000);\n\n //add to toolbar when it's available\n var addToToolbarTimer;\n \n function addToToolbar() {\n var toolbar = $('.md-toolbar-tools');\n \n if(!toolbar.length) return;\n \n toolbar.append(div1);\n toolbar.append(div2);\n clearInterval(addToToolbarTimer);\n }\n addToToolbarTimer = setInterval(addToToolbar, 100);\n });\n</script>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"global","x":610,"y":220,"wires":[[]]},{"id":"ad489ccd.214b4","type":"sqldbs","z":"8f30f009.b5868","mydb":"48cdc586.7ea4cc","querytype":"select","name":"","x":580,"y":380,"wires":[["faa83741.810758","ad5d0c56.3bd9c"]]},{"id":"860a7750.bd0788","type":"debug","z":"8f30f009.b5868","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":610,"y":500,"wires":[]},{"id":"f975dbc3.e13668","type":"function","z":"8f30f009.b5868","name":"TEST","func":"msg.topic = \"SELECT * FROM dbo.NodeRedData ORDER BY id DESC\";\nreturn msg;","outputs":1,"noerr":0,"x":410,"y":220,"wires":[["ad489ccd.214b4","acedeb7f.0f8f28"]]},{"id":"acedeb7f.0f8f28","type":"debug","z":"8f30f009.b5868","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":370,"y":280,"wires":[]},{"id":"faa83741.810758","type":"change","z":"8f30f009.b5868","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[0]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":460,"wires":[["860a7750.bd0788"]]},{"id":"ad5d0c56.3bd9c","type":"change","z":"8f30f009.b5868","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[0]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":380,"wires":[["72dfa212.5c91fc"]]},{"id":"228b227e.eab39e","type":"comment","z":"8f30f009.b5868","name":"SELECTS DATA FROM MY MSSQL DATABASE","info":"","x":560,"y":180,"wires":[]},{"id":"eef9f24b.ecad6","type":"comment","z":"8f30f009.b5868","name":"CHANGES ARRAY FROM 2 TO 1","info":"","x":730,"y":420,"wires":[]},{"id":"4c3ce79c.3446f8","type":"debug","z":"8f30f009.b5868","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":990,"y":640,"wires":[]},{"id":"42a3b34d.1ff3ac","type":"template","z":"8f30f009.b5868","name":"HTML TABLE","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<!DOCTYPE html>\n<html>\n \n<table>\n <tr>\n <th>id</th>\n <th>Topic</th>\n <th>Room Number</th>\n <th>Information</th>\n <th>Status</th>\n <th>Timestamp</th>\n </tr>\n \n {{#payload}}\n <tr>\n <td>{{{id}}}</td>\n <td>{{{Topic}}}</td>\n <td>{{{JobType}}}</td>\n <td>{{{Information}}}</td>\n <td>{{{Status}}}</td>\n <td>{{{Timestamp}}}</td>\n </tr>\n{{/payload}}\n</table>\n</html>","output":"str","x":1040,"y":560,"wires":[["eeab512c.21c3","4c3ce79c.3446f8"]]},{"id":"618b88df.0ecc18","type":"debug","z":"8f30f009.b5868","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1050,"y":460,"wires":[]},{"id":"8099c9a4.c7d558","type":"debug","z":"8f30f009.b5868","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1280,"y":800,"wires":[]},{"id":"eeab512c.21c3","type":"ui_template","z":"8f30f009.b5868","group":"1cd4729b.9f3d3d","name":"","order":0,"width":"24","height":"12","format":"<style>\n {{msg.style}}\n</style>\n<div ng-bind-html=\"msg.payload\"></div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1240,"y":740,"wires":[["8099c9a4.c7d558"]]},{"id":"72dfa212.5c91fc","type":"template","z":"8f30f009.b5868","name":"css test","field":"style","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"table {\n font-family: \"Trebuchet MS\", Arial, Helvetica, sans-serif;\n border-collapse: collapse;\n width: 100%;\n}\n\n td, th {\n border: 1px solid #ddd;\n padding: 8px;\n text-align: center;\n}\n\ntr:nth-child(even){background-color: #f2f2f2;}\n\ntr:hover {background-color: #ddd;}\n\nth {\n padding-top: 12px;\n padding-bottom: 12px;\n text-align: center;\n background-color: #4CAF50;\n color: white;\n}","output":"str","x":870,"y":480,"wires":[["42a3b34d.1ff3ac","618b88df.0ecc18"]]},{"id":"8c1ebd25.92b2c","type":"sqldbs","z":"96fd6a7d.c63498","mydb":"2ed1fbb9.386894","querytype":"select","name":"","x":240,"y":240,"wires":[["15276dc3.6c3692","b082f444.eba688"]]},{"id":"59801652.ff3628","type":"function","z":"96fd6a7d.c63498","name":"Verification Attempt","func":"msg.topic = \"(SELECT COUNT(1) FROM dbo.passwordstore WHERE Room = '\" + msg.payloaddata[\"Room Number\"] + \"' AND Password = '\" + msg.payloaddata[\"Password\"] + \"' AND Email = '\" + msg.payloaddata[\"Email\"] + \"')\";\nreturn msg;","outputs":1,"noerr":0,"x":190,"y":180,"wires":[["f438b290.f5cac","8c1ebd25.92b2c"]]},{"id":"15276dc3.6c3692","type":"debug","z":"96fd6a7d.c63498","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":410,"y":240,"wires":[]},{"id":"f438b290.f5cac","type":"debug","z":"96fd6a7d.c63498","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":350,"y":180,"wires":[]},{"id":"cccc60ec.0c8ea","type":"switch","z":"96fd6a7d.c63498","name":"","property":"payload","propertyType":"msg","rules":[{"t":"nnull"},{"t":"null"}],"checkall":"true","repair":false,"outputs":2,"x":510,"y":440,"wires":[["46df93bf.0dbb4c","5d6d5fec.486ea"],[]]},{"id":"de2dfea7.31529","type":"debug","z":"96fd6a7d.c63498","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":470,"y":360,"wires":[]},{"id":"5b4f362b.60b8c8","type":"debug","z":"f1d7872.a535978","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1130,"y":260,"wires":[]},{"id":"5c0493b3.5539bc","type":"function","z":"f1d7872.a535978","name":"Update Status","func":"msg.topic = \"UPDATE dbo.PasswordStore SET Password ='\" + msg.payload[\"Password\"] + \"', Email ='\" + msg.payload[\"Email\"] + \"' WHERE Room =\" + msg.payload.Room + \" \";\nreturn msg;","outputs":1,"noerr":0,"x":560,"y":180,"wires":[["c0e0107e.030ab","dc673607.2b7f88"]]},{"id":"c0e0107e.030ab","type":"sqldbs","z":"f1d7872.a535978","mydb":"2ed1fbb9.386894","querytype":"update","name":"","x":960,"y":160,"wires":[["5b4f362b.60b8c8"]]},{"id":"3fc40630.40ffca","type":"ui_form","z":"f1d7872.a535978","name":"","label":"Update Room Verification Details Form","group":"f52915c8.50e0d8","order":0,"width":0,"height":0,"options":[{"label":"Please Enter Room Number","value":"Room","type":"text","required":true},{"label":"Please Enter New Password","value":"Password","type":"text","required":true},{"label":"Please Enter Customer's Email","value":"Email","type":"email","required":true}],"formValue":{"Room":"","Password":"","Email":""},"payload":"","topic":"","x":210,"y":140,"wires":[["5c0493b3.5539bc"]]},{"id":"dc673607.2b7f88","type":"debug","z":"f1d7872.a535978","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":680,"y":300,"wires":[]},{"id":"8fc65b7a.001d18","type":"change","z":"96fd6a7d.c63498","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"payloaddata","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":150,"y":120,"wires":[["59801652.ff3628","2a88acbd.889884"]]},{"id":"2a88acbd.889884","type":"debug","z":"96fd6a7d.c63498","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":310,"y":120,"wires":[]},{"id":"b55c797a.c22ce8","type":"inject","z":"8f30f009.b5868","name":"","topic":"","payload":"","payloadType":"date","repeat":"10","crontab":"","once":true,"onceDelay":0.1,"x":150,"y":80,"wires":[["f975dbc3.e13668"]]},{"id":"143d7157.97da0f","type":"sqldbs","z":"89e61aba.e37948","mydb":"2ed1fbb9.386894","querytype":"select","name":"","x":580,"y":360,"wires":[["3b7785f2.f5c64a","652fecd.ff02e14"]]},{"id":"8f17a114.f9a7","type":"debug","z":"89e61aba.e37948","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":590,"y":480,"wires":[]},{"id":"98082811.34df38","type":"function","z":"89e61aba.e37948","name":"TEST","func":"msg.topic = \"SELECT * FROM dbo.PasswordStore ORDER BY Room ASC\";\nreturn msg;","outputs":1,"noerr":0,"x":390,"y":200,"wires":[["143d7157.97da0f","d163c08f.bef25"]]},{"id":"d163c08f.bef25","type":"debug","z":"89e61aba.e37948","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":350,"y":260,"wires":[]},{"id":"3b7785f2.f5c64a","type":"change","z":"89e61aba.e37948","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[0]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":440,"wires":[["8f17a114.f9a7"]]},{"id":"652fecd.ff02e14","type":"change","z":"89e61aba.e37948","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[0]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":360,"wires":[["d81141ab.11aaa"]]},{"id":"636b7cac.9429d4","type":"comment","z":"89e61aba.e37948","name":"SELECTS DATA FROM MY MSSQL DATABASE","info":"","x":540,"y":160,"wires":[]},{"id":"470d35.f5fbb2cc","type":"comment","z":"89e61aba.e37948","name":"CHANGES ARRAY FROM 2 TO 1","info":"","x":710,"y":400,"wires":[]},{"id":"6f9e886d.a51358","type":"debug","z":"89e61aba.e37948","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":970,"y":620,"wires":[]},{"id":"435bd0ac.b6f7","type":"template","z":"89e61aba.e37948","name":"HTML TABLE","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<!DOCTYPE html>\n<html>\n \n<table>\n <tr>\n <th>Room</th>\n <th>Password</th>\n <th>Email</th>\n </tr>\n \n {{#payload}}\n <tr>\n <td>{{{Room}}}</td>\n <td>{{{Password}}}</td>\n <td>{{{Email}}}</td>\n </tr>\n{{/payload}}\n</table>\n</html>","output":"str","x":1020,"y":540,"wires":[["37c9fe49.3b8fd2","6f9e886d.a51358"]]},{"id":"fa6f2ebb.54465","type":"debug","z":"89e61aba.e37948","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1030,"y":440,"wires":[]},{"id":"ee52337.3002dd","type":"debug","z":"89e61aba.e37948","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1260,"y":780,"wires":[]},{"id":"37c9fe49.3b8fd2","type":"ui_template","z":"89e61aba.e37948","group":"e9326d39.818f3","name":"","order":0,"width":"0","height":"0","format":"<style>\n {{msg.style}}\n</style>\n<div ng-bind-html=\"msg.payload\"></div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1220,"y":720,"wires":[["ee52337.3002dd"]]},{"id":"d81141ab.11aaa","type":"template","z":"89e61aba.e37948","name":"css test","field":"style","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"table {\n font-family: \"Trebuchet MS\", Arial, Helvetica, sans-serif;\n border-collapse: collapse;\n width: 100%;\n}\n\n td, th {\n border: 1px solid #ddd;\n padding: 8px;\n text-align: center;\n}\n\ntr:nth-child(even){background-color: #f2f2f2;}\n\ntr:hover {background-color: #ddd;}\n\nth {\n padding-top: 12px;\n padding-bottom: 12px;\n text-align: center;\n background-color: #4CAF50;\n color: white;\n}","output":"str","x":850,"y":460,"wires":[["435bd0ac.b6f7","fa6f2ebb.54465"]]},{"id":"43bcd993.d067c8","type":"inject","z":"89e61aba.e37948","name":"","topic":"","payload":"","payloadType":"date","repeat":"10","crontab":"","once":true,"onceDelay":0.1,"x":130,"y":60,"wires":[["98082811.34df38"]]},{"id":"21c436b.97a5aca","type":"ui_toast","z":"96fd6a7d.c63498","position":"dialog","displayTime":"3","highlight":"","outputs":1,"ok":"OK","cancel":"","topic":"Successful!","name":"Success pop-up","x":800,"y":480,"wires":[["4703e91e.cba818"]]},{"id":"5d6d5fec.486ea","type":"change","z":"96fd6a7d.c63498","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Your room service request was successful!","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":440,"wires":[["21c436b.97a5aca"]]},{"id":"b082f444.eba688","type":"change","z":"96fd6a7d.c63498","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[0]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":300,"wires":[["6b5e003a.99b","cea9b283.2c41d"]]},{"id":"6b5e003a.99b","type":"debug","z":"96fd6a7d.c63498","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":430,"y":300,"wires":[]},{"id":"4703e91e.cba818","type":"debug","z":"96fd6a7d.c63498","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":950,"y":480,"wires":[]},{"id":"cea9b283.2c41d","type":"function","z":"96fd6a7d.c63498","name":"Return Value 1 or Null","func":"var array = msg.payload;\nif (msg.payload[0][\"\"]== \"1\") {\n return [ msg, null ];\n} else {\n return [null, msg ];\n}\nreturn msg1, msg2;","outputs":2,"noerr":0,"x":280,"y":360,"wires":[["cccc60ec.0c8ea","de2dfea7.31529"],["ed1ae462.b8e6e8"]]},{"id":"4fb4d54d.be0fec","type":"ui_toast","z":"96fd6a7d.c63498","position":"dialog","displayTime":"3","highlight":"","outputs":1,"ok":"OK","cancel":"","topic":"Error","name":"","x":190,"y":520,"wires":[["95a4d5ee.342008"]]},{"id":"ed1ae462.b8e6e8","type":"change","z":"96fd6a7d.c63498","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Your room details have been entered incorrectly. Please try again, or if you have lost your room details, please contact Reception.","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":180,"y":460,"wires":[["4fb4d54d.be0fec","7e6bc4c0.748bdc"]]},{"id":"7e6bc4c0.748bdc","type":"debug","z":"96fd6a7d.c63498","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":330,"y":460,"wires":[]},{"id":"95a4d5ee.342008","type":"debug","z":"96fd6a7d.c63498","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":330,"y":520,"wires":[]},{"id":"70c0317e.13625","type":"ui_form","z":"e33cf5ce.702c38","name":"","label":"","group":"69501d5f.4e7c24","order":0,"width":0,"height":0,"options":[{"label":"Please enter the room number to which you want the details for.","value":"Room","type":"text","required":true},{"label":"Please enter the customer's phone number to send their details via text.","value":"number","type":"text","required":false},{"label":"Please enter customer email.","value":"Cust","type":"text","required":false}],"formValue":{"Room":"","number":"","Cust":""},"payload":"","topic":"","x":90,"y":40,"wires":[["78382508.b5fe0c"]]},{"id":"be3a89ad.e11128","type":"function","z":"e33cf5ce.702c38","name":"TEST","func":"msg.topic = \"SELECT * FROM dbo.PasswordStore WHERE Room='\" + msg.payload[\"Room\"] + \"'\";\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":140,"wires":[["15dc12f7.530d8d","b6a4d2b3.42f3a"]]},{"id":"15dc12f7.530d8d","type":"debug","z":"e33cf5ce.702c38","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":330,"y":240,"wires":[]},{"id":"9a86b8ee.b96d08","type":"template","z":"e33cf5ce.702c38","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"<!DOCTYPE html>\n<html>\n <head>\n{{#payload}}\n <h1>Room Number - {{{Room}}}</h1>\n </head>\n<body>\n <p>Email Address - {{{Email}}}</p>\n <p>Password - {{{Password}}}</p>\n </body>\n{{/payload}}\n</html>","output":"str","x":710,"y":120,"wires":[["4d69f146.2c893"]]},{"id":"b6a4d2b3.42f3a","type":"sqldbs","z":"e33cf5ce.702c38","mydb":"2ed1fbb9.386894","querytype":"select","name":"","x":420,"y":180,"wires":[["e3e0c534.d99248"]]},{"id":"e3e0c534.d99248","type":"change","z":"e33cf5ce.702c38","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[0]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":260,"wires":[["9a86b8ee.b96d08","a845b7d1.537638","8a566658.164d78","cd79aed6.49609"]]},{"id":"5b83f32.386c30c","type":"e-mail","z":"e33cf5ce.702c38","server":"smtp.gmail.com","port":"465","secure":true,"name":"","dname":"","x":910,"y":40,"wires":[]},{"id":"4d69f146.2c893","type":"change","z":"e33cf5ce.702c38","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"Your Room Details","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":80,"wires":[["5b83f32.386c30c","3e8d67bc.a6ba68"]]},{"id":"8075de99.fc67c","type":"serial out","z":"e33cf5ce.702c38","name":"","serial":"497925b0.375a6c","x":1260,"y":280,"wires":[]},{"id":"cd79aed6.49609","type":"function","z":"e33cf5ce.702c38","name":"Send to number","func":"var num = msg.number;\nvar at_cmd = \"AT+CMGS=\\\"\"+num+\"\\\"\";\n\nmsg.payload=at_cmd+\"\\r\";\n\nreturn msg;","outputs":1,"noerr":0,"x":960,"y":260,"wires":[["8075de99.fc67c","e35a4486.f1d668"]]},{"id":"10f94766.829f59","type":"serial in","z":"e33cf5ce.702c38","name":"","serial":"497925b0.375a6c","x":240,"y":480,"wires":[["23338114.0aadce"]]},