if( !$form->isValid($this->getRequest()->getPost()) ) { return; } // Process $values = $form->getValues(); if( ($CouponCode = $form->getElement(‘coupon_code’)) && isset($values[‘coupon_code’])) { $iCouponExist = $table->checkCouponExist($values[‘coupon_code’]); if($iCouponExist == 1) { return $CouponCode->addError(‘This Coupon Code is not available, please use another one.’); } }
zend framework group by select in socialengine
$viewer = Engine_Api::_()->user()->getViewer(); $iCurUser = $viewer->getIdentity(); $oSelect = $this->getAdapter()->select() ->from(‘engine4_job_usersapplied’, array(‘job_id’, ‘COUNT(job_id) as applied_count’)) ->group(‘job_id’) ->where(‘job_user = ?’, $iCurUser); $result = $this->getAdapter()->fetchAll($oSelect);
batch file renaming in ubuntu
In Ubuntu bulk file renaming or batch file renaming is not easy as like in windows. We need to install packages for easy renaming of file names. One of the best package found suitable for ubuntu file renaming is “pyRenamer” Install pyRenamer – sudo apt-get install pyrenamer. Take pyRenamer from Accessories->pyRenamer.pyRenamer has different options for…
Maximum range of varchar in MySQL
Varchar() is a datatype in MySQL. The length of Varchar() is varies from 0 – 65,535. The important feature of this data type is ,it only using the bytes wants to store data,no wastage of memory.
jquery file upload-restrict number of files
Parameter: maxNumberOfFiles: 1 jQuery(‘#fileupload-1’).fileupload({ dataType: ‘json’, autoUpload : true, sequentialUploads:true, uploadTemplateId: ”, downloadTemplateId: ”, crossDomain: true, maxNumberOfFiles: 1, });