Exemplo n.º 1
0
//
//    Pastèque 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.
//
//    Pastèque 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 Pastèque.  If not, see <http://www.gnu.org/licenses/>.
namespace BaseStocks;

$modules = \Pasteque\get_loaded_modules(\Pasteque\get_user_id());
$multilocations = false;
$defaultLocationId = null;
if (in_array("stock_multilocations", $modules)) {
    $multilocations = true;
}
$locSrv = new \Pasteque\LocationsService();
$locations = $locSrv->getAll();
$locNames = array();
$locIds = array();
foreach ($locations as $location) {
    $locNames[] = $location->label;
    $locIds[] = $location->id;
}
$currLocation = null;
if (isset($_POST['location'])) {
Exemplo n.º 2
0
//
//    Copyright (C) 2013 Scil (http://scil.coop)
//
//    This file is part of Pastèque.
//
//    Pastèque 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.
//
//    Pastèque 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 Pastèque.  If not, see <http://www.gnu.org/licenses/>.
namespace Pasteque;

ob_clean();
$user_id = \Pasteque\get_user_id();
$dbhost = \Pasteque\get_db_host($user_id);
$dbuser = \Pasteque\get_db_user($user_id);
$dbpasswd = \Pasteque\get_db_password($user_id);
$database = \Pasteque\get_db_name($user_id);
$dbport = \Pasteque\get_db_port($user_id);
header("Content-type: application/x-gzip-compressed");
header("Content-Disposition: attachment; filename=pasteque-" . date(Ymd) . "-" . $database . "-.sql.gz");
$output = fopen("php://output", "rb+");
$cmd = "mysqldump -u " . $dbuser . " --password="******" " . $database . " --port=" . $dbport . " | gzip -c";
fputs($output, system($cmd));
Exemplo n.º 3
0
function displayModule($module, $activatedModules, $pp_id, $sandbox)
{
    $activated = false;
    foreach ($activatedModules as $actMod) {
        if ($actMod == $module['module']) {
            $activated = true;
            break;
        }
    }
    if (!$activated) {
        echo "<td>" . \i18n($module['module'], PLUGIN_NAME) . " (" . \i18nCurr($module['price']) . ")</td>\n";
        $host = $sandbox ? "www.sandbox.paypal.com" : "www.paypal.com";
        echo "<td>";
        echo "<form target=\"paypal\" action=\"https://" . $host . "/cgi-bin/webscr\" method=\"post\" >\n";
        echo "<input type=\"hidden\" name=\"cmd\" value=\"_cart\" />\n";
        echo "<input type=\"hidden\" name=\"business\" value=\"" . \Pasteque\esc_attr($pp_id) . "\" />\n";
        echo "<input type=\"hidden\" name=\"custom\" value=\"" . \Pasteque\esc_attr(\Pasteque\get_user_id()) . "\" />\n";
        echo "<input type=\"hidden\" name=\"lc\" value=\"FR\" />\n";
        echo "<input type=\"hidden\" name=\"item_name\" value=\"" . \Pasteque\esc_attr(\i18n($module['module'], PLUGIN_NAME)) . "\" />\n";
        echo "<input type=\"hidden\" name=\"item_number\" value=\"" . \Pasteque\esc_attr($module['module']) . "\" />\n";
        echo "<input type=\"hidden\" name=\"amount\" value=\"" . $module['price'] . "\" />\n";
        echo "<input type=\"hidden\" name=\"currency_code\" value=\"EUR\" />\n";
        echo "<input type=\"hidden\" name=\"button_subtype\" value=\"products\" />\n";
        echo "<input type=\"hidden\" name=\"no_note\" value=\"0\" />\n";
        echo "<input type=\"hidden\" name=\"cn\" value=\"Ajouter des instructions particulières pour le vendeur :\" />\n";
        echo "<input type=\"hidden\" name=\"no_shipping\" value=\"2\" />\n";
        echo "<input type=\"hidden\" name=\"tax_rate\" value=\"20.000\" />\n";
        echo "<input type=\"hidden\" name=\"add\" value=\"1\" />\n";
        echo "<input type=\"hidden\" name=\"bn\" value=\"PP-ShopCartBF:btn_cart_LG.gif:NonHosted\" />\n";
        echo "<input type=\"image\" src=\"https://" . $host . "/fr_FR/FR/i/btn/btn_cart_LG.gif\" border=\"0\" name=\"submit\" alt=\"PayPal - la solution de paiement en ligne la plus simple et la plus sécurisée !\" />\n";
        echo "<img alt=\"\" border=\"0\" src=\"https://" . $host . "/fr_FR/i/scr/pixel.gif\" width=\"1\" height=\"1\" />\n";
        echo "</form></td>\n";
    } else {
        echo "<td>" . \i18n($module['module'], PLUGIN_NAME) . "</td>\n";
        echo "<td>" . \i18n("activated", PLUGIN_NAME) . "</td>\n";
    }
}