This commit is contained in:
2025-04-01 00:38:54 +02:00
parent d4d4c0c09d
commit 87da06293a
22351 changed files with 5168854 additions and 7538 deletions

View File

@@ -0,0 +1,259 @@
<?php
/**
* NOTICE OF LICENSE
*
* This file is licenced under the Software License Agreement.
* With the purchase or the installation of the software in your application
* you accept the licence agreement.
*
* You must not modify, adapt or create derivative works of this source code
*
* @author PrestaHelp.com
* @copyright 2019 PrestaHelp
* @license LICENSE.txt
*/
class AuthDSPhStickers
{
private $url_hash;
private $name;
public function __construct($name = false)
{
$this->url_hash = 'aHR0cHM6Ly9tb2R1bGVzLnByZXN0YWhlbHAuY29tL3dzLw==';
if ($name) {
$this->name = $name;
}
}
public function isActive($domain)
{
$url = base64_decode($this->url_hash).'getLicence';
$data = array(
'moduleName' => $this->name,
'domain' => $domain
);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
return (array)json_decode(curl_exec($ch));
}
/**
* @param $module_name
* @param $module_version
* @param $domain
* @return bool
*/
public function makeTools($module_name, $module_version, $domain)
{
$url = base64_decode($this->url_hash).'set';
$data = array(
'moduleName' => $module_name,
'moduleVersion' => $module_version,
'domain' => $domain,
'date_add' => date('Y-m-d H:i:s')
);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
$response = curl_exec($ch);
if (!$response) {
return false;
}
return true;
}
/**
* @return array
*/
public function getBaners()
{
$url = base64_decode($this->url_hash).'getproducts';
try {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
curl_close($ch);
} catch (Exception $e) {
print_r($e);
}
$resp = (array)json_decode($response);
return $resp;
}
/**
* @return array
*/
public function getAuthor()
{
$url = base64_decode($this->url_hash).'getAuthor';
try {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
curl_close($ch);
} catch (Exception $e) {
print_r($e);
}
$resp = (array)json_decode($response);
$respons = array();
if (!empty($resp)) {
foreach ($resp as $r) {
$respons[$r->name] = $r->value;
}
}
return $respons;
}
/**
* @return array|bool
*/
public function getChangelog()
{
$url = base64_decode($this->url_hash).'getchangelog';
$data = array(
'module' => $this->name
);
try {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_VERBOSE, true);
$response = curl_exec($ch);
} catch (Exception $e) {
print_r($e);
}
if (!$response) {
return false;
}
return (array)json_decode($response);
}
/**
* @return array|bool
*/
public function getChangelogOther()
{
$url = base64_decode($this->url_hash).'getchangelogother';
$data = array(
'module' => $this->name
);
try {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_VERBOSE, true);
$response = curl_exec($ch);
} catch (Exception $e) {
print_r($e);
}
if (!$response) {
return false;
}
return (array)json_decode($response);
}
/**
* @return array|bool
*/
public function getCurrentModuleVersion()
{
$url = base64_decode($this->url_hash).'getCurrentModuleVersion';
$data = array(
'module' => $this->name
);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
$response = curl_exec($ch);
if (!$response) {
return false;
}
return (array)json_decode($response);
}
/**
* @return bool|string|string[]
*/
public static function getBanersHtml()
{
$url = "https://update.prestahelp.com/produkty.html";
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$html = curl_exec($ch);
curl_close($ch);
$html = str_replace('src="app/', 'src="https://update.prestahelp.com/app/', $html);
return $html;
}
public function getStaticLicence($domain, $module_name, $licenceUser, $showLicence = null)
{
$time = 10;
$key = 'w7UixRT2T1';
$module_number = 16;
$licence = hash('sha512', $domain.(int)$time.$key.$module_name.(int)$module_number);
Configuration::updateValue('INPOSTSHIP_LICENCE_GEN', $licence);
Configuration::updateValue('INPOSTSHIP_LICENCE_GEN_DATA', $domain.'|'.$time.'|'.$key.'|'.$module_name.'|'.$module_number);
$licences = array();
if ($showLicence == 1) {
echo $licenceUser.'<br />'.$licence.'<br />';
}
if ($licenceUser == $licence) {
$licences['licence'] = new stdClass();
$licences['licence']->licence = 1;
$licences['licence']->date_expire_update = date('Y-m-d H:i:s', strtotime('+365 days'));
$licences['licence']->date_expire_support = date('Y-m-d H:i:s', strtotime('+90 days'));
$licences['licence']->date_expire = date('Y-m-d H:i:s', strtotime('+9999 days'));
$licences['licence']->licence_update = 1;
$licences['licence']->licence_support = 0;
$licences['licence']->time = 10;
$licences['licence']->time_upd = 7;
$licences['licence']->date_expire_update_left = new stdClass();
$licences['licence']->date_expire_update_left->left = '';
}
if ($showLicence == 1) {
print_r($licences);
}
return $licences;
}
public static function clearDomain($domain) {
$domain = str_replace('http://', '', $domain);
$domain = str_replace('https://', '', $domain);
$domain = str_replace('www.', '', $domain);
$domain = str_replace('/', '', $domain);
return $domain;
}
public function getMessageInfo($id_key)
{
$url = base64_decode($this->url_hash).'getMessages';
$data = array(
'id_module' => 16,
'id_key' => $id_key
);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
$response = curl_exec($ch);
if (!$response) {
return false;
}
return (array)json_decode($response);
}
}

