Пример #1
0
$filterTelegram = array('descricao' => array('filter' => FILTER_SANITIZE_STRING), 'bot_token' => array('filter' => FILTER_SANITIZE_STRING), 'users_bots_id' => array('filter' => FILTER_VALIDATE_INT));
$filterGET = array('action' => array('filter' => FILTER_VALIDATE_REGEXP, 'options' => array("regexp" => "/^(excluir|imprimir)\$/")), 'page' => array('filter' => FILTER_VALIDATE_INT), 'id' => array('filter' => FILTER_VALIDATE_INT), 'pgname' => array('filter' => FILTER_SANITIZE_STRING));
$filterFinanceiro = array('data_vencimento' => array('filter' => FILTER_VALIDATE_REGEXP, 'options' => array("regexp" => "/^[0-9]{2}\\/[0-9]{2}\\/[0-9]{4}\$/")));
//
$data_org = filter_input_array(INPUT_POST);
$datauser = filter_input_array(INPUT_POST, $filterPostUser);
$data = filter_input_array(INPUT_POST, $filterPostUserInfo);
$data_endereco = filter_input_array(INPUT_POST, $filterPostEndereco);
$data_financeiro = filter_input_array(INPUT_POST, $filterFinanceiro);
$data_telegram = filter_input_array(INPUT_POST, $filterTelegram);
$dataGet = filter_input_array(INPUT_GET, $filterGET);
//print_r($dataGet);
//
try {
    $revendas = revendedorBO::getRevendas(1000);
    $planos = plano_assinaturaBO::getListaCombo();
    $moedas = moedasBO::getListaCombo();
    if ($data) {
        $response = array();
        if (empty($data['nome'])) {
            $response['error'][] = 'Preencher nome';
        } else {
            if ($datauser['passwlogin'] == NULL) {
                $response['error'][] = 'Preencher senha corretamanete (mínimo 5 caracteres)';
            } else {
                if ($datauser['phone'] == NULL) {
                    $response['error'][] = 'Preencher whatsapp';
                } else {
                    if ($data['tpPessoa'] == NULL) {
                        $response['error'][] = 'Pessoa Tipo Inválido!';
                    } else {