private static function setValues(&$frm, array $value) { $frm->addText('file', $value['file']); $frm->addText('case', $value['case']); $frm->addImage('photo'); $frm->addFile('attachment'); $frm->addText('name', $value['name']); $frm->addText('ic', $value['ic']); $frm->addDropdown('gender', array('' => '', 'male' => 'Male', 'female' => 'Female'), $value['gender']); $frm->addText('placeofbirth', $value['placeofbirth']); $frm->addText('education', $value['education']); $frm->addText('language', $value['language']); $frm->addText('race', $value['race']); $frm->addText('faith', $value['faith']); $frm->addText('maritalstatus', $value['maritalstatus']); $frm->addText('nationality', $value['nationality']); $frm->addText('profession', $value['profession']); $frm->addText('epf', $value['epf']); $frm->addText('banker', $value['banker']); $frm->addTextarea('address', $value['address']); $frm->addText('contactno', $value['contactno']); $frm->addText('email', $value['email']); $frm->addText('platesno', $value['platesno']); $frm->addText('assets', $value['assets']); $frm->addText('height', $value['height'])->setAttribute('placeholder', 'digits only'); $frm->addText('weight', $value['weight'])->setAttribute('placeholder', 'digits only'); $frm->addDropdown('blood', array('' => '', 'O+' => 'O+', 'A+' => 'A+', 'B+' => 'B+', 'AB+' => 'AB+', 'O-' => 'O-', 'A-' => 'A-', 'B-' => 'B-', 'AB-' => 'AB-'), $value['blood']); $frm->addText('eye', $value['eye']); $frm->addText('hair', $value['hair']); $frm->addText('skin', $value['skin']); $frm->addText('dna', $value['dna']); $frm->addTextarea('family', $value['family']); $frm->addTextarea('casereport', $value['casereport']); if ($value['company']) { setCompanyValue($frm, $value['company']); } else { self::generateComp($frm); } $frm->addTextArea('remarks', $value['remarks']); $frm->addButton('submit', 'Submit'); }
$frm->addText('banker', $get_user['banker']); $frm->addTextarea('address', $get_user['address']); $frm->addText('contactno', $get_user['contactno']); $frm->addText('email', $get_user['email']); $frm->addText('platesno', $get_user['platesno']); $frm->addText('assets', $get_user['assets']); $frm->addText('height', $get_user['height'])->setAttribute('placeholder', 'digits only'); $frm->addText('weight', $get_user['weight'])->setAttribute('placeholder', 'digits only'); $frm->addDropdown('blood', array('' => '', 'O+' => 'O+', 'A+' => 'A+', 'B+' => 'B+', 'AB+' => 'AB+', 'O-' => 'O-', 'A-' => 'A-', 'B-' => 'B-', 'AB-' => 'AB-'), $get_user['blood']); $frm->addText('eye', $get_user['eye']); $frm->addText('hair', $get_user['hair']); $frm->addText('skin', $get_user['skin']); $frm->addText('dna', $get_user['dna']); $frm->addTextarea('family', $get_user['family']); $frm->addTextarea('casereport', $get_user['casereport']); setCompanyValue($frm, $get_user['company']); $frm->addTextArea('remarks', $get_user['remarks']); $frm->addButton('submit', 'Submit'); if ($frm->isSubmitted()) { //after form submitted $frm->getField('name')->isFilled('Please Fill in Client\'s Name.'); if ($frm->getField('email')->isFilled()) { $frm->getField('email')->isEmail('Please provide a valid email address.'); } for ($i = 1; $i < 6; $i++) { if ($frm->getField('companyemail' . $i)->isFilled()) { $frm->getField('companyemail' . $i)->isEmail('Please provide a valid email address.'); } } if ($frm->getField('photo')->isFilled()) { if ($frm->getField('photo')->isAllowedExtension(array('jpg', 'png', 'gif', 'jpeg'), 'Only jpg/gif/png/jpeg are allowed.')) {