public function fetchAll($where = null, $orderby = 'updated_date DESC') { $resultSet = $this->getDbTable()->fetchAll($where, $orderby); $entries = array(); foreach ($resultSet as $row) { $entry = new Default_Model_Resume(); $entry->setResumeId($row->resume_id); $entry->setResumeCode($row->resume_code); $entry->setFullName($row->full_name); $entry->setBirthday($row->birthday); $entry->setGender($row->gender); $entry->setMaritalStatus($row->marital_status); $entry->setStatus($row->status); $entry->setEmail1($row->email_1); $entry->setEmail2($row->email_2); $entry->setMobile1($row->mobile_1); $entry->setMobile2($row->mobile_2); $entry->setTel($row->tel); $entry->setAddress($row->address); $entry->setViewCount($row->view_count); $entry->setCreatedDate($row->created_date); $entry->setUpdatedDate($row->updated_date); $entry->setCreatedConsultantId($row->created_consultant_id); $entry->setUpdatedConsultantId($row->updated_consultant_id); $entries[] = $entry; } return $entries; }
public function saveResumeAction() { $aNamespace = new Zend_Session_Namespace('zs_User'); $post = $this->getRequest()->getPost(); $resumeRowset = new Default_Model_Resume(); $resume = new Default_Model_ResumeMapper(); $result = $resume->checkExists($post['full_name'], $post['birthday'], $post['email1']); if ($result && !$post['resume_id']) { $resumeRowset->setFullName($post['full_name']); $resumeRowset->setBirthday($post['birthday']); $resumeRowset->setGender($post['gender']); $resumeRowset->setMaritalStatus($post['marital_status']); $resumeRowset->setEmail1($post['email1']); $resumeRowset->setEmail2($post['email2']); $resumeRowset->setMobile1($post['mobile1']); $resumeRowset->setMobile2($post['mobile2']); $resumeRowset->setTel($post['tel']); $resumeRowset->setAddress($post['address']); $this->view->resumeRowset = $resumeRowset; $this->view->msg = 'Resume has exists in Database'; $this->render('personal-info'); } else { if ($post['resume_id']) { $resumeCode = 'R' . $post['resume_id']; } else { $resumeCode = 'R'; } $resumeRowset->setResumeId($post['resume_id']); $resumeRowset->setResumeCode($resumeCode); $resumeRowset->setFullName($post['full_name']); $resumeRowset->setBirthday($post['birthday']); $resumeRowset->setGender($post['gender']); $resumeRowset->setMaritalStatus($post['marital_status']); $resumeRowset->setStatus('Active'); $resumeRowset->setEmail1($post['email1']); $resumeRowset->setEmail2($post['email2']); $resumeRowset->setMobile1($post['mobile1']); $resumeRowset->setMobile2($post['mobile2']); $resumeRowset->setTel($post['tel']); $resumeRowset->setAddress($post['address']); $resumeRowset->setCreatedDate(date('Y-m-d')); $resumeRowset->setCreatedConsultantId($aNamespace->consultant_id); $resumeRowset->setUpdatedConsultantId($aNamespace->consultant_id); $resume = new Default_Model_ResumeMapper(); $resumeId = $resume->save($resumeRowset); if (!$post['resume_id']) { $resume->updateResumCode('R' . $resumeId, $resumeId); } //upload file resume if ($_FILES['file_resume']['name']) { $this->saveResumeFile($_FILES['file_resume'], $resumeId); } $this->_redirect('/resume/education/id/' . $resumeId); } }