Exemplo n.º 1
0
    accessforbidden();
}
// Get supervariables
$action = GETPOST('action', 'alpha');
$id = GETPOST('id', 'int');
$socid = GETPOST('socid', 'int');
$page = GETPOST('page', 'int');
$sortorder = GETPOST('sortorder', 'alpha') == "" ? "DESC" : GETPOST('sortorder', 'alpha');
$sortfield = GETPOST('sortfield', 'alpha') == "" ? "pl.fk_soc" : GETPOST('sortfield', 'alpha');
/*
 * Actions
 */
if ($action == 'confirm_delete') {
    $bon = new BonPrelevement($db, "");
    $bon->fetch($id);
    $res = $bon->delete();
    if ($res > 0) {
        header("Location: index.php");
        exit;
    }
}
if ($action == 'confirm_credite' && GETPOST('confirm', 'alpha') == 'yes') {
    $bon = new BonPrelevement($db, "");
    $bon->fetch($id);
    $bon->set_credite();
    header("Location: card.php?id=" . $id);
    exit;
}
if ($action == 'infotrans' && $user->rights->prelevement->bons->send) {
    require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
    $bon = new BonPrelevement($db, "");