Archives

You are currently viewing archive for 27 July 2007
Category: Web dev
Posted by: hajime osako

function Validator()
{
// Constructor

// Declare Properties
this.regExpPatterns = new Object();
this.errMsgs = new Object();

// Declare Methods
this.validate = function(elm, ptn, msg)
{
var _str = null;

if(!ptn && elm.name && _parent.regExpPatterns[elm.name])
{
ptn = this.regExpPatterns[elm.name];
}

...
}

this.setAlertErr = function(bool)
{
this.alertErr = bool;
}

this.getAlertErr = function()
{
return this.alertErr;
}
}

OR

var Validator = new Function();

Validator.prototype.field1 = XXXXXX;
Validator.prototype.method1 = function (param1, param2)
{
[snip]
}
Category: Web dev
Posted by: hajime osako
Category: Web dev
Posted by: hajime osako
Blog.okuryu : PHP の array_multisort で多次元配列をソートする
$tmpOrderBy1 = array();
$tmpOrderBy2 = array();

foreach($dbResult as $key=>$row)
{
   $tmpOrderBy1[$key] = $row[orderby_column_1];
   $tmpOrderBy2[$key] = $row[orderby_column_2];
}

array_multisort($tmpOrderBy1, SORT_DESC, $tmpOrderBy2, SORT_ASC, $dbResult);