Skip to content

A scheduling solution for Bloom's two meeting rooms

Notifications You must be signed in to change notification settings

bloomlabs/bloom-schedule

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bloom Schedule

About

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.

Goals

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.

The Idea

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.

Getting Started

  • 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!

Web App

To be written.

Dashboard

To be written.

API

The API is built upon the Slim PHP micro-framework using the standard REST design principle.

Bookings

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

Statistics

GET -> /statistics/bookings - Return total amount of bookings managed by the system

{
  "category": "statistics",
  "type": "bookings",
  "content": {
	"total_results": "1"
  }
}

... more to come.

Other API details

Example API response

{
  "category": "booking",
  "type": "booking_details",
  "content": {
	"booking_id": "1",
	"booking_title": "My cool booking!",
	"booking_author": "John Appleseed"
  }
}

Database connection

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()

Contributing

Feel free to take a look at CONTRIBUTORS.md for some guidelines on contributing.

License

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.


Bloom Labs logo

About

A scheduling solution for Bloom's two meeting rooms

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published