update
This commit is contained in:
@@ -1,185 +1,188 @@
|
||||
<?php
|
||||
function sendInvoice($record) {
|
||||
require_once('modules/EcmInvoiceOuts/EcmInvoiceOut.php');
|
||||
$inv = new EcmInvoiceOut();
|
||||
$inv->retrieve($record);
|
||||
$pl = $inv->getPositionList();
|
||||
$response = array (
|
||||
'document_no' => $inv->document_no,
|
||||
'register_date' => $inv->register_date,
|
||||
'total_netto' => $inv->total_netto,
|
||||
'total_brutto' => $inv->total_brutto,
|
||||
'vats_summary' => $inv->vats_summary,
|
||||
'position_list' => $pl
|
||||
);
|
||||
echo json_encode($response);
|
||||
function sendInvoice($record) {
|
||||
require_once('modules/EcmInvoiceOuts/EcmInvoiceOut.php');
|
||||
$inv = new EcmInvoiceOut();
|
||||
$inv->retrieve($record);
|
||||
$pl = $inv->getPositionList();
|
||||
$response = array (
|
||||
'document_no' => $inv->document_no,
|
||||
'register_date' => $inv->register_date,
|
||||
'payment_date' => $inv->payment_date,
|
||||
'total_netto' => $inv->total_netto,
|
||||
'total_brutto' => $inv->total_brutto,
|
||||
'currency_id' => $inv->currency_id,
|
||||
'currency_value' => $inv->currency_value,
|
||||
'vats_summary' => $inv->vats_summary,
|
||||
'position_list' => $pl
|
||||
);
|
||||
echo json_encode($response);
|
||||
}
|
||||
function sendProduct($record) {
|
||||
require_once('modules/EcmProducts/EcmProduct.php');
|
||||
$prod = new EcmProduct();
|
||||
$prod->retrieve($record);
|
||||
$response = array (
|
||||
'name' => $prod->name,
|
||||
'code' => $prod->code,
|
||||
'ean' => $prod->ean,
|
||||
'vat' => $prod->vat_value,
|
||||
'unit_id' => $prod->unit_id,
|
||||
'product_category_id' => $prod->product_category_id,
|
||||
'product_category_name' => $prod->product_category_name
|
||||
);
|
||||
echo json_encode($response);
|
||||
}
|
||||
function copySaleFromTwinpol($record) {
|
||||
$db = $GLOBALS['db'];
|
||||
|
||||
// check if sale exists
|
||||
$exists = $db->fetchByAssoc($db->query("SELECT id, document_no FROM ecmsales WHERE edi_zs_id='$record'"));
|
||||
if (isset($exists)) {
|
||||
echo "ZS istnieje: ";
|
||||
echo '<a target="new" href="https://crm.e5.pl/index.php?module=EcmSales&action=DetailView&record='.$exists['id'].'">'.$exists['document_no'].'</a>';
|
||||
die();
|
||||
}
|
||||
function sendProduct($record) {
|
||||
require_once('modules/EcmProducts/EcmProduct.php');
|
||||
$prod = new EcmProduct();
|
||||
$prod->retrieve($record);
|
||||
$response = array (
|
||||
'name' => $prod->name,
|
||||
'code' => $prod->code,
|
||||
'ean' => $prod->ean,
|
||||
'vat' => $prod->vat_value,
|
||||
'unit_id' => $prod->unit_id,
|
||||
'product_category_id' => $prod->product_category_id,
|
||||
'product_category_name' => $prod->product_category_name
|
||||
);
|
||||
echo json_encode($response);
|
||||
}
|
||||
function copySaleFromTwinpol($record) {
|
||||
$db = $GLOBALS['db'];
|
||||
|
||||
// check if sale exists
|
||||
$exists = $db->fetchByAssoc($db->query("SELECT id, document_no FROM ecmsales WHERE edi_zs_id='$record'"));
|
||||
if (isset($exists)) {
|
||||
echo "ZS istnieje: ";
|
||||
echo '<a target="new" href="https://crm.e5.pl/index.php?module=EcmSales&action=DetailView&record='.$exists['id'].'">'.$exists['document_no'].'</a>';
|
||||
die();
|
||||
}
|
||||
$res = makeCUrlRequest("https://crm.twinpol.com/REST/index.php?key=d68dac4c-f784-4e1b-8267-9ffcfa0eda4c&action=getSale&record=".$record);
|
||||
$sale = json_decode($res);
|
||||
$sale->position_list = json_decode($sale->position_list);
|
||||
echo "Numer dokumentu TwinPol: <b>".$sale->document_no."</b><br>";
|
||||
|
||||
$res = makeCUrlRequest("https://crm.twinpol.com/REST/index.php?key=d68dac4c-f784-4e1b-8267-9ffcfa0eda4c&action=getSale&record=".$record);
|
||||
$sale = json_decode($res);
|
||||
$sale->position_list = json_decode($sale->position_list);
|
||||
echo "Numer dokumentu TwinPol: <b>".$sale->document_no."</b><br>";
|
||||
|
||||
$gotAllProducts = true; // hope :)
|
||||
$newPositionList = array();
|
||||
$total_netto = 0; $total_brutto = 0; $total_discount = 0; $vats = array();
|
||||
foreach ( $sale->position_list as $product ) {
|
||||
echo 'Produkt: '.$product->product_code;
|
||||
$p = getProduct(trim($product->product_code));
|
||||
if (!$p) {
|
||||
echo ' (produkt nie istnieje w bazie E5)<br>';
|
||||
$gotAllProducts = false;
|
||||
continue;
|
||||
$gotAllProducts = true; // hope :)
|
||||
$newPositionList = array();
|
||||
$total_netto = 0; $total_brutto = 0; $total_discount = 0; $vats = array();
|
||||
foreach ( $sale->position_list as $product ) {
|
||||
echo 'Produkt: '.$product->product_code;
|
||||
$p = getProduct(trim($product->product_code));
|
||||
if (!$p) {
|
||||
echo ' (produkt nie istnieje w bazie E5)<br>';
|
||||
$gotAllProducts = false;
|
||||
continue;
|
||||
} else {
|
||||
// pricebook price?
|
||||
$pricebookPrice = $db->fetchByAssoc($db->query("
|
||||
SELECT price FROM ecmpricebooks_ecmproducts
|
||||
WHERE ecmpricebook_id = '3e78ac33-7c46-1b94-0a67-653a17c06f9e'
|
||||
AND ecmproduct_id='$p->id'
|
||||
AND deleted=0 LIMIT 0,1"));
|
||||
if (isset($pricebookPrice)) {
|
||||
$price_start = $pricebookPrice['price'];
|
||||
echo " Cena: ".$price_start." (<a href=\"https://crm.e5.pl/index.php?module=EcmPriceBooks&action=DetailView&record=3e78ac33-7c46-1b94-0a67-653a17c06f9e\" target=\"new\">Amazon_2023</a>)<br>";
|
||||
} else {
|
||||
// pricebook price?
|
||||
$pricebookPrice = $db->fetchByAssoc($db->query("
|
||||
SELECT price FROM ecmpricebooks_ecmproducts
|
||||
WHERE ecmpricebook_id = '3e78ac33-7c46-1b94-0a67-653a17c06f9e'
|
||||
AND ecmproduct_id='$p->id'
|
||||
AND deleted=0 LIMIT 0,1"));
|
||||
if (isset($pricebookPrice)) {
|
||||
$price_start = $pricebookPrice['price'];
|
||||
echo " Cena: ".$price_start." (<a href=\"https://crm.e5.pl/index.php?module=EcmPriceBooks&action=DetailView&record=3e78ac33-7c46-1b94-0a67-653a17c06f9e\" target=\"new\">Amazon_2023</a>)<br>";
|
||||
} else {
|
||||
// invoice price?
|
||||
$fvPrice = $db->fetchByAssoc($db->query("
|
||||
SELECT i.id, i.document_no, ii.price_start, ii.ecmvat_value, ii.ecmvat_name, ii.ecmvat_id
|
||||
FROM ecminvoiceoutitems AS ii
|
||||
INNER JOIN ecminvoiceouts AS i
|
||||
ON i.id = ii.ecminvoiceout_id
|
||||
WHERE
|
||||
i.parent_id= '1b9643ca-5b1a-8f9b-b809-586b5619b068' AND
|
||||
i.currency_id = 'PLN' AND
|
||||
ii.ecmproduct_id = '$p->id'
|
||||
ORDER BY i.register_date DESC
|
||||
LIMIT 0,1
|
||||
"));
|
||||
// invoice price?
|
||||
$fvPrice = $db->fetchByAssoc($db->query("
|
||||
SELECT i.id, i.document_no, ii.price_start, ii.ecmvat_value, ii.ecmvat_name, ii.ecmvat_id
|
||||
FROM ecminvoiceoutitems AS ii
|
||||
INNER JOIN ecminvoiceouts AS i
|
||||
ON i.id = ii.ecminvoiceout_id
|
||||
WHERE
|
||||
i.parent_id= '1b9643ca-5b1a-8f9b-b809-586b5619b068' AND
|
||||
i.currency_id = 'PLN' AND
|
||||
ii.ecmproduct_id = '$p->id'
|
||||
ORDER BY i.register_date DESC
|
||||
LIMIT 0,1
|
||||
"));
|
||||
|
||||
if (!isset($fvPrice)) {
|
||||
$price_start = 0;
|
||||
echo " <b>Brak ceny</b><br>";
|
||||
} else {
|
||||
$price_start = $fvPrice['price_start'];
|
||||
echo " Cena: ".$price_start." (<a href=\"https://crm.e5.pl/index.php?module=EcmInvoiceOuts&action=DetailView&record=".$fvPrice['id']."\" target=\"new\">".$fvPrice['document_no']."</a>)<br>";
|
||||
}
|
||||
}
|
||||
|
||||
$prod = array();
|
||||
|
||||
if (!isset($product->discount)) {
|
||||
$product->discount = 0;
|
||||
}
|
||||
$prod['quantity'] = $product->quantity;
|
||||
$prod['discount'] = $product->discount;
|
||||
$prod['price_start'] = $price_start;
|
||||
$prod['price_netto'] = round($price_start - ($price_start * ($product->discount / 100)),2);
|
||||
$prod['ecmvat_id'] = $fvPrice['ecmvat_id'];
|
||||
$prod['ecmvat_value'] = $fvPrice['ecmvat_value'];
|
||||
$prod['ecmvat_name'] = $fvPrice['ecmvat_name'];
|
||||
$prod['price_brutto'] = round($prod['price_netto']+($prod['price_netto']*($prod['ecmvat_value']/100)),2);
|
||||
$prod['total_netto'] = round($prod['price_netto'] * $prod['quantity'], 2);
|
||||
$prod['total_brutto'] = round($prod['total_netto']+($prod['total_netto']*($prod['ecmvat_value']/100)),2);
|
||||
|
||||
$total_netto += $prod['total_netto'];
|
||||
$total_brutto += $prod['total_brutto'];
|
||||
$total_discount = ($prod['price_start'] - $prod['price_netto']) * $prod['quantity'];
|
||||
|
||||
if (isset($vats[$prod['ecmvat_value']])) {
|
||||
$vats[$prod['ecmvat_value']] += $prod['total_netto'];
|
||||
if (!isset($fvPrice)) {
|
||||
$price_start = 0;
|
||||
echo " <b>Brak ceny</b><br>";
|
||||
} else {
|
||||
$vats[$prod['ecmvat_value']] = $prod['total_netto'];
|
||||
$price_start = $fvPrice['price_start'];
|
||||
echo " Cena: ".$price_start." (<a href=\"https://crm.e5.pl/index.php?module=EcmInvoiceOuts&action=DetailView&record=".$fvPrice['id']."\" target=\"new\">".$fvPrice['document_no']."</a>)<br>";
|
||||
}
|
||||
}
|
||||
|
||||
$prod['date_entered'] = date('Y-m-d H:i:s');
|
||||
$prod['date_modified'] = date('Y-m-d H:i:s');
|
||||
$prod['modified_user_id'] = null;
|
||||
$prod['assigned_user_id'] = null;
|
||||
$prod['created_by'] = null;
|
||||
$prod['deleted'] = '0';
|
||||
$prod['product_id'] = $p->id;
|
||||
$prod['position'] = $product->position;
|
||||
$prod['product_code'] = $p->code;
|
||||
$prod['name'] = $product->name;
|
||||
$prod['unit_id'] = $product->unit_id;
|
||||
$prod['unit_name'] = $product->unit_name;
|
||||
$prod['category_id'] = $p->product_category_id;
|
||||
$prod['recipient_code'] = $product->recipient_code;
|
||||
$prod['ean'] = $p->ean;
|
||||
array_push($newPositionList, $prod);
|
||||
$prod = array();
|
||||
|
||||
if (!isset($product->discount)) {
|
||||
$product->discount = 0;
|
||||
}
|
||||
}
|
||||
$vats_summary = '';
|
||||
foreach ($vats as $k=>$v ) {
|
||||
$vats_summary .= $k.'%:'.$v.',';
|
||||
}
|
||||
$prod['quantity'] = $product->quantity;
|
||||
$prod['discount'] = $product->discount;
|
||||
$prod['price_start'] = $price_start;
|
||||
$prod['price_netto'] = round($price_start - ($price_start * ($product->discount / 100)),2);
|
||||
$prod['ecmvat_id'] = $fvPrice['ecmvat_id'];
|
||||
$prod['ecmvat_value'] = $fvPrice['ecmvat_value'];
|
||||
$prod['ecmvat_name'] = $fvPrice['ecmvat_name'];
|
||||
$prod['price_brutto'] = round($prod['price_netto']+($prod['price_netto']*($prod['ecmvat_value']/100)),2);
|
||||
$prod['total_netto'] = round($prod['price_netto'] * $prod['quantity'], 2);
|
||||
$prod['total_brutto'] = round($prod['total_netto']+($prod['total_netto']*($prod['ecmvat_value']/100)),2);
|
||||
|
||||
if (!$gotAllProducts) {
|
||||
echo 'Brak produktow w bazie E5. Dokument nie zostal skopiowany.';
|
||||
die();
|
||||
}
|
||||
$total_netto += $prod['total_netto'];
|
||||
$total_brutto += $prod['total_brutto'];
|
||||
$total_discount = ($prod['price_start'] - $prod['price_netto']) * $prod['quantity'];
|
||||
|
||||
require_once('modules/EcmSales/EcmSale.php');
|
||||
$new = new EcmSale();
|
||||
$new->position_list = $newPositionList;
|
||||
$new->parent_id = "1b9643ca-5b1a-8f9b-b809-586b5619b068";
|
||||
$new->parent_name = "Twinpol Sp. z o.o.";
|
||||
$new->parent_address_street = "al. Lipowa 48";
|
||||
$new->parent_address_city = "Obrowo";
|
||||
$new->parent_address_postalcode = "87-126";
|
||||
$new->parent_address_country = "Polska";
|
||||
$new->parent_nip = "8792676609";
|
||||
$new->parent_iln = "5909000837119";
|
||||
$new->pricebook_id = "13b29aa1-48f0-de58-7630-59c22756c5e4";
|
||||
$new->status = "s30";
|
||||
$new->type = "sales_order";
|
||||
$new->name = $sale->name;
|
||||
$new->ecmpaymentcondition_name = "90 dni";
|
||||
$new->ecmpaymentcondition_id = "28de9f83-abd3-9a5d-4df9-4df9b7e0031f";
|
||||
$new->parent_document_no = $sale->parent_document_no;
|
||||
$new->register_date = $sale->register_date;
|
||||
$new->send_date = $sale->send_date;
|
||||
$new->delivery_date = $sale->delivery_date;
|
||||
$new->ecmlanguage = "pl_pl";
|
||||
$new->currency_id = 'PLN';
|
||||
$new->total_netto = $total_netto;
|
||||
$new->total_brutto = $total_brutto;
|
||||
$new->discount = $total_discount;
|
||||
$new->vats_summary = $vats_summary;
|
||||
$new->shipping_address_name = $sale->parent_name;
|
||||
$new->shipping_address_street = $sale->parent_address_street;
|
||||
$new->shipping_address_postalcode = $sale->parent_address_postalcode;
|
||||
$new->shipping_address_city = $sale->parent_address_city;
|
||||
$new->shipping_address_country = $sale->parent_address_country;
|
||||
$new->shipping_iln = $sale->parent_iln;
|
||||
$new->shipping_nip = $sale->parent_nip;
|
||||
$new->edi_zs_id = $sale->id;
|
||||
$new->edi_zs_document_no = $sale->document_no;
|
||||
$new->pdf_text =
|
||||
if (isset($vats[$prod['ecmvat_value']])) {
|
||||
$vats[$prod['ecmvat_value']] += $prod['total_netto'];
|
||||
} else {
|
||||
$vats[$prod['ecmvat_value']] = $prod['total_netto'];
|
||||
}
|
||||
|
||||
$prod['date_entered'] = date('Y-m-d H:i:s');
|
||||
$prod['date_modified'] = date('Y-m-d H:i:s');
|
||||
$prod['modified_user_id'] = null;
|
||||
$prod['assigned_user_id'] = null;
|
||||
$prod['created_by'] = null;
|
||||
$prod['deleted'] = '0';
|
||||
$prod['product_id'] = $p->id;
|
||||
$prod['position'] = $product->position;
|
||||
$prod['product_code'] = $p->code;
|
||||
$prod['name'] = $product->name;
|
||||
$prod['unit_id'] = $product->unit_id;
|
||||
$prod['unit_name'] = $product->unit_name;
|
||||
$prod['category_id'] = $p->product_category_id;
|
||||
$prod['recipient_code'] = $product->recipient_code;
|
||||
$prod['ean'] = $p->ean;
|
||||
array_push($newPositionList, $prod);
|
||||
}
|
||||
}
|
||||
$vats_summary = '';
|
||||
foreach ($vats as $k=>$v ) {
|
||||
$vats_summary .= $k.'%:'.$v.',';
|
||||
}
|
||||
|
||||
if (!$gotAllProducts) {
|
||||
echo 'Brak produktow w bazie E5. Dokument nie zostal skopiowany.';
|
||||
die();
|
||||
}
|
||||
|
||||
require_once('modules/EcmSales/EcmSale.php');
|
||||
$new = new EcmSale();
|
||||
$new->position_list = $newPositionList;
|
||||
$new->parent_id = "1b9643ca-5b1a-8f9b-b809-586b5619b068";
|
||||
$new->parent_name = "Twinpol Sp. z o.o.";
|
||||
$new->parent_address_street = "al. Lipowa 48";
|
||||
$new->parent_address_city = "Obrowo";
|
||||
$new->parent_address_postalcode = "87-126";
|
||||
$new->parent_address_country = "Polska";
|
||||
$new->parent_nip = "8792676609";
|
||||
$new->parent_iln = "5909000837119";
|
||||
$new->pricebook_id = "13b29aa1-48f0-de58-7630-59c22756c5e4";
|
||||
$new->status = "s30";
|
||||
$new->type = "sales_order";
|
||||
$new->name = $sale->name;
|
||||
$new->ecmpaymentcondition_name = "90 dni";
|
||||
$new->ecmpaymentcondition_id = "28de9f83-abd3-9a5d-4df9-4df9b7e0031f";
|
||||
$new->parent_document_no = $sale->parent_document_no;
|
||||
$new->register_date = $sale->register_date;
|
||||
$new->send_date = $sale->send_date;
|
||||
$new->delivery_date = $sale->delivery_date;
|
||||
$new->ecmlanguage = "pl_pl";
|
||||
$new->currency_id = 'PLN';
|
||||
$new->total_netto = $total_netto;
|
||||
$new->total_brutto = $total_brutto;
|
||||
$new->discount = $total_discount;
|
||||
$new->vats_summary = $vats_summary;
|
||||
$new->shipping_address_name = $sale->parent_name;
|
||||
$new->shipping_address_street = $sale->parent_address_street;
|
||||
$new->shipping_address_postalcode = $sale->parent_address_postalcode;
|
||||
$new->shipping_address_city = $sale->parent_address_city;
|
||||
$new->shipping_address_country = $sale->parent_address_country;
|
||||
$new->shipping_iln = $sale->parent_iln;
|
||||
$new->shipping_nip = $sale->parent_nip;
|
||||
$new->edi_zs_id = $sale->id;
|
||||
$new->edi_zs_document_no = $sale->document_no;
|
||||
$new->pdf_text =
|
||||
"Dostawa
|
||||
".$sale->shipping_address_name."
|
||||
".$sale->shipping_address_street."
|
||||
@@ -188,16 +191,16 @@
|
||||
NIP: ".$sale->shipping_nip."
|
||||
ILN: ".$sale->shipping_iln;
|
||||
|
||||
$newId = $new->save(true);
|
||||
$newId = $new->save(true);
|
||||
|
||||
//update E5 number in Twinpol
|
||||
$res = $db->fetchByAssoc($db->query("SELECT document_no FROM ecmsales WHERE id='$newId'"));
|
||||
$document_no = str_replace(" ", "%20", $res['document_no']);
|
||||
makeCUrlRequest("https://crm.twinpol.com/REST/index.php?key=d68dac4c-f784-4e1b-8267-9ffcfa0eda4c&action=updateSaleE5Number&record=$record&e5_record=$newId&e5_document_no=$document_no");
|
||||
//update E5 number in Twinpol
|
||||
$res = $db->fetchByAssoc($db->query("SELECT document_no FROM ecmsales WHERE id='$newId'"));
|
||||
$document_no = str_replace(" ", "%20", $res['document_no']);
|
||||
makeCUrlRequest("https://crm.twinpol.com/REST/index.php?key=d68dac4c-f784-4e1b-8267-9ffcfa0eda4c&action=updateSaleE5Number&record=$record&e5_record=$newId&e5_document_no=$document_no");
|
||||
|
||||
echo '<a target="new" href="https://crm.e5.pl/index.php?module=EcmSales&action=DetailView&record='.$newId.'">Utworzono ZS.</a>';
|
||||
die();
|
||||
}
|
||||
echo '<a target="new" href="https://crm.e5.pl/index.php?module=EcmSales&action=DetailView&record='.$newId.'">Utworzono ZS.</a>';
|
||||
die();
|
||||
}
|
||||
|
||||
// local helpers
|
||||
function getProduct($code) {
|
||||
|
||||
@@ -12,11 +12,11 @@ if ($_GET['key'] != $restConfig['e5Key']) {
|
||||
exit;
|
||||
}
|
||||
// Enable SugarCRM features
|
||||
if(!defined('sugarEntry'))define('sugarEntry', true);
|
||||
if (!defined('sugarEntry')) define('sugarEntry', true);
|
||||
require_once('./include/entryPoint.php');
|
||||
// Make action
|
||||
switch ($_GET["action"]) {
|
||||
case 'getInvoice':
|
||||
case 'getInvoice':
|
||||
sendInvoice($_GET['record']);
|
||||
break;
|
||||
case 'getProduct':
|
||||
@@ -25,5 +25,52 @@ switch ($_GET["action"]) {
|
||||
case 'copySaleFromTwinpol':
|
||||
copySaleFromTwinpol($_GET['record']);
|
||||
break;
|
||||
}
|
||||
?>
|
||||
case 'export.products.list':
|
||||
if ($_GET['since'] == null) {
|
||||
echo 'No since date';
|
||||
exit;
|
||||
}
|
||||
$products = [];
|
||||
$db = $GLOBALS['db'];
|
||||
$sixMonthsAgo = (new DateTime())->modify('-6 months')->format('Y-m-d H:i:s');
|
||||
$sinceDate = date('Y-m-d H:i:s', intval($_GET['since']));;
|
||||
$query = "
|
||||
SELECT
|
||||
p.id,
|
||||
p.name,
|
||||
p.code,
|
||||
p.ean,
|
||||
GROUP_CONCAT(s.stock_address SEPARATOR ', ') AS stock_addresses
|
||||
FROM ecmproducts p
|
||||
LEFT JOIN ecmproducts_stock_addresses s ON p.id = s.ecmproduct_id
|
||||
WHERE p.active = 1
|
||||
AND p.deleted = 0
|
||||
AND p.date_modified > '$sixMonthsAgo'
|
||||
AND (p.exportedAt IS NULL OR p.exportedAt > '$sinceDate')
|
||||
GROUP BY p.id, p.name, p.code
|
||||
";
|
||||
$r = $db->query($query);
|
||||
while ($row = $db->fetchByAssoc($r)) {
|
||||
$p = [];
|
||||
$p['id'] = $row['id'];
|
||||
$p['ean'] = $row['ean'];
|
||||
$p['name'] = $row['name'];
|
||||
$p['code'] = $row['code'];
|
||||
$p['stock_addresses'] = $row['stock_addresses'];
|
||||
array_push($products, $p);
|
||||
}
|
||||
echo json_encode($products);
|
||||
break;
|
||||
case 'export.products.setExportedAt':
|
||||
{
|
||||
if ($_GET['exportedAt'] == null || $_GET['id'] == null) {
|
||||
echo 'Wrong parameters';
|
||||
exit;
|
||||
}
|
||||
$db = $GLOBALS['db'];
|
||||
$exportedAt = date('Y-m-d H:i:s', intval($_GET['exportedAt']));;
|
||||
$id = $_GET['id'];
|
||||
$db->query("UPDATE ecmproducts SET exportedAt='$exportedAt' WHERE id='$id'");
|
||||
break;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user