43 lines
3.4 KiB
PHP
43 lines
3.4 KiB
PHP
<?php
|
|
/**
|
|
* Module Name: Perimeter / Length / Surface (Area) / Volume / Weight Calculator for Prestashop
|
|
*
|
|
* Module URI: Please contact with info@megventure.com
|
|
* Description: A tool to calculate quantity in linear, perimeter, surface (area), volume or weight units.
|
|
* Version: 5.5.1
|
|
*
|
|
* @author MEG Venture <info@megventure.com>
|
|
* @copyright 2007-2021 MEG Venture
|
|
* @license For Prestashop--> http://opensource.org/licenses/osl-3.2.1.php Open Software License (OSL 3.2.1)
|
|
*
|
|
* This program is not a free software: you can't redistribute it and/or modify
|
|
* it. All rights reserved to MEG Venture.
|
|
*
|
|
* This copyright notice and licence should be retained in all modules based on this framework.
|
|
* This does not affect your rights to assert copyright over your own original work.
|
|
*/
|
|
|
|
error_reporting(E_ALL ^ E_NOTICE);
|
|
ini_set('error_reporting', E_ALL ^ E_NOTICE);
|
|
include dirname(__FILE__) . '/../../../../config/config.inc.php';
|
|
include_once dirname(__FILE__) . '/../../../../init.php';
|
|
|
|
/* set headers to force download on csv format */
|
|
header('Content-Type: text/csv; charset=utf-8');
|
|
header('Content-Disposition: attachment; filename=dimensionsettings.csv');
|
|
|
|
/* we initialize the output with the headers */
|
|
$output = "id_shop,id_product,displaycalculator,displaypicture,calculationtype,additionalquantity,directinput,displayquantity,displayprice,displayreserve,unit_baseprice,displaystartingprice,displayextrafee,displayextrafeeselect,displaywaste,displaywasteselect,conversion,secconversionselect,secconversion,conversionunit,attribute,attributeunit,step,disableapplet,allow_ordering_from_listing,attselect,minheight,maxheight,maxheightunit,heightcheck,step_height,minwidth,maxwidth,maxwidthunit,widthcheck,step_width,mindepth,maxdepth,maxdepthunit,depthcheck,step_depth,minweight,maxweight,maxweightunit,weightcheck,ratio\n";
|
|
/* select all records from the ps_squaremeteradmin table */
|
|
$sql = 'SELECT * FROM ' . pSQL(_DB_PREFIX_) . 'squaremeteradmin ORDER BY id_product ASC';
|
|
if ($list = Db::getInstance()->ExecuteS($sql)) {
|
|
foreach ($list as $rs) {
|
|
/* add new row */
|
|
$output .= $rs['id_shop'] . ',' . $rs['id_product'] . ',' . $rs['displaycalculator'] . ',' . $rs['displaypicture'] . ',' . $rs['calculationtype'] . ',' . $rs['additionalquantity'] . ',' . $rs['directinput'] . ',' . $rs['displayquantity'] . ',' . $rs['displayprice'] . ',' . $rs['displayreserve'] . ',' . $rs['unit_baseprice'] . ',' . $rs['displaystartingprice'] . ',' . $rs['displayextrafee'] . ',' . $rs['displayextrafeeselect'] . ',' . $rs['displaywaste'] . ',' . $rs['displaywasteselect'] . ',' . $rs['conversion'] . ',' . $rs['secconversionselect'] . ',' . $rs['secconversion'] . ',' . $rs['conversionunit'] . ',' . $rs['attribute'] . ',' . $rs['attributeunit'] . ',' . $rs['step'] . ',' . $rs['disableapplet'] . ',' . $rs['allow_ordering_from_listing'] . ',' . $rs['attselect'] . ',' . $rs['minheight'] . ',' . $rs['maxheight'] . ',' . $rs['maxheightunit'] . ',' . $rs['heightcheck'] . ',' . $rs['step_height'] . ',' . $rs['minwidth'] . ',' . $rs['maxwidth'] . ',' . $rs['maxwidthunit'] . ',' . $rs['widthcheck'] . ',' . $rs['step_width'] . ',' . $rs['mindepth'] . ',' . $rs['maxdepth'] . ',' . $rs['maxdepthunit'] . ',' . $rs['depthcheck'] . ',' . $rs['step_depth'] . ',' . $rs['minweight'] . ',' . $rs['maxweight'] . ',' . $rs['maxweightunit'] . ',' . $rs['weightcheck'] . ',' . $rs['ratio'] ."\n";
|
|
}
|
|
}
|
|
|
|
/* export the output */
|
|
echo $output;
|
|
exit;
|