Exemplo n.º 1
0
 public function executeSimpan()
 {
     $i18n = new sfI18N();
     $i18n->initialize($this->getContext());
     $i18n->setCulture($this->getUser()->getCulture());
     $action_i18n = $i18n->globalMessageFormat->format('save as new');
     $action_type = $this->getRequestParameter('action_type');
     if ($action_type == $action_i18n || !$this->getRequestParameter('id')) {
         $employee_childs = new EmployeeChilds();
     } else {
         $employee_childs = EmployeeChildsPeer::retrieveByPk($this->getRequestParameter('id'));
         $this->forward404Unless($employee_childs);
     }
     $employee_childs->setId($this->getRequestParameter('id'));
     $employee_childs->setEmployeeId($this->getRequestParameter('employee_id'));
     if ($this->getRequestParameter('dob')) {
         $employee_childs->setDob($this->getRequestParameter('dob'));
     }
     $employee_childs->setName($this->getRequestParameter('name'));
     $employee_childs->setPob($this->getRequestParameter('pob'));
     $employee_childs->setReligionId($this->getRequestParameter('religion_id'));
     $employee_childs->setRelation($this->getRequestParameter('relation'));
     $employee_childs->setSex($this->getRequestParameter('sex'));
     $employee_childs->save();
     return $this->redirect('user_profile_l/listChilds?employee_id=' . $this->getRequestParameter('employee_id'));
 }