Example #1
0
function ordGetOrderContent($orderID)
{
    $q = db_query('select name, Price, Quantity, tax, load_counter, itemID from ' . ORDERED_CARTS_TABLE . ' where orderID=' . (int) $orderID);
    $q_order = db_query('select currency_code, currency_value, customerID, order_time, currency_round from ' . ORDERS_TABLE . ' where orderID=' . (int) $orderID);
    $order = db_fetch_row($q_order);
    $currency_code = $order['currency_code'];
    $currency_value = $order['currency_value'];
    $currency_round = $order['currency_round'];
    $data = array();
    while ($row = db_fetch_row($q)) {
        $productID = GetProductIdByItemId($row['itemID']);
        $row['pr_item'] = $productID;
        $product = GetProduct($productID);
        if ($product['eproduct_filename'] != null && $product['eproduct_filename'] != '') {
            if (file_exists('core/files/' . $product['eproduct_filename'])) {
                $row['eproduct_filename'] = $product['eproduct_filename'];
                $row['file_size'] = (string) round(filesize('core/files/' . $product['eproduct_filename']) / 1048576, 3);
                if ($order['customerID'] != null) {
                    $custID = $order['customerID'];
                } else {
                    $custID = -1;
                }
                $row['getFileParam'] = 'orderID=' . $orderID . '&' . 'productID=' . $productID . '&' . 'customerID=' . $custID;
                //additional security for non authorized customers
                if ($custID == -1) {
                    $row['getFileParam'] .= '&order_time=' . base64_encode($order['order_time']);
                }
                $row['getFileParam'] = cryptFileParamCrypt($row['getFileParam'], null);
                $row['load_counter_remainder'] = $product['eproduct_download_times'] - $row['load_counter'];
                $currentDate = dtGetParsedDateTime(get_current_time());
                $betweenDay = _getDayBetweenDate(dtGetParsedDateTime($order['order_time']), $currentDate);
                $row['day_count_remainder'] = $product['eproduct_available_days'] - $betweenDay;
            }
        }
        $row['PriceToShow'] = _formatPrice(roundf($currency_value * $row['Price'] * $row['Quantity']), $currency_round) . ' ' . $currency_code;
        $row['PriceOne'] = _formatPrice(roundf($currency_value * $row['Price']), $currency_round) . ' ' . $currency_code;
        $data[] = $row;
    }
    return $data;
}
Example #2
0
             $callBackParam["sort"] = trim($_GET["sort"]);
             if (isset($_GET["direction"])) {
                 $callBackParam["direction"] = trim($_GET["direction"]);
             }
         }
         $count = 0;
         if (isset($_GET["export_to_excel"])) {
             $number2showNexport = (int) $_GET["count_to_export"];
         } else {
             $number2showNexport = 20;
         }
         $navigatorHtml = GetNavigatorHtml(_getUrlToNavigate(), $number2showNexport, 'regGetCustomers', $callBackParam, $customers, $offset, $count);
         if (isset($_GET["export_to_excel"])) {
             serExportCustomersToExcel($customers);
             $smarty->assign("customers_has_been_exported_succefully", 1);
             $smarty->assign("urlToDownloadResult", ADMIN_FILE . "?do=get_file&getFileParam=" . cryptFileParamCrypt("GetCustomerExcelSqlScript", null));
             $smarty->assign("file_size", filesize("core/temp/customers.csv"));
         }
         $smarty->hassign("encodedReturnUrl", $encodedReturnUrl);
         $smarty->assign("search_result_string", str_replace("{N}", $count, ADMIN_N_RECORD_IS_SEARCHED));
         $smarty->assign("count_to_export", count($customers));
         $smarty->assign("customers", $customers);
         $smarty->assign("navigator", $navigatorHtml);
     }
     $smarty->hassign("urlToSort", _getUrlToSort());
     $customer_groups = GetAllCustGroups();
     $smarty->assign("customer_groups", $customer_groups);
 } else {
     $c_login = regGetLoginById($_GET["customerID"]);
     if (!$c_login) {
         $smarty->assign("customerID", NULL);
Example #3
0
            //other categories
            $q = db_query("select categoryID, name from " . CATEGORIES_TABLE . " where parent=1 order by sort_order, name");
            $result = array();
            while ($row = db_fetch_row($q)) {
                if (isset($_POST["categ_{$row['0']}"])) {
                    _exportCategoryLine($row[0], 0, $f, $delimiter);
                    _exportProducts($row[0], $f, $delimiter);
                    _exportSubCategoriesAndProducts($row[0], 1, $f, $delimiter);
                }
            }
            gzclose($f);
            Redirect(ADMIN_FILE . "?dpt=catalog&sub=excel_export&export_completed=yes");
        }
        if (isset($_GET["export_completed"])) {
            if (file_exists("core/temp/catalog.csv.gz")) {
                $getFileParam = cryptFileParamCrypt("GetCSVCatalog", null);
                $smarty->assign("getFileParam", $getFileParam);
                $smarty->assign("excel_export_successful", 1);
                $smarty->assign("excel_filesize", (string) round(filesize("core/temp/catalog.csv.gz") / 1048576, 3));
            }
        } else {
            $q = db_query("select categoryID, name from " . CATEGORIES_TABLE . " where parent=1 order by sort_order, name");
            $result = array();
            while ($row = db_fetch_row($q)) {
                $result[] = $row;
            }
            $smarty->assign("categories", $result);
        }
        $smarty->assign("admin_sub_dpt", "catalog_excel_export.tpl");
    }
}
Example #4
0
         case 'fExportSubscribersList':
             $CountRow = 0;
             $Subscriptions = subscrGetAllSubscriber('', $CountRow);
             $ExportBuffer = '';
             if (!count($Subscriptions)) {
                 break;
             }
             $fp = @fopen('core/temp/subscribers.txt', 'w');
             if (!$fp) {
                 $_SESSION['SUBSCRIBE_MESSAGE'] = array('Message' => ADMIN_SUBSCRIPTIONS_ERROR_FILE_CREATION, 'MessageCode' => 2);
                 break;
             }
             foreach ($Subscriptions as $_Subscription) {
                 fwrite($fp, $_Subscription['Email'] . "\r\n");
             }
             $getFileParam = cryptFileParamCrypt("GetSubscriptionsList", null);
             $smarty->assign("getFileParam", $getFileParam);
             $_SESSION['SUBSCRIBE_MESSAGE'] = array('Message' => str_replace('{*URL*}', ADMIN_FILE . '?do=get_file&getFileParam=' . $getFileParam, ADMIN_SUBSCRIPTIONS_OK_EXPORT_SUBSCRLIST), 'MessageCode' => 1);
             fclose($fp);
             break;
     }
     Redirect($xREQUEST_URI);
 }
 function _getUrlToNavigate()
 {
     $res = ADMIN_FILE . "?dpt=custord&sub=subscribers";
     return $res;
 }
 function _getUrlToUnsub()
 {
     $res = ADMIN_FILE . "?dpt=custord&sub=subscribers";
Example #5
0
         $smarty->assign("sync_successful", 0);
     }
     $smarty->assign("sync_action", "import");
 } elseif (isset($_POST["full_export"])) {
     if (CONF_BACKEND_SAFEMODE) {
         Redirect(ADMIN_FILE . "?dpt=catalog&sub=dbsync&safemode=yes");
     }
     if (file_exists("core/temp/fulldump.sql.gz")) {
         unlink("core/temp/fulldump.sql.gz");
     }
     $masterfef = "core/temp";
     include_once 'core/classes/class.dump.php';
     $SK = new dumper();
     $SK->SET['masterfef'] = "core/temp";
     $SK->backup();
     $getFileParam = cryptFileParamCrypt("GetFullFileDb", null);
     $smarty->assign("getFileParam", $getFileParam);
     $smarty->assign("filenameffe", "fulldump.sql.gz");
     $smarty->assign("database_filesizef", round(filesize("core/temp/fulldump.sql.gz") / 1048576, 3));
 }
 if (isset($_GET["optimize"])) {
     if (CONF_BACKEND_SAFEMODE) {
         Redirect(ADMIN_FILE . "?dpt=catalog&sub=dbsync&safemode=yes");
     }
     @set_time_limit(0);
     if (updatebases()) {
         $smarty->assign("gain", "nots");
     }
 }
 //set sub-department template
 $smarty->assign("admin_sub_dpt", "catalog_dbsync.tpl");