Merge branch 'ticket/r15782-stats' into develop
This commit is contained in:
commit
de3d84758a
@ -23,14 +23,21 @@ switch ($action) {
|
||||
$start = Tools::getValue('date_export_begin');
|
||||
$end = Tools::getValue('date_export_end');
|
||||
|
||||
$path = dirname(__FILE__) . '/export';
|
||||
$filename = 'export-remb-'.$start.'-'.$end.'.csv';
|
||||
$file = $path . '/' . $filename;
|
||||
if (file_exists($file)) {
|
||||
unlink($file);
|
||||
}
|
||||
|
||||
if (empty($start) || empty($end)) {
|
||||
$url = '';
|
||||
} else {
|
||||
$url = Tools::getShopDomain(true) . '/modules/stats_logistic/ajax.php?action=check&token='.Tools::getValue('token');
|
||||
}
|
||||
|
||||
$cmd = dirname(__FILE__).'/bin/export.php --start '.$start.' --end '.$end.'';
|
||||
exec('php '.$cmd.' &');
|
||||
$cmd = dirname(__FILE__).'/bin/export.php --start '.$start.' --end '.$end;
|
||||
exec("php ".$cmd." > /dev/null &");
|
||||
|
||||
// Always return checkin url
|
||||
echo json_encode(array(
|
||||
|
@ -9,7 +9,6 @@ $_SERVER['SERVER_PORT'] = 443;
|
||||
require_once __DIR__ . '/../../../config/config.inc.php';
|
||||
require_once __DIR__ . '/../stats_logistic.php';
|
||||
|
||||
|
||||
if (!Tools::isCli()){
|
||||
exit();
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ class StatsLogistic
|
||||
{
|
||||
$this->date_export_begin = $start;
|
||||
$this->date_export_end = $end;
|
||||
|
||||
$fname = 'export-remb-'.$this->date_export_begin.'-'.$this->date_export_end.'.csv';
|
||||
$result = null;
|
||||
|
||||
$sale_ids = $this->getSales();
|
||||
@ -180,7 +180,7 @@ class StatsLogistic
|
||||
}
|
||||
}
|
||||
}
|
||||
$fname = 'export-remb-'.$this->date_export_begin.'-'.$this->date_export_end.'.csv';
|
||||
|
||||
if ($result !== null) {
|
||||
$this->exportCSV($result, $fname);
|
||||
} else {
|
||||
|
@ -27,11 +27,8 @@ $(function(){
|
||||
}
|
||||
|
||||
$('form').submit(function(e) {
|
||||
e.preventDefault();
|
||||
$(this).find('input#submitExport').attr('disabled', 'disabled');
|
||||
url = $(this).attr('action');
|
||||
console.log(url);
|
||||
console.log($(this).serialize());
|
||||
$.post(url, $(this).serialize(), function (data, textStatus) {
|
||||
if (data.url != '') {
|
||||
url = data.url;
|
||||
|
Loading…
Reference in New Issue
Block a user