Ejemplo n.º 1
0
?>
><?php 
echo l10n('cart_plot_productscount', 'Products count');
?>
</option>
				</select>
			</div>
<?php 
if (isset($imSettings['ecommerce']) && isset($imSettings['ecommerce']['database'])) {
    $dbconf = getDbData($imSettings['ecommerce']['database']['id']);
    $prefix = $imSettings['ecommerce']['database']['table'];
    $pagination_length = 15;
    $pagination_start = isset($_GET['page']) ? $_GET['page'] * $pagination_length : 0;
    $ecommerce = new ImCart();
    // Clean the temp files
    $ecommerce->deleteTemporaryFiles("../");
    if ($ecommerce->setDatabaseConnection($dbconf['host'], $dbconf['user'], $dbconf['password'], $dbconf['database'], $prefix)) {
        // Connection check
        // Build the plot data
        $json = "";
        $colors = array("rgb(250,164,58)", "rgb(96,189,104)", "rgb(77,77,77)", "rgb(93,165,218)", "rgb(241,124,176)", "rgb(222,207,63)", "rgb(178,118,178)", "rgb(178,145,47)", "rgb(241,88,84)");
        $bgcolors = array("rgba(250,164,58,0.2)", "rgba(96,189,104,0.2)", "rgba(77,77,77,0.2)", "rgba(93,165,218,0.2)", "rgba(241,124,176,0.2)", "rgba(222,207,63,0.2)", "rgba(178,118,178,0.2)", "rgba(178,145,47,0.2)", "rgba(241,88,84,0.2)");
        switch ($plot_type) {
            /**
             * -------------------
             * Non Cumulative Plot
             * -------------------
             */
            case "noncumulative":
                $data = $ecommerce->getNonCumulativeSellings();
                if (!count($data)) {