Optimus Funding - a case study
Project description: Create an application that allows a member to log in and choose from three real estate marketing templates, input and upload property data and photographs, enter realtor and company info, create multiple custom loan scenarios and then view, approve, and print the completed template to pdf for immediate distribution. Final document will be automatically logged and stored for future use or reference.
This project utilizes the power of PHP coupled with a MySQL database to create a truly dynamic solution that enables publishing complex documents, with pixel perfect positioning on the fly. It includes user registration and authentication, the ability to upload images while creating a thumbnail simultaneously, and generate personalized documents in Portable Document Format (pdf).
Create user registration and login capabilities. Restricting access is mission-critical from a security perspective, and preventing malicious attacks is always a key priority when designing a server-based application. So a registration/login portal was needed to restrict access strictly to members. Of course, this also required the ability to retreive a forgotten password by emailing to the user a server-generated temporary one. A "change password" function was also developed for added security. For those who were new to the site, the ability to register as a new member was also provided.
Create an icon based "breadcrumbs" system. Because of the lengthy multi-form data input process, it was important to create a visual system where the user could track his/her progress, view what parts of the process they've completed, and see what's next in the process.
A color-coded system was developed where "green" indicated which parts were completed, "blue" indicated where the user was in the data input process, and "grey" denoted areas that still needed to be completed.
Designing an effective database with SQL. Taking pen to paper and creating an efficient database design is the crucial, first step in linking data to the web. It needs to be simplicity itself with data confined to tables that represent the lowest common denominator of information needed. Related information stored in this way is capable of being sorted and parsed in a multitude of ways without redundancy and can be searched with a wide range of criterion, returning results with absolute specificity in the blink of an eye.
The data is then called upon to aquire the results in a specific way using "queries" to the SQL database. The information is then displayed via PHP in the final template layout
Creating a bunch of forms that can think. One of the challenges was developing a set of forms to capture only the data that was needed to complete the desired template without extraneous information and collecting it in the database. It was also crucial to build forms for the loan scenarios which would automatically calculate interest and tax rates.
Saving input with session control. Because of the amount of data needed, it was important to be able to track a user during a single session on the website. This required code that generated a unique session ID, a cryptographically random number that is referred to as a "cookie". Cookies can be used to remember a user's data throughout the session and are also capable of recalling specific data in the future.
Developing an application with file upload functionality. At this point image upload capability was developed to aquire image files needed for the chosen template. It was neccesary to upload a higher resolution file for the final pdf output, but additionally, a lower resolution file or "thumbnail" was needed to be used in the online review process to prevent unneeded overhead to the server. A custom function was developed to create both files and save them to two locations simultaneously. It's important to note that at no time were the images themselves stored in the database just verbose filenames which reference them on the server. The actual images were stored in the "images" directory on the server to further reduce overhead.
FPDF. Where the rubber meets the road. FPDF is a PHP class which allows developers to generate PDF files with pure PHP. This is where the printable hi-rez pdf "final template" is created. FPDF is a PHP class which extends PHP's capability. It is "open source" and is therefore free to use, unlike Adobe's PDFlib library which is fee-based. FPDF's feature set is limited and can't do everything PDFlib does, but it's capabilities were more than sufficient for this project.
The awesome power of the database. All of this dynamic goodness could not be possible without the MySQL database. Although there are many server solutions for projects big and small, none is more widely accessible on servers far and wide...
...and the technology's free. PHP, MySQL, and FPDF are all "open source" applications that are free to use and enjoyed by a host of developers worldwide. There is a broad base of support on the web and a large user community adding to the literature daily.
So now that you know what this application can do, why not set up a membership, log in, and create the brochure template of your choice to see the many things your website can be capable of.
Try out the Optimus Funding web application now.