public function doDiagnosticoEligibility($enterprise) { if ($enterprise['HeadOfficeStatus'] == '1') { return $this->setDiagnosticoEligibility($enterprise->getId(), 1); } $to = Zend_Registry::get('configDb')->addr->eligibilityGestorEmail; $toEnterprise = $enterprise->getEmailDefault(); $enterpriseName = $enterprise->getSocialName(); $enterpriseCnpj = Vtx_Util_Formatting::maskFormat($enterprise->getCnpj(), '##.###.###/####-##'); $this->createElegibilityNotification('manager', $to, $enterpriseName, $enterpriseCnpj); if ($toEnterprise != null && $toEnterprise != '') { $this->createElegibilityNotification('enterprise', $toEnterprise, $enterpriseName, $enterpriseCnpj); } return $this->setDiagnosticoEligibility($enterprise->getId(), 0); }
protected function getDataTableFieldsets() { // override for Report_Devolutive_CandidateDataPage $president = $this->getPresident(); $addressPresident = $this->getAddressPresident(); $bornDate = strtotime($president['BornDate']); $bornDate = date('d/m/Y', $bornDate); $cpf = Vtx_Util_Formatting::maskFormat($president['Cpf'], '###.###.###-##'); $position = $this->getPosition(); $educationLevel = $this->getEducationLevel(); $cep = Vtx_Util_Formatting::maskFormat($addressPresident['Cep'], '#####-###'); $state = $this->getState(); $city = $this->getCity(); $neighborhood = $this->getNeighborhood(); return array(array('Name' => $president['Name'], 'BirthDate' => $bornDate, 'Cpf' => $cpf), array('Position' => $position, 'EducationLevel' => $educationLevel, 'Email' => $president['Email']), array('Cellphone' => $president['Cellphone'], 'Phone' => $president['Phone'], 'Cep' => $cep), array('StreetNameFull' => $addressPresident['StreetNameFull'], 'StreetNumber' => $addressPresident['StreetNumber'], 'StreetCompletion' => $addressPresident['StreetCompletion']), array('Neighborhood' => $neighborhood, 'City' => $city, 'State' => $state)); }
protected function getDataTableFieldsets() { // override for Report_Devolutive_CandidateDataPage $enterprise = $this->getEnterprise(); $addressEnterprise = $this->getAddressEnterprise(); $cnpj = Vtx_Util_Formatting::maskFormat($enterprise['Cnpj'], '##.###.###/####-##'); $creationDate = strtotime($enterprise['CreationDate']); $creationDate = date('d/m/Y', $creationDate); $annualRevenue = $this->getAnnualRevenue(); $categorySector = $this->getCategorySector(); $cep = Vtx_Util_Formatting::maskFormat($addressEnterprise['Cep'], '#####-###'); $state = $this->getState(); $city = $this->getCity(); $neighborhood = $this->getNeighborhood(); $categoryAward = $this->getCategoryAward(); return array(array('SocialName' => $enterprise['SocialName'], 'FantasyName' => $enterprise['FantasyName'], 'Cnpj' => $cnpj), array('CreationDate' => $creationDate, 'EmailDefault' => $enterprise['EmailDefault'], 'Cnae' => $enterprise['Cnae']), array('Phone' => $enterprise['Phone'], 'Site' => $enterprise['Site'], 'EmployeesQuantity' => $enterprise['EmployeesQuantity']), array('AnnualRevenue' => $annualRevenue, 'CategorySector' => $categorySector, 'Cep' => $cep), array('StreetNameFull' => $addressEnterprise['StreetNameFull'], 'StreetNumber' => $addressEnterprise['StreetNumber'], 'StreetCompletion' => $addressEnterprise['StreetCompletion']), array('Neighborhood' => $neighborhood, 'City' => $city, 'State' => $state), array('CategoryAward' => $categoryAward)); }
/** * * @param type $userId * @return type */ public function getEnterpriseData($userId) { $User = new Model_User(); $President = new Model_President(); $Enterprise = new Model_Enterprise(); $UserLocality = new Model_UserLocality(); $AddressEnterprise = new Model_AddressEnterprise(); //$userId = 81; $userRow = $User->getUserById($userId); $userLocalityRow = $UserLocality->getUserLocalityByUserId($userRow->getId()); $enterpriseRow = $Enterprise->getEnterpriseById($userLocalityRow->getEnterpriseId()); $presidentRow = $President->getPresidentByEnterpriseId($enterpriseRow->getId()); $addressEnterpriseRow = $AddressEnterprise->getAddressEnterpriseByEnterpriseId($enterpriseRow->getId()); $arrAnnualRevenue = Vtx_Util_Array::annualRevenue(); $neighborhood = $addressEnterpriseRow->findParentNeighborhood(); $arrEnterprise = array('Registro OCB' => $enterpriseRow->getOcbRegister() != '' ? $enterpriseRow->getOcbRegister() : '', 'Razão Social' => $enterpriseRow->getSocialName() != '' ? $enterpriseRow->getSocialName() : '', 'E-mail' => $enterpriseRow->getEmailDefault() != '' ? $enterpriseRow->getEmailDefault() : '', 'Nome Fantasia' => $enterpriseRow->getFantasyName() != '' ? $enterpriseRow->getFantasyName() : '', 'Ramo de Atividade' => $enterpriseRow->getMetierId() ? DbTable_Metier::getInstance()->getById($enterpriseRow->getMetierId())->getDescription() : '', 'Atividade Econômica(CNAE)' => $enterpriseRow->getCnae() != '' ? $enterpriseRow->getCnae() : '', 'CPF/CNPJ' => $enterpriseRow->getCnpj() != '' ? Vtx_Util_Formatting::maskFormat($enterpriseRow->getCnpj(), '##.###.###/####-##') : '', 'Porte da Empresa' => $enterpriseRow->getAnnualRevenue() != '' && isset($arrAnnualRevenue[$enterpriseRow->getAnnualRevenue()]) ? $arrAnnualRevenue[$enterpriseRow->getAnnualRevenue()] : '', 'Número de Colaboradores' => $enterpriseRow->getEmployeesQuantity() != '' ? $enterpriseRow->getEmployeesQuantity() : '', 'Data de Abertura' => $enterpriseRow->getCreationDate() != '' ? Vtx_Util_Date::format_dma($enterpriseRow->getCreationDate()) : '', 'Endereço' => is_object($addressEnterpriseRow) ? $addressEnterpriseRow->getStreetNameFull() : '', 'Número' => is_object($addressEnterpriseRow) ? $addressEnterpriseRow->getStreetNumber() : '', 'Complemento' => is_object($addressEnterpriseRow) ? $addressEnterpriseRow->getStreetCompletion() : '', 'Bairro' => $neighborhood ? $addressEnterpriseRow->findParentNeighborhood()->getName() : '', 'Cidade/Estado' => is_object($addressEnterpriseRow) ? DbTable_City::getInstance()->getById($addressEnterpriseRow->getCityId())->getName() . "/" . DbTable_State::getInstance()->getById($addressEnterpriseRow->getStateId())->getUf() : '', 'CEP' => is_object($addressEnterpriseRow) ? Vtx_Util_Formatting::maskFormat($addressEnterpriseRow->getCep(), '#####-###') : ''); $arrContact = array('Nome' => is_object($presidentRow) ? $presidentRow->getName() : '', 'Cargo' => is_object($presidentRow) ? 'Presidente' : '', 'Telefone' => is_object($presidentRow) ? $presidentRow->getPhone() : '', 'E-mail' => is_object($presidentRow) ? $presidentRow->getEmail() : '', 'Cpf' => Vtx_Util_Formatting::maskFormat($presidentRow->getCpf(), '###.###.###-##')); $arrIssues = array('0' => array('Q' => '1. É uma Matriz?', 'R' => $enterpriseRow->getHeadOfficeStatus() == '1' ? 'Sim' : 'Não'), '1' => array('Q' => '2. É uma Singular?', 'R' => $enterpriseRow->getSingularStatus() == '1' ? 'Sim' : 'Não'), '2' => array('Q' => '3. A empresa está vinculada a alguma Central?', 'R' => $enterpriseRow->getCentralName() != '' ? $enterpriseRow->getCentralName() : 'Não'), '3' => array('Q' => '4. A empresa está vinculada a alguma Federação?', 'R' => $enterpriseRow->getFederationName() != '' ? $enterpriseRow->getFederationName() : 'Não'), '4' => array('Q' => '5. A empresa está vinculada a alguma Confederação?', 'R' => $enterpriseRow->getConfederationName() != '' ? $enterpriseRow->getConfederationName() : 'Não')); return array($arrEnterprise, $arrContact, $arrIssues); }
public function getFormattedCnpj() { return Vtx_Util_Formatting::maskFormat($this->getCnpj(), '##.###.###/####-##'); }
public function updateAction() { $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(); $dbTablePresident = new DbTable_President(); $createUser = $dbTablePresident->migrateUser(); $objArray = $createUser->toArray(); $obj = array(); foreach ($objArray as $newUser) { $obj = array(); $senha = !empty($newUser['Password']) ? $newUser['Password'] : md5('1234'); $nome = !empty($newUser['Name']) ? $newUser['Name'] : "psmn"; $email = !empty($newUser['Email']) ? $newUser['Email'] : "null"; $obj['cpf'] = Vtx_Util_Formatting::maskFormat($newUser['Cpf'], '###.###.###-##'); $obj['first_name'] = $nome; $obj['surname'] = $newUser['NickName']; $obj['email'] = $email; $obj['enterprise_id'] = $newUser['EnterpriseId']; $obj['keypass'] = $senha; $createUserMigrate = $this->userModel->createUserMigrate($obj); if (!$createUserMigrate['status']) { echo '<pre>'; print_r($obj); echo $createUserMigrate['messageError']; return; } /* */ echo $newUser['EnterpriseId'] . '<br />'; } }
/** * dados da empresa * * @param type $userId * @return type */ public function getEnterpriseData($userId) { $User = new Model_User(); //$President = new Model_President(); $Enterprise = new Model_Enterprise(); $UserLocality = new Model_UserLocality(); $AddressEnterprise = new Model_AddressEnterprise(); $Position = new Model_Position(); $userRow = $User->getUserById($userId); $userLocalityRow = $UserLocality->getUserLocalityByUserId($userRow->getId()); $enterpriseRow = $Enterprise->getEnterpriseById($userLocalityRow->getEnterpriseId()); //var_dump('EnterpriseId: ',$enterpriseRow->getId()); //$presidentRow = $President->getPresidentByEnterpriseId($enterpriseRow->getId()); $addressEnterpriseRow = $AddressEnterprise->getAddressEnterpriseByEnterpriseId($enterpriseRow->getId()); $arrAnnualRevenue = Vtx_Util_Array::annualRevenue(); $arrCategoria = Vtx_Util_Array::categoriaMpe(); $idCategoria = $enterpriseRow->getCategoriaId(); $nomeCategoria = ""; if (is_int($idCategoria)) { $nomeCategoria = $arrCategoria[$idCategoria]; } $arrTipoEmpresa = Vtx_Util_Array::tipoEmpresaMPE(); $idTipoEmpresa = $enterpriseRow->getEnterpriseTypeId(); $tipoEmpresa = ""; if (is_int($idTipoEmpresa)) { $tipoEmpresa = $arrTipoEmpresa[$idTipoEmpresa]; } // var_dump('addressEnterpriseRow: ',$addressEnterpriseRow); // exit; $neighborhood = $addressEnterpriseRow->findParentNeighborhood(); //var_dump('neighborhood: ',$neighborhood); $idUf = $addressEnterpriseRow->getStateId(); $idCidade = $addressEnterpriseRow->getCityId(); //var_dump($idCidade); //var_dump($idUf); if (is_int($idUf)) { $uf = DbTable_State::getInstance()->getById($idUf)->getUf(); } else { $uf = ""; } if (is_int($idCidade)) { $cidade = DbTable_City::getInstance()->getById($idCidade)->getName(); } else { $cidade = ""; } $cidadeEstado = $cidade . "/" . $uf; //var_dump ($cidadeEstado); exit; //var_dump($cidadeEstado); //exit; $cnpj = $enterpriseRow->getCnpj(); if (is_string($cnpj)) { $cpfCnpj = $cnpj; } else { $cpfCnpj = ""; } //$cnpjMask = Vtx_Util_Formatting::maskFormat($getcnpj,'##.###.###/####-##'); //$cnpj = null; //var_dump($cnpj); //exit; $arrEnterprise = array('Razão Social' => $enterpriseRow->getSocialName() != '' ? $enterpriseRow->getSocialName() : '', 'E-mail' => $enterpriseRow->getEmailDefault() != '' ? $enterpriseRow->getEmailDefault() : '', 'Nome Fantasia' => $enterpriseRow->getFantasyName() != '' ? $enterpriseRow->getFantasyName() : '', 'Atividade Econômica(CNAE)' => $enterpriseRow->getCnae() != '' ? $enterpriseRow->getCnae() : '', 'CPF/CNPJ' => $cpfCnpj, 'Faturamento Anual' => $enterpriseRow->getAnnualRevenue() != '' && isset($arrAnnualRevenue[$enterpriseRow->getAnnualRevenue()]) ? $arrAnnualRevenue[$enterpriseRow->getAnnualRevenue()] : '', 'Número de Colaboradores' => $enterpriseRow->getEmployeesQuantity() != '' ? $enterpriseRow->getEmployeesQuantity() : '0', 'Data de Abertura' => $enterpriseRow->getCreationDate() != '' ? Vtx_Util_Date::format_dma($enterpriseRow->getCreationDate()) : '', 'Endereço' => is_object($addressEnterpriseRow) ? $addressEnterpriseRow->getStreetNameFull() : '', 'Número' => is_object($addressEnterpriseRow) ? $addressEnterpriseRow->getStreetNumber() : '', 'Complemento' => is_object($addressEnterpriseRow) ? $addressEnterpriseRow->getStreetCompletion() : '', 'Bairro' => $neighborhood ? $addressEnterpriseRow->findParentNeighborhood()->getName() : '', 'Cidade/Estado' => $cidadeEstado, 'CEP' => is_object($addressEnterpriseRow) ? Vtx_Util_Formatting::maskFormat($addressEnterpriseRow->getCep(), '#####-###') : '', 'Categoria' => $nomeCategoria, 'Tipo Empresa' => $tipoEmpresa); $idPosition = $userRow->getPositionId(); $cargo = ""; if (is_int($idPosition)) { $posicao = $Position->getPosition($idPosition); $cargo = $posicao ? $posicao->getDescription() : ''; } $arrContact = array('Nome' => is_object($userRow) ? $userRow->getNomeCompleto() : '', 'Cargo' => is_object($userRow) ? $cargo : '', 'Telefone' => is_object($userRow) ? $userRow->getTelefone() : '', 'Celular' => is_object($userRow) ? $userRow->getCelular() : '', 'E-mail' => is_object($userRow) ? $userRow->getEmail() : ''); $arrIssues = array(); return array($arrEnterprise, $arrContact, $arrIssues); }