Development Guide

This is a guide to coding practices for QReRP

General Layout

QReRP uses a single page UI that has a <div> that is changed via AJAX.

All CSS and JavaScript Required must be loaded in the head of /Index.php.

The Page Content is done via the changeContent(PageID) method in my.js. The PageId is queried against the pagelookup Table. The Page's Titles and current Address is returned(This allows page relocation without any headaches). Then the Page itself is fetched. All pages are just the content(ie no <head> or <body>) and are in the form of a PHP echo (So all the content will be inside an echo statement).

Styles

This project uses both Metro UI CSS and Bootstrap for styles and controls. The look is to be like the Metro UI but some components are used from Bootstrap as it has the wider range of advanced components.

Variables

Variables are written in camelCase. If a variable is found that is not camelCase, please post it on Github as an issue (tag it as invalid).

Features and Development

Please open a discussion if you have any questions or want any advice. Open a discussion about features you would like to add, so everybody can give suggestions so that version 1 will be as good as it could be. It is also a good idea to do it to prevent double work.(You can also open an issue labelled improvement and assign it to yourself) Please open all discussions and issues on GitHub A discussion can be opened on Github by opening an issue and labelling it Help Wanted.

Database

The database is posted here with the model (.mwb) To use this model, open the model with MySQL Workbench and go Database -> Forward Engineer. A connection might have to be setup to your development MySQL. The database name is coolfusion. That will be changed, but it is low priority.

SQL Queries

All SQL Queries are done through /sql_query.php. Herte is how it works:

require("sql_query.php");
$connection=connect();
$sql="My SQL Query here"
$result=query($connection,$sql);


This is to a) prevent the login credentials from being embedded in the page (the login credentials will be moved to a config file later) and b) To prevent SQL injection (The injection prevention code will still be added to sql_query.php)

Authorisation

Authorisation to the application and pages is done via auth.php For development purposes, this is switched off. Before it is released the code will be added to the pages. If you require more than "permission to access this page" protection, please open a discussion.

Page ID's

Page ID's are kept in CSV format in the root of the project.

Last edited May 5, 2014 at 11:30 PM by JacquesLoubser, version 7