*
* 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 2 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/**
* \file htdocs/paypal/admin/import.php
* \ingroup paypal
* \brief Setup page for paypal module
* \version $Id$
*/
require("../../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/paypal/lib/paypal.lib.php");
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
if (!$user->admin)
accessforbidden();
$langs->load("paypal");
$langs->load("admin");
$action=GETPOST('action');
$idprod=GETPOST('idprod');
/*
* Actions
*/
if (preg_match('/set_(.*)/',$action,$reg))
{
$code=$reg[1];
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
{
Header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
else
{
dol_print_error($db);
}
}
if (preg_match('/del_(.*)/',$action,$reg))
{
$code=$reg[1];
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
{
Header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
else
{
dol_print_error($db);
}
}
if ($action == 'setproductshippingcosts')
{
if (dolibarr_set_const($db, 'PAYPAL_PRODUCT_SHIPPING_COSTS', $idprod, 'chaine', 0, '', $conf->entity) > 0)
{
Header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
else
{
dol_print_error($db);
}
}
/*
* View
*/
$form=new Form($db);
llxHeader('',$langs->trans("PaypalSetup"));
$linkback=''.$langs->trans("BackToModuleList").'';
print_fiche_titre(' - '.$langs->trans("ModuleSetup"),$linkback,'paypal_logo@paypal');
print '
';
$head=paypaladmin_prepare_head();
dol_fiche_head($head, 'import', $langs->trans("ModuleSetup"));
print '
';
print '
';
print '';
$var=true;
print '';
print '';
print '| '.$langs->trans("Parameters").' | '."\n";
print ' | ';
print ''.$langs->trans("Value").' | '."\n";
print '
';
$var=!$var;
print '';
print '
';
$db->close();
llxFooter('$Date$ - $Revision$');
?>