Пример #1
0
$langs->load("categories");
// Get supervariables
$action = GETPOST('action', 'alpha');
$id = GETPOST('id', 'int');
$socid = GETPOST('socid', 'int');
$page = GETPOST('page', 'int');
$sortorder = GETPOST('sortorder', 'alpha');
$sortfield = GETPOST('sortfield', 'alpha');
if ($action == 'confirm_rejet') {
    if (GETPOST("confirm") == 'yes') {
        $daterej = mktime(2, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
        $lipre = new LignePrelevement($db, $user);
        if ($lipre->fetch($id) == 0) {
            if (GETPOST('motif', 'alpha') > 0 && $daterej < time()) {
                $rej = new RejetPrelevement($db, $user);
                $rej->create($user, $id, GETPOST('motif', 'alpha'), $daterej, $lipre->bon_rowid, GETPOST('facturer', 'int'));
                Header("Location: ligne.php?id=" . $id);
                exit;
            } else {
                dol_syslog("Motif : " . GETPOST('motif', 'alpha'));
                dol_syslog("{$daterej} {$time} ");
                Header("Location: ligne.php?id=" . $id . "&action=rejet");
                exit;
            }
        }
    } else {
        Header("Location: ligne.php?id=" . $id);
        exit;
    }
}
/*
Пример #2
0
if ($action == 'confirm_rejet')
{
	if ( GETPOST("confirm") == 'yes')
	{
		$daterej = mktime(2, 0 , 0, GETPOST("remonth"), GETPOST("reday"), GETPOST("reyear"));

		$lipre = new LignePrelevement($db, $user);

		if ($lipre->fetch($id) == 0)
		{

			if (GETPOST("motif") > 0 && $daterej < time())
			{
				$rej = new RejetPrelevement($db, $user);

				$rej->create($user, $id, GETPOST("motif"), $daterej, $lipre->bon_rowid, GETPOST("facturer"));

				Header("Location: ligne.php?id=".$id);
				exit;
			}
			else
			{
				dol_syslog("Motif : ".GETPOST("motif"));
				dol_syslog("$daterej $time ");
				Header("Location: ligne.php?id=".$id."&action=rejet");
				exit;
			}
		}
	}
	else
	{