O PHPCG é um CRUD Generator desenvolvido em PHP puro para construir seu completo painel de administração Bootstrap usando uma interface visual de usuário.
O PHPCG é adequado tanto para não programadores quanto para programadores PHP avançados, que terão acesso a código limpo e bem organizado para que possam aproveitar todo o seu potencial.
O PHPCG é capaz de analisar seu banco de dados e extrair tabelas, campos e qualquer tipo de relacionamento de forma inteligente.
O motor CRUD é baseado em PHP PDO e tem suporte total aos seguintes Sistemas de Gerenciamento de Banco de Dados Relacionais (RDBMS):
MySQL
MariaDB
Oracle
Firebird
PostgreSQL
Você pode então usar os dados analisados do banco para gerar seu painel de administração:
Listas paginadas (CRUD READ)
filtragem de registros, incluindo com tabelas relacionais internas/externas
ordenação
edição avançada no próprio site (texto, select, Booleano, data e hora, ...)
tabelas aninhadas
tabelas de dados externas (relações externas)
exportação para os formatos Excel/CSV/PDF/PRINT
Formulários de Criação e Atualização (CRUD CREATE/UPDATE)
formulários construídos com PHP Form Builder, conhecido por sua robustez e confiabilidade
Todos os tipos de campos
Integração automática dos melhores plugins jQuery para melhorar a experiência do usuário (select e radio personalizados, editor de texto rico, uploader de arquivos, seletores, ...)
listas suspensas com conteúdo inteligente e personalizável
upload de arquivos/imagens com crop/resize e geração de miniaturas personalizável
validação automática de acordo com o tipo de dados personalizável
layout eficiente e direto - Possibilidade de agrupar campos em 2 e 3 colunas
Formulários de Exclusão (CRUD DELETE)
Exclusão em Cascata de Registros Dependentes
Exibição do número de registros dependentes que serão excluídos
Dicas rápidas
Aqui está um curto vídeo de apresentação que mostra como o PHP CRUD Generator funciona do início ao fim.
Para criar seu banco de dados relacional, recomendamos que você consulte:
PHP 8.1+ com driver PDO, mb_string e curl extensões habilitadas. A extensão PHP curl deve estar autorizada a enviar requisições ao servidor de licenciamento.
db-connect.php Configurações de conexão PDO — contém as configurações de conexão de até 2 servidores, selecionadas automaticamente para o servidor atual; pode ser sincronizado entre servidores
Envie as pastas necessárias* para o seu servidor conforme descrito na seção "estrutura do pacote".
Se você instalar o PHP CRUD Generator dentro de uma subpasta
(em outras palavras, se a admin, classe, conf, generator, ... as pastas não estão na raiz do seu projeto), você deve editar admin/.htaccess para evitar erros 404:
abra /admin/.htaccess no seu editor de código
adicione sua subpasta ao RewriteRule. Por exemplo: RewriteRule . /your-folder/admin/index.php [QSA,L]
2
Abra o instalador - /install/index.php - no seu navegador e siga o assistente: A Etapa 1 verifica seu servidor (requisitos) e registra sua licença; a Etapa 2 registra sua conexão com o banco de dados; a Etapa 3 define as informações gerais essenciais (nome do projeto, logo, ...). Se você usar um servidor local + um servidor remoto, deverá executar o instalador em ambos. Mais informações disponíveis no Instalação/Registro seção
3
Tudo está pronto para gerar seu painel de administração usando o CRUD Generator.
Abra o gerador - /generator/generator.php - no seu navegador.
Instalação/Registro
Se você usar um servidor local + um servidor remoto, deverá executar o instalador em ambos: cada servidor registra suas próprias configurações de conexão e sua própria ativação de licença.
O que o instalador faz?
O instalador:
Testa a compatibilidade do seu servidor (versão do PHP, módulos disponíveis, direitos de escrita, ...)
Verifica e registra sua licença
Registra as credenciais de conexão com o banco de dados para o servidor atual em class/database/db-connect.php
Define as informações gerais essenciais (nome do projeto, logo, ...)
Um arquivo de conexão, até dois servidores
class/database/db-connect.php contém as configurações de conexão de até 2 servidores diferentes (por exemplo, seu servidor de desenvolvimento local e seu servidor de produção). O programa calcula uma impressão digital do servidor a partir do nome do host da máquina e do caminho de instalação, e usa automaticamente as configurações registradas para o servidor em que é executado.
Portanto, este arquivo pode ser sincronizado entre seus servidores sem risco.
Não há fallback: se o servidor atual não tiver nenhuma conexão registrada (instalação movida, pasta renomeada, container reconstruído, novo deployment, ...), a aplicação para em uma tela de Conexão com o banco de dados necessária que aponta para o instalador. Executar o instalador nesse servidor pré-preenche as configurações existentes e registra o servidor atual - nada é excluído.
Se você encontrar algum erro
Como em qualquer programa PHP, você pode encontrar problemas durante a instalação ou a inicialização inicial. Isso não significa que o programa esteja quebrado, mas sim que você precisa configurar seu servidor adequadamente para usá-lo.
Se isso acontecer:
Antes de tudo, verifique se o seu servidor atende aos requisitos (versão do PHP, reescrita habilitada, ...)
Não altere nada aqui, a menos que saiba o que está fazendo.
Configuração do USUÁRIO (Configurações Gerais)
Este arquivo contém algumas configurações globais que podem ser personalizadas
Para alterar essas configurações, abra o Generator no seu navegador e clique na aba Configuração aba.
Projeto
Nome do site
O nome do seu projeto exibido no cabeçalho do painel de administração.
Logo de administração
O logotipo do seu projeto exibido no cabeçalho do painel de administração.
Segurança
Bloquear o Generator
Permite bloquear/desbloquear o acesso ao gerador. Se o gerador estiver bloqueado, o acesso será protegido por uma página de identificação. Será necessário inserir seu e-mail e sua chave de licença para acessá-lo.
Licença
Status da licença
Cartão somente leitura exibindo o estado da sua licença: um selo de ativação (Ativada com data, ou Não ativada), sua chave de licença mascarada, e-mail de registro, domínio licenciado e um atalho para o seu portal do cliente Polar para gerenciar as ativações. O cartão lê apenas o registro local da licença — a ativação e a autorrecuperação são tratadas pelo install/do-install.php.
Depuração
Ativar depuração
Escolha "Sim" para exibir os detalhes quando uma consulta ao banco de dados encontrar um erro, além de mensagens de exceção e informações estendidas sobre o erro.
Simular e depurar
Se ativado, todas as consultas de inserção/atualização/exclusão serão simuladas (NÃO executadas) e os detalhes de todas as consultas ao banco de dados serão exibidos na tela.
Monitoramento de Erros do PHP
Ativar monitoramento de ERROS do PHP
escolha "Sim" para ativar o monitoramento de erros do PHP e receber um e-mail sempre que ocorrer um erro no painel de administração.
NÍVEL DE ERRO
Estão disponíveis 3 níveis de erro: NOTICE + WARNING + FATAL|UNKNOWN ERROR, WARNING + FATAL|UNKNOWN ERROR, FATAL|UNKNOWN ERROR.
E-mail
O(s) endereço(s) de e-mail para os quais você deseja que os erros sejam enviados.
Estilos
Tema Bootstrap
Selecione um dos muitos temas disponíveis na lista suspensa.
Estilo da barra de navegação
Estilo do menu de navegação superior do painel de administração.
Estilo da barra lateral
Estilo da barra lateral do painel de administração.
Classe CSS das colunas filtradas
No painel de administração, as colunas filtradas são marcadas com um estilo específico de sua escolha. Aqui você pode inserir uma classe CSS do Bootstrap e ajustar a opacidade. Por exemplo: bg-danger bg-opacity-10
Estilo dos seletores de data e hora
Estilo dos seletores de data e hora ("Default" ou "Material Design").
Classe padrão dos botões
Classe CSS do Bootstrap para os botões secundários do painel de administração. Por exemplo: text-bg-light
Fundo padrão dos cabeçalhos de tabela
Classe CSS do Bootstrap para os cabeçalhos de tabela do painel de administração. Por exemplo: text-bg-dark
Interface do usuário (UI)
Posição dos botões de ACTION no painel de administração
Escolha se deseja exibir os botões de edição de registro (visualizar/editar/excluir) à esquerda ou à direita nas listas READ do painel de administração.
Ativar a possibilidade de alterar os estilos pelo painel de administração
Se ativado, cada usuário pode escolher as cores de seu tema e barra de navegação. Suas preferências são armazenadas no navegador e não afetam os outros usuários.
Ativar filtros
Quando um usuário do painel administrativo define um filtro, o filtro pode ser aplicado imediatamente ou após clicar no botão "filtrar", como preferir.
Recolher categorias inativas da barra lateral
Escolha se deseja que a barra lateral do painel administrativo se comporte como um menu acordeão ou se várias categorias podem permanecer abertas ao mesmo tempo.
Exibição das tabelas de dados
Escolha se deseja exibir os dados da tabela na parte visível da página com uma barra de rolagem interna, ou em uma tabela de altura ilimitada usando a barra de rolagem do navegador.
Exibição dos resultados da busca
Exiba todos os resultados da busca na mesma página ou use resultados paginados.
Restrição de senha para novas contas de usuários
Escolha o nível mínimo de segurança para as senhas dos usuários administradores.
Configurações de idioma
Idioma
O idioma principal do painel administrativo.
Tradução de data/hora para as listas administrativas
Define o PHP Locale::setDefault para traduzir automaticamente as datas do PHP
Fuso horário
Seu fuso horário
Idioma dos seletores de data e hora
Os idiomas disponíveis estão localizados em class/phpformbuilder/plugins/pickadate/lib/compressed/translations/
Idioma da validação de formulários ao vivo (JavaScript)
Os idiomas disponíveis estão localizados em class/phpformbuilder/plugins/formvalidation/js/locales
Idioma da validação de formulários no servidor (PHP)
Proteger o acesso ao Gerador com uma página de login
Para proteger o acesso ao gerador:
Abra o Gerador - generator/generator.php - em seu navegador
Abra a Configuração aba
Defina Lock the Generator ao Sim
Pronto - quando você abrir generator/generator.php em seu navegador. Você será redirecionado para a página de login. Digite seu e-mail de registro e sua chave de licença para fazer login.
Painel Principal
Ao abrir o CRUD Generator, o aplicativo dá acesso a todos os seus recursos principais.
Escolha a tabela que deseja configurar e clique em um dos três botões disponíveis para criar ou editar seu administrador de Leitura Lista, Criação/Atualização de Formulários ou Exclusão de Formulário para a tabela escolhida.
Nesta aba você pode definir tudo o que for necessário para gerar a lista de Leitura da tabela selecionada. Para mais informações, consulte este tutorial, que mostra passo a passo como criar as Listas de Leitura do seu painel administrativo.
Filtros de Listas
Clique no botão "Adicionar Filtro" no formulário do gerador de Listas de Leitura para adicionar um novo filtro.
Ele adicionará um novo filtro à sua lista.
O PHPCG oferece dois tipos de filtros:
Filtros simples
Você só precisa escolher o campo a ser filtrado na lista suspensa.
Filtros avançados
Os filtros avançados são úteis:
se você quiser exibir dois ou mais valores na lista suspensa administrativa. por exemplo, o nome e o sobrenome são exibidos, e o valor filtrado é o ID.
se você quiser filtrar valores de relacionamentos externos.
Para usar filtros avançados, é necessário inserir parâmetros de consulta com joins.
Um botão de ajuda está disponível para auxiliá-lo na construção da sua consulta, assim como um botão de visualização que permite ver a lista suspensa gerada e verificar sua validade.
Você pode escolher o tema Bootstrap e as cores da barra de navegação na aba de Configuração do CRUD Generator.
Cada usuário do painel administrativo pode então escolher individualmente, no admin e de acordo com suas preferências, seu tema e cores preferidos, que serão aplicados apenas no seu próprio navegador (armazenados como cookies).
Temas Bootstrap e CSS
Se você é um desenvolvedor e usa Gulp + SASS, os arquivos-fonte estão disponíveis, prontos para uso e bem organizados:
SASS usuários: todos os fontes SASS estão disponíveis
Módulo de Autenticação de Usuários Administrativos
Instalação do Módulo de Autenticação de Usuário Admin
O instalador do Módulo de Autenticação de Usuário permite que você configure os direitos de acesso aos elementos do admin. Portanto, ele deve ser instalado por último, depois de ter criado todos os elementos do CRUD.
Abra o gerador no seu navegador e clique na aba "Módulo de Autenticação".
O instalador criará as tabelas users e users_profiles tabelas
Você também terá que inserir as informações do administrador principal.
O administrador principal poderá então gerenciar usuários e perfis no painel administrativo.
Reinstalar/Atualizar o Módulo de Autenticação de Usuário Admin
Se você adicionar tabelas ao seu painel administrativo depois de ter instalado o Módulo de Autenticação de Usuário, você terá que atualizar a tabela users_profiles .
Para isso, você tem duas possibilidades:
1 - reinstalar com o instalador automático
Desative o módulo no gerador
Desinstale o módulo no gerador
Exclusão admin/secure/install/install.lock do seu servidor
Exclua a tabela "users" e a tabela "users_profiles" do seu banco de dados.
Reinicie o instalador e siga o processo
2 - Atualizar com uma simples consulta SQL
Quando você instala/reinstala o módulo de autenticação, o users_profiles tabela usada pelo PHP CRUD Generator para gerenciar os direitos dos usuários é modificada. Para cada tabela do seu banco de dados usada no painel de administração, quatro campos são criados:
read_tabela
update_tabela
create_delete_tabela
constraint_query_tabela
Em vez de usar o instalador automático, você pode adicionar os quatro campos com uma simples consulta MySQL. O resultado será exatamente o mesmo que usar o instalador.
Copie / cole a consulta abaixo em sua interface de gerenciamento de banco de dados (ex: phpmyadmin) para adicionar os quatro campos à users_profiles .
Substitua users_profiles pelo seu users_profiles nome da tabela, que pode ter um prefixo.
Substitua _tabela pelo nome da tabela que você deseja adicionar ao módulo de autenticação.
ALTER TABLE `users_profiles`
ADD `r_table` BOOLEAN NOT NULL DEFAULT TRUE AFTER `profile_name`,
ADD `u_table` BOOLEAN NOT NULL DEFAULT TRUE AFTER `r_table`,
ADD `cd_table` BOOLEAN NOT NULL DEFAULT TRUE AFTER `u_table`,
ADD `cq_table` VARCHAR(255) NULL DEFAULT '' AFTER `cd_table`;
Protegido pelo módulo de autenticação de usuários & gerenciamento de direitos
Obter registros para pré-preencher o formulário
Criar e exibir o formulário, incluindo todos os plugins (dropdowns de seleção, pickers, uploaders, ...)
Validação PHP
Atualizar os registros do banco de dados ou exibir os erros caso valores incorretos sejam enviados
<?php
use phpformbuilder\Form;
use phpformbuilder\Validator\Validator;
use Migliori\PowerLitePdo\Db;
use common\Utils;
use secure\Secure;
include_once ADMIN_DIR . 'secure/class/secure/Secure.php';
$debug_content = '';
/* =============================================
validation if posted
============================================= */
if ($_SERVER["REQUEST_METHOD"] == "POST" && Form::testToken('form-edit-actor') === true) {
$validator = Form::validate('form-edit-actor', FORMVALIDATION_PHP_LANG);
$validator->required()->validate('first_name');
$validator->maxLength(45)->validate('first_name');
$validator->required()->validate('last_name');
$validator->maxLength(45)->validate('last_name');
if (isset($_POST['last_update_submit'])) {
$validator->date()->validate('last_update_submit');
} else {
$validator->date()->validate('last_update');
}
$validator->required()->validate('last_update');
// check for errors
if ($validator->hasErrors()) {
$_SESSION['phpfb']['errors']['form-edit-actor'] = $validator->getAllErrors();
} else {
// PowerLitePDO: the container is defined in conf.php
$db = POWERLITEPDO_CONTAINER->get(Db::class);
if (DEBUG_DB_QUERIES) {
$db->setDebug('silent');
}
$values = array();
$values['first_name'] = $_POST['first_name'];
$values['last_name'] = $_POST['last_name'];
$value_date = $_POST['last_update'];
$value_time = $_POST['last_update-time'];
if (isset($_POST['last_update_submit'])) {
$value_date = $_POST['last_update_submit'];
}
if (isset($_POST['last_update-time_submit'])) {
$value_time = $_POST['last_update-time_submit'];
}
if (trim($value_date . ' ' . $value_time) == '') {
$values['last_update'] = null;
} else {
$values['last_update'] = $value_date . ' ' . $value_time;
}
$where = $_SESSION['actor_editable_primary_keys'];
// begin transaction
$db->transactionBegin();
try {
// update actor
if (DEMO !== true && $db->update('actor', $values, $where, DEBUG_DB_QUERIES ? 'silent' : false) === false) {
$error = DEBUG_DB_QUERIES ? $db->getDebug()->get() : DB_ERROR;
throw new \Exception($error);
} else {
if (DEMO !== true && DEBUG_DB_QUERIES) {
$debug_content .= $db->getDebug()->get();
}
// get records from film_actor
$film_actor_current_records = array();
// Array with film.film_id
$film_actor_records_to_add = array();
// Array with film_actor.actor_id
$film_actor_records_to_delete = array();
$from = 'film_actor';
$columns = array('film_id');
$where = array('actor_id' => $_SESSION['actor_editable_primary_keys']['actor.actor_id']);
$db->select($from, $columns, $where, array(), DEBUG_DB_QUERIES ? 'silent' : false);
if (DEBUG_DB_QUERIES) {
$debug_content .= $db->getDebug()->get();
}
$db_count = $db->numRows();
if (!empty($db_count)) {
while ($row = $db->fetch()) {
$film_actor_current_records[] = $row->film_id;
}
}
foreach ($_POST['ext_film'] as $film_value) {
if (!in_array($film_value, $film_actor_current_records)) {
$film_actor_records_to_add[] = $film_value;
}
}
foreach ($film_actor_current_records as $film_value) {
if (!in_array($film_value, $_POST['ext_film'])) {
$film_actor_records_to_delete[] = $film_value;
}
}
// insert records in film_actor
foreach ($film_actor_records_to_add as $value) {
$values = array();
$values['actor_id'] = $_SESSION['actor_editable_primary_keys']['actor.actor_id'];
$values['film_id'] = $value;
if (DEMO !== true && $db->insert('film_actor', $values, DEBUG_DB_QUERIES ? 'silent' : false) === false) {
$error = DEBUG_DB_QUERIES ? $db->getDebug()->get() : DB_ERROR;
throw new \Exception($error);
}
}
// delete records from film_actor
foreach ($film_actor_records_to_delete as $film_id_value) {
$where = array();
$where['actor_id'] = $_SESSION['actor_editable_primary_keys']['actor.actor_id'];
$where['film_id'] = $film_id_value;
if (DEMO !== true && $db->delete('film_actor', $where, DEBUG_DB_QUERIES ? 'silent' : false) === false) {
$error = DEBUG_DB_QUERIES ? $db->getDebug()->get() : DB_ERROR;
throw new \Exception($error);
}
}
// ALL OK
if (!DEBUG_DB_QUERIES) {
$db->transactionCommit();
$_SESSION['msg'] = Utils::alert(UPDATE_SUCCESS_MESSAGE, 'alert-success has-icon');
// reset form values
Form::clear('form-edit-actor');
// redirect to list page
if (isset($_SESSION['active_list_url'])) {
header('Location:' . $_SESSION['active_list_url']);
} else {
header('Location:' . ADMIN_URL . 'actor');
}
// if we don't exit here, $_SESSION['msg'] will be unset
exit();
} else {
$db->transactionRollback();
$_SESSION['msg'] = Utils::alert(UPDATE_SUCCESS_MESSAGE . '<br>(' . DEBUG_DB_QUERIES_ENABLED . ')', 'alert-success has-icon');
}
}
} catch (\Exception $e) {
$db->transactionRollback();
$msg_content = DB_ERROR;
if (DEBUG) {
$msg_content .= '<br>' . $e->getMessage();
}
$_SESSION['msg'] = Utils::alert($msg_content, 'alert-danger has-icon');
}
} // END else
} // END if POST
// register editable primary keys, which are NOT posted and will be the query update filter
// $params come from data-forms.php
// replace 'fieldname' with 'table.fieldname' to avoid ambigous query
$where_params = array_combine(
array_map(function ($k) {
return 'actor.' . $k;
}, array_keys($params)),
$params
);
$_SESSION['actor_editable_primary_keys'] = $where_params;
if (!isset($_SESSION['phpfb']['errors']['form-edit-actor']) || empty($_SESSION['phpfb']['errors']['form-edit-actor'])) { // If no error registered
$from = 'actor';
$columns = '*';
$where = $_SESSION['actor_editable_primary_keys'];
// if restricted rights
if (ADMIN_LOCKED === true && Secure::canUpdateRestricted('actor')) {
$where = array_merge($where, Secure::getRestrictionQuery('actor'));
}
$db = POWERLITEPDO_CONTAINER->get(Db::class);
$db->select($from, $columns, $where, array(), DEBUG_DB_QUERIES ? 'silent' : false);
if ($db->numRows() < 1) {
if (DEBUG) {
exit('No Record Found');
} else {
exit('No Record Found');
}
}
if (DEBUG_DB_QUERIES) {
$debug_content .= $db->getDebug()->get();
}
$row = $db->fetch();
$_SESSION['phpfb']['form-edit-actor']['actor_id'] = $row->actor_id;
$_SESSION['phpfb']['form-edit-actor']['first_name'] = $row->first_name;
$_SESSION['phpfb']['form-edit-actor']['last_name'] = $row->last_name;
$last_update_ts = null;
if (!is_null($row->last_update)) {
$last_update_ts = strtotime($row->last_update);
}
// if timestamp is valid and > '1970-01-01'
if (!is_null($last_update_ts) && Utils::isValidTimeStamp($last_update_ts) && $last_update_ts > -62169984000) {
$_SESSION['phpfb']['form-edit-actor']['last_update'] = date('Y-m-d', $last_update_ts);
$_SESSION['phpfb']['form-edit-actor']['last_update-time'] = date('H:i', $last_update_ts);
} else {
$_SESSION['phpfb']['form-edit-actor']['last_update'] = null;
$_SESSION['phpfb']['form-edit-actor']['last_update-time'] = null;
}
}
$_SESSION['phpfb']['form-edit-actor']['ext_film'] = array();
$from = 'film_actor';
$columns = array('film_id');
$where = array('actor_id' => $_SESSION['actor_editable_primary_keys']['actor.actor_id']);
$db = POWERLITEPDO_CONTAINER->get(Db::class);
$db->select($from, $columns, $where, array(), DEBUG_DB_QUERIES ? 'silent' : false);
if (DEBUG_DB_QUERIES) {
$debug_content .= $db->getDebug()->get();
}
$db_count = $db->numRows();
if (!empty($db_count)) {
while ($row = $db->fetch()) {
$_SESSION['phpfb']['form-edit-actor']['ext_film'][] = $row->film_id;
}
}
// $params come from data-forms.php
$pk_url_params = http_build_query($params, '', '/');
$form = new Form('form-edit-actor', 'horizontal', 'novalidate');
$form->setAction(ADMIN_URL . 'actor/edit/' . $pk_url_params);
$form->startFieldset();
// actor_id --
$form->setCols(2, 10);
$form->addInput('hidden', 'actor_id', '');
// first_name --
$form->setCols(2, 10);
$form->addInput('text', 'first_name', '', 'First Name', 'required');
// last_name --
$form->addInput('text', 'last_name', '', 'Last Name', 'required');
// last_update --
$form->groupElements('last_update', 'last_update-time');
$form->addPlugin('pickadate', '#last_update'); // date field
$form->addPlugin('pickadate', '#last_update-time', 'pickatime'); // time field
$form->setCols(2, 6);
$form->addInput('text', 'last_update', '', 'Last Update', 'required, data-format=dd mmmm yyyy, data-format-submit=yyyy-mm-dd, data-set-default-date=true');
$form->setCols(0, 4);
if (DATETIMEPICKERS_STYLE === 'material') {
$form->addInput('text', 'last_update-time', '', '', 'required, data-format=hh:i A, data-format-submit=HH:i, data-twelve-hour=false, data-interval=15, placeholder=Time');
} else {
$form->addInput('text', 'last_update-time', '', '', 'required, data-format=H:i a, data-format-submit=HH:i, data-interval=15, placeholder=Time');
}
$form->setCols(2, 10);
// external relation: actor => film_actor => film;
$from = 'film';
$columns = 'title, film_id';
$where = false;
$extras = array(
'selectDistinct' => true
);
$db = POWERLITEPDO_CONTAINER->get(Db::class);
$db->select($from, $columns, $where, $extras, DEBUG_DB_QUERIES ? 'silent' : false);
if (DEBUG_DB_QUERIES) {
$debug_content .= $db->getDebug()->get();
}
$db_count = $db->numRows();
if (!empty($db_count)) {
$values = array();
$display_values = array();
while ($row = $db->fetch()) {
$values[] = $row->film_id;
$display_values[] = $row->title;
}
for ($i = 0; $i < $db_count; $i++) {
$form->addOption('ext_film[]', $values[$i], $display_values[$i]);
}
$form->addSelect('ext_film[]', 'Film', 'data-slimselect=true, multiple, data-close-on-select=false');
}
$form->addBtn('button', 'cancel', 0, '<i class="' . ICON_BACK . ' prepend"></i>' . CANCEL, 'class=btn btn-warning, data-ladda-button=true, data-style=zoom-in, onclick=history.go(-1)', 'btn-group');
$form->addBtn('submit', 'submit-btn', 1, SUBMIT . '<i class="' . ICON_CHECKMARK . ' append"></i>', 'class=btn btn-success, data-ladda-button=true, data-style=zoom-in', 'btn-group');
$form->setCols(0, 12);
$form->centerContent();
$form->printBtnGroup('btn-group');
$form->endFieldset();
$form->addPlugin('pretty-checkbox', '#form-edit-actor');
$form->addPlugin('formvalidation', '#form-edit-actor', 'default', array('language' => FORMVALIDATION_JAVASCRIPT_LANG));
Personalização para usuários avançados
Se a estrutura do seu banco de dados mudar ao longo do caminho, o PHPCG é capaz de reconstruir os dados e permite que você regenere as páginas CRUD correspondentes.
Ao gerar as páginas do painel de administração, o PHPCRUD mantém automaticamente um backup da versão anterior.
Os ferramenta de comparação de arquivos integrada ao gerador permite comparar lado a lado sua versão atual e a anterior e mesclá-las escolhendo os blocos de código a serem mantidos.
As personalizações da administração podem, assim, ser mantidas durante alterações de versão/estrutura.
Instruções de atualização
As atualizações são automáticas.
Quando uma nova versão é lançada, você verá a mensagem "New PHP CRUD GENERATOR version is available" em /generator/generator.php e bastará clicar no botão "Install".
O número da sua versão está disponível em /conf/conf.php (VERSION)
Atualizando da versão 1.x para a 2.x
A versão 2 é uma atualização principal, portanto não é possível atualizar a partir da versão 1.
A solução, portanto, é instalar a versão 2 e, em seguida, reconfigurar seu painel de administração a partir dela.
Idiomas/Tradução (I18n)
O PHP CRUD Generator e o painel de administração Bootstrap gerado são totalmente multilíngues.
Para traduzir para o seu idioma:
Duplique admin/i18n/en.php e renomeie-o para o seu próprio idioma.
Faça as traduções dentro do arquivo que você criou (admin/i18n/[seu-idioma].php)
Abra a aba Configuration do CRUD Generator e defina o idioma com o nome de arquivo que você usou anteriormente (ou substitua "lang": "en" pelo nome do seu arquivo em conf/user-conf.).
Verifique class/phpformbuilder/plugins/select2/js/i18n/[seu-idioma].js e crie-o se não existir.
Ficaremos felizes em receber sua tradução. Ela será útil para outros usuários.
PHP Form Builder
PHP Form Builder está incluído no pacote, e você pode usá-lo sem restrições no mesmo domínio do seu CRUD.
Isso significa que você pode criar qualquer formulário que desejar em seu site/projeto e usar os plugins e funcionalidades integrados.
Para usar o PHP Form Builder em seu projeto, crie um arquivo PHP onde deseja adicionar um formulário ou abra qualquer arquivo PHP existente e, em seguida, adicione este código bem no início dele:
Então você poderá criar seus formulários. A documentação está disponível no site oficial: https://www.phpformbuilder.pro
Construtor de Formulários Drag & Drop e Templates
O Construtor de Formulários drag & drop e os templates de formulários não estão incluídos no pacote do PHP CRUD Generator. Isso não é uma restrição, mas simplesmente porque estão disponíveis online, e a maioria dos usuários não precisa deles, reduzindo assim o peso do pacote PHPCG.
O arquivo ZIP contém dois diretórios: drag-n-drop-form-builder e templates
Construtor de Formulários Drag & Drop
Coloque o drag-n-drop-form-builder diretório dentro da pasta classe , logo ao lado da pasta phpformbuilder . Você poderá então abrir /class/drag-n-drop-form-builder/index.html no seu navegador e começar a criar seus formulários.
Quando você obtiver os códigos dos formulários gerados pela ferramenta de arrastar e soltar, não se esqueça de sempre adicionar manualmente o código específico do CRUD Generator (conforme explicado acima):
Coloque o drag-n-drop-form-builder diretório dentro da pasta classe , logo ao lado da pasta phpformbuilder . Você poderá então abrir /class/drag-n-drop-form-builder/index.html no seu navegador e começar a criar seus formulários.
Os templates pode estar em qualquer lugar do seu servidor, não importa em qual pasta esteja, os templates funcionarão perfeitamente.
Fontes e Créditos
Muitos agradecimentos aos autores por seu excelente trabalho
Após qualquer atualização, feche e reabra seu navegador para limpar a SESSION do PHP
versão 3.0.0 (10/2026)
New Features:
- Polar one-time-purchase license replaces the purchase code system (self-service activation, customer portal management)
- new pricing page with the Polar checkout
- reworked install wizard: step 1 combines the Polar license activation and the server prerequisites check
- server-aware database connections: db-connect.php stores up to 2 per-server connection settings (localhost + remote), selected by server fingerprint and synchronizable between environments
- new db-connection-recovery screen guides the user to the installer when no stored connection matches the current server
- generator "Reinstall" button with optional backup ZIP before uninstall
- add Danish translation (Generator, Admin panel and PHP CRUD Generator's website)
Improvements:
- PHP 8.1 required (installer check updated accordingly)
- replace the legacy diff/merge ajax layer by the visual-diff-merge package
- multilingual support of the installer and the admin templates
- new DEBUG constant (configurable from the generator settings) replaces the ENVIRONMENT constant
- automatic aria-labels on generated form fields and admin search controls (accessibility)
Bug Fix:
- remove unused PHPCG_USERDATA_TABLE definition (user_data table option no longer available)
versão 2.3.12 (02/2025)
New Features:
Improvements:
- add a "refresh" button to the auto-updater to clear the cached versions
- auto-updater now displays a message for the user if the PHP ZIP extension is missing
Bug Fix:
- fix 'time' fields session values in the generator's create form
versão 2.3.11 (01/2025)
New Features:
Improvements:
- manage the cases where the database connection fails or the database is empty and display a proper error message
- replace silent errors (@) with try/catch blocks
Bug Fix:
- fix database INSERT error with tables that have multiple indirect foreign keys
- fix a problem with external fields in forms that didn't show
- fix saving edited images in the image uploader when the image is preloaded from the database
- fix custom time formats storage in the generator READ lists
versão 2.3.10 (11/2024)
Bug Fix:
- fix external fields indexing issue in the generator's generate create/edit form
- fix custom datetime formats storage in the generator READ lists
- fix the image uploader's editor to save files & thumbnails after editing
- rewrite the image uploader's resizing code to avoid exceeding max width & height when both are set
- fix wrong values in export data when external tables have the same fieldnames
- fix php warning in generator forms with image fields when thumbs, crop or editor are not set
- publish Db class with the latest changes for zero / null values in select queries
- fix php 8.3 types errors
versão 2.3.9 (09/2024)
Bug Fix:
- fix a php8 json_decode error in the edit forms with select multiple or checkboxes
- fix a php7.7 compatibility issue with the FormExtended class
versão 2.3.8 (09/2024)
New Features:
- Ability to filter data in lists by empty, null, and zero values.
Bug Fix:
- fix installer error when the default logo file doesn't exist on the server
versão 2.3.7 (09/2024)
Improvements:
- upgrade PHP Form Builder to the latest version (5.3.0)
Bug Fix:
- fix generator diff-files form error for installations in a subfolder
- fix the admin filters that look for array values
- fix the "Enable the ability to change styles from the admin dashboard" option in the generator configuration form
versão 2.3.6 (01/2024)
New Features:
- add a PHP Error Handler and Monitoring system with automatic email sending
- add the PHP Error Handler and Monitoring configuration to the Generator's configuration tab
- add the German translation
Bug Fix:
- fix the Material Datepicker plugin bug in admin forms
- fix pickadate time picker reported bug: https://github.com/amsul/pickadate.js/issues/1243
- fix file uploader image resizing ratios (previously not working properly in some specific cases)
versão 2.3.5 (12/2023)
Improvements:
- improve Spanish translations
Bug Fix:
- fix "|raw" apprearing in the list's tables headers"
- fix quotes escaping in the forms help texts
versão 2.3.4 (11/2023)
Bug Fix:
- fix a weird error with the error_log function call in DB class
- fix error with the Spanish translation
versão 2.3.3 (11/2023)
New Features:
- Add PHP Errors Monitoring with email sending. Available in the generator's configuration tab.
Improvements:
- lint code with SonarLint + PHP 8.2, remove all php deprecated and warning messages
Bug Fix:
- fix a bug with "update" queries using the same fieldname in both values and where clause
versão 2.3.2 (10/2023)
Improvements:
- add SQL group_by clause in DB->select() '$extras' argument
- ability to use HTML code for field titles
Bug Fix:
- the custom fieldnames are now properly displayed in the single records views
- fix image field addons display in the generator forms
- fix admin infinite loading bug in Firefox due to an internal Pace loader bug (https://github.com/CodeByZach/pace/issues/510)
versão 2.3.1 (04/2023)
Bug Fix:
- fix the file comparison tab not showing the tool
- fix the broken date pickers translations
versão 2.3 (03/2023)
Improvements:
- fix wrong links & images in the documentation
- database insert now returns the last insert id if supported by the db driver
Bug Fix:
- fix plugins_path in class/Form.php (PHP Form Builder) when the plugins folder URL is set with $form->setPluginsUrl()
- repair the database getLastInsertId() function
- remove PHP warning with Secure class when passing NULL to the constraint query
- fix floating values that were converted to int with input[type="number"]
- fix query error with empty filters
- fix a warning in admin forms with some special restriction queries
- fix error when sorting fields from relational tables
- fix Deprecated error in class.fileuploader.php
versão 2.2 (02/2023)
Improvements:
- remove the search box in the Edit in place's boolean selects
Bug Fix:
- fix non-working Generator lock
- fix error on cascade delete - please regenerate your delete forms if they use cascade deletion to get them working properly.
versão 2.1 (01/2023)
Improvements:
- authentication module installer will keep the multiselect opened when choosing the admin tables
- update the wordcharcount plugin to set the default maxWords to -1 (= infinity)
Bug Fix:
- fix a wrong query in create/update forms on external tables
- fix tinymce theme in class/phpformbuilder/plugins-config-custom/tinymce.xml
versão 2.0.1 (01/2023)
Improvements:
- enable of the auto-update system for the package's version 2
Bug Fix:
- fix filters inappropriate error message when the filter data contains null values
versão 2.0 (01/2023)
New Features:
- switch from Mysqli to PDO with prepared queries
- Oracle database support
- PostgreSQL database support
- Firebird database support
- upgrade to Bootstrap 5
- upgrade Bootswatch themes
- add the SCSS source files to the package
- rewrite the color palette and make use of the Bootstrap 5 color contrast utilities (.text-bg-xxx)
- replace PHP Form Builder by the latest version
- add 'Display the database errors' and 'Simulate and debug' options to the generator's general settings for easy database debugging.
- add an option to the generator's general settings to display the data tables in the viewport with or without a vertical scrollbar.
- highly improve the debugging system, which now can show all the queries (including Ajax requests), PDO parameters and performances using the 'Simulate and debug' option.
- add the ability to set a custom CSS class for the filtered columns in the admin READ
Improvements:
- auto-highlight filtered columns in the admin READ lists and remove the "Column number" setting in the generator "advanced filters" settings
- the generator's advanced filters test tool now analyzes the queries and display an explicit error message when a field are missing from the query.
- optimisation of the CRUD Generator forms and tools for more efficient loading
- complete redesign of the generator and admin dashboard User Interface (UI)
versão 1.29 (08/2022)
Improvements:
- add an error message with a link to the documentation when a user opens a READ lists in the admin with the authentication module enabled and the table not registered inside it.
Bug Fix:
- fix an error with external fields multiple checkboxes
versão 1.28 (07/2022)
New Features:
- Display of values from secondary relationships.
E.g: address.city_id -> city.country_id -> country.name
PHPCG now can show the country name straight from the address READ list and forms.
- Add capability to load the select options dynamically in Ajax from the database in the admin forms
Improvements:
- add 'json' in database fields types
- update and improve the file comparison tool
- test Apache FollowSymLinks + admin 404 errors in the installer and return the appropriate help messages
versão 1.27 (06/2022)
Improvements:
- the installer will now show a clear message if the database connection is successful but no table is found, instead of showing a connection failure message.
Bug Fix:
- fix a missing translation in Italian
- fix a missing parenthesis in generator/generator-templates/form-edit-template.php
versão 1.26 (05/2022)
Bug Fix:
- fix a missing parenthesis in generator/generator-templates/form-create-template.php
versão 1.25 (05/2022)
Improvements:
- PHPCG will now preselect the current values in READ lists live-edit's select dropdowns
- the Live edit in admin READ lists will now show the values of the relational table instead after editing
- fix PHP warning with mysqli_free_result, boolean and null values & PHP 8.1
- add a loading indicator when loading Live Edit forms from the READ lists
Bug Fix:
- set mysqli_report to MYSQLI_REPORT_OFF during the installation to make sure that mysqli_query will not throw a warning when a query fails (which is normal when we test if a table exist for instance, the query returns false);
- fix all the errors in the generator with PHP8 and the count() function when some fields have been deleted from the database
- fix broken queries due to a regex that didn't include table/field names with a number in admin/class/crud/ElementFilters
- fix PHP Warning with Ajax filters in the admin dashboard
- escape JSON values in Live edit select dropdowns
versão 1.24 (02/2022)
Improvements:
- add a warning to the installer if the install folder is not at the root of the project
- add the same warning to the Quick Start Guide
versão 1.23 (11/2021)
Improvements:
- update the TWIG engine to 3.3.4
- add a "Select" type in the READ list generator to prevent the CREATE/UPDATE form from reverting to "text" when rebuilding the READ list
- add a message in the installer to warn users if their url has uppercase characters (uppercase are not valid and cause problems).
Bug Fix:
- replace a php arrow function call in ElementsFilters.php for php <7.4 compatibility
versão 1.22 (10/2021)
Improvements:
- load the Codecanyon package images in documentation/index.html from local assets instead of Cloudinary CDN, which was not authorized for external hostnames
Bug Fix:
- fix a sql error caused by Secure users rights (Secure::getRestrictionQuery() returning a single space instead of an empty value)
- the Date Range filters now remove the NULL values to detect the minimum / maximum available dates for filter
- fix filter error with invalid JSON values in database in latest MySQL versions
- fix missing images in the documentation on users localhost.
- fix the admin search engine for relational fields with 2 values
versão 1.21 (08/2021)
Bug Fix:
- the PHP integer validator will now accept null values
- In the generator - custom validation: removing a validator will now work as expected instead of always removing the last validation rule.
versão 1.20 (07/2021)
New Features:
- Add a new option in the generator that allows to choose the target (intermediate or final table) of the add/edit/delete buttons for relational tables
Bug Fix:
- fix error in Material Datepicker months (error coming from the original plugin)
- fix missing ACTION header in the admin lists when the action buttons are on the right and bulk check is disabled
versão 1.19 (04/2021)
Improvements:
- update the admin css to align the nested tables vertically on top
Bug Fix:
- fix broken boolean filters in the admin panel
- fix php warnings in the generator with validation auto + INT fields + MySQL v8
- restore the "add new" button for nested tables (external relations) in the admin dashboard READ lists
- fix paginated search results urls in the admin dashboard
- fix wrong links from READ lists nested tables to their edit/delete form if the nested table name contains underscores
versão 1.18 (03/2021)
New Features:
- PHPCG now accepts PHP 8
Improvements:
- choice of the name of the license table during the installation process
- improve php version checking during the installation process
- update the Tinymce responsive filemanager plugin to the latest version - only in the Codecanyon package, not in the auto-update to avoid breaking customized code from users.
- improve code standards for PHP 8 compatibility
Bug Fix:
- fix issues with boolean values storage in the generator
- remove PHP warning with Ajax filters loading
- remove PHP warnings in the generator about missing relations
- fix weird field types returned by MySQL, e.g., "smallint unsigned" instead of "smallint", which is the official valid field type
versão 1.17 (03/2021)
- quickly unreleased because of unexpected bugs
versão 1.16 (02/2021)
New Features:
Improvements:
Bug Fix:
- fix wrong behavior of the admin delete forms when no option or "no" is selected due to a previous update
- solve assets urls issues in the main index.html and the documentation
versão 1.15 (12/2020)
New Features:
- add a new 'html' field type in the generator to show the HTML content in the admin lists instead of HTML code when the fields contain HTML
- auto enable textarea + tinyMce in the generator for HTML fields
Improvements:
- add $mail->Sender in Form.php for PHPMailer to improve email deliverability
- edit the Fileuploader PHP image upload script to crop the images AFTER resizing
- (the original behavior that center-crops the original image is still available in the file code comments)
- add a default empty value in the admin forms select, radio & checkbox when the field is not required
Bug Fix:
- validator now validates integers with leading zeros (PHP :: Bug #43372)
- fix wrong ajax POST url in the admin search with paginated results
- fix textarea custom heights in CREATE forms
versão 1.14 (11/2020)
New Features:
- add field height option for textarea in the generator
Improvements:
- Accept NULL date / time instead of registering the default '1970-01-01 00:00' timestamp in database
- sanitize directory separator in class/Form.php to avoid wrong plugins url detection on server with inconsistent $_SERVER['SCRIPT_NAME'] and $_SERVER['SCRIPT_FILENAME'] values
- show tinymce and word char count in the generator only for textarea
Bug Fix:
- remove php warning when posting a delete form without choosing yes/no
versão 1.13.3 (11/2020)
Improvements:
- improve scrolling behavior in admin nested tables show / hide
Bug Fix:
- fix non-working nested tables show / hide due to the new OverlayScrollbars plugin
versão 1.13.2 (11/2020)
Bug Fix:
- replace the deprecated admin table scrollbar plugin broken by the latest jQuery with the great new OverlayScrollbars plugin
versão 1.13.1 (11/2020)
New Features:
- new tutorial to customize the admin Home page: https://www.phpcrudgenerator.com/tutorials/customize-the-bootstrap-admin-homepage
- add documentation to update the Authentication Module with a simple SQL query instead of reinstalling from scratch:
https://www.phpcrudgenerator.com/documentation/index#admin-user-authentication-module
Bug Fix:
- fix a bug in the General Settings Form due to the previous update
versão 1.13 (11/2020)
Bug Fix:
- update jQuery to 3.5.1 due to a recent browser bug that prevented the generator forms to submit (nothing happened after clicking the submit button)
versão 1.12 (11/2020)
Bug Fix:
- prefill the generator create/update form properly with TinyMce and character counter options & values
- remove php warning when installing the authentication module
- move the generator scripts to the <head> part to avoid jQuery not loaded error in some special circumstances
- change the target table in READ lists nested tables EDIT buttons to the end relationnal table instead of intermediate
- edit class/Utils/isValidTimeStamp function to return true with number entry as well as string
versão 1.11 (09/2020)
Improvements:
- trim $url in CrudTwigExtension::ifRemoteFileExists($url) - vendor/twig/twig/src/Extension/CrudTwigExtension.php
- replace "url" property in object classes with "item_url" to avoid conflicts with database fields named "url"
Bug Fix:
- fix php Notice when building single record READ lists
- add empty default value in create / update forms for fields that get their values from a table when no record exist
- fix the filtered columns overlay colored by colorColumns in the admin READ lists
- fix wrong default dates / times in UPDATE forms with the pickadate & material date/time pickers hidden fields
- fix date value with date pickers when a form is posted with errors
- fix the index of the colored columns in READ lists when some filters are active with bulk delete enabled and admin action buttons are on the left
versão 1.10 (06/2020)
Improvements:
- add "open url button" link to the documentation in the generator
- better date & time formats management with the material datepicker plugin
(rebuild your create/update forms if you want to benefit from these changes)
Bug Fix:
- fix date and time custom formats with translations in the create / edit forms
- add missing session_start() in ajax bulk delete forms
versão 1.9 (06/2020)
New Features:
- add Bulk Delete capabilities to the admin dashboard's data lists
- add date range picker filter to the generator filters options + the admin dashboard's data lists
- add "Default field for search" option to the generator
Improvements:
- improve the generator design consistency
- improve root path detection for servers with inconsistent directory separators
- collapse admin inactive sidebar categories on categorie click
Bug Fix:
- fix Ajax filter results when the result options use 2 field names
versão 1.8 (05/2020)
Improvements:
- add timezone to the generator general settings
- update PHP Form Builder to the latest version (4.4)
- upgrade Twig to Twig 3.0 and others vendor libraries for PHP 7.4.x compatibility
- add php DOM extension test in the installer's server capabilities tests
- add a clear error message with a link to the help center on root path detection failure
- add a loading indicator to the auto-updater
Bug Fix:
- fix wrong urls in admin forms when moving the admin files from localhost to the production server
- fix the missing relational values in the exported data
- fix admin login failure after reinstalling the authentication module with changing the user table name
- replace the double quotes with single quotes in the generator delete form template main query
versão 1.7.7 (04/2020)
Bug Fix:
- fix stupid ROOT path error with subfolder installations due to the previous update
versão 1.7.6 (04/2020)
Improvements:
- add a server test file in the install folder to debug paths & urls
- auto-apply ORDER BY changes from the generator to the admin panel without clearing PHP session
- update ElementFilters to allow simple quotes in advanced filters
Bug Fix:
- fix ROOT path with server alias
versão 1.7.5 (04/2020)
New Features:
- add an "Ajax loading" option in the generator READ Lists filters (default: false)
Hint: Enable Ajax loading on all the tables that contain a lot of records
This new option allows to load the filters options on demand and will GREATLY improve the loading speed
- add ORDER BY in the generator READ List main settings
- add website search to https://www.phpcrudgenerator.com documentation, tutorials & help center
- add default skin loader for each Bootstrap admin theme CSS in the general settings form
- add the item name in the admin header h1
- add a footer template for admin READ lists (admin/templates/footer.html)
Improvements:
- cleaner generator design
- add instructions to solve 404 errors on some servers (lightspeed) in the help center + admin/.htaccess
- various minor optimizations
Bug Fix:
- fix Tinymce's Responsive file manager url
- edit the cUrl test file in install/
versão 1.7.4 (12/2019)
New Features:
- new setting available to choose to show search results in all on the same page or in a paginated list
IMPORTANT: regenerate your READ lists from the generator if you want the paginated search results
or your paginated results will lead to 404 NOT FOUND
Bug Fix:
- fix nested table records in READ lists with only the primary key displayed
- fix the "add new" button link (previously to 404) in READ lists nested tables with page > 1
- the generator delete form now sets the correct stored options for external tables records
versão 1.7.3 (12/2019)
New Features:
- add an "Advanced" section in the tutorials with a new "Date and Time formats management logic tutorial
Bug Fix:
- fix wrong date / time formats in admin READ lists for servers without PHP intl extension in some random cases depending on the chosen format
- fix date / time format dropdown helpers in the generator
versão 1.7.2 (11/2019)
Improvements:
- add Czech translation
- improve documentation
Bug Fix:
- fix PHP warnings with forms & array values
- fix error in general settings form when no logo is registered
- fix filters query with number values & MySQL 5.7+
- fix error in the Italian translation
- fix PHP warning caused by primary keys aliases in the admin READ lists external relations
versão 1.7.1 (08/2019)
Bug Fix:
- Fix the Admin Dropdown Search field cross-browser compatibility
(rebuild your lists to apply)
versão 1.7 (08/2019)
New Features:
- New live search with Ajax Autocomplete for Bootstrap Admin Panel READ lists
(rebuild your lists to apply)
Improvements:
- Update Material Pickers for compatibility
versão 1.6.1 (07/2019)
New Features:
- Admin filters now can deal with JSON array values (select multiple, checkboxes)
- New PHP CRUD Generator Tutorials channel on Youtube
Improvements:
- Array values from database now displayed as comma-separated values instead of raw JSON
- improve the online Documentation & Tutorials
Bug Fix:
- Rewrite code to limit users rights to their own records
(rebuild your lists / forms to apply)
Improvements:
- The General Settings form in the generator now allows to change the Bootstrap admin main body class
Bug Fix:
- the installer was broken by the previous changes. Solved now.
- Edit in place is no more available in Admin READ lists for users with insufficient rights
- the broken "enable/disable" authentication module in the Generator now works again
versão 1.5.5 (06/2019)
New Features:
- The date & Time pickers languages can now be defined in the General Settings form
- You can now choose the style of the Bootstrap admin date & Time pickers
(default | Material Design)
- New Italian translation - Many thanks to Alberto
versão 1.5.4 (06/2019)
New Features:
- New General Settings form available in the Generator
- The action buttons of the Bootstrap Admin panel can now be on the left or right of the table
- The filters of the Bootstrap Admin panel can now be triggered automatically when selected
- You can change the site title and admin logo using the General Settings form
- You can change the admin language using the General Settings form
- You can change the admin skin using the General Settings form
Improvements:
- Show custom table names in Admin READ lists nested tables
Bug Fix:
- The Validation button in the Generator should now never overlap the forms
versão 1.5.3 (06/2019)
New Features:
- Action buttons in the admin panel can now be displayed in the
1st column of the admin READ lists
Improvements:
- Responsive & others in admin CSS
Bug Fix:
- datepicker plugin
- files & images upload
- tooltips
(these bugs were due to the previous update with latest PHP Form Builder)
New Features:
- replace PHP Form Builder with the latest version 4.2.1
Improvements:
- Admin Panel Fast Loading optimization with the new LoadJS features
- PHP CRUD Fast Loading optimization with the new LoadJS features
- rewrite queries for admin restricted users rights
- upgrade Bootstrap to the latest version 4.3.1
- minor various others improvements
versão 1.4.9 (05/2019)
New Features:
- add new Export features (print - current view - all records) in admin READ lists
versão 1.4.8 (02/2019)
New Features:
Improvements:
- add (very) strong protection for fileuploader plugin uploads
Bug Fix:
- remove some PHP warnings
- solved admin sidebar duplicate items issue
versão 1.4.7 (02/2019)
Bug Fix:
- fix navbar issue with empty icons
versão 1.4.6 (02/2019)
New Features:
- New "array" field type in generator for checkboxes & select multiple values
will show JSON decoded values in the READ lists
Improvements:
- better admin navbar content management ("Organize Navbar")
- improve array values management in the generator
Bug Fix:
- fix non-working select multiple with "set" & "enum" field types
- fix changelog url in auto-update success message
versão 1.4.5 (02/2019)
New Features:
- License system now accepts domain with multiple extensions
e.g., domain.com, domain.eu, domain.co.uk are all valid with the same license.
- New button in the Generator to reload fresh database structure
(When you add or remove tables)
Improvements:
Bug Fix:
- admin filters now accept zero values
- fix queries in admin lists on external tables with direct relation (no intermediate table)
versão 1.4.4 (02/2019)
New Features:
- external records from relational tables can now be managed
from the READ LISTS & the CREATE/UPDATE forms (!)
- add self-referential foreign keys management
- tables can now be removed/re-enabled from the admin navbar
- add Spanish admin translation (Thanks to Sergio)
Improvements:
- export buttons (csv/xls[x]) now export the exact filtered list items
- align single fields on the left in admin panels
Bug Fix:
- remove phone validation in auth. module installer
- logout from generator/generator.php now does its job as intended
- upgrade PHPMailer to latest 6.0.6 to fix PHP 7.3 warnings
versão 1.4.3 (12/2018)
Bug Fix:
- fix inverted label & value in form CREATE/EDIT templates
- protect relation tables SELECT queries in form CREATE/EDIT templates
versão 1.4.2 (10/2018)
New Features:
- new "Add New" button in admin READ lists on external nested tables even if no record
Improvements:
- ADMIN panel: register URL query parameters in $_GET (Altorouter ROUTES doesn't deal with these).
- the ADMIN ADD & UPDATE forms now redirect to the correct list if we come from a nested table (external relation)
- move date_default_timezone_set from conf/conf.php to conf/user-conf.php
- add Help & instructions for Microsoft IIS & NGINX servers
Bug Fix:
- "Add New" button in admin READ lists now always targets the right CREATE form
even if there's several external nested tables in the list.
- Fix several warnings & minor issues
versão 1.4.1 (10/2018)
New Features:
- add "Add New", "Edit" & "Delete" buttons in READ Lists nested tables for external tables records
Improvements:
- add compatibility for date & time without PHP intl extension
Bug Fix:
- definitely fix the Apache mod_security error on the install process with some misconfigured servers
versão 1.4 (10/2018)
Atenção: se suas listas READ de administrador tiverem campos de data ou data e hora, abra os templates correspondentes em /admin/templates, localize as funções toDate(...) e substitua o formato de data do PHP pelo formato de data ICU.
New Features:
- PHPCG includes now the complete latest PHP Form Builder version with all its features & plugins.
- Add the online knowledge base with numerous tutorials & videos
Improvements:
- improve date & time translations management - https://www.phpcrudgenerator.com/tutorials/translate-dates-times-in-admin-panel
- add full date & time translation in admin lists & forms
- change admin form action from absolute url to root relative url
- add install/curl-test.php to help with CURL debbuging
Bug Fix:
- the generator now retrieves the correct stored values to be displayed in READ lists for the external fields
- get the correct time value in admin edit forms with datetime fields
- solve plugins URL detection with paths containing uppercase letters
versão 1.3.2 (08/2018)
Improvements:
- dates edit in place now get the current field value
- image now crop from the center
Bug Fix:
- fix missing fields in update forms due to previous update error
- fix admin lists bug with fields having uppercase characters
- fix admin edit in place with dates & uppercase table name
versão 1.3.1 (08/2018)
Improvements:
Bug Fix:
- fix Generator form create profiles
versão 1.3 (08/2018)
Notes:
- After this update you may have to reinstall the user authentication module from the Generator page.
Improvements:
- update server-side validation functions to accept empty values,
except for the validators whose internal logic make values required.
Details available here: https://www.phpformbuilder.pro/documentation/class-doc.php#php-validation-methods
- the User Authentication Module now keeps the users & users profiles tables and records when uninstalling.
- the User Authentication Module can now be reinstalled even if the users & users profiles table exist
- improve user profiles management and rights limitations
- the users rights changes now take effect without clearing the session
- the admin sidebar doesn't show empty categories anymore
- the only required fields in users table are now name, firstname, profile ID, email, pass & active
(takes effect on new User Authentication Module installs only)
- add simulate property to Generator.php to simulate when we reset a table structure from generator
- remove several warnings & improve various feedback messages
Bug Fix:
- solve problem with updates & SSL errors on misconfigured servers
versão 1.2.4 (07/2018)
Notes:
- After this update you may have to reinstall the user authentication module from the Generator page.
Improvements:
- set default empty value for passwords in UPDATE FORMS
Bug Fix:
- solve CREATE/UPDATE forms generation with custom validation
- solve READ LISTS generation with advanced filders
- solve image path in admin when the field thumbs are not enabled
- remove password validation in UPDATE FORMS if posted value is empty
- correct select values count in generator CREATE/UPDATE forms with custom values
- solve error 500 when adding new users
versão 1.2.3 (07/2018)
New Features:
- add an uninstallation process
- add a login module for the generator on the production server
- primary key management in admin forms
Improvements:
- remove the "select database" form in generator & auto select the correct database
- add warnings for non-standard tables & field names (hyphenated)
- improve password fields management in CREATE/UPDATE forms:
better password encryption with Secure class
password are now automatically optional on update forms with an helper text: "Leave blank to keep the current password"
- turn fileuploader debug on for CREATE/UPDATE forms
- improve documentation
- improve auto-validation detection according to forms & database field types
Bug Fix:
- revert Twig template engine to version 1.35.4 to preserve PHP < 7.0 compatibility
- regenerate css & js combined plugin files for CREATE/UPDATE forms when the forms are edited with the generator
- fix generator which failed to validate when custom validators were selected while generating the CREATE/UPDATE forms
- fix password encryption when changes are made in CREATE/UPDATE users table
versão 1.2.2 (07/2018)
Improvements:
- add user-conf file to avoid breaking user custom settings with updates
- move the install folder outside the generator folder.
- improve the updater script
- improve url & path management
Bug Fix:
- fix server issues in some special configurations
versão 1.2.1 (07/2018)
Atenção: se o seu módulo de autenticação não estiver habilitado, após a atualização abra php-crud-generator/conf/admin-lock.php e defina ADMIN_LOCKED ao false.
Improvements:
- move ADMIN_LOCKED and ADMIN_LOGO to separate files for easier updates
Bug Fix:
- fix several minor bugs