├── 1crud-generator-php
├── LICENSE
├── README.md
├── assets
│ ├── css
│ │ ├── bootstrap.min.css
│ │ └── style.css
│ └── tip.txt
├── db_my.sql
├── db_pg.sql
├── delete.php
├── fetch_data.php
├── footer.php
├── functions
│ ├── connection.txt
│ └── crud.php
├── header.php
├── index.php
├── insert.php
├── install.php
├── search.php
└── update.php
├── 3crud-generator-mvc
├── Classes
│ ├── Connection.php
│ ├── Controller.php
│ ├── Model.php
│ └── Utils.php
├── LICENSE
├── README.md
├── assets
│ ├── css
│ │ ├── bootstrap.min.css
│ │ └── style.css
│ ├── fonts
│ │ ├── glyphicons-halflings-regular.eot
│ │ ├── glyphicons-halflings-regular.svg
│ │ ├── glyphicons-halflings-regular.ttf
│ │ ├── glyphicons-halflings-regular.woff
│ │ └── glyphicons-halflings-regular.woff2
│ ├── images
│ │ ├── ajax-loader.gif
│ │ ├── crud.png
│ │ ├── form_my.png
│ │ └── form_pg.png
│ ├── js
│ │ ├── bootstrap.min.js
│ │ ├── jquery-1.10.2.min.js
│ │ └── jquery.bootpag.min.js
│ └── tip.txt
├── config.php
├── db_my.sql
├── db_pg.sql
├── index.php
├── install.php
└── views
│ ├── delete.php
│ ├── fetch_data.php
│ ├── insert.php
│ ├── search.php
│ ├── templates
│ ├── footer.php
│ └── header.php
│ └── update.php
├── 4crud-generator-mvc-static
├── Classes
│ ├── Connection.php
│ ├── Controller.php
│ ├── Model.php
│ └── Utils.php
├── LICENSE
├── README.md
├── assets
│ ├── css
│ │ ├── bootstrap.min.css
│ │ └── style.css
│ ├── fonts
│ │ ├── glyphicons-halflings-regular.eot
│ │ ├── glyphicons-halflings-regular.svg
│ │ ├── glyphicons-halflings-regular.ttf
│ │ ├── glyphicons-halflings-regular.woff
│ │ └── glyphicons-halflings-regular.woff2
│ ├── images
│ │ ├── ajax-loader.gif
│ │ ├── crud.png
│ │ ├── form_my.png
│ │ └── form_pg.png
│ ├── js
│ │ ├── bootstrap.min.js
│ │ ├── jquery-1.10.2.min.js
│ │ └── jquery.bootpag.min.js
│ └── tip.txt
├── config.php
├── db_my.sql
├── db_pg.sql
├── index.php
├── install.php
└── views
│ ├── delete.php
│ ├── fetch_data.php
│ ├── insert.php
│ ├── search.php
│ ├── templates
│ ├── footer.php
│ └── header.php
│ └── update.php
├── README.md
├── db_my.sql
├── db_pg.sql
└── images
├── crud-generator.png
└── form.png
/1crud-generator-php/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Ribamar FS
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/1crud-generator-php/README.md:
--------------------------------------------------------------------------------
1 | # Gerador de CRUDs em PHP
2 |
3 | Eu tinha um crud-generator, que é para Laravel. Se estiver procurando por este ele fica em
4 |
5 | https://github.com/ribafs/laravel-crud-generator
6 |
7 | ## Recursos
8 |
9 | - PHP estruturado
10 | - PDO
11 | - Bootstrap 3
12 | - Paginação com Bootpag
13 | - Busca
14 | - Funções úteis
15 | - Boa prática
16 | - Tabela do MySQL com dados de teste gerada pela biblioteca Faker:
17 | - https://github.com/ribafs/faker-dados
18 | - https://github.com/ribafs/FakerRestaurantBr
19 | - https://github.com/fzaninotto/Faker
20 |
21 | ## Requisitos:
22 | - Apache2
23 | - PHP 5.5.9+
24 | - MySQL 5.5+ ou PostgreSQL 8+
25 |
26 | ## SGBD testados
27 |
28 | - MySQL
29 | - PostgreSQL
30 |
31 | ## Esta fase
32 |
33 | Esta é a fase inicial deste gerador. Ele tem 4 fases, esta que é em PHP estruturado. A próxima que é em PHPOO. A seguinte usa MVC e a final que usa MVC com classes estáticas. A intenção aqui é mostrar a conversão de um aplicativo em PHP estruturado para PHPOO. Depois converter PHPOO para MVC simples e finalmente converter o aplicativo com MVC para MVC com classes estáticas, como gostam de usar os grandes frameworks.
34 |
35 | ## Instalação
36 |
37 | Somente no primeiro acesso será mostrado o form de instalação.
38 |
39 | - Download de https://github.com/ribafs/auto-crud
40 | - Descompacte para seu diretório web na pasta gerador (exemplo0
41 | - Crie um banco dedados no MySQL
42 | - Acesse
43 |
44 | http://localhost/gerador
45 |
46 | Entre com oa dados no form
47 |
48 | ## MySQL
49 |
50 | 
51 |
52 | ## PostgreSQL
53 |
54 | 
55 |
56 | Então será levado para o CRUD com PDO, Bootstrap, Paginação e Busca, com suporte a MySQL e PostgreSQL garantidos e ainda outros via PDO populado com os registros da tabela indicada.
57 |
58 | 
59 |
60 | Pode e idealmente deve testar com os scripts existentes para mysql e para postgresql: db_my.sql e db_pg.sql.
61 |
62 | ## Customizações
63 |
64 | O código com a paginação está basicamente no arquivo index.php ao final. É uma paginação com o plugin da jQuery Bootpag (https://botmonster.com/jquery-bootpag/). A lib está em assets/js.
65 |
66 | A customização pode ser feita no arquivo index.php
67 |
68 | ## Objetivo principal
69 |
70 | O principal objetivo deste pequeno software é o de facilitar a vida de quem não programa e nem está pensando em aprender e quer apenas criar algo rápido, como uma agenda ou um cadastro simples.
71 |
72 | ## Referências
73 |
74 | - https://www.kodingmadesimple.com/2017/01/simple-ajax-pagination-in-jquery-php-pdo-mysql.html
75 | - https://www.codingcage.com/2015/10/create-pagination-script-using-php-jquery.html
76 | - https://www.bipmedia.com/blog/tutorial/pagination-script-using-php-pdo-with-jquery
77 |
78 | ## Licença
79 |
80 | MIT
81 |
82 |
83 |
--------------------------------------------------------------------------------
/1crud-generator-php/assets/css/style.css:
--------------------------------------------------------------------------------
1 | .top{
2 | padding-top: 5px;
3 | }
4 |
5 | .footer{
6 | background-color:#e6e6e6;
7 | width:85%;
8 | font-size:11px;
9 | text-align:center;
10 | }
11 |
12 | .header{
13 | text-align:center;
14 | background-color:#8ad3f7;
15 | padding-top: 10px;
16 | padding-bottom: 10px;
17 | }
18 |
--------------------------------------------------------------------------------
/1crud-generator-php/assets/tip.txt:
--------------------------------------------------------------------------------
1 | Glyphicons:
2 | https://www.w3schools.com/bootstrap/bootstrap_ref_comp_glyphs.asp
3 |
--------------------------------------------------------------------------------
/1crud-generator-php/delete.php:
--------------------------------------------------------------------------------
1 |
";
12 | }
13 | }
14 | ?>
15 |
--------------------------------------------------------------------------------
/1crud-generator-php/fetch_data.php:
--------------------------------------------------------------------------------
1 | prepare("SELECT * FROM $table ORDER BY id DESC LIMIT $start, $regsPerPage");
18 | }else if($sgbd == 'pgsql'){
19 | $results = $pdo->prepare("SELECT * FROM $table ORDER BY id DESC LIMIT $regsPerPage OFFSET $start");
20 | }
21 |
22 | $results->execute();
23 | $nr = $results->rowCount();
24 |
25 | if($nr > 0){
26 |
27 | while($row = $results->fetch(PDO::FETCH_ASSOC)) {
28 | echo "