Upload plugin files but mPDF folder
This commit is contained in:
parent
ba5c48b8e8
commit
9ac4bbce8a
36 changed files with 2864 additions and 0 deletions
57
www/admin/clients.php
Normal file
57
www/admin/clients.php
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
|
||||
namespace Garradin;
|
||||
|
||||
require_once __DIR__ . '/_inc.php';
|
||||
|
||||
$session->requireAccess('compta', Membres::DROIT_ACCES);
|
||||
|
||||
if(f('add'))
|
||||
{
|
||||
$form->check('add_client', [
|
||||
'nom' => 'required|string',
|
||||
'adresse' => 'required|string',
|
||||
'code_postal' => 'required|string',
|
||||
'ville' => 'required|string',
|
||||
'telephone' => 'string',
|
||||
'email' => 'email'
|
||||
]);
|
||||
|
||||
if (!$form->hasErrors())
|
||||
{
|
||||
try
|
||||
{
|
||||
$id = $client->add([
|
||||
'nom' => f('nom'),
|
||||
'adresse' => f('adresse'),
|
||||
'code_postal' => f('code_postal'),
|
||||
'ville' => f('ville'),
|
||||
'telephone' => f('telephone'),
|
||||
'email' => f('email')
|
||||
]);
|
||||
|
||||
$id ? Utils::redirect(PLUGIN_URL . 'client.php?id='.(int)$id):'';
|
||||
}
|
||||
catch (UserException $e)
|
||||
{
|
||||
$form->addError($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// var_dump($client->listAll());
|
||||
$tpl->assign('clients', $client->listAll());
|
||||
$tpl->assign('champs',
|
||||
[
|
||||
'id' => 'id',
|
||||
'nom' => 'Nom',
|
||||
'adresse' => 'Adresse',
|
||||
'code_postal' => 'Code postal',
|
||||
'ville' => 'Ville',
|
||||
'telephone' => 'Numéro de téléphone',
|
||||
'email' => 'Adresse mail'
|
||||
]
|
||||
);
|
||||
|
||||
$tpl->display(PLUGIN_ROOT . '/templates/clients.tpl');
|
||||
Loading…
Add table
Add a link
Reference in a new issue