init summer progess

This commit is contained in:
darkicewolf50 2023-10-20 15:47:23 -06:00
parent 6c06ac6e8f
commit 4bb15f459b
4 changed files with 213 additions and 0 deletions

Binary file not shown.

58
reinbursementform.html Normal file
View File

@ -0,0 +1,58 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<meta name="description" content="Local form for students to get reinbured in a intelligent way">
<title>Reinbursement Form</title>
<link rel="stylesheet" href="subfolder1/subfolder2/style.css">
</head>
<body>
<nav>
<h1>Reinbursement Form</h1>
</nav>
<div class="MainContent">
<aside></aside>
<article>
<p>
This standardizes all of our reciepts that we recieve and logs them away so that we can easily get the money you spent on the club back to you.
</p>
<p>Please put the amount on the reciept we will split the bill on food for you no need to go through mental gymnatics</p>
<div>
<h4>Name (Last name if there is someone who shares your name)</h4>
<input type="text" placeholder="Scott Webber">
</div>
<div>
<h4>Final Total on reciept $(CAD) </h4>
<input type="number" placeholder="200 (no $ sign needed)">
</div>
<div>
<h4>Reason (optional)</h4>
<input type="text" placeholder="What is it for? (optional)">
</div>
<div>
<h4>Picture or PDF of reciept</h4>
<input id="fileInput" type="file">
</div>
<div id="buttonDiv">
<button id="submitButton" type="button" onclick="buttonClick()">Submit</button>
</div>
</article>
<aside id="rightSide"></aside>
</div>
<footer>
<p>© Schulich Off-Road (BAJA)</p>
</footer>
<script src="subfolder1/subfolder2/JSconertToStandardForm.js"></script>
</body>
</html>

View File

@ -0,0 +1,76 @@
//import fs from 'fs';
const submitButton = document.getElementById("submitButton");
const inputBoxes = document.getElementsByTagName("input");
const buttonClick = async (event) => {
submitButton.disabled = true;
submitButton.innerText = "Working...";
submitButton.style.backgroundColor = 'grey';
submitButton.classList.add('disabled');
submitButton.style.cursor = 'not-allowed';
var inputValues = [];
for (let key in inputBoxes) {
if (inputBoxes[key].value == undefined) {
break;
}
inputValues.push(inputBoxes[key].value);
}
let date = new Date();
var month = (date.getMonth() + 1).toString();
var day = date.getDate().toString();
var year = date.getFullYear().toString();
var currentDate = month + day + year;
let fileWrite = inputValues[0] + currentDate;
let fileExt = getFileExtension(inputValues[3]);
fileWrite += "." + fileExt;
inputValues.push(fileWrite);
console.log( inputValues)
//fake delay
await Fakedelay(5000)
console.log("fake delay");
submitButton.disabled = false;
submitButton.innerText = "Submit";
submitButton.style.backgroundColor = 'green';
submitButton.style.cursor = '';
isButtonDisabled = false;
// Need to send to the synology server through the back end...
};
function getFileExtension(fileName) {
const lastDotIndex = fileName.lastIndexOf(".");
if (lastDotIndex === -1 || lastDotIndex === fileName.length - 1) {
return "bad"; // No extension found or the dot is at the end of the filename
}
return fileName.slice(lastDotIndex + 1);
}
const sendForm = async (toSend) => {
if (1) {
return 1;
}
else {
const res = await fetch("http://jsonplaceholder.typicode.com/todos", {
method: "POST",
body: JSON.stringify({
stuff: 1,
lots: "of stuff"
}),
headers: {
"Optional": "no"
}
});
}
//to do finish this off so that it works
}
function Fakedelay(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}

View File

@ -0,0 +1,79 @@
body {
display: flex;
flex-direction: column;
border: 0px;
margin: 0px;
}
nav {
flex-direction: row;
}
nav h1 {
flex: 1;
text-align: center;
font-size: xx-large;
font-weight: normal;
}
aside {
flex-grow: 1;
height: 100px;
flex-direction: row;
}
article {
width: 70%;
flex-direction: row;
}
article div {
padding-bottom: 5%;
}
h4 {
padding-left: 1%;
padding-bottom: 10px;
margin: 0px;
font-weight: normal;
font-size: larger;
}
input {
padding-top: 0px;
font-size: x-large;
}
button {
font-size: xx-large;
justify-content: center;
}
footer {
display: flex;
padding-top: 2%;
justify-content: center;
}
.MainContent {
display: flex;
flex-direction: row;
justify-content: center;
}
#rightSide {
justify-content: end;
}
#fileInput {
font-size: large;
}
#buttonDiv {
display: flex;
justify-content: center;
}
#submitButton {
background-color: green;
padding: 1%;
border-radius: 15%;
}