var today = new Date(); var expDate = new Date($("#cart-expyear").val(),($("#cart-expmonth").val()-1)); // JS Date Month is 0-11 not 1-12 grrr if(today.getTime() > expDate.getTime()) { messages.push("Your Card is expired. Please check expiry date."); }
Developer How to
Yii, Jquery, PHP, Developer stuffs
Thursday, 4 September 2014
Javascript / Jquery Credit Card Month Expiry Date Validator
Wednesday, 30 July 2014
Apache Create Subdomain Yii2 Advanced template
- Edit httpd.conf
<VirtualHost *:80>
ServerName example.com
DocumentRoot /var/www/html/frontend/web
</VirtualHost>
<VirtualHost *:80>
ServerName admin.example.com
DocumentRoot /var/www/html/backend/web
</VirtualHost>
Wednesday, 2 July 2014
Thursday, 28 November 2013
Yii Model beforeSave insert timestamp
public function beforeSave() {
if (parent :: beforeSave()) {
if ($this->isNewRecord) {
$this->created = new CDbExpression('NOW()');
} else {
$this->modified = new CDbExpression('NOW()');
}
return true;
} else {
return false;
}
}
if (parent :: beforeSave()) {
if ($this->isNewRecord) {
$this->created = new CDbExpression('NOW()');
} else {
$this->modified = new CDbExpression('NOW()');
}
return true;
} else {
return false;
}
}
Wednesday, 5 June 2013
Send file via sftp using PHP
- Download and enable php_ssh2 extension for php http://downloads.php.net/pierre/
$connection=@ssh2_connect("host", 22);
@ssh2_auth_password($connection,"username","pass");
ssh2_scp_send($connection, 'file', 'file', 0644);
Monday, 27 May 2013
Connect Drupal and Alfresco
- Download CMIS API Module http://drupal.org/project/cmis
- Download Alfresco http://www.alfresco.com/products/community
- Add at ./sites/default/settings.php the following:
- Configure module root directory add " \ "
'default' => array(
'user' => 'user',
'password' => 'password',
'url' => 'http://127.0.0.1:8080/alfresco/s/cmis',
)
);
Subscribe to:
Posts (Atom)