Ejemplo n.º 1
0
 // 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)) {
                 echo l10n("cart_plot_nodata", "Tere is no data about evaded orders to show.");
                 break;
             }
             $json .= "{";
             // Months
             $json .= "labels: [";
             foreach (l10n("date_full_months", array()) as $month) {
                 $json .= '"' . $month . '",';
             }
             $json = trim($json, ",");
             $json .= "],";
             // Close labels
             // Data sets
             $json .= "datasets:[";