PHP

Zcodo Launches

I've got some exciting news. Over the weekend, Zcodo officially launched! Zcodo is a PHP5 framework built for rapid prototyping web applications that is based upon the Qcodo framework.

The motivation for creating Zcodo could more than fill this blog post. Suffice it to say that contributing to Qcodo was becoming difficult and my efforts for the last year to change this were uneffective.

Additionally, the future of QDrupal will be based upon Zcodo, so stay tuned for exciting news in that area.

http://zcodo.com

Print Stylesheet for Tasks Pro

Tasks ProI've started using Tasks Pro to keep track of my ToDo items around my house. I've used Tasks Pro off and on for work items for almost 3 years now and I'm wondering why I didn't do this before.

My wife and I follow the GTD principles "loosely". We first write all the items down in a notebook, then enter them into a local, 1-user copy of Tasks Pro. At this point, my wife asked if we could print out the list and stick it on the fridge. Great idea!

Unfortunately, Tasks Pro didn't have a nice print stylesheet. Given an hour on a lazy Sunday afternoon, this was easily fixed.  read more »

Custom QForm Control Tutorial - QIntegerSpinBox

The following is a tutorial on creating a custom QForm Control. QForms is a forms library and are a component of the Qcodo framework. Additionally, this control makes use of the excellent jQuery library and the SpinBox Control Plugin.

Overview
In this tutorial I lay out the steps necessary to create a new QControl. The control is very simple, but very useful. The control utilizes javascript to create a spin box, something you'd typically see in any GUI based toolkit.

For an example of the finished product, take a look at the control demonstration page.  read more »

How I build an application - Part 5 - User Interface Design

This article the 5th installment in of a series titled 'How I build an application'. You can find the other installments and subsection here.

Nothing is more critical then the User Interface (UI) of an application. All things come together in the UI. If your database design is top notch, but your UI sucks, your application sucks. Examples of this are all over the computer world.

That being said, I definitely wouldn't consider myself a great UI designer. I can achieve a passing grade, but there are giants in this field that I am constantly bowing to. I work much better with the bottom 90% of the application. I'm the guy who engineers the application with the care of a Ferrari mechanic, but has difficulty with designing the seat to perfectly fit with the driver in a way that makes the car feel like an extension of your body.  read more »

MySQL 5 Stored Procedure Examples with PHP

I've received a lot of interest from my previous post about MySQL Stored Procedures and PHP 5. So, I decided to set up an example archive of the stored procedures I've written for a Inventory Management project I'm currently working on. I've got 13 examples up so far, with more to come. Check it out.

Transaction Table

The transaction table is the core of the application. It records amounts of inventory moving from one area to another. It also implements a Single Table Inheritance pattern to capture data about different types of transactions.

<?php
--
--
Table structure for table `transaction`
--

CREATE TABLE `transaction` (
  `
transaction_id` int(10) unsigned NOT NULL auto_increment,
  `
debit_account_id` int(10) unsigned NOT NULL default '0',
  `
credit_account_id` int(10) unsigned NOT NULL default '0',
  `
created` datetime NOT NULL default '0000-00-00 00:00:00',
  `
date` date NOT NULL default '0000-00-00',
  `
category_id` int(10) unsigned NULL default '0',
  `
amount` double(10,2) NOT NULL default '0.00',
  `
memo` text,
  `
batch_number` int(10) default '0',
  `
unit_number` int(10) default '0',
  `
ia_number` int(10) default '0',
  `
fma_number` int(10) default '0',
  `
cases` int(10) default '0',
  `
html_tag` text,
 
PRIMARY KEY  (`transaction_id`),
 
KEY `IDX_transaction_debit_account_id` (`debit_account_id`),
 
KEY `IDX_transaction_credit_account_id` (`credit_account_id`),
 
KEY `IDX_transaction_category_id` (`category_id`),
 
KEY `IDX_transaction_batch_number` (`batch_number`),
 
KEY `IDX_transaction_unit_number` (`unit_number`),
 
KEY `IDX_transaction_ia_number` (`ia_number`),
 
KEY `IDX_transaction_fma_number` (`fma_number`),
 
KEY `IDX_transaction_cases` (`cases`),
 
KEY `IDX_transaction_date` (`date`),
 
KEY `IDX_transaction_created` (`created`)
)
ENGINE=InnoDB DEFAULT CHARSET=utf8;
?>

Inventory Management Project

I'm currently working on an Inventory Management project. The core is based on a very simple double entry accounting system. I've slowly been moving most of the heavy lifting of my business logic into procedures and this archive is the result.

MySQL 5 Stored Procedure Examples

As I've been experimenting more with MySQL's stored procedures, I have found that there are very few examples online. Questions I had about the stored procedures were difficult to answer. So, here's an archive of stored procedure examples that I have written for a current project. Hopefully they will help someone.

PHP 5 and MySQL 5 Stored Procedures Error and Solution with Qcodo

I've been working on a re-architecture of a project and I've been experimenting with using MySQL Stored Procedures for some of my business level logic. I'm using PHP 5.2.0, PHP's MySQLi Extension and MySQL 5.0, so stored procedures are new, but stable.

I also make use of the Qcodo ORM framework. Qcodo has support for both of the MySQL API's; Original Mysql and Mysqli. I created my first Stored Procedure using the following code:  read more »

How I build an application - Part 4 - Use Cases

This article the 4th installment in of a series titled 'How I build an application'. You can find the other two installments and subsection here.

I've written about my Idea, but before I get into the code, I need to flesh out how the idea is translated into a usable application a bit more. When I come up with an idea, I have a general page flow diagram in my head. Translating that in-memory page flow into code is generally straightforward, and most of the time I can simply sit down and code it.

For the use of this article, that brain dump process is hard to explain. The purpose of this article is to explain that process. Without further ado, here's my page flow diagram created in Microsoft Visio using their Use Case template set.  read more »