public static function inscrever($post, $tipo) { self::$date = date("Y-m-d H:i:s"); global $database; $codigo = md5($_POST['email']); if ($tipo == "cpfsenior") { $sql = "INSERT INTO " . self::$table_name . " (name,name_cracha,email,pass,birth,genero,tshirt,country,cpf,estado,cidade,phone,type,empresa,cargo,segmento,date,confirm,cep,bairro,rua,numero,complemento,celular,codigo) VALUES ('{$post['name']}','{$post['name_cracha']}','{$post['email']}','{$post['pass']}','{$post['birth']}','{$post['genero']}','{$post['tshirt']}','{$post['country']}','{$post['cpf']}','{$post['estado']}','{$post['cidade']}','{$post['phone']}','{$post['type']}','{$post['empresa']}','{$post['cargo']}','{$post['segmento']}','" . self::$date . "','false','{$post['cep']}','{$post['bairro']}','{$post['rua']}','{$post['numero']}','{$post['complemento']}','{$post['cel_phone']}','" . $codigo . "')"; } if ($tipo == "cpfjunior") { $sql = "INSERT INTO " . self::$table_name . " (name,name_cracha,email,pass,birth,genero,tshirt,country,cpf,estado,cidade,phone,type,federacao,ej,cargo_jr,tempo,date,confirm,cep,bairro,rua,numero,complemento,celular,codigo) VALUES ('{$post['name']}','{$post['name_cracha']}','{$post['email']}','{$post['pass']}','{$post['birth']}','{$post['genero']}','{$post['tshirt']}','{$post['country']}','{$post['cpf']}','{$post['estado']}','{$post['cidade']}','{$post['phone']}','{$post['type']}','{$post['federacao']}','{$post['ej']}','{$post['cargo_jr']}','{$post['tempo']}','" . self::$date . "','false','{$post['cep']}','{$post['bairro']}','{$post['rua']}','{$post['numero']}','{$post['complemento']}','{$post['cel_phone']}','" . $codigo . "')"; } if ($tipo == "passaportesenior") { $sql = "INSERT INTO " . self::$table_name . " (name,name_cracha,email,pass,birth,genero,tshirt,country,cpf,estado,cidade,phone,type,empresa,cargo,segmento,date,confirm,cep,bairro,rua,numero,complemento,celular,codigo) VALUES ('{$post['name']}','{$post['name_cracha']}','{$post['email']}','{$post['pass']}','{$post['birth']}','{$post['genero']}','{$post['tshirt']}','{$post['country']}','{$post['passport']}','{$post['estado']}','{$post['cidade']}','{$post['phone']}','{$post['type']}','{$post['empresa']}','{$post['cargo']}','{$post['segmento']}','" . self::$date . "','false','{$post['cep']}','{$post['bairro']}','{$post['rua']}','{$post['numero']}','{$post['complemento']}','{$post['cel_phone']}','" . $codigo . "')"; } if ($tipo == "passaportejunior") { $sql = "INSERT INTO " . self::$table_name . " (name,name_cracha,email,pass,birth,genero,tshirt,country,cpf,estado,cidade,phone,type,federacao,ej,cargo_jr,tempo,date,confirm,cep,bairro,rua,numero,complemento,celular,codigo) VALUES ('{$post['name']}','{$post['name_cracha']}','{$post['email']}','{$post['pass']}','{$post['birth']}','{$post['genero']}','{$post['tshirt']}','{$post['country']}','{$post['passport']}','{$post['estado']}','{$post['cidade']}','{$post['phone']}','{$post['type']}','{$post['federacao']}','{$post['ej']}','{$post['cargo_jr']}','{$post['tempo']}','" . self::$date . "','false','{$post['cep']}','{$post['bairro']}','{$post['rua']}','{$post['numero']}','{$post['complemento']}','{$post['cel_phone']}','" . $codigo . "')"; } if (!$database->query($sql)) { echo mysql_error(); return mysql_error(); } // seta a session para aparecer na index $_SESSION['mensagem'] = "Aguarde seu email"; header("Location: ../views/index.php"); }