Created
August 25, 2017 12:10
-
-
Save davidchc/b4b4e4d6d75c85c3c76ff8a37701fd77 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Controllers; | |
class CompanyController | |
{ | |
public function edit() | |
{ | |
$company_id = $_POST['company_id']; | |
$companyDAO = new CompanyDAO(); | |
$company = $companyDAO->getCompany($company_id); | |
if($company->data['company_cnpj']) { | |
$mask = $company->data['company_cnpj'] == 11 ? '###.###.###-##' : '##.###.###.####-##'; | |
$find->data['company_cnpj'] = mask($company->data['company_cnpj'], $mask); | |
} | |
$this->data['dataCompany'] = $find->data; | |
$this->view('partials/header', $this->data); | |
$this->view('company/companyFormEdit', $this->data); | |
$this->view('partials/footer', $this->data); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment