<?php
/* --------------------------------------------------------------
GMOrderFormat.php 2008-08-10 gambio
Gambio OHG
http://www.gambio.de
Copyright (c) 2008 Gambio OHG
Released under the GNU General Public License (Version 2)
[http://www.gnu.org/licenses/gpl-2.0.html]
--------------------------------------------------------------
* -> class to create a google sitemap
*/
class GMOrderFormat {
/*
* -> type: invoice or packingslip
*/
var $type;
/*
* -> constructor
*/
function GMOrderFormat() {
}
/*
* -> get act id from table orders
*/
function get_act_id($type) {
if($type == 'GM_NEXT_INVOICE_ID') {
$type = 'gm_orders_id';
} else {
$type = 'gm_packings_id';
}
$gm_query = xtc_db_query("
SELECT
" . $type . "
AS
id
FROM
orders
ORDER BY
" . $type . "
DESC
LIMIT 1
");
if(xtc_db_num_rows($gm_query) > 0) {
$gm_row = xtc_db_fetch_array($gm_query);
return $gm_row['id'];
} else {
return 0;
}
}
function get_next_id($type) {
return gm_get_conf($type);
}
function update_next_id($type, $value, $oID) {
if($type == 'GM_NEXT_INVOICE_ID') {
$type = 'gm_orders_id';
} else {
$type = 'gm_packings_id';
}
xtc_db_query("
UPDATE
orders
SET
" . $type . " = '" . $value . "'
WHERE
orders_id = '" . $oID . "'
");
}
function update_next_code($type, $value, $oID) {
if($type == 'GM_NEXT_INVOICE_ID') {
$type = 'gm_orders_code';
} else {
$type = 'gm_packings_code';
}
xtc_db_query("
UPDATE
orders
SET
" . $type . " = '" . $value . "'
WHERE
orders_id = '" . $oID . "'
");
}
function set_next_id($type, $next_id) {
if(is_numeric($next_id) && $next_id > $this->get_act_id($type)) {
gm_set_conf($type, $next_id);
return true;
} else {
return false;
}
}
/*
* function to change the order status
* @param int $p_orders_id
* @param int $p_order_status_id
* @param int $p_customer_notified
* @param String $p_comment
* @return void
*/
function update_orders_status($p_orders_id, $p_order_status_id, $p_customer_notified, $p_comment)
{
if(!empty($p_order_status_id))
{
xtc_db_query("
UPDATE " .
TABLE_ORDERS . "
SET
orders_status = '" . (int)$p_order_status_id . "',
last_modified = NOW()
WHERE
orders_id = '" . (int)$p_orders_id . "'
");
xtc_db_query("
INSERT INTO " .
TABLE_ORDERS_STATUS_HISTORY . "
SET
orders_id = '" . (int)$p_orders_id . "',
orders_status_id = '" . (int)$p_order_status_id . "',
customer_notified = '" . $customer_notified . "',
comments = '" . $p_comment . "',
date_added = NOW()"
);
}
return;
}
/*
* function to get the date of the invoice
* @param int $p_orders_id
* @param int $p_order_status_id
* @return String
*/
function get_invoice_date($p_orders_id, $p_order_status_id)
{
$t_invoice_date = date('d.m.Y');
if(!empty($p_order_status_id))
{
$t_query = xtc_db_query("
SELECT
date_added
FROM " .
TABLE_ORDERS_STATUS_HISTORY . "
WHERE
orders_id = '" . (int)$p_orders_id . "'
AND
orders_status_id = '" . (int)$p_order_status_id . "'
GROUP BY
orders_status_id
ORDER BY
date_added
ASC
LIMIT 1
");
if((int)xtc_db_num_rows($t_query) > 0)
{
$t_row = xtc_db_fetch_array($t_query);
$t_invoice_date = xtc_date_short($t_row['date_added']);
}
}
return $t_invoice_date;
}
}
?>| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| GMAltText.php | 2013-11-12 20:53 | 2.55 KB | 76129f60960:kunden | -xw-x----- | |
| GMGroupIdChecker.php | 2013-11-12 20:53 | 2.33 KB | 76129f60960:kunden | -xw-x----- | |
| GMIdStarts.php | 2013-11-12 20:53 | 2.52 KB | 76129f60960:kunden | -xw-x----- | |
| GMInvoicing.php | 2013-11-12 20:53 | 10.88 KB | 76129f60960:kunden | -xw-x----- | |
| GMInvoicingConfiguration.php | 2013-11-12 20:53 | 6.39 KB | 76129f60960:kunden | -xw-x----- | |
| GMLangFileImport.php | 2013-11-12 20:53 | 795 B | 76129f60960:kunden | -xw-x----- | |
| GMModulesManager.php | 2013-11-12 20:53 | 13.34 KB | 76129f60960:kunden | -xw-x----- | |
| GMOpenSearch.php | 2013-11-12 20:53 | 4.09 KB | 76129f60960:kunden | -xw-x----- | |
| GMOrderFormat.php | 2013-11-12 20:53 | 4.09 KB | 76129f60960:kunden | -xw-x----- | |
| GMProductExport.php | 2013-11-12 20:53 | 56.76 KB | 76129f60960:kunden | -xw-x----- | |
| GMProductUpload.php | 2013-11-12 20:53 | 7.9 KB | 76129f60960:kunden | -xw-x----- | |
| GMSitemapXML.php | 2013-11-12 20:53 | 15.42 KB | 76129f60960:kunden | -xw-x----- | |
| GMStart.php | 2013-11-12 20:53 | 11.6 KB | 76129f60960:kunden | -xw-x----- | |
| GMStat.php | 2013-11-12 20:53 | 19.62 KB | 76129f60960:kunden | -xw-x----- | |
| GMUpload.php | 2013-11-12 20:53 | 5.52 KB | 76129f60960:kunden | -xw-x----- | |
| ShowLogs.php | 2013-11-12 20:53 | 7.29 KB | 76129f60960:kunden | -xw-x----- | |
| gmOrderPDF.php | 2013-11-12 20:53 | 26.84 KB | 76129f60960:kunden | -xw-x----- | |
| gmPDF.php | 2013-11-12 20:53 | 13.37 KB | 76129f60960:kunden | -xw-x----- | |