Beispiel #1
0
 /**
  * Checks to see if this form has been correctly submitted. Will revalidate by default.
  *
  * @param bool[optional] $revalidate Do we need to enforce validation again, even if it might already been done before?
  * @return bool
  */
 public function isCorrect($revalidate = true)
 {
     return parent::isCorrect($revalidate);
 }
Beispiel #2
0
 }
 if (!in_array($frm->getField('gender')->getValue(), array('', 'male', 'female'))) {
     $frm->getField('gender')->setError('Please choose from the list only!');
 }
 if (!in_array($frm->getField('blood')->getValue(), array('', 'O+', 'A+', 'B+', 'AB+', 'O-', 'A-', 'B-', 'AB-'))) {
     $frm->getField('blood')->setError('Please choose from the list only!');
 }
 if ($frm->getField('height')->isFilled()) {
     $frm->getField('height')->isNumeric('Digits only please! eg: 180');
     //it needs to be numeric!
 }
 if ($frm->getField('weight')->isFilled()) {
     $frm->getField('weight')->isNumeric('Digits only please! eg: 80');
     //it needs to be numeric!
 }
 if ($frm->isCorrect()) {
     if ($frm->getField('photo')->isFilled()) {
         $imagename = uniqid();
         SpoonFile::setContent(IMAGE_PATH . '/' . $imagename . '.' . $frm->getField('photo')->getExtension(), SpoonFile::getContent($frm->getField('photo')->getTempFileName()));
         //create Thumbnail
         $frm->getField('photo')->createThumbnail(IMAGE_PATH . '/' . $imagename . '_thumbnail.' . $frm->getField('photo')->getExtension(), 130, 130);
     }
     $company = "";
     for ($i = 1; $i < 6; $i++) {
         $company .= $frm->getField('company' . $i)->getValue() . ', ' . $frm->getField('registerno' . $i)->getValue() . ', ' . $frm->getField('companyno' . $i)->getValue() . ', ' . $frm->getField('companyemail' . $i)->getValue() . ', ' . $frm->getField('shareholder' . $i)->getValue() . ', ' . $frm->getField('registeraddr' . $i)->getValue() . ', ' . $frm->getField('businessaddr' . $i)->getValue();
         if ($i < 6) {
             $company .= ', ';
         }
     }
     //get values from form
     $values = array();