diff --git a/.github/contributing.md b/.github/contributing.md deleted file mode 100644 index 6a2eaf2..0000000 --- a/.github/contributing.md +++ /dev/null @@ -1,20 +0,0 @@ -# Guia do Colaborador - -Algumas orientações. - -There are many reasons why a person or organization would want to open source a project. Some examples include: - - Collaboration: Open source projects can accept changes from anybody in the world. Exercism, for example, is a programming exercise platform with over 350 contributors. - - Adoption and remixing: Open source projects can be used by anyone for nearly any purpose. People can even use it to build other things. WordPress, for example, started as a fork of an existing project called b2. - - Transparency: Anyone can inspect an open source project for errors or inconsistencies. Transparency matters to governments like Bulgaria or the United States, regulated industries like banking or healthcare, and security software like Let’s Encrypt. - -Open source isn’t just for software, either. You can open source everything from data sets to books. Check out GitHub Explore for ideas on what else you can open source. -Does open source mean “free of charge”? - -One of open source’s biggest draws is that it does not cost money. “Free of charge”, however, is a byproduct of open source’s overall value. - -Because an open source license requires that anyone can use, modify, and share your project for nearly any purpose, projects themselves tend to be free of charge. If the project cost money to use, anyone could legally make a copy and use the free version instead. - -As a result, most open source projects are free, but “free of charge” is not part of the open source definition. There are ways to charge for open source projects indirectly through dual licensing or limited features, while still complying with the official definition of open source. diff --git a/README.md b/README.md index 5152c72..3a09b4f 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,12 @@ # Criador Automático de CRUDs -Apenas indique o banco de dados e a tabela no conexao.php e ele cria seu CRUD com PDO, Bootstrap e Paginação, com suporte a MySQL e PostgreSQL garantidos e ainda outros via PDO. +#### Apenas indique o banco de dados e a tabela no conexao.php e ele cria seu CRUD com PDO, Bootstrap e Paginação, com suporte a MySQL e PostgreSQL garantidos e ainda outros via PDO. + +### Mais facilidades para esta versão +Agora você pode apenas inserir o script.sql na pasta script e indicar no conexão que o auto-crud-pt irá criar o banco para ele e importar seu script ### Em dois Idiomas -Português - https://github.com/ribafs/auto-crud +Português - https://github.com/ribafs/auto-crud-pt Inglês - https://github.com/ribafs/auto-crud-en diff --git a/atualizar.php b/atualizar.php new file mode 100644 index 0000000..a16d36f --- /dev/null +++ b/atualizar.php @@ -0,0 +1,53 @@ +'.ucfirst($table).''; +?> + + +
+
+
+
+
+ + +prepare("SELECT * from $table WHERE id = :id"); + $sth->bindValue(':id', $id, PDO::PARAM_STR); // No select e no delete basta um único bindValue + $sth->execute(); + + $reg = $sth->fetch(PDO::FETCH_OBJ); + + $num_campos = num_campos(); + + for($x=1;$x<$num_campos;$x++){ + $campo = nome_campo($x); +?> + + + + +
        +
+
+
+
+
+ + + diff --git a/atualizarbd.php b/atualizarbd.php new file mode 100644 index 0000000..1de01aa --- /dev/null +++ b/atualizarbd.php @@ -0,0 +1,37 @@ +prepare($sql); + + for($x=0;$x<$num_campos;$x++){ + $campo = nome_campo($x); + $sth->bindParam(":$campo", $_POST["$campo"], PDO::PARAM_STR); + } + + if($sth->execute()){ + print ""; + }else{ + print "Erro ao editar o registro!

"; + } +} diff --git a/busca.php b/busca.php new file mode 100644 index 0000000..3ac700a --- /dev/null +++ b/busca.php @@ -0,0 +1,64 @@ +prepare($sql); + $sth->bindValue(":palavra", $palavra."%"); + $sth->execute(); + $rows =$sth->fetchAll(PDO::FETCH_ASSOC); +} + +print '
'; +print '

Registro(s) encontrado(s)

'; + +if(count($rows) > 0){ + print '
'; + echo ''; + echo ""; + + $num_campos = num_campos(); + + for($x=0;$x<$num_campos;$x++){ + $campo = nome_campo($x); + ?> + + Ação'; + echo ""; + + // Loop através dos registros recebidos + foreach ($rows as $row){ + echo ""; + for($x=0;$x<$num_campos;$x++){ + $campo = nome_campo($x); + ?> + + + + + + "; + } + echo "
"; + +}else{ + print '

Nenhum Registro encontrado!

'; +} + +?> + + +
+ + diff --git a/search_results.php b/busca_resultados.php similarity index 64% rename from search_results.php rename to busca_resultados.php index 65c71e6..ccda1ab 100644 --- a/search_results.php +++ b/busca_resultados.php @@ -1,16 +1,16 @@ - +
-
-
+ +