Thursday, August 18, 2011

Path Finding in PHP

Lately create a path finding algorithm example using PHP for my junior to refer. Hopefully this code will also benefit others who look for same solution.

Saturday, May 28, 2011

Symfony Admin Generator Framework Skeleton

Symfony is a very useful PHP framework, specially the admin generator features! Just define the database schema, run few command and without writing a single code (errr.... sort of) the basic CRUD (Create Read Update Delete) functionality is ready! In addition, table listing, search features (with filtering function) and batch action is there too! It's amazing and thanks to Symfony developer effort on this.

However, the output still lack of other essential features like
  • Site header and site footer
  • User authentication, user account, user permission and user group.
  • Menu system
  • and so on....

Friday, May 13, 2011

PHP Pear Mail Test Kit

Requested by the support team, I had build a PHP page that able to test the functionality of the PHP Pear Mail module.



The features included
  • Validate installation of PEAR
  • Validate installation of PEAR Mail module
  • Support all send mail options that supported by PEAR Mail - mail, direct sendmail, SMTP.
  • Enable or disable SMTP authentication.
  • Full validation on user input
  • ALL in a SINGLE file, easy to install.


Thursday, March 31, 2011

Enhancement of jquery datetime plugin

The problem
Lately integrate jquery datetime v1.0.5 plugin (http://plugins.jquery.com/project/datetime) into my web app to let user choose both date and time. When using it, found a problem if below conditions is applied.
  1. Min date and Max date is set.
  2. Default date and time is the middle of min and max date and the default date is following month of min date.
  3. e.g. Min date is 28/04/2011, Max date is 30/06/2011 and default date is 30/04/2011 16:00.

The problem are
  1. The calender shown May calender as expected but the previous button is disable and user cannot back to April which the Min date is set.
  2. User can forward to additional two months after the Max date month, which mean this case the next button only disable when user access until month of August. However, user still cannot choose the date after the Max date.

Wednesday, January 19, 2011

Excel column label calculation (increment)

Sharing out the code that calculate the excel column label by increment. Suitable for any version of excel.

Sunday, January 16, 2011

IE8 : jquery : ajaxfileupload : Syntax Error: Unterminated string constant

The problem
Write a web app to upload a file, read the content then return the content in HTML table using JSON format then display the result dynamically at current HTML page. Below is the JSON return by a PHP script.
{filename: 'input.dat',total_recipient: '1',totalcolumn: '3',samples: '<table width="400px"><thead><tr><th>Column 1</th><th>Column 2</th><th>Column 3</th></tr></thead><tbody><tr><td>name</td><td>phone no</td><td>address</td></tr></tbody></table>',columntag: '{Col_1},{Col_2},{Col_3},'}
As usual it work perfectly on FF 3.5.3, but when come to IE8 I got the error message "Syntax Error: Unterminated string constant".

Saturday, January 15, 2011

IE8 : Object doesn't support this property or method

The problem
Try to load following html to IE8 then insert some text to the input box and click the button. It should just alert the text you had key in but it give a javascript error "Object doesn't support this property or method". Below code work perferly on FF 3.5.3.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>ID Test</TITLE>
<script type="text/javascript">
function testnow()
{
 inputvalue = document.getElementById('inputvalue').value;
 alert ("input value is ["+inputvalue+"]");
}
</script></HEAD>
<BODY>

<H3>Input Text</H3>
<input id="inputvalue" type="tet"></input>
<BR/>
<button onclick="testnow()">click me</button>
</BODY></HTML>