View File

@@ -0,0 +1,256 @@
<?php
class Sticker
{
public static $positions = array(
1 => 'Góra lewa',
2 => 'Góra środek',
3 => 'Góra prawa',
4 => 'Środek lewa',
5 => 'Środek',
6 => 'Środek prawa',
7 => 'Doł lewa',
8 => 'Dół środek',
9 => 'Dół prawa'
);
public static function addSticker($files, $priceOn = 0, $priceMin = 0, $priceMax = 0, $pricePos = 0, $qtyOn = 0, $qtyMin = 0, $qtyMax = 0, $qtyPos = 0, $manuOn = 0, $idManu = 0, $manuPos = 0, $posNew = 0, $showNew = 0)
{
if (is_array($files)) {
Db::getInstance()->insert('phstickers', array(
'price_on' => $priceOn,
'price_min' => $priceMin,
'price_max' => $priceMax,
'qty_on' => $qtyOn,
'qty_min' => $qtyMin,
'qty_max' => $qtyMax,
'manu_on' => $manuOn,
'position_price' => $pricePos,
'position_qty' => $qtyPos,
'position_manu' => $manuPos,
'id_manufacturer' => $idManu,
'position_new' => $posNew,
'show_new' => $showNew,
'date_add' => date('Y-m-d H:i:s')
));
$id_sticker = Db::getInstance()->Insert_ID();
foreach ($files as $key => $file) {
$id_lang = (int)$key;
$name = $file['name'];
$destination = __DIR__.'/../stickers/'.$key.'/'.$name;
if (!is_dir(__DIR__.'/../stickers/'.$id_lang)) {
if (!mkdir($concurrentDirectory = __DIR__ . '/../stickers/' . $id_lang) && !is_dir($concurrentDirectory)) {
throw new \RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory));
}
}
if (move_uploaded_file($file['tmp_name'], $destination)) {
Db::getInstance()->insert('phstickers_lang', array(
'id_sticker' => $id_sticker,
'file_name' => $name,
'id_lang' => $id_lang
));
}
}
}
}
public static function editSticker($id_sticker, $files, $priceOn = 0, $priceMin = 0, $priceMax = 0, $pricePos = 0, $qtyOn = 0, $qtyMin = 0, $qtyMax = 0, $qtyPos = 0, $manuOn = 0, $idManu = 0, $manuPos = 0, $showNew = 0, $posNew = 0)
{
Db::getInstance()->update('phstickers', array(
'price_on' => $priceOn,
'price_min' => $priceMin,
'price_max' => $priceMax,
'qty_on' => $qtyOn,
'qty_min' => $qtyMin,
'qty_max' => $qtyMax,
'manu_on' => $manuOn,
'position_price' => $pricePos,
'position_qty' => $qtyPos,
'position_manu' => $manuPos,
'id_manufacturer' => $idManu,
'position_new' => $posNew,
'show_new' => $showNew,
), '`id_sticker` = '.(int)$id_sticker);
if (is_array($files)) {
foreach ($files as $key => $file) {
$id_lang = (int)$key;
$name = $file['name'];
$destination = __DIR__.'/../stickers/'.$key.'/'.$name;
$update = false;
$sticker = Sticker::getSticker((int)$id_sticker, (int)$id_lang);
if (isset($sticker['langs'][(int)$id_lang]) && !empty($sticker['langs'][(int)$id_lang])) {
$update = true;
}
if (!is_dir(__DIR__.'/../stickers/'.$id_lang)) {
if (!mkdir($concurrentDirectory = __DIR__ . '/../stickers/' . $id_lang) && !is_dir($concurrentDirectory)) {
throw new \RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory));
}
}
if (move_uploaded_file($file['tmp_name'], $destination)) {
if ($update) {
Db::getInstance()->update('phstickers_lang', array(
'file_name' => $name
), '`id_sticker` = '.(int)$id_sticker.' AND `id_lang` = '.(int)$id_lang);
} else {
Db::getInstance()->insert('phstickers_lang', array(
'id_sticker' => $id_sticker,
'file_name' => $name,
'id_lang' => $id_lang
));
}
}
}
}
}
public static function deleteSticker($id_sticker)
{
$sticker = Sticker::getSticker((int)$id_sticker);
if (!empty($sticker)) {
foreach ($sticker['langs'] as $lang) {
$dir = __DIR__.'/../stickers/'.$lang['id_lang'].'/';
unlink($dir.$lang['file_name']);
Db::getInstance()->delete('phstickers_lang', 'id_sticker = '.(int)$id_sticker.' AND id_lang = '.(int)$lang['id_lang']);
}
Db::getInstance()->delete('phstickers', 'id_sticker = '.(int)$id_sticker);
return true;
}
return false;
}
public static function getSticker($id_sticker, $id_lang = false)
{
$sticker = DB::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.'phstickers` WHERE `id_sticker` = '.(int)$id_sticker);
if (!empty($sticker)) {
$sticker_lang = DB::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'phstickers_lang` WHERE `id_sticker` = '.(int)$id_sticker.($id_lang ? ' AND `id_lang` = '.(int)$id_lang : ''));
if (!$id_lang) {
$langs = array();
if (!empty($sticker_lang)) {
foreach ($sticker_lang as $item) {
$langs[$item['id_lang']] = $item;
}
}
} else {
$langs = $sticker_lang[0];
}
$sticker['langs'] = $langs;
}
return $sticker;
}
public static function getAllStickers($id_lang = 1)
{
$return = Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'phstickers` s LEFT JOIN `'._DB_PREFIX_.'phstickers_lang` sl ON sl.`id_sticker` = s.`id_sticker` WHERE sl.`id_lang` = '.(int)$id_lang);
if (!empty($return)) {
foreach ($return as &$r) {
$mname = '';
if ($r['id_manufacturer'] > 0) {
$manufacturer = new Manufacturer((int)$r['id_manufacturer'], (int)$id_lang);
$mname = $manufacturer->name;
}
$r['manufacturer_name'] = $mname;
}
}
return $return;
}
public static function orderFiles($files)
{
$shuffleFile = array();
if (is_array($files)) {
$mainKey = key($files);
foreach ($files[$mainKey] as $key => $file) {
if (is_array($file)) {
foreach ($file as $ki => $item) {
$shuffleFile[$ki][$key] = $item;
}
}
}
}
return $shuffleFile;
}
public static function addStickerProduct($id_product, $stickers, $positions, $inherit)
{
if (is_array($stickers)) {
foreach ($stickers as $s) {
if ($s > 0) {
DB::getInstance()->insert('phstickers_product', array(
'id_sticker' => (int)$s,
'id_product' => (int)$id_product,
'position' => (int)$positions[(int)$s],
'inherit' => $inherit
));
}
}
}
}
public static function deleteProductSticker($id_product)
{
Db::getInstance()->delete('phstickers_product', 'id_product = '.(int)$id_product);
}
public static function getProductSticker($id_product)
{
return Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'phstickers_product` WHERE `id_product` = '.(int)$id_product);
}
public static function addCategorySticker($categorys, $stickers, $positions)
{
if (is_array($categorys)) {
foreach ($categorys as $category) {
if (!empty($stickers)) {
foreach ($stickers as $sticker) {
DB::getInstance()->insert('phstickers_category', array(
'id_sticker' => (int)$sticker,
'id_category' => (int)$category,
'position' => $positions[$sticker]
));
}
}
}
}
}
public static function editStickersCategory($id_category, $stickers, $positions)
{
if (!empty($stickers)) {
foreach ($stickers as $sticker) {
DB::getInstance()->insert('phstickers_category', array(
'id_sticker' => (int)$sticker,
'id_category' => (int)$id_category,
'position' => $positions[$sticker]
));
}
}
}
public static function getAllCategorySticker()
{
return Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'phstickers_category` ORDER BY `id_category` ASC');
}
public static function getCategorySticker($id_sticker_category)
{
return Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.'phstickers_category` WHERE `id_sticker_category` = '.(int)$id_sticker_category);
}
public static function getCategoryStickers($id_category)
{
return Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'phstickers_category` WHERE `id_category` = '.(int)$id_category);
}
public static function deleteCategorySticker($id_sticker_category)
{
return Db::getInstance()->delete('phstickers_category', 'id_sticker_category = '.(int)$id_sticker_category);
}
public static function deleteCategoryStickers($id_category)
{
return Db::getInstance()->delete('phstickers_category', 'id_category = '.(int)$id_category);
}
}

