first commit

This commit is contained in:
2024-12-17 13:43:22 +01:00
commit 8e6cd8b410
21292 changed files with 3514826 additions and 0 deletions

View File

@@ -0,0 +1,135 @@
<?php
/**
* Module Name: Perimeter / Length / Surface (Area) / Volume / Weight Calculator for Prestashop
*
* Module URI: Please contact with info@megventure.com
* Description: A utility to calculate quantity in perimeter, length, area, volume or weight units
* Version: 5.5.0
*
* @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.
*/
class SquaremeterAdmin extends ObjectModel
{
/** @var string Name */
public $id_squaremeteradmin;
/** @var integer */
public $id_shop;
public $id_product;
/** @var string */
public $displaycalculator;
public $displaypicture;
public $calculationtype;
public $additionalquantity;
public $directinput;
public $displayquantity;
public $displayprice;
public $displayreserve;
public $unit_baseprice;
public $displaystartingprice;
public $displayextrafee;
public $displayextrafeeselect;
public $displaywaste;
public $displaywasteselect;
public $attselect;
public $conversion;
public $secconversionselect;
public $secconversion;
public $attribute;
public $minheight;
public $maxheight;
public $maxheightunit;
public $heightcheck;
public $step_height;
public $minwidth;
public $maxwidth;
public $maxwidthunit;
public $widthcheck;
public $step_width;
public $mindepth;
public $maxdepth;
public $maxdepthunit;
public $depthcheck;
public $step_depth;
public $minweight;
public $maxweight;
public $maxweightunit;
public $weightcheck;
public $conversionunit;
public $attributeunit;
public $step;
public $disableapplet;
public $allow_ordering_from_listing;
public $ratio;
public static $definition = array(
'table' => 'squaremeteradmin',
'primary' => 'id_squaremeteradmin',
'multilang' => false,
'fields' => array(
'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isInt'), /* Adding id_shop spoils 1.6 update*/
'id_product' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
'displaycalculator' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'displaypicture' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'calculationtype' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'additionalquantity' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'directinput' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'displayquantity' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'ratio' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'displayprice' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'displayreserve' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'unit_baseprice' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'displaystartingprice' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'displayextrafee' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'displayextrafeeselect' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'displaywaste' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'displaywasteselect' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'attselect' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'conversion' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'secconversionselect' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'secconversion' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'attribute' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'minheight' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'maxheight' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'maxheightunit' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'heightcheck' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'step_height' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'minwidth' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'maxwidth' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'maxwidthunit' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'widthcheck' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'step_width' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'mindepth' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'maxdepth' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'maxdepthunit' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'depthcheck' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'step_depth' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'minweight' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'maxweight' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'maxweightunit' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'weightcheck' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'conversionunit' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'attributeunit' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'step' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'disableapplet' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'allow_ordering_from_listing' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
),
);
public static function loadByIdProduct($id_product, $id_shop)
{
$result = Db::getInstance()->getRow('SELECT * FROM `' . pSQL(_DB_PREFIX_) . 'squaremeteradmin` sample WHERE sample.`id_shop` = ' . (int) $id_shop . ' AND sample.`id_product` = ' . (int) $id_product);
return new SquaremeterAdmin($result['id_squaremeteradmin']);
}
}

View File

@@ -0,0 +1,29 @@
<?php
/*
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author MEG Venture <info@megventure.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,65 @@
<?php
/**
* Module Name: Perimeter / Length / Surface (Area) / Volume / Weight Calculator for Prestashop
*
* Module URI: Please contact with info@megventure.com
* Description: A utility to calculate quantity in perimeter, length, area, volume or weight units
* Version: 5.5.0
*
* @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.
*/
include dirname(__FILE__) . '/../../../config/config.inc.php';
require_once dirname(__FILE__) . '/../squaremeter.php';
$id_product = Tools::getValue('id_product');
if (file_exists(dirname(__FILE__) . "/../../../modules/squaremeter/views/img/uploads/" . $id_product . '.jpg')) {
unlink(dirname(__FILE__) . "/../../../modules/squaremeter/views/img/uploads/" . $id_product . '.jpg');
}
if (file_exists(dirname(__FILE__) . "/../../../modules/squaremeter/views/img/uploads/" . $id_product . '.jpeg')) {
unlink(dirname(__FILE__) . "/../../../modules/squaremeter/views/img/uploads/" . $id_product . '.jpeg');
}
if (file_exists(dirname(__FILE__) . "/../../../modules/squaremeter/views/img/uploads/" . $id_product . '.JPG')) {
unlink(dirname(__FILE__) . "/../../../modules/squaremeter/views/img/uploads/" . $id_product . '.JPG');
}
if (file_exists(dirname(__FILE__) . "/../../../modules/squaremeter/views/img/uploads/" . $id_product . '.JPEG')) {
unlink(dirname(__FILE__) . "/../../../modules/squaremeter/views/img/uploads/" . $id_product . '.JPEG');
}
if (file_exists(dirname(__FILE__) . "/../../../modules/squaremeter/views/img/uploads/" . $id_product . '.gif')) {
unlink(dirname(__FILE__) . "/../../../modules/squaremeter/views/img/uploads/" . $id_product . '.gif');
}
if (file_exists(dirname(__FILE__) . "/../../../modules/squaremeter/views/img/uploads/" . $id_product . '.tif')) {
unlink(dirname(__FILE__) . "/../../../modules/squaremeter/views/img/uploads/" . $id_product . '.tif');
}
if (file_exists(dirname(__FILE__) . "/../../../modules/squaremeter/views/img/uploads/" . $id_product . '.png')) {
unlink(dirname(__FILE__) . "/../../../modules/squaremeter/views/img/uploads/" . $id_product . '.png');
}
if (file_exists(dirname(__FILE__) . "/../../../modules/squaremeter/views/img/uploads/" . $id_product . '.PNG')) {
unlink(dirname(__FILE__) . "/../../../modules/squaremeter/views/img/uploads/" . $id_product . '.PNG');
}
if (file_exists(dirname(__FILE__) . "/../../../modules/squaremeter/views/img/uploads/" . $id_product . '.bmp')) {
unlink(dirname(__FILE__) . "/../../../modules/squaremeter/views/img/uploads/" . $id_product . '.bmp');
}
$src = $_FILES['file']['tmp_name'];
$filename = Tools::getValue('filename');
$targ = dirname(__FILE__) . "/../../../modules/squaremeter/views/img/uploads/" . $filename;
move_uploaded_file($src, $targ);
$targ = Tools::substr($targ, strpos($targ, "/../../..") + 9);
echo $targ;