Exemplo n.º 1
0
 public function actionConsortium()
 {
     try {
         $companyConsortium = new CompanyConsortium();
         $currency = new Currency();
         $country = new Country();
         $companyGround = new CompanyGround();
         $countryList = $country->getCountryList();
         $currencyList = $currency->getCurrencyList();
         $companyGroundList = $companyGround->getCompanyGroundList();
         //var_dump($countryList); exit();
         // if(Yii::$app->request->post())
         if ($companyConsortium->load(Yii::$app->request->post())) {
             $post = Yii::$app->request->post();
             // $transaction = Yii::$app->db->beginTransaction();
             var_dump($post);
             exit;
             // var_dump($post['CompanyConsortium']['name']);
         } else {
             echo "error";
         }
     } catch (CException $ex) {
         var_dump($ex);
         Yii::app()->end();
     }
     return $this->render('consortium', ['companyConsortium' => $companyConsortium, 'currencyList' => $currencyList, 'country' => $country, 'countryList' => $countryList, 'companyGroundList' => $companyGroundList]);
 }
Exemplo n.º 2
0
 public function actionIndex()
 {
     $personData = new Employee();
     $currency = new Currency();
     $country = new Country();
     return $this->render('index', ['personData' => $personData, 'currencyList' => $currency->getCurrencyList(), 'countryList' => $country->getCountryList()]);
 }
Exemplo n.º 3
0
 public function actionIndex()
 {
     try {
         $personData = new Person();
         $currency = new Currency();
         $country = new Country();
         $profession = new Professions();
         $bloodGroup = new BloodGroup();
         if ($personData->load(Yii::$app->request->post())) {
             $post = Yii::$app->request->post();
             $jsonValue = $personData->genJsonPerson();
             $jsonValue['profile_data']['first_name'] = $post['Person']['first_name'];
             $jsonValue['profile_data']['second_name'] = $post['Person']['second_name'];
             $jsonValue['profile_data']['first_surname'] = $post['Person']['first_surname'];
             $jsonValue['profile_data']['second_surname'] = $post['Person']['second_surname'];
             $jsonValue['profile_data']['date_born'] = $post['Person']['date_born'];
             $jsonValue['profile_data']['gender'] = $post['Person']['gender'];
             $jsonValue['profile_data']['marital_status_id'] = $post['Person']['marital_status_id'];
             $jsonValue['profile_data']['nationality_country_id'] = $post['Person']['nationality_country_id'];
             $jsonValue['profile_data']['blood_group_id'] = $post['Person']['blood_group_id'];
             $jsonValue['profile_data']['dni_type_id'] = $post['Person']['dni_type_id'];
             $jsonValue['profile_data']['dni'] = $post['Person']['dni'];
             /***********************************/
             $jsonValue['geograhpic_data']['address']['country_id'] = $post['Person']['country_id'];
             $jsonValue['geograhpic_data']['address']['state_id'] = $post['Person']['state_id'];
             $jsonValue['geograhpic_data']['address']['city_id'] = $post['Person']['city_id'];
             $jsonValue['geograhpic_data']['address']['address'] = $post['Person']['address'];
             /***********************************/
             $jsonValue['technical_data']['education_level_id'] = $post['Person']['education_level_id'];
             /***********************************/
             $jsonValue['contact_data']['phone']['mobile'] = $post['Person']['phone_number_personal'];
             /************* Arreglos dentro de otros *********/
             array_push($jsonValue['technical_data']['profession_id'], $post['Person']['profession_id']);
             array_push($jsonValue['contact_data']['email'], $post['Person']['email'], $post['Person']['email_2']);
             /* BVariables de Entorno Modelo*/
             $personData->person_data = json_encode($jsonValue);
             $personData->date_reg = date('Y-m-d h:m:s');
             if ($personData->validate()) {
                 if ($personData->save(false)) {
                     echo $personData->id;
                 } else {
                     echo date('Y-m-d');
                 }
             } else {
                 // validation failed: $errors is an array containing error messages
                 $errors = $personData->errors;
             }
         }
     } catch (CException $ex) {
         var_dump($ex);
         Yii::app()->end();
     }
     return $this->render('index', ['personData' => $personData, 'currencyList' => $currency->getCurrencyList(), 'countryList' => $country->getCountryList(), 'professionList' => $profession->getProfessionList(), 'bloodGroup' => $bloodGroup->getBloodGroupList()]);
 }