Subscribe to PHP

PHP

Zcodo Launches

Submitted by mikehostetler on Mon, 03/31/2008 - 10:18

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

Submitted by mikehostetler on Tue, 07/31/2007 - 10:27

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.

Custom QForm Control Tutorial - QIntegerSpinBox

Submitted by mikehostetler on Fri, 05/04/2007 - 12:59

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.

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.

MySQL 5 Stored Procedure Examples with PHP

Submitted by mikehostetler on Thu, 04/26/2007 - 09:25

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

Submitted by mikehostetler on Thu, 04/26/2007 - 08:38

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 <code>transaction</code>
--

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

Inventory Management Project

Submitted by mikehostetler on Thu, 04/26/2007 - 08:29

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.

Taxonomy upgrade extras: 

MySQL 5 Stored Procedure Examples

Submitted by mikehostetler on Thu, 04/26/2007 - 08:26

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.

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:

How I build an application - Part 4 - Use Cases

Submitted by mikehostetler on Thu, 04/05/2007 - 13:42

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.

Pages