Bloom Schedule (working name) is a simple PHP-based web app designed to be used as an easy way for members and staff to create, modify and remove bookings for the two meeting rooms currently residing in the Bloom Lab. It's split into two seperate components; an API for data manipulation and a web front-end.
Eventually the goal is to have a screen either mounted on the wall or placed near the meeting rooms allowing Bloom Lab members and staff to identify current and scheduled meetings, their duration and if the room is free or not. Users can then proceed to a web page on their personal devices to create, modify or remove their own bookings.
Spilt into three seperate components (interface, dashboard & API) it is simple to either run the complete “system” on one device, or seperate it among different devices. For example the interface and API can run off a server, and the dashboard could run off a Raspberry Pi attached to a display.
- Clone / fork / download this Git repo
- Copy the component that you want to install to where you’d like it
composer install
to grab all of the required frameworks- Configure the database settings and you’re ready to go!
To be written.
To be written.
The API is built upon the Slim PHP micro-framework using the standard REST design principle.
GET -> /booking/all
- Returns the details of all current and future bookings
SELECT *
FROM bookings
WHERE `booking_start` > CURRENT_TIMESTAMP
GET -> /booking/next/:room
- Returns the details of the next bookings for room number of :room
SELECT *
FROM bookings
WHERE `booking_start` > CURRENT_TIMESTAMP
AND `booking_room` = :room
LIMIT 1
GET -> /booking/:id
- Return the details of the booking an id of :id
SELECT *
FROM bookings
WHERE (booking_id = :id)
LIMIT 1
GET -> /statistics/bookings
- Return total amount of bookings managed by the system
{
"category": "statistics",
"type": "bookings",
"content": {
"total_results": "1"
}
}
... more to come.
{
"category": "booking",
"type": "booking_details",
"content": {
"booking_id": "1",
"booking_title": "My cool booking!",
"booking_author": "John Appleseed"
}
}
We've formed a database connection in /core/database.php
using the newer PDO methodology. It's mostly self-explanatory in the classes that have already been created, but if you'd like to explore further into database queries feel free to research-up!
Below is a query that would fetch the entire bookings
table as an array.
// Create MySQL database connection
$database = Database::getFactory()->getConnection();
// Create & prepare our SQL ready to execute
$sql = "SELECT * FROM bookings";
$query = $database->prepare($sql);
// Execute our query
$query->execute();
// Fetch the result as an array & return
return $query->fetchAll()
Feel free to take a look at CONTRIBUTORS.md for some guidelines on contributing.
Copyright 2015 © Bloom Labs, Inc. & Damian J Worsdell
Distribution, modification or use of this source code without
permission from Bloom Labs, Inc. It is strictly forbidden under any
circumstance. By using it you agree to the terms of use and service.