Вы находитесь на странице: 1из 9

Advanced Client Portal

Documentation

23rd and Walnut

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

USER RIGHTS VARIABLES

$CONFIG[base_url]

$CONFIG[company][name] $CONFIG[company][address] $CONFIG[company][address_2] $CONFIG[company][phone] $CONFIG[company][logo]

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]

$CONFIG[uploads][path] $CONFIG[uploads][web_path] $CONFIG[uploads][max_file_size] $CONFIG[uploads][allow_client_uploads]

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.

II. COMMON ISSUES


1. Uploading If your uploads are failing, there are several server related settings you should check. If you are unsure how to make changes to these values, you should contact your hosting provider. a. upload_max_filesize in php ini b. post_max_size in php.ini c. max_execution_time d. memory_limit 2. White screen This means that PHP is throwing a fatal error. The most likely case is incorrect DB information. You can view the error by setting DEVELOPMENT ENVIRONMENT = true in the config file. Once you have identified, and fixed the error, you should change this setting back to false. 3. Broken links If the links arent working, verify your value for Base Url in the config file and make sure it has a trailing slash

III. Program Structure


This program uses the Model View Controller design pattern. MVC is an architectural pattern used in software engineering. The pattern isolates "domain logic" (the application logic for the user) from input and presentation (GUI), permitting independent development, testing and maintenance of each. The model handles the applications business and database logic. The view is the presentation layer (i.e HTML). The controller handles all requests from the browser, loads the appropriate models, and passes information to the view to be displayed to the user. You can read more about MVC at the following link: http://en.wikipedia.org/wiki/Modelviewcontroller

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.

IV. Presentation Files


HTML Files
This section pertains to the Views in the application. There is no formal template system, but the views are loaded via the loadView function on the controller object. This function accepts the name of a view as a parameter. The load view function does the following: includes header.php, includes the requested view, includes footer.php then sends everything to the browser.

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.

VII. More Details on MVC core


Model.class.php Base for all models and has all database functions (i.e. connect, query, select, etc.) Controller.class.php Base for all controllers and has several important functions you should be aware of.
loadModel($model) this function creates a new object for the model you would like to use. For example, loadModel(Client) will create a new instance of the Client object. loadView(view_name) this function loads a view by including the desired view file. For example, loadView(new_project), will have the same effect as the following three lines of php: include header.php; include new_project.php include footer.php set(name, $value) this function creates a variable named name that has a value of $value. This allows us to pass variables to our view files. alert() This method allows you to display messages to the user. There are three types of messages. Success, Notice, and Error. Redirect(controler/action) This function allows you to redirect the user to a different controller/action pair. It helps control application flow. Logged_in() This function determines if a user is logged in, and returns a $user object with user details if they are.

Shared.php the primary function of this file is to route browser requests to the appropriate controller. This is
performed in the callHook function.

Вам также может понравиться