Start Point al 2026
This commit is contained in:
commit
8a76e1db3b
371 files changed
+160283
No files matched your search
@@ -0,0 +1,60 @@
|
||||
<?php namespace App\Controllers;
|
||||
|
||||
use App\Libraries\Crud;
|
||||
|
||||
|
||||
class Clienti extends CRUDController {
|
||||
|
||||
// Tab: Clienti = ['clIDcliente', 'clNome', 'clInfo', 'clCreatedAt', 'clUpdatedAt', 'clDeletedAt'];
|
||||
|
||||
protected $crud;
|
||||
|
||||
function __construct() {
|
||||
|
||||
$params = [
|
||||
'table' => 'Clienti',
|
||||
'dev' => false,
|
||||
'fields' => $this->field_options(),
|
||||
'form_title_add' => 'Add Cliente',
|
||||
'form_title_update' => 'Edit Cliente',
|
||||
'form_submit' => 'Add',
|
||||
'table_title' => 'Pagina per la tabella Clienti',
|
||||
'form_submit_update' => 'Update',
|
||||
'base' => '',
|
||||
'UpdatedAt' => 'clUpdatedAt',
|
||||
'DeletedAt' => 'clDeletedAt',
|
||||
];
|
||||
|
||||
$this->crud = new Crud($params, service('request'));
|
||||
}// __construct
|
||||
|
||||
|
||||
protected function field_options() {
|
||||
|
||||
$fields = [];
|
||||
$fields['clIDcliente'] = ['label' => 'ID Cliente', 'helper' => 'Identificativo univoco del record nel database'];
|
||||
$fields['clNome'] = ['label' => 'Nome', 'helper' => 'Nome identificativo del cliente (max 32 caratteri)', 'required' => true, 'unique' => [true, 'clNome']];
|
||||
$fields['clInfo'] = ['label' => 'Info relative', 'helper' => 'Descrizione del cliente o altre informazioni utili ad esso relative', 'required' => true];
|
||||
$fields['clCreatedAt'] = ['label' => 'Created at', 'helper' => 'Data di creazione del record relativo nel database', 'only_edit'=> true];
|
||||
$fields['clUpdatedAt'] = ['label' => 'Updated at', 'helper' => 'Timestamp dell\'ultimo aggiornamento del record nel database', 'type' => 'unset'];
|
||||
$fields['clDeletedAt'] = ['label' => 'Deleted at', 'helper' => 'Data di cancellazione del record relativo nel database', 'type' => 'unset'];
|
||||
|
||||
return $fields;
|
||||
}// field_options
|
||||
|
||||
|
||||
public function index() { return $this->CRUD_view(['clIDcliente', 'clNome', 'clInfo', 'clCreatedAt', 'clUpdatedAt', 'clDeletedAt']); }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Auto CRUD terminato
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user