Академический Документы
Профессиональный Документы
Культура Документы
Documentation
Saleem 7/12/2010
Table of Contents
I. Installation.....................................................................................................................................................................3 II. COMMON ISSUES..........................................................................................................................................................5 III. Program Structure .......................................................................................................................................................6 MVC..............................................................................................................................................................................6 OOP ..............................................................................................................................................................................6 APPLICATION FLOW ......................................................................................................................................................6 FOLDER STRUCTURE......................................................................................................................................................6 IV. Presentation Files ........................................................................................................................................................8 HTML Files ....................................................................................................................................................................8 CSS files ........................................................................................................................................................................8 Javascript ......................................................................................................................................................................8 VII. More Details on MVC core ..........................................................................................................................................9
Please send me an email via my codecanyon profile page if you have any questions beyond the scope of this document.
http://codecanyon.net/user/23andwalnut
-Saleem El-Amin
I. Installation
1. In most cases, the installation wizard should be used to install Advanced Client Portal. You can access this wizard by navigating to the install/install.php once you have uploaded everything to your server.
Manual Installation
1. Database - To install this program you first need to create the database structure. To do this, first create a database (i.e. acp). You can do this via phpmyadmin or using the sql. a. CREATE database acp 2. Once you have created the database you need import acp.sql into into the newly created database 3. Config File - Once the database tables are set up navigate to the config folder and fill in appropriate values for ALL config items. The application will not work without these config options. You can find an explanation of each below.
Config Value DB_NAME Description
this is the name of the database you created in step one. Enter it between the single quotes i.e. define('DB_NAME', 'acp'); this is the username for your database connection. Your hosting provider can help you with this value if you are unsure. This is the db password. . Your hosting provider can help you with this value if you are unsure. The database hostname. . Your hosting provider can help you with this value if you are unsure. You shouldnt touch these variables unless you are planning on making changes to the functionality of the application This is the web url of your installation of Advanced Client Portal. For instance, if you uploaded the application to a directory named acp in your public_html directory, the base url would be http://www.yoursite.com/acp/ NOTE: DO NOT FORGET THE TRAILING SLASH
DB_USER
DB_PASSWORD
DB_HOST
$CONFIG[base_url]
This is the name of you company This is the name of you company This is the name of you company This is the name of you company This is the path to your logo file. This is used during the invoice generation process. The starting invoice number. Each new invoice created will increment this number by one. Location where documents are stored on the server. Web path to the document store maximum file upload size Whether or not to allow clients to upload documents.
$CONFIG[invoice][base_invoice_number]
4. Upload the entire Advance Client Portal folder to your sever. 5. Ensure that the folder ds has write permissions. (i.e. 777). Create two sub folders within ds one called thumbs and the other called invoices. Ensure both also have chmod settings of 777. 6. Navigate to the Advanced Client Portal folder and log in with username: admin and leave the password blank. NOTE: If the links in Advanced Clientele Portal appear to be broken, you have entered an incorrect value for Base URL in your config options.
MVC
OOP
This program also user Object Oriented Programming (OOP) to implement its Models and Controllers. A basic understanding of OOP is helpful if you plan on modifying this code.
APPLICATION FLOW
The basic application flow is as follows: 1. User types a url into the browser 2. Index.php receives the request, loads the config file, and passes the request to shared.php in the Core folder 3. Shared.php parses the url to get the desired Controller and Action (function in the controller object). 4. Shared.php loads the appropriate Controller using the __autoload() function. 5. Shared.php calls the appropriate function on the Controller object, passing any variables contained in the url. 6. The controller determines which model(s) need to be loaded to complete the request. 7. The controller calls a function on the model and passes the result data to the the view.
FOLDER STRUCTURE
1.
Core Contains shared.php as well as the base model and controller classes. All models and controllers are extensions of these bases classes Appliction a. Models The application Models b. Views The application views as well as images, css, and JavaScript c. Contollers The applications controllers Config Config files for the application Ds Abbreviation for document storage. This is the folder where any uploaded documents will be stored. This folder has a .htaccess file in it. This file is VERY important. It prevents the people from directly accessing the folder and downloading documents. All download requests are served through the Document controller to ensure only authorized individuals are able to download documents. It also protects one client from being able to access documents related to another clients account.
2.
3. 4.
5. 6.
Plugins Third party plugins such as flowplayer and fpdf for invoice generation Install The installation files. These should be deleted once the app is functioning correctly.
CSS files
There are two css files. Basic.css which has a css reset and some general styling. The majority of styling is handled in style.css.
Javascript
There are 2 javascript files. 1. jQuery is a Javascript library that greatly reduces the amount of code that you must write. 2. Main.js contains several jQuery plugins as well as some code I've written myself for this template. The jQuery plugins included in this file are jqModal for the modal windows and the jQuery color plugin. The custom functions set up event handlers for button clicks, and load forms via ajax for the modal boxes.
Shared.php the primary function of this file is to route browser requests to the appropriate controller. This is
performed in the callHook function.