Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

loCal

Searchable Google Calendar Database by Sam Kessler and Catie Rose Pate

[Illustrated Instructions] (https://github.com/skesslr/loCal/blob/master/documentation.pdf)

Overview

The program for loCal uses a combination of PHP, HTML, JavaScript and SQL. The files are organized with MVC--the public folder generally handles controllers, views takes care of the view and layout, and the SQL database in finalProject.sql handles models needed.

loCal was created as a project for Harvard’s CS50 course, and uses the CS50-provided library in the vendor folder.

How it Works

The includes folder contains config.php and helpers.php. Includes comes from CS50. The files in includes are both referenced throughout the code. The config file is referenced at the top of the public folder’s files. It redirects users who aren't logged in to the Log In page and sets up the website so it can access the CS50 code inside vendor. The helpers file contains a series of functions that are used throughout the program: apologize sends out apology messages that will be displayed in an apology.php file from the views folder; dump is used for error/debugging purposes, and logs errors from the arguments into dump.php in the views folder; logout destroys a session after it ends; redirect takes users to another URL; render passes values saved and displays the view between the header and footer. The vendor folder, the CS50 php file contains functions for initializing the CS50 library at a path and a function that handles SQL queries.

Inside public are files that control how the website interacts with the user--they’re largely written in php. The css folder, though, has a bootstrap file for using bootstrap components, and a styles css file to control layout. The styles sheet is linked in header so it can be used in the other web pages. The files in fonts allow the code to access other fonts than basic ones. The file image contains a png file of the loCal logo. The JS folder contains files related to JavaScript and JQuery for both the website and Bootstrap.

The remaining php files are controllers. The add_folder file in public first displays an add_folder_form from views, then takes the input (for the folder name) and uses it to add a new folder to the SQL folders database, along with the user id and calendar id. The add_to_folder file first displays an add_to_folder form from views that takes input for the calendar, and then adds a calendar into a folder in the folders database in SQL. The delete_folder files first calls the delete_folder_form from views to get which folder to delete, then removes the folder from the folders SQL database. The folder file gets folder and tag information to pass to the calendar_list file in views to show all calendars inside of the folder. The index file is the home page, which stores calendar and tag information for all saved calendars. The info is passed to calendar_list in views to show the table. The login file first calls the login_form.1 form for users to fill out, then compares username and password input with users database, and then sets the session id to that user. The logout file calls the logout() helper function described above from includes and redirects to the login page. The password file first calls the password_form file in views, then it checks the old password you provided, and sets it to the new one if it matches the confirmation. The register file first calls the register_form file in views, then it adds a user to the users database and logs them in. The remove file deletes a calendar from the calendars, tags, folders, and history databases. The save file adds a calendar into the user's saved library by adding it to the history SQL database.

The search first compares the input to the calendars database's calendar names, then the tag database's tags. Then, it stores the info in positions, and passes that to the search_results view form. The search_results view form loops through the information passed from search in $positions and displays it all in a table. The share file first presents share_form from views, passing the calendar_link and recipient's email address back to share_confirmation, which has a button to send the link to that email address. The tag file either calls the tag_form file in views, which remembers the calendar name and requests a tag name, or it adds the tag and calendar into a new row in the tags database. The unsave file deletes the specific row from history linking the user and calendar. The upload file first calls the upload_form file in views, then uses the input for calendar name and address (and, if applicable, tag and description) and inserts the calendar into the calendars database. If there tag was filled out, the calendar and tag are added to the tags database as well. The uploads file gets the calendar info for a user's uploads from the calendars database, then passes them to uploaded_calendars in views. The view_cal passes the calendar_id to the calendar_viewer file in views, which embeds an iframe from Google containing a particular Google Calendar. The calendar_list in views is used for a view for most of the calendar tables in the website, just with different information in $positions passed in. It takes the info from $positions and loops through each calendar provided, filling in the table.

The header includes all of the css and javascript links required. The rest of header is a navigation bar with buttons, a button, two dropdowns and a search form (from Bootstrap). The Folders dropdown uses a SQL query to loop through and show all of the folders the user has created. The footer just has a small note added to the bottom of the page.

About

Searchable, user-curated calendar database w/ PHP and mySQL

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages