/registrar

many-to-many relationship with Silex, PHP. Plus, Join Statement and Join Tables

Primary LanguagePHPGNU General Public License v3.0GPL-3.0

School Registrar

####A basic app practicing many-to-many relationships for a students and courses enrolled. 09/28/2016

By Anand Angalig

Description

The Registrar(user) is able to Create, Read, Update, and Delete courses and students. Also, he/she can enroll/drop students from a class and add/delete courses from a student's schedule.

Setup/Installation Requirements

  • If you wish to view the source code locally on your machine please follow the following steps:

    • Navigate to the directory in which you want the project to reside

    • Enter the following command into your terminal: git clone https://github.com/anandangalig/registrar.git

    • Navigate to the cloned directory, and execute the following command in the terminal: composer install

    • Start your local hosting program, such as MAMP, and set the Web Server preference to highest level of the downloaded repository file

    • To start the MySQL, go to the terminal and execute: /Applications/MAMP/Library/bin/mysql --host=localhost -uroot -proot

    • Using PHPMyAdmin, create a new Database named registrar, then import the registrar.sql.zip file

    • Start a new tab on the Terminal and navigate to the web directory and start your local host by executing the following command in your terminal: php -S localhost:8000

    • Open up the browser of your choice and go to the following url: http://localhost:8000/

    • If you wish to look at the source code, feel free to browse through the files in the directory

User Stories:

  • _As a user, he/she is able to create new courses and students

  • As a user, he/she is able to see the existing courses and students

  • As a user, he/she is able to update information of existing courses and students

  • As a user, he/she is able to delete courses and students one by one or all at once

  • As a user, he/she is able create relationships between the two courses:

    • _Any given student can be enrolled into or dropped from any existing class
    • Any given class can be added to or dropped from any student's schedule

MySQL Commands Used:

  • CREATE DATABASE registrar;
  • USE registrar;
  • CREATE TABLE courses (id serial PRIMARY KEY, name VARCHAR (255));
  • CREATE TABLE students (id serial PRIMARY KEY, name VARCHAR (255));
  • CREATE TABLE courses_students (id serial PRIMARY KEY, course_id INT, student_id INT);

Known Bugs

None for now, but please contact me if you find one

Support and Contact Details

Please feel free to contact us at: anandangalig@gmail.com

Technologies Used

  • silex v~2.0
  • twig v~1.0
  • phpunit v5.5.*
  • MAMP

License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Copyright (c) 2016 Anand Angalig