Upload plugin files but mPDF folder
This commit is contained in:
parent
ba5c48b8e8
commit
9ac4bbce8a
36 changed files with 2864 additions and 0 deletions
40
www/admin/client_supprimer.php
Normal file
40
www/admin/client_supprimer.php
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace Garradin;
|
||||
|
||||
require_once __DIR__ . '/_inc.php';
|
||||
|
||||
$session->requireAccess('compta', Membres::DROIT_ADMIN);
|
||||
|
||||
qv(['id' => 'required|numeric']);
|
||||
|
||||
$id = (int) qg('id');
|
||||
|
||||
$c = $client->get($id);
|
||||
|
||||
if (!$client)
|
||||
{
|
||||
throw new UserException("Ce client n'existe pas.");
|
||||
}
|
||||
|
||||
if (f('delete'))
|
||||
{
|
||||
$form->check('delete_client_'.$c->id);
|
||||
|
||||
if (!$form->hasErrors())
|
||||
{
|
||||
try {
|
||||
var_dump($client->delete($c->id));
|
||||
Utils::redirect(PLUGIN_URL . 'clients.php');
|
||||
}
|
||||
catch (UserException $e)
|
||||
{
|
||||
$form->addError($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$tpl->assign('deletable', $client->isDeletable($id));
|
||||
$tpl->assign('client', $client->get($id));
|
||||
$tpl->display(PLUGIN_ROOT . '/templates/client_supprimer.tpl');
|
||||
Loading…
Add table
Add a link
Reference in a new issue