Files
crm.e5.pl/modules/EcmProducts/SendXML.php
2024-04-27 09:23:34 +02:00

24 lines
944 B
PHP
Executable File

<?php
error_reporting(0);
include_once("modules/EcmProducts/xml_template.php");
$xml=xml($_REQUEST['record']);
$file="cache/upload/product_xml_".str_replace(" ","_",str_replace(".","_",microtime())).".xml";
fopen($file);
file_put_contents($file,$xml);
chmod($file,0777);
$remote_file="/xml_products/".$r['code']."_".date("YmdHis").".xml";
$conn_id = ftp_connect("www.leobite.com");
$login_result = ftp_login($conn_id, "ftpleobite.leobite.com", "wrT%I9g");
if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) {
//echo "successfully uploaded $file\n";
} else {
//echo "There was a problem while uploading $file\n";
}
ftp_chmod($conn_id, 0755, $remote_file);
$GLOBALS['db']->query("update ecmproducts_log set sent='1' where date_entered<='".date("Y-m-d H:i:s")."' and ecmproduct_id='".$_REQUEST['record']."'");
//header("Location: ".$file);
header("Location: index.php?module=EcmProducts&action=DetailView&record=".$_REQUEST['record']);
?>