View File

@@ -0,0 +1,204 @@
<?php
class StickerUpdate
{
public $update = false;
public $updateList = array();
public function __construct()
{
}
public function checkUpdate()
{
$this->updateVersion102();
$this->updateVersion103();
$this->updateVersion104();
$this->updateVersion105();
$this->updateVersion106();
}
private function updateVersion102()
{
$update102_sql1 = Db::getInstance()->executeS('SHOW COLUMNS FROM `'._DB_PREFIX_.'phstickers` WHERE `Field` = "price_min"');
if (empty($update102_sql1)) {
$this->update = true;
$this->updateList[0] = 'price_min';
}
$update102_sql2 = Db::getInstance()->executeS('SHOW COLUMNS FROM `'._DB_PREFIX_.'phstickers` WHERE `Field` = "price_max"');
if (empty($update102_sql2)) {
$this->update = true;
$this->updateList[1] = 'price_max';
}
}
private function updateVersion103()
{
$update103_sql1 = Db::getInstance()->executeS('SHOW COLUMNS FROM `'._DB_PREFIX_.'phstickers_product` WHERE `Field` = "inherit"');
if (empty($update103_sql1)) {
$this->update = true;
$this->updateList[2] = 'inherit';
}
}
private function updateVersion104()
{
$update104_sql1 = Db::getInstance()->executeS('SHOW COLUMNS FROM `'._DB_PREFIX_.'phstickers` WHERE `Field` = "qty_min"');
if (empty($update104_sql1)) {
$this->update = true;
$this->updateList[3] = 'qty_min';
}
$update104_sql2 = Db::getInstance()->executeS('SHOW COLUMNS FROM `'._DB_PREFIX_.'phstickers` WHERE `Field` = "qty_max"');
if (empty($update104_sql2)) {
$this->update = true;
$this->updateList[4] = 'qty_max';
}
$update104_sql3 = Db::getInstance()->executeS('SHOW COLUMNS FROM `'._DB_PREFIX_.'phstickers` WHERE `Field` = "price_on"');
if (empty($update104_sql3)) {
$this->update = true;
$this->updateList[5] = 'price_on';
}
$update104_sql4 = Db::getInstance()->executeS('SHOW COLUMNS FROM `'._DB_PREFIX_.'phstickers` WHERE `Field` = "qty_on"');
if (empty($update104_sql4)) {
$this->update = true;
$this->updateList[6] = 'qty_on';
}
$update104_sql5 = Db::getInstance()->executeS('SHOW COLUMNS FROM `'._DB_PREFIX_.'phstickers` WHERE `Field` = "manu_on"');
if (empty($update104_sql5)) {
$this->update = true;
$this->updateList[7] = 'manu_on';
}
$update104_sql6 = Db::getInstance()->executeS('SHOW COLUMNS FROM `'._DB_PREFIX_.'phstickers` WHERE `Field` = "id_manufacturer"');
if (empty($update104_sql6)) {
$this->update = true;
$this->updateList[8] = 'id_manufacturer';
}
}
private function updateVersion105()
{
$update105_sql1 = Db::getInstance()->executeS('SHOW COLUMNS FROM `'._DB_PREFIX_.'phstickers` WHERE `Field` = "position_price"');
if (empty($update105_sql1)) {
$this->update = true;
$this->updateList[9] = 'position_price';
}
$update105_sql2 = Db::getInstance()->executeS('SHOW COLUMNS FROM `'._DB_PREFIX_.'phstickers` WHERE `Field` = "position_qty"');
if (empty($update105_sql2)) {
$this->update = true;
$this->updateList[10] = 'position_qty';
}
$update105_sql3 = Db::getInstance()->executeS('SHOW COLUMNS FROM `'._DB_PREFIX_.'phstickers` WHERE `Field` = "position_manu"');
if (empty($update105_sql3)) {
$this->update = true;
$this->updateList[11] = 'position_manu';
}
$update105_sql4 = Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.'phstickers_lang` WHERE `file_name` = "100proc.png"');
if (empty($update105_sql4)) {
$this->update = true;
$this->updateList[12][0] = '100proc.png';
}
$update105_sql5 = Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.'phstickers_lang` WHERE `file_name` = "polecany.png"');
if (empty($update105_sql5)) {
$this->update = true;
$this->updateList[12][1] = 'polecany.png';
}
}
private function updateVersion106()
{
$update106_sql1 = Db::getInstance()->executeS('SHOW COLUMNS FROM `'._DB_PREFIX_.'phstickers` WHERE `Field` = "position_new"');
if (empty($update106_sql1)) {
$this->update = true;
$this->updateList[13] = 'position_new';
}
$update106_sql2 = Db::getInstance()->executeS('SHOW COLUMNS FROM `'._DB_PREFIX_.'phstickers` WHERE `Field` = "show_new"');
if (empty($update106_sql2)) {
$this->update = true;
$this->updateList[14] = 'show_new';
}
}
public function processUpdate($adminLink)
{
if (Tools::getIsset('addPriceMinProcess')) {
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'phstickers` ADD `price_min` DOUBLE(20, 6) NOT NULL AFTER `id_sticker`');
Tools::redirect($adminLink.'&conf=4');
}
if (Tools::getIsset('addPriceMaxProcess')) {
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'phstickers` ADD `price_max` DOUBLE(20, 6) NOT NULL AFTER `price_min`');
Tools::redirect($adminLink.'&conf=4');
}
if (Tools::getIsset('addInheritProcess')) {
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'phstickers_product` ADD `inherit` int(11) NOT NULL');
Tools::redirect($adminLink.'&conf=4');
}
if (Tools::getIsset('addQtyMinProcess')) {
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'phstickers` ADD `qty_min` int(11) NOT NULL AFTER `price_max`');
Tools::redirect($adminLink.'&conf=4');
}
if (Tools::getIsset('addQtyMaxProcess')) {
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'phstickers` ADD `qty_max` int(11) NOT NULL AFTER `qty_min`');
Tools::redirect($adminLink.'&conf=4');
}
if (Tools::getIsset('addPriceOnProcess')) {
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'phstickers` ADD `price_on` int(11) NOT NULL AFTER `id_sticker`');
Tools::redirect($adminLink.'&conf=4');
}
if (Tools::getIsset('addQtyOnProcess')) {
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'phstickers` ADD `qty_on` int(11) NOT NULL AFTER `price_max`');
Tools::redirect($adminLink.'&conf=4');
}
if (Tools::getIsset('addManuOnProcess')) {
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'phstickers` ADD `manu_on` int(11) NOT NULL AFTER `qty_max`');
Tools::redirect($adminLink.'&conf=4');
}
if (Tools::getIsset('addIdManuProcess')) {
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'phstickers` ADD `id_manufacturer` int(11) NOT NULL AFTER `manu_on`');
Tools::redirect($adminLink.'&conf=4');
}
if (Tools::getIsset('addPosPriceProcess')) {
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'phstickers` ADD `position_price` int(11) NOT NULL AFTER `price_max`');
Tools::redirect($adminLink.'&conf=4');
}
if (Tools::getIsset('addPosQtyProcess')) {
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'phstickers` ADD `position_qty` int(11) NOT NULL AFTER `qty_max`');
Tools::redirect($adminLink.'&conf=4');
}
if (Tools::getIsset('addPosManuProcess')) {
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'phstickers` ADD `position_manu` int(11) NOT NULL AFTER `id_manufacturer`');
Tools::redirect($adminLink.'&conf=4');
}
if (Tools::getIsset('addImage105Process')) {
$naklejki = Tools::getValue('manyImage');
$naklejkiExp = explode('|', $naklejki);
if (!empty($naklejkiExp)) {
foreach ($naklejkiExp as $item) {
if (!empty($item)) {
Db::getInstance()->insert('phstickers', array(
'date_add' => date('Y-m-d H:i:s')
));
$id = Db::getInstance()->Insert_ID();
Db::getInstance()->insert('phstickers_lang', array(
'id_sticker' => (int)$id,
'file_name' => $item,
'id_lang' => Context::getContext()->cookie->id_lang
));
}
}
}
Tools::redirect($adminLink.'&conf=4');
}
if (Tools::getIsset('addPosNewProcess')) {
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'phstickers` ADD `position_new` int(11) NOT NULL AFTER `position_manu`');
Tools::redirect($adminLink.'&conf=4');
}
if (Tools::getIsset('addShowNewProcess')) {
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'phstickers` ADD `show_new` int(11) NOT NULL AFTER `position_new`');
Tools::redirect($adminLink.'&conf=4');
}
}
}

View File

@@ -0,0 +1,35 @@
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* 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 PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 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;