Nimbin[12]?Web & Tools / dienstplancreator / js/database/institutions.js

dienstplancreator git · main

Dienstplan (roster) creator, PHP/JS web app

php javascript roster web · first commit 2023-07-13 · last commit 2023-09-14 (3 years ago) · synced 3 days ago · upstream: github.com/nimbin2/dienstplancreator

JavaScript 50% PHP 40.5% CSS 8.5%
git clone https://git.christianimmanuel.de/web-tools/dienstplancreator.gitwget https://git.christianimmanuel.de/web-tools/dienstplancreator/archive/dienstplancreator.tar.gz
js/database/institutions.js 1.6 KB · 53 lines raw
dbAdd_institution = async (name, yearweek) => {
    let response = await fetch("/api/institution/add.php", {
		method: "POST",
		body: JSON.stringify({name: name, yearweek: yearweek}),
		headers: {
		"Content-Type": "application/json; charset=UTF-8"
		}
    })
    return await response.json()
}
dbGet_institution = async (id) => {
	let response = await fetch("/api/institution/get.php", {
		method: "POST",
		body: JSON.stringify({id: id}),
		headers: {
		"Content-Type": "application/json; charset=UTF-8"
		}
	})
	return await response.json()
}
dbGet_institutions = async () => {
    let response = await fetch("/api/institution/getAll.php", {
		method: "POST",
		headers: { "Content-Type": "application/json; charset=UTF-8" }
	})
	return await response.json()
}
dbSwitch_institution = async (id) => {
	let response = await fetch("/api/institution/switch.php", {
		method: "POST",
		body: JSON.stringify({id: id}),
		headers: { "Content-Type": "application/json; charset=UTF-8" }
	})
	return await response.json()
}
dbSwitchAs_institution = async (id, as) => {
	let response = await fetch("/api/institution/switchAs.php", {
		method: "POST",
		body: JSON.stringify({id: id, as: as}),
		headers: { "Content-Type": "application/json; charset=UTF-8" }
	})
	return await response.json()
}
dbRemove_institution = async (data_id, password) => {
    let response = await fetch("/api/institution/remove.php", {
		method: "POST",
		body: JSON.stringify({data_id: data_id, password: password}),
		headers: {
		"Content-Type": "application/json; charset=UTF-8"
		}
    })
	return await response.json()
}