Initial import: Carteasy Shop (Dev-Stand)

This commit is contained in:
Thomas Bartelt
2026-04-20 01:03:43 +02:00
commit d504f8a05d
3845 changed files with 761050 additions and 0 deletions
+87
View File
@@ -0,0 +1,87 @@
<?php
/**
* @version $Id: index.php 10381 2008-06-01 03:35:53Z $
* @package Easyshop
* @copyright Copyright (C) 2005 - 2011 TA-EDV
* @license proprietary
* @author Richard Kammermayer <rk@ta-edv.de>
* Easyshop is a web shop system
*/
if(isset($_GET['debug']) && $_GET['debug'] == true) {
ini_set('display_errors', 1);
error_reporting(E_ALL);
}
else {
error_reporting(E_ERROR);
}
ini_set("memory_limit","1024M");
set_time_limit(60000);
// including libs
include_once './core/base.class.php';
include_once './core/registry.class.php';
include_once './core/uri.class.php';
//echo microtime_float() - $start_time;
// base object
$base_object = new base();
// show errors if modus is development or debug
if ($base_object->config->debug || $base_object->config->development) {
ini_set("display_errors",1);
}
Registry::set('base', $base_object);
if (isset($_GET['admin_modul'])) {
// go to admin website
include './modules/admin_init.php';
} elseif (isset($_GET['soap_modul'])) {
// soap
include './modules/soap_init.php';
} elseif (isset($_GET['website_modul'])) {
include './modules/website_init.php';
} elseif (isset($_GET['lightningrod'])) {
include './service/lightningrod_init.php';
} elseif (isset($_GET['exportpdf'])) {
include './scripts/exportpdf.php';
} else {
// go to shop website
// get structure
if (isset($_GET['structure_suri'])) {
$structure = URI::fetch_structure($_GET['structure_suri']);
/*if (!$structure) {
header('Location: /error_404/');
}
else {
$_GET['menu_id'] = $structure;
}*/
$_GET['menu_id'] = $structure;
}
// get parent structures 2-8
$_GET['parent_ids'] = isset($_GET['menu_id']) ? array($_GET['menu_id']) : array();
for($i=1;$i<9;$i++) {
if (isset($_GET['structure_suri'.$i])) {
$_GET['parent_ids'][] = URI::fetch_structure($_GET['structure_suri'.$i]);
}
}
// get item
if (isset($_GET['item_suri'])) {
$item = URI::fetch_item($_GET['item_suri']);
if (!$item) {
header('Location: /error_404/');
}
else {
$_GET['item_id'] = $item;
}
}
include './modules/website_init.php';
}
/* EOF */
+73
View File
@@ -0,0 +1,73 @@
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
//include_once '../../config.inc.php';
include_once '/srv/www/vhosts/vgr-vertrieb.de/httpdocs/config.inc.php';
$db = new mysqli(
$config_shop_system['db_host'],
$config_shop_system['db_user'],
$config_shop_system['db_password'],
$config_shop_system['db_name']
);
$db->query("SET NAMES 'utf8'");
// get exported orders
$sql = "SELECT shipping_list_number, order_number FROM orders WHERE export_to_shipping=1";
$result = $db->query($sql);
$exported_orders = array();
while ($obj = $result->fetch_object()) {
if (!$obj->shipping_list_number) {
$obj->shipping_list_number = $obj->order_number;
}
$exported_orders[] = $obj->shipping_list_number;
}
// get sendet orders from external database
/*
$db_extern = new mysqli(
$config_shop_system['db_host'],
$config_shop_system['db_user'],
$config_shop_system['db_password'],
$config_shop_system['db_name']
);
*/
$db_extern = new mysqli(
'rottlerlogistik.dyndns.org',
'U10VGR',
'vgRwa10',
'U10VGR',
32751
);
if (!$db_extern->connect_errno) {
$db_extern->query("SET NAMES 'utf8'");
$sql = "SELECT * FROM versandliste WHERE lieferscheinNr IN ('" . implode("','", $exported_orders) . "')";
$result = $db_extern->query($sql);
$sended_objects = array();
while ($obj = $result->fetch_object()) {
if (isset($sended_objects[$obj->lieferscheinNr])) {
$sended_objects[$obj->lieferscheinNr]->paketnummer .= '; '.$obj->paketnummer;
}
else {
$sended_objects[$obj->lieferscheinNr] = $obj;
}
}
// update orders
foreach ($sended_objects as $sendobject) {
$trackingcode = $sendobject->paketnummer;
$order_number = $sendobject->lieferscheinNr;
$sql = "UPDATE orders SET export_to_shipping=2, trackingcode='$trackingcode' WHERE order_number='$order_number' OR shipping_list_number='$order_number'";
$db->query($sql);
}
}
else {
echo "connection error";
}
exit();
+255
View File
@@ -0,0 +1,255 @@
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
include_once '../../config.inc.php';
global $db;
global $date;
global $item_array;
global $manufacturer_array;
global $manufacturer_to_item_categories_array;
global $url;
global $file;
global $fh;
global $item_category;
global $footer_pages;
global $header_pages;
global $helper_pages;
$db = new mysqli(
$config_shop_system['db_host'],
$config_shop_system['db_user'],
$config_shop_system['db_password'],
$config_shop_system['db_name']
);
$db->query("SET NAMES 'utf8'");
$date = date('Y-m-d');
$item_array = array();
$manufacturer_array = array();
$manufacturer_to_item_categories_array = array();
$url = $config_shop_system['MAIN_URL'];
$file = $config_shop_system['ROOT_DIR'] . 'web/' . $config_shop_system['SHOP_SYSTEM'] . '/documents/files/sitemap.html';
$item_category = 3;
$footer_pages = 7;
$header_pages = 5;
$helper_pages = 61;
function char_replace($text) {
return str_replace($search, $replace, $text);
}
function get_structure_by_root($id, $parent_short_uri = '/', $is_item_category = false, &$return_array) {
global $db;
global $url;
global $helper_pages;
$sql = "SELECT * FROM structure WHERE parent_id=" . $db->real_escape_string($id);
$result = $db->query($sql);
if ($result->num_rows > 0) {
while ($tmp = $result->fetch_assoc()) {
if ($id != 0) {
$tmp['full_short_uri'] = $parent_short_uri . $tmp['short_uri'] . '/';
$tmp['is_root'] = 0;
} else {
$tmp['full_short_uri'] = $parent_short_uri;
$tmp['is_root'] = 1;
}
if ($is_item_category) {
$tmp['is_item_category'] = $is_item_category;
get_structure_by_root($tmp['id'], $tmp['full_short_uri'], true, &$return_array);
} else {
get_structure_by_root($tmp['id'], $tmp['full_short_uri'], false, &$return_array);
}
$tmp['url'] = $url . $tmp['full_short_uri'];
if (!($tmp['is_root'])) {
$return_array[$tmp['id']] = $tmp;
}
}
}
}
function get_manufacturer_to_item_categories($structure_array) {
global $db;
global $manufacturer_to_item_categories_array;
$sql = "SELECT
i.manufacturer_id,
i.structure_id,
s.short_uri AS structure_short_uri
FROM
items i
LEFT JOIN
structure s
ON
i.structure_id = s.id
GROUP BY
i.manufacturer_id, i.structure_id";
$result = $db->query($sql);
if ($result->num_rows > 0) {
while ($tmp = $result->fetch_assoc()) {
if (isset($structure_array[$tmp['structure_id']])) {
$tmp['partial_short_url'] = $structure_array[$tmp['structure_id']]['full_short_uri'];
} else {
$tmp['partial_short_url'] = '';
}
$manufacturer_to_item_categories_array[$tmp['manufacturer_id']][$tmp['structure_id']] = $tmp;
}
}
}
function get_manufacturers() {
global $db;
global $url;
global $manufacturer_array;
$sql = "SELECT * FROM manufacturers";
$result = $db->query($sql);
if ($result->num_rows > 0) {
while ($tmp = $result->fetch_assoc()) {
$tmp['url'] = $url . '/Kaufen/' . $tmp['short_uri'] . '/';
$manufacturer_array[] = $tmp;
}
}
}
function print_items_by_category($category_array) {
global $db;
global $item_array;
global $date;
global $fh;
foreach ($category_array as $category) {
$sql = "SELECT
i.*,
m.name AS manufacturer_name
FROM
items i
JOIN
manufacturers m
ON
m.id = i.manufacturer_id
WHERE
i.structure_id=" . $db->real_escape_string($category['id']);
$result = $db->query($sql);
if ($result->num_rows > 0) {
$name = substr($category['full_short_uri'], 1, -1);
$name = str_replace('/', ' &gt; ', $name);
fwrite($fh, '<h3 class="sitemap_sub_header"><a href="' . $category['url'] . '">' . $name . '</a></h3><ul>');
while ($tmp = $result->fetch_assoc()) {
fwrite($fh, '<li><a href="' . $category['url'] . $tmp['short_uri'] . '.html">' . $tmp['name'] . '</a></li>');
}
fwrite($fh, "</ul>");
}
}
}
function print_items_by_manufacturer($manufacturer_id, $structure_id) {
global $db;
global $item_array;
global $manufacturer_array;
global $manufacturer_to_item_categories_array;
global $date;
global $fh;
$sql = "SELECT *
FROM items
WHERE manufacturer_id=" . $db->real_escape_string($manufacturer_id);
" AND structure_id=" . $db->real_escape_string($structure_id);
$result = $db->query($sql);
if ($result->num_rows > 0) {
$name = $manufacturer_array[$manufacturer_id]['name'];
$url = $manufacturer_array[$manufacturer_id]['url'] . substr($manufacturer_to_item_categories_array[$manufacturer_id][$structure_id]['partial_short_url'], 1);
fwrite($fh, '<h3 class="sitemap_sub_header"><a href="' . $url . '">' . $name . '</a></h3><ul>');
while ($tmp = $result->fetch_assoc()) {
if (isset($manufacturer_array[$tmp['manufacturer_id']])) {
if (isset($manufacturer_to_item_categories_array[$tmp['manufacturer_id']][$tmp['structure_id']])) {
fwrite($fh, '<li><a href="' . $manufacturer_array[$tmp['manufacturer_id']]['url'] . substr($manufacturer_to_item_categories_array[$manufacturer_id][$structure_id]['partial_short_url'], 1) . $tmp['short_uri'] . '.html' . $tmp['name'] . '</a></li>');
}
}
}
}
}
$fh = fopen($file, 'w');
//fwrite($fh, '<div id="sitemap">');
$header_array = array();
get_structure_by_root($header_pages, '/', false, $header_array);
if ($header_array != array()) {
fwrite($fh, '<h2 class="sitemap_sub_header">Header Men&uuml;</h2><ul class="site_list">');
foreach ($header_array as $header) {
fwrite($fh, '<li><a href="' . $header['url'] . '">' . $header['name'] . '</a></li>');
}
fwrite($fh, "</ul>");
}
$footer_array = array();
get_structure_by_root($footer_pages, '/', false, $footer_array);
if ($footer_array != array()) {
fwrite($fh, '<h2 class="sitemap_sub_header">Footer Men&uuml;</h2><ul class="site_list">');
foreach ($footer_array as $footer) {
fwrite($fh, '<li><a href="' . $footer['url'] . '">' . $footer['name'] . '</a></li>');
}
fwrite($fh, "</ul>");
}
$category_array = array();
get_structure_by_root($item_category, '/', true, $category_array);
if ($category_array != array()) {
fwrite($fh, '<h2 class="sitemap_sub_header">Warengruppenmen&uuml;</h2><ul>');
print_items_by_category($category_array);
fwrite($fh, "</ul>");
}
$category_array = array();
get_structure_by_root($item_category, '/', true, $category_array);
get_manufacturer_to_item_categories($category_array);
get_manufacturers();
//$manufactuerer_category_name = "Fishe";
//fwrite($fh, '<h2 class="sitemap_sub_header">'. $manufactuerer_category_name . '</h2><ul>');
//foreach ($manufacturer_array as $manufacturer) {
// if (isset($manufacturer_to_item_categories_array[$manufacturer['id']])) {
// foreach ($manufacturer_to_item_categories_array[$manufacturer['id']] as $data) {
// print_items_by_manufacturer($manufacturer['id'], $data['structure_id']);
// }
// }
//}
//fwrite($fh, '</ul>');
//fwrite($fh, "</div>");
fclose($fh);
+193
View File
@@ -0,0 +1,193 @@
<?php
include_once '../../config.inc.php';
global $db;
global $date;
global $structure_array;
global $manufacturer_array;
global $manufacturer_to_item_categories_array;
global $url;
global $file;
global $fh;
global $item_category;
global $helper_pages;
$db = new mysqli(
$config_shop_system['db_host'],
$config_shop_system['db_user'],
$config_shop_system['db_password'],
$config_shop_system['db_name']
);
$date = date('Y-m-d');
$structure_array = array();
$manufacturer_array = array();
$manufacturer_to_item_categories_array = array();
$url = $config_shop_system['MAIN_URL'];
$file = $config_shop_system['ROOT_DIR'] . 'web/' . $config_shop_system['SHOP_SYSTEM'] . '/documents/files/sitemap.xml';
$item_category = 3;
$helper_pages = 61;
function get_structure($id, $parent_short_uri = '/', $is_item_category = false) {
global $db;
global $structure_array;
global $url;
global $date;
global $fh;
global $item_category;
global $helper_pages;
$sql = "SELECT * FROM structure WHERE parent_id=" . $db->real_escape_string($id);
$result = $db->query($sql);
if ($result->num_rows > 0) {
while ($tmp = $result->fetch_assoc()) {
if ($id != 0) {
$tmp['full_short_uri'] = $parent_short_uri . $tmp['short_uri'] . '/';
$tmp['is_root'] = 0;
} else {
$tmp['full_short_uri'] = $parent_short_uri;
$tmp['is_root'] = 1;
}
if ($tmp['parent_id'] == $item_category || $is_item_category) {
$tmp['is_item_category'] = $is_item_category;
$tmp['sub_categories'] = get_structure($tmp['id'], $tmp['full_short_uri'], true);
} else {
$tmp['sub_categories'] = get_structure($tmp['id'], $tmp['full_short_uri']);
}
$tmp['url'] = $url . $tmp['full_short_uri'];
if (($tmp['id'] != $helper_pages) || ($tmp['parent_id'] != $helper_pages)) {
if (!($tmp['is_root'])) {
$structure_array[$tmp['id']] = $tmp;
fwrite($fh, "<url>\n");
fwrite($fh, "<loc>" . $tmp['url'] . "</loc>\n");
fwrite($fh, "<lastmod>" . $date . "</lastmod>\n");
fwrite($fh, "<changefreq>daily</changefreq>\n");
fwrite($fh, "<priority>1.0</priority>\n");
fwrite($fh, "</url>\n");
}
}
}
}
}
function get_manufacturer_to_item_categories() {
global $db;
global $structure_array;
global $manufacturer_to_item_categories_array;
$sql = "SELECT
i.manufacturer_id,
i.structure_id,
s.short_uri AS structure_short_uri
FROM
items i
LEFT JOIN
structure s
ON
i.structure_id = s.id
GROUP BY
i.manufacturer_id, i.structure_id";
$result = $db->query($sql);
if ($result->num_rows > 0) {
while ($tmp = $result->fetch_assoc()) {
if (isset($structure_array[$tmp['structure_id']])) {
$tmp['partial_short_url'] = $structure_array[$tmp['structure_id']]['full_short_uri'];
} else {
$tmp['partial_short_url'] = '';
}
$manufacturer_to_item_categories_array[$tmp['manufacturer_id']][$tmp['structure_id']] = $tmp;
}
}
}
function get_manufacturers() {
global $db;
global $url;
global $manufacturer_array;
$sql = "SELECT * FROM manufacturers";
$result = $db->query($sql);
if ($result->num_rows > 0) {
while ($tmp = $result->fetch_assoc()) {
$tmp['url'] = $url . '/Kaufen/' . $tmp['short_uri'] . '/';
$manufacturer_array[] = $tmp;
}
}
}
function get_items() {
global $db;
global $structure_array;
global $manufacturer_array;
global $manufacturer_to_item_categories_array;
global $date;
global $fh;
$sql = "SELECT
i.*,
m.name AS manufacturer_name
FROM
items i
JOIN
manufacturers m
ON
m.id = i.manufacturer_id";
$result = $db->query($sql);
if ($result->num_rows > 0) {
while ($tmp = $result->fetch_assoc()) {
if (isset($structure_array[$tmp['structure_id']])) {
fwrite($fh, "<url>\n");
fwrite($fh, "<loc>" . $structure_array[$tmp['structure_id']]['url'] . $tmp['short_uri'] . '.html' . "</loc>\n");
fwrite($fh, "<lastmod>" . $date . "</lastmod>\n");
fwrite($fh, "<changefreq>daily</changefreq>\n");
fwrite($fh, "<priority>1.0</priority>\n");
fwrite($fh, "</url>\n");
}
if (isset($manufacturer_array[$tmp['manufacturer_id']])) {
if (isset($manufacturer_to_item_categories_array[$tmp['manufacturer_id']][$tmp['structure_id']])) {
fwrite($fh, "<url>\n");
fwrite($fh, "<loc>" . $manufacturer_array[$tmp['manufacturer_id']]['url'] . substr($manufacturer_to_item_categories_array[$tmp['manufacturer_id']][$tmp['structure_id']]['partial_short_url'], 1) . $tmp['short_uri'] . '.html' . "</loc>\n");
fwrite($fh, "<lastmod>" . $date . "</lastmod>\n");
fwrite($fh, "<changefreq>daily</changefreq>\n");
fwrite($fh, "<priority>1.0</priority>\n");
fwrite($fh, "</url>\n");
}
}
}
}
}
$fh = fopen($file, 'w');
fwrite($fh, '<?xml version="1.0" encoding="UTF-8"?>' . "\n");
fwrite($fh, '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . "\n");
get_structure(0);
get_manufacturer_to_item_categories();
get_manufacturers();
get_items();
fwrite($fh, "</urlset>\n");
fclose($fh);
+196
View File
@@ -0,0 +1,196 @@
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('company_name', 'COMPANY', '', 'Firmenname');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('company_legal_form', 'COMPANY', '', 'Rechtsform');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('company_ustid', 'COMPANY', '', 'USt-IdNr.');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('company_jurisdiction', 'COMPANY', '', 'Gerichtsstand');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('company_management', 'COMPANY', '', ' Geschäftführung');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('company_director', 'COMPANY', '', 'Vorstand');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('company_directorat', 'COMPANY', '', 'Aufsichtsratsvorsitz');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('company_register_court', 'COMPANY', '', 'Sitz, Registergericht, Registernummer');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('company_data_protection_officer', 'COMPANY', '', ' Datenschutzbeauftragte');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('company_youth_protection_officer', 'COMPANY', '', 'Jugendschutzbeauftragte');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('company_country', 'COMPANY', '', 'Land');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('company_street', 'COMPANY', '', 'Straße');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('company_zip_code', 'COMPANY', '', 'PLZ');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('company_city', 'COMPANY', '', 'Ort');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('company_email', 'COMPANY', '', 'E-Mail');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('company_phone', 'COMPANY', '', 'Telefon');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('company_fax', 'COMPANY', '', 'Fax');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('company_website', 'COMPANY', '', 'Webseite');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('company_bank', 'COMPANY', '', 'Bank');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('company_bank_number', 'COMPANY', '', 'BLZ');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('company_account_number', 'COMPANY', '', 'Kto-Nr.');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('company_iban', 'COMPANY', '', 'IBAN');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('company_swift_bic', 'COMPANY', '', 'SWIFT / BIC');
DROP TABLE `words`;
CREATE TABLE IF NOT EXISTS `text_translation` (
`var_id` varchar(255) NOT NULL,
`modul` varchar(255) NOT NULL,
`text` varchar(255) NOT NULL,
`text_en` varchar(255) NOT NULL,
PRIMARY KEY (`var_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `currency` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`iso` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `domains` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`google_site_verification` varchar(255) NOT NULL,
`google_analytics_code` varchar(255) NOT NULL,
`standard_theme_id` int(11) NOT NULL,
`standard_language_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('item_image_size_zoom', 'ITEM', '800', 'Artikel Bildgröße bei Zoom');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('item_image_size_overview', 'ITEM', '150', 'Artikel Bildgröße bei der Artikelliste');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('item_image_size_thumb', 'ITEM', '90', 'Artikel Bildgröße für Thumbnails');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('item_image_size_details', 'ITEM', '330', 'Artikel Bildgröße in der Detailansicht');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('item_image_size_detaildefault', 'ITEM', '245', 'Artikel Bildgröße in der standard Detailansicht');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('show_child_items', 'ITEM', '0', 'Zeige Kinderartikel in der Artikelverwaltung.');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('item_customer_opinion', 'ITEM', '0', 'Zeige Artikelbewertung in der Artikeldetailansicht.');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('default_system_language', 'SYSTEM', 'de', 'Standardsprache des Systems in ISO631-1 (deutsch = de).');
CREATE TABLE IF NOT EXISTS `order_dhl` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_number` varchar(255) NOT NULL,
`verfahren` int(11) NOT NULL,
`produkt` int(11) NOT NULL,
`services` int(11) NOT NULL,
`gewicht` varchar(255) NOT NULL,
`teilnahme` varchar(255) NOT NULL,
`zollinhaltserklaerung` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('show_item_item_assign2', 'ITEM', '1', 'Zeige Ersatzteile bei Artikel an.');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('item_list_filter_max_inventory', 'ITEM', '0', 'Spezieller Artikelfilter mit maximaler Lagerbestandszahl.');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('main_menu_item_clickable', 'SITE_WIDGETS', '1', 'Hauptmenüpunkte sind klickbar');
CREATE TABLE IF NOT EXISTS `bills` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`number` varchar(255) NOT NULL,
`bill_date` date,
`state_id` tinyint(4) NOT NULL,
`payment_date` date,
`payment_state` tinyint(4) NOT NULL,
`customer` varchar(255) NOT NULL,
`amount_brutto` DECIMAL( 9, 4 ) NOT NULL,
`open_amount` DECIMAL( 9, 4 ) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `return_goods` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`return_date` date,
`state_id` tinyint(4) NOT NULL,
`customer` varchar(255) NOT NULL,
`amount_brutto` DECIMAL( 9, 4 ) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('show_shoppingcart_different_items_sum', 'shoppingcart', '0', 'Zeige die Anzahl der unterschiedlichen Artikel an und nicht die Gesamtsumme der Artikel.');
ALTER TABLE `site_content` ADD `style` VARCHAR( 255 ) NOT NULL AFTER `activ`;
UPDATE site_content SET style='h1';
ALTER TABLE `structure` ADD `sitemap_activ` tinyint(4) NOT NULL;
ALTER TABLE `customer_addresses` ADD `freetextfield1` varchar(255) DEFAULT NULL;
ALTER TABLE `customer_addresses` ADD `freetextfield2` varchar(255) DEFAULT NULL;
ALTER TABLE `customer_addresses` ADD `freetextfield3` varchar(255) DEFAULT NULL;
ALTER TABLE `customer_addresses` ADD `freetextfield4` varchar(255) DEFAULT NULL;
ALTER TABLE `customer_groups` ADD COLUMN `customer_number_edit` TINYINT(2) UNSIGNED NOT NULL DEFAULT '0' AFTER `verification_type`;
ALTER TABLE `customers` ADD COLUMN `skonto` TINYINT(2) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `countries` ADD COLUMN `customer_ust_id_required` TINYINT(2) UNSIGNED NOT NULL DEFAULT '0';
INSERT INTO `configuration` (`name`, `text`, `group_id`, `setting`, `type`, `description`) VALUES
('guest_order_customer_id', 'text', 'SHOP_SETTINGS', '0', 0, 'Kunden-ID für die Gastbestellung.');
INSERT INTO `configuration` (`name`, `text`, `group_id`, `setting`, `type`, `description`) VALUES
('cashdesk_giftcertificate', 'text', 'CASHDESK', '0', 0, 'Gutscheincode beim Kassengang (1 = an, 0 = aus).');
INSERT INTO `configuration` (`name`, `text`, `group_id`, `setting`, `type`, `description`) VALUES
('item_search_not_found_text', 'formated', 'SHOP_TEXT', 'Für den Suchbegriff "[#search_word]" wurden keine Treffer in unserer Datenbank gefunden.', 1, 'Text für die Artikelsuche wenn keine gefunden wurden.');
ALTER TABLE `structure` ADD `item_type` int(11) NOT NULL DEFAULT '0';
ALTER TABLE `structure` ADD `customer_group` int(11) NOT NULL DEFAULT '0';
INSERT INTO `payment_methods` (
`id` ,
`name` ,
`module` ,
`active` ,
`rang` ,
`invoice_text` ,
`order_text` ,
`helperjoinkey`
)
VALUES (
NULL , 'Kundenspezifisch', 'customized', '1', '8', 'Kundenspezifisch', '', 'customized'
);
ALTER TABLE `shipping_area` ADD `active_customized` TINYINT( 2 ) NOT NULL AFTER `active_bar`;
ALTER TABLE `shipping_area` ADD `add_customized` DECIMAL( 9, 2 ) NOT NULL AFTER `add_bar`;
ALTER TABLE `shipping_area` ADD `account_type_customized` TINYINT( 4 ) NOT NULL AFTER `account_type_bar`;
ALTER TABLE `items` ADD `bargain_price_type` TINYINT( 2 ) NOT NULL DEFAULT '0';
ALTER TABLE `item_type_definitions` ADD `item_type_definition_type` TINYINT( 2 ) NOT NULL DEFAULT '0';
INSERT INTO `configuration` (`name`, `text`, `group_id`, `setting`, `type`, `description`) VALUES
('cash_desk_order_completed', 'formated', 'SHOP_TEXT', 'Ihre Bestellung mit der Bestellnummer <strong>[#order_number]</strong> wurde erfolgreich an uns &uuml;bermittelt.', 1, 'Text für die Bestellbestätigungsseite.');
ALTER TABLE `item_types` ADD `item_type_available_from` DATETIME NULL;
ALTER TABLE `item_types` ADD `item_type_available_until` DATETIME NULL;
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('save_customer_shoppingcart', 'shoppingcart', '0', 'Warenkorb für eingeloggte Kunden speichern.');
ALTER TABLE `shopping_cart_items` ADD `customer_id` int(11) NOT NULL DEFAULT '0';
ALTER TABLE `shipping_area` ADD `free_payment_nn` DECIMAL(6,2) NOT NULL DEFAULT '0.0';
ALTER TABLE `shipping_area` ADD `free_payment_pp` DECIMAL(6,2) NOT NULL DEFAULT '0.0';
ALTER TABLE `shipping_area` ADD `free_payment_vk` DECIMAL(6,2) NOT NULL DEFAULT '0.0';
ALTER TABLE `shipping_area` ADD `free_payment_be` DECIMAL(6,2) NOT NULL DEFAULT '0.0';
ALTER TABLE `shipping_area` ADD `free_payment_r` DECIMAL(6,2) NOT NULL DEFAULT '0.0';
ALTER TABLE `shipping_area` ADD `free_payment_bar` DECIMAL(6,2) NOT NULL DEFAULT '0.0';
ALTER TABLE `shipping_area` ADD `free_payment_computop_creditcard` DECIMAL(6,2) NOT NULL DEFAULT '0.0';
ALTER TABLE `shipping_area` ADD `free_payment_billpay_invoice` DECIMAL(6,2) NOT NULL DEFAULT '0.0';
ALTER TABLE `shipping_area` ADD `free_payment_paymorrow_rechnung` DECIMAL(6,2) NOT NULL DEFAULT '0.0';
ALTER TABLE `shipping_area` ADD `free_payment_paymorrow_raten` DECIMAL(6,2) NOT NULL DEFAULT '0.0';
ALTER TABLE `shipping_area` ADD `free_payment_klarna_rechnung` DECIMAL(6,2) NOT NULL DEFAULT '0.0';
ALTER TABLE `shipping_area` ADD `free_payment_klarna_raten` DECIMAL(6,2) NOT NULL DEFAULT '0.0';
ALTER TABLE `shipping_area` ADD `free_payment_customized` DECIMAL(6,2) NOT NULL DEFAULT '0.0';
ALTER TABLE `items` ADD `last_change_date` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00';
ALTER TABLE `items` ADD `last_change_user_id` int(11) NOT NULL DEFAULT '0';
INSERT INTO `configuration` (`name`, `text`, `group_id`, `setting`, `type`, `description`) VALUES
('customer_freetextfield1_name', 'text', 'CUSTOMER', 'Freitextfeld 1', 1, 'Bezeichnung für das Freitextfeld 1 der Kundendaten.');
INSERT INTO `configuration` (`name`, `text`, `group_id`, `setting`, `type`, `description`) VALUES
('customer_freetextfield2_name', 'text', 'CUSTOMER', 'Freitextfeld 2', 1, 'Bezeichnung für das Freitextfeld 1 der Kundendaten.');
INSERT INTO `configuration` (`name`, `text`, `group_id`, `setting`, `type`, `description`) VALUES
('customer_freetextfield3_name', 'text', 'CUSTOMER', 'Freitextfeld 3', 1, 'Bezeichnung für das Freitextfeld 1 der Kundendaten.');
INSERT INTO `configuration` (`name`, `text`, `group_id`, `setting`, `type`, `description`) VALUES
('customer_freetextfield4_name', 'text', 'CUSTOMER', 'Freitextfeld 4', 1, 'Bezeichnung für das Freitextfeld 1 der Kundendaten.');
INSERT INTO `configuration` (`name`, `text`, `group_id`, `setting`, `type`, `description`) VALUES
('customer_freetextfield5_name', 'text', 'CUSTOMER', 'Freitextfeld 5', 1, 'Bezeichnung für das Freitextfeld 1 der Kundendaten.');
INSERT INTO `configuration` (`name`, `text`, `group_id`, `setting`, `type`, `description`) VALUES
('customer_freetextfield6_name', 'text', 'CUSTOMER', 'Freitextfeld 6', 1, 'Bezeichnung für das Freitextfeld 1 der Kundendaten.');
@@ -0,0 +1,15 @@
ALTER TABLE `text_translation` ADD `text_en` VARCHAR(255) NULL DEFAULT NULL;
ALTER TABLE `items` ADD `name_en` VARCHAR(255) NULL DEFAULT NULL;
ALTER TABLE `items` ADD `short_description_en` TEXT NULL DEFAULT NULL;
ALTER TABLE `items` ADD `detail_description_en` TEXT NULL DEFAULT NULL;
ALTER TABLE `structure` ADD `name_en` VARCHAR(255) NULL DEFAULT NULL;
ALTER TABLE `news` ADD `title_en` VARCHAR(255) NULL DEFAULT NULL;
ALTER TABLE `news` ADD `sub_title_en` VARCHAR(255) NULL DEFAULT NULL;
ALTER TABLE `news` ADD `text_en` TEXT NULL DEFAULT NULL;
ALTER TABLE `site_content` ADD `title_en` VARCHAR(255) NULL DEFAULT NULL;
ALTER TABLE `site_content` ADD `content_en` TEXT NULL DEFAULT NULL;
ALTER TABLE `item_schema_attributes` ADD `name_en` VARCHAR(255) NULL DEFAULT NULL;
ALTER TABLE `standard_messages` ADD `title_en` VARCHAR(255) NULL DEFAULT NULL;
ALTER TABLE `standard_messages` ADD `message_en` TEXT NULL DEFAULT NULL;
File diff suppressed because one or more lines are too long
@@ -0,0 +1,74 @@
-- Migration: Widerrufs-Button nach EU-RL 2026/2673 (§ 312g BGB neu)
-- Datum: 2026-04-19
-- Autor: Thomas Bartelt / Wlanium
-- Scope: Elektronischer Widerruf für B2C (Endverbraucher=1, Gast=103)
-- Silent-Modus bis Mitte Mai 2026 via Config-Flag (kein DB-Flag nötig)
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 1;
-- ============================================================
-- Tabelle: revocations
-- Ein Eintrag pro Bestellung, für die ein Widerrufs-Link erzeugt
-- wurde. Legacy-Bestellungen vor Go-Live bleiben unberührt.
-- ============================================================
CREATE TABLE IF NOT EXISTS revocations (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
order_id BIGINT UNSIGNED NOT NULL,
customer_id INT UNSIGNED NULL,
customer_email VARCHAR(255) NOT NULL,
customer_group_id INT NOT NULL COMMENT 'Snapshot zum Bestellzeitpunkt',
token_hash CHAR(64) NOT NULL COMMENT 'SHA-256 des URL-Tokens',
expires_at DATETIME NOT NULL COMMENT '20 Tage ab Bestelldatum',
status ENUM('pending','submitted','processed','expired','revoked_by_admin')
NOT NULL DEFAULT 'pending',
submitted_at DATETIME NULL,
processed_at DATETIME NULL,
owner_notified_at DATETIME NULL,
customer_confirmed_at DATETIME NULL,
reason_id INT UNSIGNED NULL,
reason_text TEXT NULL,
ip_anonymized VARCHAR(45) NULL COMMENT 'gesetzt nur bei submit, /24 v4 oder /48 v6',
user_agent VARCHAR(255) NULL,
admin_note TEXT NULL,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id),
UNIQUE KEY uk_token_hash (token_hash),
UNIQUE KEY uk_order_id (order_id) COMMENT 'max 1 Widerruf pro Bestellung',
KEY idx_status_expires (status, expires_at),
KEY idx_customer_email (customer_email),
CONSTRAINT fk_rev_order FOREIGN KEY (order_id) REFERENCES orders(id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ============================================================
-- Tabelle: revocation_reasons
-- Optionale Gründe-Liste für das Widerrufs-Formular.
-- Bewusst eigene Tabelle, nicht cancellationreasons (andere Semantik).
-- ============================================================
CREATE TABLE IF NOT EXISTS revocation_reasons (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
label VARCHAR(150) NOT NULL,
sort SMALLINT UNSIGNED NOT NULL DEFAULT 0,
active TINYINT(1) UNSIGNED NOT NULL DEFAULT 1,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- Seed: 6 Standardgründe
INSERT INTO revocation_reasons (label, sort, active) VALUES
('Artikel entspricht nicht der Beschreibung', 10, 1),
('Falscher Artikel geliefert', 20, 1),
('Artikel beschädigt angekommen', 30, 1),
('Artikel passt nicht / nicht kompatibel', 40, 1),
('Lieferung zu spät', 50, 1),
('Anderer Grund', 99, 1);
+271
View File
@@ -0,0 +1,271 @@
/* 2013-08-21 */
INSERT INTO `text_translation` (`var_id`, `modul`, `text`) VALUES ('nl_title', 'newsletter_widget', 'Newsletter');
INSERT INTO `text_translation` (`var_id`, `modul`, `text`) VALUES ('nl_infotext', 'newsletter_widget', 'Hier gibts ...');
INSERT INTO `text_translation` (`var_id`, `modul`, `text`) VALUES ('nl_footertext', 'newsletter_widget', 'Jetzt eintragen');
/* 2013-08-26 */
ALTER TABLE `structure`
ADD COLUMN `root_id` INT(10) UNSIGNED NULL DEFAULT '0' AFTER `name_en`,
ADD COLUMN `level` INT(10) UNSIGNED NULL DEFAULT '1' AFTER `root_id`;
/* 2013-08-27 */
ALTER TABLE `items`
ADD COLUMN `has_additional_items` TINYINT UNSIGNED NULL DEFAULT '0' AFTER `detail_description_en`,
ADD COLUMN `has_spare_parts` TINYINT UNSIGNED NULL DEFAULT '0' AFTER `has_additional_items`,
ADD COLUMN `has_documents` TINYINT UNSIGNED NULL DEFAULT '0' AFTER `has_spare_parts`;
/* 2013-09-03 */
ALTER TABLE `item_files`
ADD COLUMN `size` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `alt`;
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('show_item_item_assign', 'ITEM', '1', 'Zeige Zubehörartikel als Register');
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('show_item_item_assign2', 'ITEM', '1', 'Zeige Ersatzteile als Register');
/* 2013-09-12 */
ALTER TABLE `cancellation_reasons`
ADD INDEX `active` (`active`);
ALTER TABLE `configuration`
ADD INDEX `group_id` (`group_id`);
ALTER TABLE `countries`
ADD INDEX `shipping_area_id` (`shipping_area_id`);
ALTER TABLE `country_customergroup_shippingarea`
ADD INDEX `country_id` (`country_id`);
ALTER TABLE `country_customergroup_shippingarea`
ADD INDEX `customer_group_id` (`customer_group_id`);
ALTER TABLE `country_customergroup_shippingarea`
ADD INDEX `country_id_customer_group_id` (`country_id`, `customer_group_id`);
ALTER TABLE `customers`
ADD INDEX `group_id` (`group_id`);
ALTER TABLE `customer_files`
ADD INDEX `customer_id` (`customer_id`);
ALTER TABLE `customer_group_payment_method_configuration`
ADD INDEX `group_id` (`group_id`),
ADD INDEX `payment_method_id` (`payment_method_id`),
ADD INDEX `shipping_area_id` (`shipping_area_id`),
ADD INDEX `active` (`active`);
ALTER TABLE `deliverers`
ADD INDEX `active` (`active`);
ALTER TABLE `discount_item`
ADD INDEX `artikel_id` (`artikel_id`);
ALTER TABLE `export`
ADD INDEX `customer_group_id` (`customer_group_id`),
ADD INDEX `set_customer_group_id` (`set_customer_group_id`);
ALTER TABLE `export_item_groups`
ADD INDEX `export_id` (`export_id`),
ADD INDEX `structure_id` (`structure_id`);
ALTER TABLE `gift_certificates`
ADD INDEX `active` (`active`),
ADD INDEX `customer_id` (`customer_id`),
ADD INDEX `customer_group_id` (`customer_group_id`);
ALTER TABLE `incomming_goods`
ADD INDEX `vendor_id` (`vendor_id`);
ALTER TABLE `itemgroup_import`
ADD INDEX `item_id` (`item_id`),
ADD INDEX `group_id` (`group_id`),
ADD INDEX `item_id_group_id` (`item_id`, `group_id`);
ALTER TABLE `items`
ADD INDEX `parent_id` (`parent_id`),
ADD INDEX `name` (`name`),
ADD INDEX `structure_id` (`structure_id`),
ADD INDEX `active` (`active`),
ADD INDEX `short_uri` (`short_uri`),
ADD INDEX `last_update` (`last_update`);
ALTER TABLE `item_attribute_variants`
ADD INDEX `item_id` (`item_id`),
ADD INDEX `customergroup_id` (`customergroup_id`);
ALTER TABLE `item_faq_assign`
ADD INDEX `article_id` (`article_id`),
ADD INDEX `faq_id` (`faq_id`),
ADD INDEX `article_id_faq_id` (`article_id`, `faq_id`);
ALTER TABLE `item_files`
ADD INDEX `item_id` (`item_id`),
ADD INDEX `rang` (`rang`);
ALTER TABLE `item_inventory`
ADD INDEX `item_id` (`item_id`);
ALTER TABLE `item_opinion`
ADD INDEX `item_id` (`item_id`),
ADD INDEX `active` (`active`),
ADD INDEX `user_id` (`user_id`),
ADD INDEX `rang` (`rang`);
ALTER TABLE `item_schema`
ADD INDEX `active` (`active`);
ALTER TABLE `item_schema_attributes`
ADD INDEX `schema_id` (`schema_id`);
ALTER TABLE `item_types`
ADD INDEX `item_id` (`item_id`),
ADD INDEX `item_type_definition_id` (`item_type_definition_id`);
ALTER TABLE `languages`
ADD INDEX `active` (`active`);
ALTER TABLE `manufacturers`
ADD INDEX `active` (`active`);
ALTER TABLE `marketing_manager_actions`
ADD INDEX `active` (`active`);
ALTER TABLE `metatags`
ADD INDEX `active` (`active`);
ALTER TABLE `nav`
ADD INDEX `parentId` (`parentId`);
ALTER TABLE `news`
ADD INDEX `active` (`active`);
ALTER TABLE `newsletter_attachments`
ADD INDEX `newsletter_id` (`newsletter_id`);
ALTER TABLE `newsletter_items`
ADD INDEX `item_id` (`item_id`);
ALTER TABLE `newsletter_recipient`
ADD INDEX `customer_group_id` (`customer_group_id`);
ALTER TABLE `order_history`
ADD INDEX `order_id` (`order_id`);
ALTER TABLE `order_item_return`
ADD INDEX `order_id` (`order_id`);
ALTER TABLE `order_status`
ADD INDEX `is_showable` (`is_showable`);
ALTER TABLE `payment_methods`
ADD INDEX `configuration_group_id` (`configuration_group_id`);
ALTER TABLE `paypal_refund`
ADD INDEX `order_id` (`order_id`);
ALTER TABLE `shipping_areas`
ADD INDEX `shipping_area_is_active` (`shipping_area_is_active`);
ALTER TABLE `shipping_area_deliverers`
ADD INDEX `active` (`active`);
ALTER TABLE `shipping_area_delivery_methods`
ADD INDEX `shipping_area_id` (`shipping_area_id`),
ADD INDEX `delivery_method_id` (`delivery_method_id`);
ALTER TABLE `shipping_area_item`
ADD INDEX `artikel_id` (`artikel_id`),
ADD INDEX `lieferzonen_id` (`lieferzonen_id`),
ADD INDEX `artikel_id_lieferzonen_id` (`artikel_id`, `lieferzonen_id`);
ALTER TABLE `shipping_area_payment_methods`
ADD INDEX `payment_method_id` (`payment_method_id`),
ADD INDEX `shipping_area_id` (`shipping_area_id`);
ALTER TABLE `shipping_area_payment_method_customer_groups`
ADD INDEX `shipping_area_id` (`shipping_area_id`),
ADD INDEX `payment_method_id` (`payment_method_id`),
ADD INDEX `customer_group_id` (`customer_group_id`);
ALTER TABLE `shop_opinion`
ADD INDEX `active` (`active`);
ALTER TABLE `site_content`
ADD INDEX `structure_id` (`structure_id`),
ADD INDEX `activ` (`activ`),
ADD INDEX `position` (`position`);
ALTER TABLE `standard_messages`
ADD INDEX `active` (`active`);
ALTER TABLE `structure`
ADD INDEX `theme_id` (`theme_id`),
ADD INDEX `active` (`active`),
ADD INDEX `show_after_login` (`show_after_login`),
ADD INDEX `short_uri` (`short_uri`);
ALTER TABLE `structure`
ADD INDEX `root_id` (`root_id`),
ADD INDEX `level` (`level`);
ALTER TABLE `tickets`
ADD INDEX `state_id` (`state_id`);
ALTER TABLE `ticket_message_attachments`
ADD INDEX `ticket_message_id` (`ticket_message_id`);
ALTER TABLE `vendors`
ADD INDEX `vendor_is_active` (`vendor_is_active`);
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`)
VALUES ('menu_in_cashdesk', 'CASHDESK', '1', 'Soll im Cashdesk das Menü links angezeigt werden?');
/* 2013-09-13 */
ALTER TABLE `item_item_assign`
CHANGE COLUMN `type` `type` TINYINT(10) NOT NULL DEFAULT '0' COMMENT '1: add. items; 2: spare parts; 3: real friends' AFTER `item_child_id`;
ALTER TABLE `items`
ADD COLUMN `has_realfriends` TINYINT(3) UNSIGNED NULL DEFAULT '0' AFTER `has_documents`;
ALTER TABLE `items`
CHANGE COLUMN `has_realfriends` `has_real_friends` TINYINT(3) UNSIGNED NULL DEFAULT '0' AFTER `has_documents`;
/* 2013-09-17 */
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`) VALUES ('infinite_scrolling', 'ITEM_LIST', '1', 'Automatisches Nachladen in der Liste, wenn _alle_ gewählt.');
-- 2013-11-08
INSERT INTO `configuration` (`name`, `group_id`, `setting`) VALUES ('main_menu_item_clickable_if_empty', 'SITE_WIDGETS', '1');
UPDATE `configuration` SET `description`='Hauptmenüpunkte sind klickbar wenn ohne Unterpunkte' WHERE `name`='main_menu_item_clickable_if_empty';
-- 2013-11-11
ALTER TABLE `items`
ADD FULLTEXT INDEX `itemsearchindexft` (`number`, `name`, `detail_description`, `attribute_1`, `attribute_2`, `attribute_3`, `attribute_4`, `attribute_5`);
-- 2013-11-14
INSERT INTO `configuration` (`name`, `group_id`, `setting`, `description`)
VALUES ('custom_global_modules', 'SYSTEM', '1', 'Dieses Shop-System hat eigene Module (Themen-/Kunden-spezifisch)');
-- 2013-11-18
ALTER TABLE `items`
ALTER `attribute_18` DROP DEFAULT;
ALTER TABLE `items`
CHANGE COLUMN `attribute_18` `attribute_18` MEDIUMTEXT NULL AFTER `attribute_17`;
ALTER TABLE `items`
ADD COLUMN `update_ready` TINYINT(3) UNSIGNED NULL DEFAULT '0' AFTER `has_real_friends`;
ALTER TABLE `items`
DROP INDEX `itemsearchindexft`,
ADD FULLTEXT INDEX `itemsearchindexft` (`number`, `name`, `detail_description`, `attribute_1`, `attribute_2`, `attribute_3`, `attribute_4`, `attribute_5`, `attribute_6`, `attribute_18`);
-- 2013-12-18
ALTER TABLE `domains`
ALTER `google_site_verification` DROP DEFAULT,
ALTER `google_analytics_code` DROP DEFAULT;
ALTER TABLE `domains`
CHANGE COLUMN `google_site_verification` `google_site_verification` VARCHAR(255) NULL AFTER `name`,
CHANGE COLUMN `google_analytics_code` `google_analytics_code` VARCHAR(255) NULL AFTER `standard_language_id`;
-- 2013-12-20
INSERT INTO `configuration` (`name`, `text`, `group_id`, `description`) VALUES ('shop_address_contact', 'formated', 'SHOP_TEXT', 'Adresse des Shops für Kontaktformular');
UPDATE `configuration` SET `description`='Adresse des Shopbetreibers für Adressbox' WHERE `name`='shop_address';
+133
View File
@@ -0,0 +1,133 @@
<?php
// Setze den include_path
chdir(dirname(__FILE__) . '/..');
set_include_path(get_include_path() . PATH_SEPARATOR . '.');
include_once 'core/main.class.php';
include_once 'core/cache.class.php';
class SitemapGenerator {
private $db;
private $base_url = 'https://intelectra.de';
private $output_file;
private $url_count = 0;
public function __construct($base_object) {
$this->db = $base_object->db;
$this->output_file = getcwd() . '/sitemap.xml.gz';
}
public function generate($verbose = false) {
$xml = new XMLWriter();
$xml->openMemory();
$xml->setIndent(true);
$xml->startDocument('1.0', 'UTF-8');
// Start sitemap
$xml->startElement('urlset');
$xml->writeAttribute('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9');
// Startseite
$this->addUrl($xml, $this->base_url, '1.0', 'daily', null, $verbose);
// Statische Seiten
$static_pages = [
'/kontakt' => ['0.7', 'monthly'],
'/impressum' => ['0.3', 'yearly'],
'/agb' => ['0.3', 'yearly'],
'/datenschutz' => ['0.3', 'yearly'],
'/versand' => ['0.5', 'monthly'],
'/ueber-uns' => ['0.6', 'monthly'],
'/warenkorb' => ['0.4', 'monthly'],
'/mein-konto' => ['0.4', 'monthly']
];
foreach ($static_pages as $page => $settings) {
$this->addUrl($xml, $this->base_url . $page, $settings[0], $settings[1], null, $verbose);
}
// Kategorien
$sql = "SELECT id, url_text FROM item_groups WHERE active = 1";
$result = $this->db->query($sql);
if ($result) {
while ($row = $result->fetch_object()) {
$url = $this->base_url . '/' . $row->url_text;
$this->addUrl($xml, $url, '0.8', 'weekly', null, $verbose);
}
}
// Artikel
$sql = "SELECT i.id, i.name, i.url_text, i.last_update
FROM items i
WHERE i.active = 1
AND i.visible = 1";
$result = $this->db->query($sql);
if ($result) {
while ($row = $result->fetch_object()) {
$url = $this->base_url . '/' . $row->url_text . '-' . $row->id . '.html';
$lastmod = date('Y-m-d', strtotime($row->last_update));
$this->addUrl($xml, $url, '0.6', 'weekly', $lastmod, $verbose);
}
}
// Hersteller
$sql = "SELECT id, url_text FROM vendor WHERE active = 1";
$result = $this->db->query($sql);
if ($result) {
while ($row = $result->fetch_object()) {
$url = $this->base_url . '/hersteller/' . $row->url_text;
$this->addUrl($xml, $url, '0.7', 'weekly', null, $verbose);
}
}
// End sitemap
$xml->endElement();
// Komprimiere und speichere
$content = $xml->outputMemory();
$compressed = gzencode($content, 9);
// Speichere Dateien
file_put_contents($this->output_file, $compressed);
file_put_contents(str_replace('.gz', '', $this->output_file), $content);
if ($verbose) {
echo "\nGesamtzahl der URLs in der Sitemap: " . $this->url_count . "\n";
echo "Sitemap wurde gespeichert unter:\n";
echo "- " . $this->output_file . "\n";
echo "- " . str_replace('.gz', '', $this->output_file) . "\n";
}
return true;
}
private function addUrl($xml, $loc, $priority = '0.5', $changefreq = 'weekly', $lastmod = null, $verbose = false) {
$xml->startElement('url');
$xml->writeElement('loc', $loc);
if ($lastmod) {
$xml->writeElement('lastmod', $lastmod);
}
$xml->writeElement('changefreq', $changefreq);
$xml->writeElement('priority', $priority);
$xml->endElement();
if ($verbose) {
echo "URL hinzugefügt: " . $loc . "\n";
}
$this->url_count++;
}
}
// Führe die Generierung aus
try {
// Erstelle base_object mit korrekter Konfiguration
$base_object = new Main(['config_file' => 'config/config.php']);
$generator = new SitemapGenerator($base_object);
// Setze verbose=true für detaillierte Ausgabe
if ($generator->generate(true)) {
echo "\nSitemap wurde erfolgreich generiert.\n";
}
} catch (Exception $e) {
echo "Fehler bei der Sitemap-Generierung: " . $e->getMessage() . "\n";
}
+100
View File
@@ -0,0 +1,100 @@
<?php
/**
* @package Easyway Shop
* @copyright Copyright (C) 2005 - 2011 TA-EDV
* @license proprietary
* @author Richard Kammermayer <rk@ta-edv.de>
*
* Easyway Shop is a web e-commerce system
*/
$shopadmin_translation = array(
'system_date_format' => 'd.m.Y',
'admin_interface' => array(
'main_data' => 'Stammdaten',
'order_cs' => 'Bestellungen / Cs',
'shop_configuration' => 'Einstellungen',
'marketing' => 'Marketing',
'statistic' => 'Statistik',
'search' => 'Suche',
'logout' => 'Abmelden',
'help' => 'Hilfe',
'info' => 'Info',
'logged_in_as' => 'Angemeldet:',
'menu' => array(
'Bill configuration' => 'PDF-Layout',
'Dashboard' => 'Dashboard',
'Item List' => 'Artikel',
'Adminroles' => 'Rollen',
'Item Attributes' => 'Attribute',
'Item Types' => 'Artikel Typen',
'Customer List' => 'Kunden',
'Customer Groups' => 'Kundengruppe',
'Customer Opinion' => 'Kundenmeinung',
'Vendors' => 'Lieferanten',
'Manufacturer' => 'Hersteller',
'Sitemenu / Item Category Manager' => 'Seitenmenü',
'Order List' => 'Bestellungen',
'Cancellation Reasons' => 'Stornierungsgründe',
'Cancellation Requests' => 'Stornierungsanfragen',
'All messages' => 'E-Mail',
'Standard messages' => 'System E-Mail',
'System config' => 'Systemeinstellungen',
'Shop layout' => 'Shopdesign',
'Payment methods' => 'Bezahlungsarten',
'Deliverers' => 'Zusteller',
'Site designer' => 'Seitengestaltung',
'Shipping cost / Shipping area' => 'Versandkosten',
'Import & Export' => 'Import & Export',
'Countries' => 'Länder',
'Plugin manager' => 'Plugin Verwaltung',
'Backup' => 'Backup',
'Newsletter' => 'Newsletter',
'Newsletter subscriber' => 'Newsletter Abonnenten',
'Shop opinion' => 'Kundenbewertung',
'Action manager' => 'Aktionsverwaltung',
'Gift certificate' => 'Gutscheine',
'SEO' => 'SEO',
'Price search engine' => 'Export',
'Sitemap' => 'Sitemap',
'Sales analysis' => 'Umsatzstatistik',
'Item analysis' => 'Artikelauswertung',
'Order analysis' => 'Bestellungen',
'Item category analysis' => 'Warengruppen Auswertung',
'Manufacturer analysis' => 'Hersteller Auswertung',
'Form configuration' => 'Formular Konfigurator',
'Item image configuration' => 'Wasserzeichen',
'Retail Sale' => 'Ladenverkauf',
'Incomming Goods' => 'Wareneingang',
'Themes' => 'Shop Themes',
'Statistics' => 'Statistiken',
'Email template' => 'E-Mail Vorlagen',
'Languages' => 'Sprachen',
'News' => 'Aktuelles',
'Text translation' => 'Sprachvariablen',
'Currency' => 'Währungen',
'Tax' => 'Steuern',
'Domains' => 'Domains',
'Import' => 'Import',
'Bills' => 'Rechnungen',
'Return of Goods' => 'Warenrückläufer',
'General Statistics' => 'Verkaufsstatistik'
),
'weekday' => array(
'Monday' => 'Montag',
'Tuesday' => 'Dienstag',
'Wednesday' => 'Mittwoch',
'Thursday' => 'Donnerstag',
'Friday' => 'Freitag',
'Saturday' => 'Samstag',
'Sunday' => 'Sonntag'
),
),
'admin_items' => array(
'all' => 'Alle',
'new_items' => 'Neue Artikel',
'sold_out' => 'Ausverkauft'
)
);
?>
+101
View File
@@ -0,0 +1,101 @@
<?php
/**
* @version $Id: shopadmin_translation_en.php
* @package Easyshop
* @copyright Copyright (C) 2005 - 2011 TA-EDV
* @license proprietary
* @author Richard Kammermayer <rk@ta-edv.de>
* Easyshop is a web shop system
*/
$shopadmin_translation = array(
'system_date_format' => 'Y-m-d',
'admin_interface' => array(
'main_data' => 'Main data',
'order_cs' => 'Order / Cs',
'shop_configuration' => 'Shop Configuration',
'marketing' => 'Marketing',
'statistic' => 'Statistic',
'search' => 'Search',
'logout' => 'Logout',
'help' => 'Help',
'info' => 'Info',
'logged_in_as' => 'Logged in:',
'menu' => array(
'Dashboard' => 'Dashboard',
'Add Shop Item' => 'Add Shop Item',
'Item List' => 'Item List',
'Item FAQ' => 'Item FAQ',
'Adminroles' => 'Administration Roles',
'Item Attributes' => 'Artikel Attribute',
'Customer List' => 'Customer List',
'Customer Groups' => 'Customer Groups',
'Customer Opinion' => 'Customer Opinion',
'Vendors' => 'Vendors',
'Manufacturer' => 'Manufacturers',
'Sitemenu / Item Category Manager' => 'Sitemenu / Item Category Manager',
'Order List' => 'Order List',
'Cancellation Reasons' => 'Cancellation reasons',
'Cancellation Requests' => 'Cancellation requests',
'New message' => 'New message',
'All messages' => 'All messages',
'System config' => 'System config',
'Shop layout' => 'Shop layout',
'payment' => 'payment',
'Site designer' => 'Site designer',
'Shipping cost' => 'Shipping cost',
'Import & Export' => 'Import & Export',
'Countries and languages' => 'Countries and languages',
'Plugin manager' => 'Plugin manager',
'Backup' => 'Backup',
'Newsletter' => 'Newsletter',
'Action manager' => 'Action manager',
'Gift certificate' => 'Gift certificate',
'Marketing manager' => 'Marketing manager',
'SEO' => 'SEO',
'Price search engine' => 'Price search engine',
'Sitemap' => 'Sitemap',
'Sales analysis' => 'Sales analysis',
'Item analysis' => 'Item analysis',
'Order analysis' => 'Order analysis',
'Themes' => 'Shop Themes',
'Item category analysis' => 'Item category analysis',
'Statistics' => 'Statistics',
'Manufacturer analysis' => 'Manufacturer analysis',
'Form configuration' => 'Form configuration',
'Item image configuration' => 'Item image configuration',
'Retail Sale' => 'Retail Sale',
'Incomming Goods' => 'Incomming Goods',
'Themes' => 'Themes',
'Statistics' => 'Statistics',
'Email template' => 'Email template',
'Languages' => 'Languages',
'News' => 'News',
'Text translation' => 'Text translation',
'Currency' => 'Currency',
'Tax' => 'Tax',
'Domains' => 'Domains',
'Bills' => 'Bills',
'Return of Goods' => 'Return of Goods',
'General Statistics' => 'General statistics'
),
'weekday' => array(
'Monday' => 'Monday',
'Tuesday' => 'Tuesday',
'Wednesday' => 'Wednesday',
'Thursday' => 'Thursday',
'Friday' => 'Friday',
'Saturday' => 'Saturday',
'Sunday' => 'Sunday'
),
),
'admin_items' => array(
'all' => 'All',
'new_items' => 'New items',
'sold_out' => 'Sold out'
)
);
?>
+63
View File
@@ -0,0 +1,63 @@
<?php
// new database
$connection=mysql_connect('localhost', 'shop_topreef_de', 'b-7+ZgQn$!') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('shop_topreef_de', $connection) or die("Konnte die Datenbank nicht waehlen.");
/*
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('topreef', $connection) or die("Konnte die Datenbank nicht waehlen.");
*/
echo "get items";
$query = mysql_query('select i.id, i.name, i.inventory, iin.id iiid from items i left join item_inventory iin on i.id = iin.item_id') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$item_ids[] = $obj;
}
echo "set structures";
foreach ($item_ids as $obj) {
if ($obj->iiid == NULL) {
$sql = "
UPDATE items
SET inventory=0
WHERE id=".$obj->id;
echo $sql;echo "<br />";
$query = mysql_query($sql);
}
}
echo "ende";
/*
echo "get items<br>";
$sql = "SELECT id, parent_id FROM items";
$query = mysql_query($sql);
$item_ids = array();
$parent_ids = array();
while($obj = mysql_fetch_object($query)) {
$manufacturers[$obj->name] = $obj->id;
$item_ids[] = $obj->id;
$parent_ids['p'.$obj->parent_id] = 1;
}
echo "update items<br>";
foreach ($item_ids as $item_id) {
if (!isset($parent_ids['p'.$item_id])) {
$sql = "
UPDATE items
SET schema_id=0
WHERE id=".$item_id.' AND parent_id = 0';
echo $sql;echo "<br />";
$query = mysql_query($sql);
}
}
*/
?>
@@ -0,0 +1,88 @@
<?php
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
// get data
// connect import database
//old database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('topreef', $connection) or die("Konnte die Datenbank old nicht waehlen.");
// get customers
$query = mysql_query('SELECT * FROM kundenimport') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
// imported data
// connect target database
// new database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('topreef', $connection) or die("Konnte die Datenbank nicht waehlen.");
foreach ($data as $object) {
$anrede = 0;
if ($object->Anrede == 'Herr') {
$anrede = 0;
}
if ($object->Anrede == 'Frau') {
$anrede = 1;
}
if ($object->Anrede == 'Firma') {
$anrede = 2;
}
$sql = "
INSERT INTO customers
SET
number='".$object->KundenID."',
group_id=1,
honorific='".$anrede."',
company='".$object->Firmenname."',
firstname='".$object->Vorname."',
surname='".$object->Nachname."',
phone='".$object->telefon."',
fax='".$object->fax."',
email='".$object->Email."',
locked='0',
tax_id='".$object->UstIdNr."'
";
$query = mysql_query($sql);
$customer_id = mysql_insert_id($connection);
if ($customer_id) {
$sql = "
INSERT INTO customer_addresses
SET
customer_id=$customer_id,
company='".$object->Firmenname."',
honorific='".$anrede."',
firstname='".$object->Vorname."',
surname='".$object->Nachname."',
street='".$object->Strasse."',
house_number='".$object->HausNr."',
zip_code='".$object->plz."',
city='".$object->ort."',
country='27'
";
$query = mysql_query($sql);
echo $object->Vorname."<br>";
$address_id = mysql_insert_id($connection);
$sql = "
UPDATE customers
SET
default_address=$address_id
WHERE
id=$customer_id
";
$query = mysql_query($sql);
}
}
?>
@@ -0,0 +1,37 @@
<?php
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
// get data
// connect import database
// old database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('topreef', $connection) or die("Konnte die Datenbank nicht waehlen.1");
echo "get items<br>";
// get items
$query = mysql_query('SELECT * FROM tabelle1') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
// new database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('topreef', $connection) or die("Konnte die Datenbank nicht waehlen.2");
echo "imports<br>";
foreach ($data as $object) {
$sql = "
UPDATE items
SET
detail_description='".mysql_real_escape_string($object->{'Shop-Langtext'})."'
WHERE id=".$object->id."
";
mysql_query($sql);
}
echo "ende";
?>
@@ -0,0 +1,70 @@
<?php
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
// get data
// connect import database
// old database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra', $connection) or die("Konnte die Datenbank nicht waehlen.1");
echo "get items<br>";
// get items
$query = mysql_query('select import_item_prices.*, items.id as item_id from import_item_prices left join items on items.old_id=import_item_prices.pid order by pid, menge asc') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
// new database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra', $connection) or die("Konnte die Datenbank nicht waehlen.2");
echo "imports<br>";
foreach ($data as $object) {
$customer_group = 1;
if ($object->uid == 6) {
$customer_group = 101;
}
if ($object->menge == 1) {
$sql = "
INSERT INTO item_prices
SET
item_id=".$object->item_id.",
customergroup_id=".$customer_group.",
quantity_1=1,
price_1='".mysql_real_escape_string(price($object->preis))."',
bargain_price_1='0'
";
}
else {
$sql = "
UPDATE item_prices
SET
quantity_2=".$object->menge.",
price_2='".mysql_real_escape_string(price($object->preis))."',
bargain_price_2='0'
WHERE
item_id=".$object->item_id." AND customergroup_id=".$customer_group."
";
}
echo $sql."<br>";
$query = mysql_query($sql);
}
echo "ende<br>";
function price ($p) {
$p = str_replace(',', '.', $p);
//$p = substr($p, 0, -2);
return $p;
}
?>
@@ -0,0 +1,56 @@
<?php
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
// get data
// connect import database
// old database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra', $connection) or die("Konnte die Datenbank nicht waehlen.1");
echo "get items<br>";
// get items
$query = mysql_query("
SELECT structure.id as sid , items.id as aid
FROM import_item_structure_assign
left join structure on import_item_structure_assign.rid = structure.old_id
left join items on import_item_structure_assign.pid = items.old_id
") or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
// new database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra', $connection) or die("Konnte die Datenbank nicht waehlen.2");
echo "imports<br>";
foreach ($data as $object) {
$sql = "
INSERT INTO item_structure_assign
SET
item_id='".$object->aid."',
structure_id='".mysql_real_escape_string($object->sid)."'
";
if ($object->sid && $object->aid) {
$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
}
}
echo "ende<br>";
function price ($p) {
$p = str_replace(',', '.', $p);
$p = substr($p, 0, -2);
return $p;
}
?>
@@ -0,0 +1,63 @@
<?php
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
// get data
// connect import database
ini_set('display_errors', 1);
error_reporting(E_ALL);
echo "start";
// old database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra', $connection) or die("Konnte die Datenbank nicht waehlen1.");
// get customers
$query = mysql_query('SELECT * FROM `import_structure` order by parentid') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
// imported data
// connect target database
// new database
mysql_select_db('intelectra', $connection) or die("Konnte die Datenbank nicht waehlen2.");
$parent_ids = array();
$parent_ids['oldid_0'] = 357;
foreach ($data as $menu) {
$short_uri = $menu->bezeichnung;
$short_uri = str_replace(array('ä', 'Ä', 'ö', 'Ö', 'ü', 'Ü', 'ß'), array('ae', 'Ae', 'oe', 'Oe', 'ue', 'Ue', 'ss'), $short_uri);
$short_uri = preg_replace("@[^0-9aA-zZ\-]@si", "-", $short_uri);
$short_uri = preg_replace("@(-{2,})@si", "-", $short_uri);
$sql = "
INSERT INTO structure
SET
parent_id=".$parent_ids['oldid_'.$menu->parentid].",
old_id=".$menu->rid.",
active=1,
short_uri='".$short_uri."',
image='',
name='".$menu->bezeichnung."'
";
echo $sql."<br>";
$query = mysql_query($sql);
$last_id = $parent_ids['oldid_'.$menu->rid] = mysql_insert_id($connection);
$sql = "
INSERT INTO `site_content` (`structure_id`, `type`, `position`, `activ`, `content`, `configuration`) VALUES
(".$last_id.", 'textbox', 1, 0, '', NULL),
(".$last_id.", 'slider', 2, 0, '', NULL),
(".$last_id.", 'article_list', 3, 1, '0', NULL),
(".$last_id.", 'banner', 4, 0, '0', NULL),
(".$last_id.", 'manufacturers', 5, 0, '', NULL),
(".$last_id.", 'substructure', 6, 0, '', NULL),
(".$last_id.", 'popular', 0, 0, '', NULL)
";
$query = mysql_query($sql);
}
@@ -0,0 +1,35 @@
<?php
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
// get data
// connect import database
ini_set('display_errors', 1);
error_reporting(E_ALL);
echo "start";
// old database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra', $connection) or die("Konnte die Datenbank nicht waehlen1.");
// get customers
$query = mysql_query('SELECT * FROM `structure`') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
foreach ($data as $menu) {
$sql = "
INSERT INTO `site_content` (`structure_id`, `type`, `position`, `activ`, `content`, `configuration`) VALUES
(".$menu->id.", 'textbox', 1, 0, '', NULL),
(".$menu->id.", 'slider', 2, 0, '', NULL),
(".$menu->id.", 'article_list', 5, 1, '0', NULL),
(".$menu->id.", 'banner', 4, 0, '0', NULL),
(".$menu->id.", 'manufacturers', 6, 1, '', NULL),
(".$menu->id.", 'substructure', 3, 1, '', "."\"\$config = array\('cat_id' => '', 'ebenen' => '2', \)\;\""."),
(".$menu->id.", 'popular', 0, 0, '', NULL)
";
echo $sql.'<br>';
$query = mysql_query($sql);
}
+92
View File
@@ -0,0 +1,92 @@
<?php
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
// get data
// connect import database
// old database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra', $connection) or die("Konnte die Datenbank nicht waehlen.1");
echo "get items<br>";
// get items
$query = mysql_query('SELECT * FROM import_items') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
// new database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra', $connection) or die("Konnte die Datenbank nicht waehlen.2");
/*
echo "get hersteller<br>";
// get manufacturers
$sql = "SELECT * FROM manufacturers ORDER BY name";
$query = mysql_query($sql);
$manufacturers = array();
while($obj = mysql_fetch_object($query)) {
$manufacturers[$obj->name] = $obj->id;
}
*/
echo "imports<br>";
foreach ($data as $object) {
//echo "import: ".$object->HauptArtikel."<br>";
//if($object->HauptArtikel > 0) {
/*$object->{'Verkaufs-Preis'} = substr($object->{'Verkaufs-Preis'},0,-4);
$object->{'Verkaufs-Preis'} = str_replace(",",".",$object->{'Verkaufs-Preis'});
$object->{'Verkaufs-Preis'} = (float)$object->{'Verkaufs-Preis'};
$object->{'Verkaufs-Preis'} = ($object->{'Verkaufs-Preis'} / (100 + $object->{'Steuerklasse'}) * 100);
*/
$sql = "
INSERT INTO items
SET
old_id='".$object->pid."',
number='".mysql_real_escape_string($object->produktid)."',
shippable=1,
schema_id=3,
price_type=1,
seo_keywords='".mysql_real_escape_string($object->keywords)."',
tax_id=1,
detail_description='".mysql_real_escape_string($object->beschreibung)."',
name='".mysql_real_escape_string($object->bezeichnung)."'
";
$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
$item_id = mysql_insert_id($connection);
/*
if ($item_id) {
$sql = "
INSERT INTO item_prices
SET
item_id=$item_id,
customergroup_id=1,
quantity_1=1,
price_1='".mysql_real_escape_string(price($object->{'Verkaufs-Preis'}))."',
bargain_price_1='0'
";
// echo $sql."<br>";
$query = mysql_query($sql);
}*/
//}
}
echo "ende<br>";
function price ($p) {
$p = str_replace(',', '.', $p);
$p = substr($p, 0, -2);
return $p;
}
?>
@@ -0,0 +1,39 @@
<?php
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
// get data
// connect import database
// old database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra', $connection) or die("Konnte die Datenbank nicht waehlen.1");
echo "get data<br>";
// get items
$query = mysql_query('SELECT * FROM passendwie') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
echo "imports<br>";
foreach ($data as $object) {
$sql = "
UPDATE items
SET
attribute_1=CONCAT_WS(';', attribute_1, '".mysql_real_escape_string($object->vertreiber)."'),
attribute_2=CONCAT_WS(';', attribute_2, '".mysql_real_escape_string($object->bestellcode)."')
WHERE number='".$object->nr."'
";
$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
}
echo "ende<br>";
?>
@@ -0,0 +1,38 @@
<?php
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
// get data
// connect import database
// old database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra', $connection) or die("Konnte die Datenbank nicht waehlen.1");
echo "get data<br>";
// get items
$query = mysql_query('SELECT * FROM gefahr') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
echo "imports<br>";
foreach ($data as $object) {
$sql = "
UPDATE items
SET
attribute_5=\"<img src='./web/intelectra_shop/images/danger/bildnummer".$object->bildnr.".gif' /><br>".mysql_real_escape_string($object->beschreibung)."\"
WHERE number='".$object->nr."'
";
$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
}
echo "ende<br>";
?>
+38
View File
@@ -0,0 +1,38 @@
<?php
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
// new database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('topreef', $connection) or die("Konnte die Datenbank nicht waehlen2.");
echo "get structure<br>";
// get structure
$sql = "SELECT * FROM structure";
$query = mysql_query($sql);
$structure = array();
while($obj = mysql_fetch_object($query)) {
$structure[$obj->old_id] = $obj->id;
}
echo "get import<br>";
// get imports
$sql = "SELECT * FROM itemgroup_import";
$query = mysql_query($sql);
$imports = array();
while($obj = mysql_fetch_object($query)) {
$imports[] = $obj;
}
echo "imports<br>";
foreach ($imports as $import) {
//$sql = "UPDATE items SET structure_id='".$structure[$import->group_id]."' WHERE id=".$import->item_id;
$sql = "INSERT INTO item_structure_assign SET structure_id='".$structure[$import->group_id]."', item_id=".$import->item_id;
$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
}
+82
View File
@@ -0,0 +1,82 @@
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra', $connection) or die("Konnte die Datenbank nicht waehlen.1");
include_once '../../libs/phImaginator/phImaginator.class.php';
$handle=opendir ("../../web/intelectra_shop/images/article/big/");
echo "Verzeichnisinhalt:<br>";
$counter = array();
$z = 0;
while ($datei = readdir ($handle)) {
$z++;
//if ($z < 50) {
//echo "$datei<br>";
$number = substr($datei,0,6);
// get item id
$item_id = 0;
$sql = "SELECT * FROM items WHERE number='".$number."'";
$query2 = mysql_query($sql) or die("Anfrage nicht erfolgreich");
while($obj2 = mysql_fetch_object($query2)) {
$item_id = $obj2->id;
}
if ($item_id) {
if (substr($datei,6,1) != '.') {
$counter['image_'.$number]++;
}
else {
$counter['image_'.$number] = 1;
// set default image
$sql = "UPDATE items
SET default_image_file_name='".$datei."'
WHERE id=".$item_id;
$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
}
$sql = "INSERT INTO item_files
SET
rang='".$counter['image_'.$number]."',
type=0,
file_name='".$datei."',
item_id=".$item_id;
$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
else {
// resize image
$default_generatable_images = array(
'overview_' => 189,
'thumb_' => 90,
'details_' => 380,
'detaildefault_' => 245
);
$targetFile = "../../web/intelectra_shop/images/article/".$datei;
echo $targetFile.'<br>';
copy ("../../web/intelectra_shop/images/article/big/".$datei,$targetFile);
foreach ($default_generatable_images as $key => $size) {
$image_name = $key;
$imaginator = new phImaginator();
$imaginator->add($targetFile);
$imaginator->Resize_fitBoth($size, $size);
$imaginator->nameAdd($image_name);
$imaginator->save();
}
}
}
else {
echo "nicht gefunden <br>";
}
}
//}
closedir($handle);
?>
+73
View File
@@ -0,0 +1,73 @@
<?php
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
// get data
// connect import database
// old database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('topreef', $connection) or die("Konnte die Datenbank nicht waehlen.1");
echo "get items<br>";
// get items
$query = mysql_query('SELECT * FROM item_import') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
// new database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('topreef', $connection) or die("Konnte die Datenbank nicht waehlen.2");
// tax wrapper
$taxes = array(
'19' => '1',
'7' => '3'
);
echo "get hersteller<br>";
// get manufacturers
$sql = "SELECT * FROM manufacturers ORDER BY name";
$query = mysql_query($sql);
$manufacturers = array();
while($obj = mysql_fetch_object($query)) {
$manufacturers[$obj->name] = $obj->id;
}
echo "update items<br>";
foreach ($data as $object) {
$object->{'EK-Preis'} = substr($object->{'EK-Preis'},0,-4);
$object->{'EK-Preis'} = str_replace(",",".",$object->{'EK-Preis'});
$object->{'EK-Preis'} = (float)$object->{'EK-Preis'};
$sql = "
UPDATE items
SET
base_price='".mysql_real_escape_string($object->{'EK-Preis'})."'
WHERE
id='".$object->id."';
";
echo $sql;echo "<br />";
//$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
}
function price ($p) {
$p = str_replace(',', '.', $p);
$p = substr($p, 0, -2);
return $p;
}
?>
@@ -0,0 +1,40 @@
<?php
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
// get data
// connect import database
$connection=mysql_connect('localhost', 'test_hawi_aquari', 'Y*AXzD6c') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('test_hawi_aquaristik', $connection) or die("Konnte die Datenbank nicht waehlen.");
echo "get items";
$query = mysql_query('SELECT * FROM items') or die("Anfrage nicht erfolgreich");
$data = array();
echo "set structures";
while ($obj = mysql_fetch_object($query)) {
if ($obj->inventory > 0) {
$sql = "INSERT INTO item_inventory
(
item_id,
item_number,
item_name,
inventory_object_type_id,
inventory_object_id,
amount,
created
) VALUES (
'".$this->db->real_escape_string($obj->id)."',
'".$this->db->real_escape_string($obj->number)."',
'".$this->db->real_escape_string($obj->name)."',
2,
0,
'".$this->db->real_escape_string($obj->inventory)."',
CURRENT_TIMESTAMP
)
";
$result = mysql_query($sql);
}
}
echo "ende";
?>
@@ -0,0 +1,45 @@
<?php
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
// get data
// connect import database
$connection=mysql_connect('localhost', 'rf_aquaristik_ne', 'K+jQ?VC,Bp') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('rf_aquaristik_ne', $connection) or die("Konnte die Datenbank nicht waehlen.");
echo "get items";
$query = mysql_query('SELECT * FROM items') or die("Anfrage nicht erfolgreich");
$data = array();
echo "set uris";
while($obj = mysql_fetch_object($query)) {
$short_uri = $obj->name;
$short_uri = str_replace(array('ä', 'Ä', 'ö', 'Ö', 'ü', 'Ü', 'ß'), array('ae', 'Ae', 'oe', 'Oe', 'ue', 'Ue', 'ss'), $short_uri);
$short_uri = preg_replace("@[^0-9aA-zZ\-]@si", "-", $short_uri);
$short_uri = preg_replace("@(-{2,})@si", "-", $short_uri);
$new_uri = '';
$old_uri = $short_uri;
$i = 0;
while ($new_uri == '') {
$sql = "SELECT id FROM items WHERE short_uri = '$short_uri' AND id != ".$obj->id;
$result = mysql_query($sql);
if (mysql_num_rows($result) == 0) {
$new_uri = $short_uri;
} else {
$i++;
$short_uri = $old_uri . '_' . $i;
}
}
$sql = "
UPDATE items
SET
short_uri='".$short_uri."'
WHERE id=".$obj->id."
";
echo "<br>".$sql;
mysql_query($sql);
}
echo "ende";
?>
@@ -0,0 +1,28 @@
<?php
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
// get data
// connect import database
$connection=mysql_connect('localhost', 'emfa_kinderwelt_', 'sgfed/(&RT') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('emfa_kinderwelt_',$connection) or die("Konnte die Datenbank nicht waehlen.");
echo "get items";
$query = mysql_query('SELECT * FROM items') or die("Anfrage nicht erfolgreich");
$data = array();
echo "set structures";
while($obj = mysql_fetch_object($query)) {
$sql = "INSERT INTO item_structure_assign (item_id, structure_id) VALUES (".$obj->id.", ".$obj->{'structure_id'}.")";
$result = mysql_query($sql);
for ($i=2;$i<11;$i++) {
if ($obj->{'structure_id_'.$i} > 0) {
$sql = "INSERT INTO item_structure_assign (item_id, structure_id) VALUES (".$obj->id.", ".$obj->{'structure_id_'.$i}.")";
$result = mysql_query($sql);
}
}
}
echo "ende";
?>
@@ -0,0 +1,47 @@
<?php
ini_set("memory_limit","1024M");
set_time_limit(60000);
// old database
$connection=mysql_connect('localhost', 'shop_topreef_de', 'b-7+ZgQn$!') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('shop_topreef_de', $connection) or die("Konnte die Datenbank nicht waehlen.");
echo "get items<br>";
// get items
$query = mysql_query('SELECT id, Gewicht FROM item_import') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
// new database
$connection=mysql_connect('localhost', 'shop_topreef_de', 'b-7+ZgQn$!') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('shop_topreef_de', $connection) or die("Konnte die Datenbank nicht waehlen.");
echo "update items<br>";
foreach ($data as $object) {
$sql = "
UPDATE items
SET
shipping_weight='".mysql_real_escape_string(str_replace(',', '.', $object->{'Gewicht'}))."'
WHERE
id='".$object->id."';
";
echo $sql;echo "<br />";
$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
}
?>
+90
View File
@@ -0,0 +1,90 @@
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
// old database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra_shop__', $connection) or die("Konnte die Datenbank nicht waehlen.1");
/*
echo "get data<br>";
// get items
$query = mysql_query('SELECT * FROM import_kundenemail') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
echo "imports email<br>";
foreach ($data as $object) {
if ($object->email) {
$sql = "
UPDATE customers
SET
email=\"".$object->email."\"
WHERE number='".$object->knr."'
";
$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
}
}
echo "ende<br>";
// get items
$query = mysql_query('SELECT * FROM import_kundenpasswort') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
echo "imports passwoerter<br>";
foreach ($data as $object) {
if ($object->kennwort) {
$sql = "
UPDATE customers
SET
pass=\"".md5($object->kennwort)."\"
WHERE number='".$object->knr."'
";
$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
}
}
echo "ende<br>";
*/
echo "get data<br>";
// get items
$query = mysql_query('SELECT * FROM import_kundenzahlungen') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
echo "imports Zahlungsart<br>";
foreach ($data as $object) {
if ($object->Zahlungsart) {
$sql = "
UPDATE customers
SET
freetextfield3=\"".$object->Zahlungsart."\"
WHERE number='".$object->Kundennummer."'
";
$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
}
}
echo "ende<br>";
?>
+128
View File
@@ -0,0 +1,128 @@
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
//old database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra_shop__', $connection) or die("Konnte die Datenbank old nicht waehlen.");
echo "start<br>";
// get customers
$query = mysql_query('SELECT * FROM import_customers') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
echo "import<br>";
foreach ($data as $object) {
$sql = "
INSERT INTO customers
SET
number='".$object->Kundennummer."',
group_id=101,
honorific=0,
company='".mysql_real_escape_string($object->Name1)."',
firstname='',
surname='',";
if ($object->Rufnummer) {
$sql .= "phone='".$object->Vorwahl.$object->Rufnummer."', ";
}
if ($object->Fax) {
$sql .= "fax='".$object->Vorwahl.$object->Fax."', ";
}
$sql .= "email='',
locked='0',
freetextfield1='".$object->Name2."',
freetextfield2='".$object->Name3."',
tax_id=''
";
$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
$customer_id = mysql_insert_id($connection);
$country = 27;
if ($object->Land == 'A') {
$country = 29;
}
elseif ($object->Land == 'CH') {
$country = 28;
}
elseif ($object->Land == 'B') {
$country = 30;
}
if ($customer_id) {
$sql = "
INSERT INTO customer_addresses
SET
customer_id=$customer_id,
company='".mysql_real_escape_string($object->Name1)."',
honorific=0,
firstname='',
surname='',
freetextfield1='".mysql_real_escape_string($object->Name2)."',
freetextfield2='".mysql_real_escape_string($object->Name3)."',
street='".mysql_real_escape_string($object->Strasse)."',
house_number='',
zip_code='".mysql_real_escape_string($object->PLZ)."',
city='".mysql_real_escape_string($object->Ort)."',
country='".$country."'
";
$query = mysql_query($sql);
$address_id1 = mysql_insert_id($connection);
// abweichende Lieferadresse
if ($object->PLZ_Lieferadresse) {
$sql = "
INSERT INTO customer_addresses
SET
customer_id=$customer_id,
company='".mysql_real_escape_string($object->Name_Lieferadresse)."',
honorific=0,
firstname='',
surname='',
freetextfield1='".mysql_real_escape_string($object->Name2_Lieferadresse)."',
freetextfield2='".mysql_real_escape_string($object->Name3_Lieferadresse)."',
street='".mysql_real_escape_string($object->Strasse_Lieferadresse)."',
house_number='',
zip_code='".mysql_real_escape_string($object->PLZ_Lieferadresse)."',
city='".mysql_real_escape_string($object->Ort_Lieferadresse)."',
country='".$country."'
";
$query = mysql_query($sql);
$address_id2 = mysql_insert_id($connection);
if (!$query) {
echo $sql;
echo "<br />";
}
}
$default_address_id = $address_id1;
if ($object->Liefer_Rechnung == 1) {
$default_address_id = $address_id2;
}
$sql = "
UPDATE customers
SET
default_address=$default_address_id
WHERE
id=$customer_id
";
$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
//echo $object->Name1."<br>";
}
}
echo "ende<br>";
?>
+56
View File
@@ -0,0 +1,56 @@
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra', $connection) or die("Konnte die Datenbank nicht waehlen.1");
$handle=opendir ("../../web/intelectra_shop/documents/article/");
echo "Verzeichnisinhalt:<br>";
$counter = array();
$z = 0;
while ($datei = readdir ($handle)) {
$z++;
//if ($z < 50) {
//echo "$datei<br>";
$number = substr($datei,0,6);
// get item id
$item_id = 0;
$sql = "SELECT * FROM items WHERE number='".$number."'";
$query2 = mysql_query($sql) or die("Anfrage nicht erfolgreich");
while($obj2 = mysql_fetch_object($query2)) {
$item_id = $obj2->id;
}
if ($item_id) {
// set default image
$sql = "UPDATE items
SET has_documents=1
WHERE id=".$item_id;
$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
$size = filesize("../../web/intelectra_shop/documents/article/".$datei);
$sql = "INSERT INTO item_files
SET
rang=0,
type=1,
file_name='".$datei."',
item_id=".$item_id.",
size='".$size."'";
$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
}
}
//}
closedir($handle);
?>
+82
View File
@@ -0,0 +1,82 @@
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra', $connection) or die("Konnte die Datenbank nicht waehlen.1");
include_once '../../libs/phImaginator/phImaginator.class.php';
$handle=opendir ("../../web/intelectra_shop/images/article_big/");
echo "Verzeichnisinhalt:<br>";
$counter = array();
$z = 0;
while ($datei = readdir ($handle)) {
$z++;
//if ($z < 50) {
//echo "$datei<br>";
$number = substr($datei,0,6);
// get item id
$item_id = 0;
$sql = "SELECT * FROM items WHERE number='".$number."'";
$query2 = mysql_query($sql) or die("Anfrage nicht erfolgreich");
while($obj2 = mysql_fetch_object($query2)) {
$item_id = $obj2->id;
}
if ($item_id) {
if (substr($datei,6,1) != '.') {
$counter['image_'.$number]++;
}
else {
$counter['image_'.$number] = 1;
// set default image
$sql = "UPDATE items
SET default_image_file_name='".$datei."'
WHERE id=".$item_id;
$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
}
$sql = "INSERT INTO item_files
SET
rang='".$counter['image_'.$number]."',
type=0,
file_name='".$datei."',
item_id=".$item_id;
$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
else {
// resize image
$default_generatable_images = array(
'overview_' => 189,
'thumb_' => 90,
'details_' => 380,
'detaildefault_' => 245
);
$targetFile = "../../web/intelectra_shop/images/article/".$datei;
echo $targetFile.'<br>';
copy ("../../web/intelectra_shop/images/article_big/".$datei,$targetFile);
foreach ($default_generatable_images as $key => $size) {
$image_name = $key;
$imaginator = new phImaginator();
$imaginator->add($targetFile);
$imaginator->Resize_fitBoth($size, $size);
$imaginator->nameAdd($image_name);
$imaginator->save();
}
}
}
else {
echo "nicht gefunden <br>";
}
}
//}
closedir($handle);
?>
@@ -0,0 +1,63 @@
<?php
//ini_set("memory_limit","1024M");
set_time_limit(6000000);
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra_shop__', $connection) or die("Konnte die Datenbank nicht waehlen.");
/*
$connection=mysql_connect('localhost', 'intelectra_shop_', 'Wwja71!3') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra_shop__', $connection) or die("Konnte die Datenbank nicht waehlen.1");*/
echo "get data<br>";
// get item ids
$query = mysql_query('select id, old_id, number from items') or die("Anfrage nicht erfolgreich");
$item_ids = array();
$item_numbers = array();
while($obj = mysql_fetch_object($query)) {
$item_ids[$obj->old_id] = $obj->id;
$item_numbers[$obj->number] = $obj->id;
}
// get items
$query = mysql_query("select lid, mid, bezeichnung from import_item_merkmale where mid in (82, 81, 282) AND bezeichnung != '' order by lid") or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
echo "imports<br>";
$type = array (
'82' => 1,
'81' => 3,
'282' => 2
);
foreach ($data as $object) {
$items = split(' ', $object->bezeichnung);
$pos = 0;
foreach ($items as $item) {
$pos++;
$sql = '
INSERT INTO item_item_assign (
item_parent_id,
item_child_id,
type,
position
) VALUES (
'.$item_ids[$object->lid].',
'.$item_numbers[$item].',
'.$type[$object->mid].',
'.$pos.'
)
';
//echo $sql.'<br>';
$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
}
}
echo "ende<br>";
?>
+70
View File
@@ -0,0 +1,70 @@
<?php
//ini_set("memory_limit","1024M");
set_time_limit(6000000);
// get data
// connect import database
// old database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra_shop__', $connection) or die("Konnte die Datenbank nicht waehlen.1");
echo "get items<br>";
// get items
$query = mysql_query('select import_item_prices.*, items.id as item_id from import_item_prices left join items on items.old_id=import_item_prices.pid order by pid, menge asc') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
// new database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra', $connection) or die("Konnte die Datenbank nicht waehlen.2");
echo "imports<br>";
foreach ($data as $object) {
$customer_group = 1;
if ($object->uid == 6) {
$customer_group = 101;
}
if ($object->menge == 1) {
$sql = "
INSERT INTO item_prices
SET
item_id=".$object->item_id.",
customergroup_id=".$customer_group.",
quantity_1=1,
price_1='".mysql_real_escape_string(price($object->preis))."',
bargain_price_1='0'
";
}
else {
$sql = "
UPDATE item_prices
SET
quantity_2=".$object->menge.",
price_2='".mysql_real_escape_string(price($object->preis))."',
bargain_price_2='0'
WHERE
item_id=".$object->item_id." AND customergroup_id=".$customer_group."
";
}
echo $sql."<br>";
$query = mysql_query($sql);
}
echo "ende<br>";
function price ($p) {
$p = str_replace(',', '.', $p);
//$p = substr($p, 0, -2);
return $p;
}
?>
+53
View File
@@ -0,0 +1,53 @@
<?php
//ini_set("memory_limit","1024M");
set_time_limit(6000000);
//$connection=mysql_connect('localhost', 'intelectra_shop_', 'Wwja71!3') or die ("Verbindungsversuch fehlgeschlagen");
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra_shop__', $connection) or die("Konnte die Datenbank nicht waehlen.1");
echo "get items<br>";
// get items
$query = mysql_query('select import_item_prices.*, items.id as item_id from import_item_prices left join items on items.old_id=import_item_prices.pid order by pid, menge asc') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
echo "imports<br>";
$merker = array();
foreach ($data as $object) {
$customer_group = 1;
if ($object->uid == 6) {
$customer_group = 101;
}
if ($object->menge != 1) {
$merker[$object->item_id]++;
$staffel = $merker[$object->item_id] + 1;
$sql = "
UPDATE item_prices
SET
quantity_".$staffel."=".$object->menge.",
price_".$staffel."='".mysql_real_escape_string(price($object->preis))."',
bargain_price_".$staffel."='0'
WHERE
item_id=".$object->item_id." AND customergroup_id=".$customer_group."
";
}
echo $sql."<br>";
$query = mysql_query($sql);
}
echo "ende<br>";
function price ($p) {
$p = str_replace(',', '.', $p);
return $p;
}
?>
@@ -0,0 +1,47 @@
<?php
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
// get data
// connect import database
// old database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra_shop__', $connection) or die("Konnte die Datenbank nicht waehlen.1");
echo "get items<br>";
// get items
$query = mysql_query("
SELECT structure.id as sid , items.id as aid
FROM import_item_structure_assign
left join structure on import_item_structure_assign.rid = structure.old_id
left join items on import_item_structure_assign.pid = items.old_id
") or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
echo "imports<br>";
foreach ($data as $object) {
$sql = "
INSERT INTO item_structure_assign
SET
item_id='".$object->aid."',
structure_id='".mysql_real_escape_string($object->sid)."'
";
if ($object->sid && $object->aid) {
$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
}
}
echo "ende<br>";
?>
+70
View File
@@ -0,0 +1,70 @@
<?php
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
// get data
// connect import database
ini_set('display_errors', 1);
error_reporting(E_ALL);
echo "start";
// old database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra', $connection) or die("Konnte die Datenbank nicht waehlen1.");
// get customers
$query = mysql_query('SELECT * FROM `import_structure` order by parentid, rindex') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
// imported data
// connect target database
// new database
mysql_select_db('intelectra', $connection) or die("Konnte die Datenbank nicht waehlen2.");
$parent_ids = array();
$parent_ids['oldid_0'] = 357;
$pos = 0;
$parent_id = 0;
foreach ($data as $menu) {
if ($menu->parentid != $parent_id) {
$parent_id = $menu->parentid;
$pos = 0;
}
$short_uri = $menu->bezeichnung;
$short_uri = str_replace(array('ä', 'Ä', 'ö', 'Ö', 'ü', 'Ü', 'ß'), array('ae', 'Ae', 'oe', 'Oe', 'ue', 'Ue', 'ss'), $short_uri);
$short_uri = preg_replace("@[^0-9aA-zZ\-]@si", "-", $short_uri);
$short_uri = preg_replace("@(-{2,})@si", "-", $short_uri);
$sql = "
INSERT INTO structure
SET
parent_id=".$parent_ids['oldid_'.$menu->parentid].",
old_id=".$menu->rid.",
active=1,
short_uri='".$short_uri."',
pos='".$pos."',
image='',
name='".$menu->bezeichnung."'
";
//echo $sql."<br>";
$query = mysql_query($sql);
$last_id = $parent_ids['oldid_'.$menu->rid] = mysql_insert_id($connection);
$pos++;
$sql = "
INSERT INTO `site_content` (`structure_id`, `type`, `position`, `activ`, `content`, `configuration`) VALUES
(".$last_id.", 'textbox', 1, 0, '', NULL),
(".$last_id.", 'slider', 2, 0, '', NULL),
(".$last_id.", 'article_list', 3, 1, '0', NULL),
(".$last_id.", 'banner', 4, 0, '0', NULL),
(".$last_id.", 'manufacturers', 5, 0, '', NULL),
(".$last_id.", 'substructure', 6, 0, '', NULL),
(".$last_id.", 'popular', 0, 0, '', NULL)
";
//$query = mysql_query($sql);
}
@@ -0,0 +1,35 @@
<?php
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
// get data
// connect import database
ini_set('display_errors', 1);
error_reporting(E_ALL);
echo "start";
// old database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra', $connection) or die("Konnte die Datenbank nicht waehlen1.");
// get customers
$query = mysql_query('SELECT * FROM `structure`') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
foreach ($data as $menu) {
$sql = "
INSERT INTO `site_content` (`structure_id`, `type`, `position`, `activ`, `content`, `configuration`) VALUES
(".$menu->id.", 'textbox', 1, 0, '', NULL),
(".$menu->id.", 'slider', 2, 0, '', NULL),
(".$menu->id.", 'article_list', 5, 1, '0', NULL),
(".$menu->id.", 'banner', 4, 0, '0', NULL),
(".$menu->id.", 'manufacturers', 6, 1, '', NULL),
(".$menu->id.", 'substructure', 3, 1, '', "."\"\$config = array\('cat_id' => '', 'ebenen' => '2', \)\;\""."),
(".$menu->id.", 'popular', 0, 0, '', NULL)
";
echo $sql.'<br>';
$query = mysql_query($sql);
}
@@ -0,0 +1,38 @@
<?php
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
// get data
// connect import database
ini_set('display_errors', 1);
error_reporting(E_ALL);
echo "start";
/*$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra', $connection) or die("Konnte die Datenbank nicht waehlen.");
*/
$connection=mysql_connect('localhost', 'intelectra_shop_', 'Wwja71!3') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra_shop__', $connection) or die("Konnte die Datenbank nicht waehlen.1");
$query = mysql_query('SELECT * FROM `structure` where parent_id=357 and id!=9885') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
foreach ($data as $menu) {
mysql_query('DELETE FROM site_content WHERE structure_id='.$menu->id);
$sql = "
INSERT INTO `site_content` (`structure_id`, `type`, `position`, `activ`, `title`, `content`, `configuration`) VALUES
(".$menu->id.", 'textbox', 4, 1, 'Ersatzteile f&uuml;r ".$menu->name."', '', NULL),
(".$menu->id.", 'slider', 2, 1, 'Sonderangebote | Ersetzteile und Zubeh&ouml;r f&uuml;r ".$menu->name."', '86', NULL),
(".$menu->id.", 'article_list', 6, 0, '', '0', NULL),
(".$menu->id.", 'banner', 5, 0, '', '0', NULL),
(".$menu->id.", 'manufacturers', 7, 0, '', '', NULL),
(".$menu->id.", 'substructure', 3, 1, 'Im Bereich ".$menu->name." bieten wir folgende Warengruppen', '', "."\"\$config = array\('cat_id' => '', 'ebenen' => '2', \)\;\""."),
(".$menu->id.", 'popular', 1, 0, '', '', NULL)
";
echo $sql.'<br>';
$query = mysql_query($sql);
}
@@ -0,0 +1,45 @@
<?php
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
// get data
// connect import database
ini_set('display_errors', 1);
error_reporting(E_ALL);
echo "start";
// old database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra', $connection) or die("Konnte die Datenbank nicht waehlen1.");
// get customers
$query = mysql_query('SELECT * FROM `structure` where parent_id=357') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
foreach ($data as $menu) {
$sql = "
INSERT INTO `site_content` (`structure_id`, `type`, `position`, `activ`, `content`, `configuration`) VALUES
(".$menu->id.", 'textbox', 1, 0, '', NULL),
(".$menu->id.", 'slider', 2, 0, '', NULL),
(".$menu->id.", 'article_list', 5, 1, '0', NULL),
(".$menu->id.", 'banner', 4, 0, '0', NULL),
(".$menu->id.", 'manufacturers', 6, 1, '', NULL),
(".$menu->id.", 'substructure', 3, 1, '', "."\"\$config = array\('cat_id' => '', 'ebenen' => '2', \)\;\""."),
(".$menu->id.", 'popular', 0, 0, '', NULL)
";
$sql = "
INSERT INTO `site_content` (`structure_id`, `type`, `position`, `activ`, `content`, `configuration`) VALUES
(".$menu->id.", 'textbox', 1, 0, '', NULL),
(".$menu->id.", 'slider', 2, 0, '', NULL),
(".$menu->id.", 'article_list', 5, 1, '0', NULL),
(".$menu->id.", 'banner', 4, 0, '0', NULL),
(".$menu->id.", 'manufacturers', 6, 1, '', NULL),
(".$menu->id.", 'substructure', 3, 1, '', "."\"\$config = array\('cat_id' => '', 'ebenen' => '2', \)\;\""."),
(".$menu->id.", 'popular', 0, 0, '', NULL)
";
echo $sql.'<br>';
//$query = mysql_query($sql);
}
+56
View File
@@ -0,0 +1,56 @@
<?php
//ini_set("memory_limit","1024M");
set_time_limit(6000000);
ini_set('display_errors', 1);
error_reporting(E_ALL);
// old database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra_shop__', $connection) or die("Konnte die Datenbank nicht waehlen.1");/*
$connection=mysql_connect('localhost', 'int-db-sql-shop', 'Msc7t24?381L') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('webshop-sql', $connection) or die("Konnte die Datenbank nicht waehlen.1");
*/
echo "get items<br>";
// get items
//$sql = 'SELECT * FROM import_items limit 4500,9000';
$sql = "select ii.* from import_items ii
left join items i on i.old_id=ii.pid
where i.id IS NULL";
$query = mysql_query($sql) or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
echo "imports<br>";
foreach ($data as $object) {
$sql = "
INSERT INTO items
SET
old_id='".$object->pid."',
number='".mysql_real_escape_string($object->produktid)."',
shippable=1,
schema_id=3,
price_type=1,
seo_keywords='".mysql_real_escape_string($object->keywords)."',
tax_id=1,
detail_description='".mysql_real_escape_string($object->beschreibung)."',
name='".mysql_real_escape_string($object->bezeichnung)."'
";
$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
}
echo "ende<br>";
?>
+53
View File
@@ -0,0 +1,53 @@
<?php
//ini_set("memory_limit","1024M");
set_time_limit(6000000);
// get data
// connect import database
// old database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra_shop__', $connection) or die("Konnte die Datenbank nicht waehlen.1");
echo "get data<br>";
// get items
$query = mysql_query('SELECT * FROM passendwie') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
echo "imports<br>";
foreach ($data as $object) {
/*$sql = "
UPDATE items
SET
attribute_1=CONCAT_WS(';', attribute_1, '".mysql_real_escape_string($object->vertreiber)."'),
attribute_2=CONCAT_WS(';', attribute_2, '".mysql_real_escape_string($object->bestellcode)."')
WHERE number='".$object->nr."'
";
*/
$content ='<p>';
$content .= '<b>'.$object->vertreiber.'</b>';
if ($object->bestellcode) {
$content .= '<br>'.$object->bestellcode;
}
$content .='</p>';
$sql = "
UPDATE items
SET
attribute_1=CONCAT_WS('', attribute_1, '".mysql_real_escape_string($content)."'),
attribute_2=''
WHERE number='".$object->nr."'
";
$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
}
echo "ende<br>";
?>
+43
View File
@@ -0,0 +1,43 @@
<?php
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
// get data
// connect import database
// old database
/*$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra_shop__', $connection) or die("Konnte die Datenbank nicht waehlen.1");
*/
$connection=mysql_connect('localhost', 'int-db-sql-shop', 'Msc7t24?381L') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('webshop-sql', $connection) or die("Konnte die Datenbank nicht waehlen.1");
echo "get data<br>";
// get items
$query = mysql_query('SELECT * FROM gefahr WHERE bildnr > 100 AND bildnr < 600') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
echo "imports<br>";
foreach ($data as $object) {
$sql = "
UPDATE items
SET
attribute_5=\"<img src='./web/intelectra_shop/images/danger/bildnummer".$object->bildnr.".gif' /><br>".mysql_real_escape_string($object->beschreibung)."\"
WHERE number='".$object->nr."'
";
$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
}
echo "ende<br>";
?>
+42
View File
@@ -0,0 +1,42 @@
<?php
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
// get data
// connect import database
// old database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra', $connection) or die("Konnte die Datenbank nicht waehlen.1");
echo "get data<br>";
// get items
$query = mysql_query('SELECT * FROM import_synonyme') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
echo "imports<br>";
$z = 0;
foreach ($data as $object) {
$sql = "
UPDATE items
SET
attribute_6=\"".mysql_real_escape_string($object->wort)."\"
WHERE number='".$object->nr."'
";
$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
else {
$z++;
}
}
echo "ende: $z <br>";
?>
+51
View File
@@ -0,0 +1,51 @@
<?php
//ini_set("memory_limit","1024M");
set_time_limit(6000000);
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra_shop__', $connection) or die("Konnte die Datenbank nicht waehlen.");
/*
$connection=mysql_connect('localhost', 'intelectra_shop_', 'Wwja71!3') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra_shop__', $connection) or die("Konnte die Datenbank nicht waehlen.1");
*/
echo "get data<br>";
// get items
$query = mysql_query('SELECT ersatzteilvertreiber FROM import_artikelcsv GROUP BY ersatzteilvertreiber') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
echo "imports<br>";
$z = 0;
foreach ($data as $object) {
$short_uri = $object->ersatzteilvertreiber;
$short_uri = str_replace(array('ä', 'Ä', 'ö', 'Ö', 'ü', 'Ü', 'ß'), array('ae', 'Ae', 'oe', 'Oe', 'ue', 'Ue', 'ss'), $short_uri);
$short_uri = preg_replace("@[^0-9aA-zZ\-]@si", "-", $short_uri);
$short_uri = preg_replace("@(-{2,})@si", "-", $short_uri);
$sql = "
INSERT INTO manufacturers
SET
name='".mysql_real_escape_string($object->ersatzteilvertreiber)."',
short_uri='".$short_uri."',
active=1
";
//echo $sql."<br>";
$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
else {
$z++;
}
}
echo "ende: $z <br>";
?>
+58
View File
@@ -0,0 +1,58 @@
<?php
//ini_set("memory_limit","1024M");
set_time_limit(6000000);
/*$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra', $connection) or die("Konnte die Datenbank nicht waehlen.");
*/
$connection=mysql_connect('localhost', 'intelectra_shop_', 'Wwja71!3') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra_shop__', $connection) or die("Konnte die Datenbank nicht waehlen.1");
$query = mysql_query('select * from manufacturers') or die("Anfrage nicht erfolgreich");
$manufacturers = array();
while($obj = mysql_fetch_object($query)) {
$manufacturers[$obj->name] = $obj->id;
}
echo "get data<br>";
// get items
$query = mysql_query('SELECT * FROM import_artikelcsv') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
echo "imports<br>";
foreach ($data as $object) {
$manufacturer_id = 1;
if(isset($manufacturers[$object->ersatzteilvertreiber])) {
$manufacturer_id = $manufacturers[$object->ersatzteilvertreiber];
}
$sql = "
UPDATE items
SET
attribute_7='".mysql_real_escape_string($object->navisionid)."',
attribute_8='".mysql_real_escape_string($object->merkmale)."',
attribute_9='".mysql_real_escape_string($object->aufdrucke)."',
attribute_10='".mysql_real_escape_string($object->handlingeinheit)."',
attribute_11='".mysql_real_escape_string($object->handlingsifaktor)."',
attribute_12='".mysql_real_escape_string($object->verpackungseinheitfaktor)."',
ean_code='".mysql_real_escape_string($object->ean)."',
vendor_item_number='".mysql_real_escape_string($object->teilenrlieferant)."',
shipping_weight='".mysql_real_escape_string($object->gewicht)."',
manufacturer_id='".$manufacturer_id."'
WHERE number='".$object->altenr."'
";
//echo $sql.'<br>';
$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
}
echo "ende<br>";
?>
+48
View File
@@ -0,0 +1,48 @@
<?php
//ini_set("memory_limit","1024M");
set_time_limit(6000000);
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra_shop__', $connection) or die("Konnte die Datenbank nicht waehlen.1");
$query = mysql_query('select * from manufacturers') or die("Anfrage nicht erfolgreich");
$manufacturers = array();
while($obj = mysql_fetch_object($query)) {
$manufacturers[$obj->name] = $obj->id;
}
echo "get data<br>";
// get items
$query = mysql_query('SELECT * FROM import_items') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
echo "imports<br>";
foreach ($data as $object) {
$manufacturer_id = 0;
if(isset($manufacturers[$object->ersatzteilvertreiber])) {
$manufacturer_id = $manufacturers[$object->ersatzteilvertreiber];
}
$sql = "
UPDATE items
SET
attribute_14='".mysql_real_escape_string($object->lieferzeit)."',
attribute_15='".mysql_real_escape_string($object->veh)."',
attribute_16='".mysql_real_escape_string($object->meh)."'
WHERE number='".$object->produktid."'
";
//echo $sql.'<br>';
$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
}
echo "ende<br>";
?>
+150
View File
@@ -0,0 +1,150 @@
<?php
//exit();
ini_set("memory_limit","2048M");
set_time_limit(6000000);
ini_set('display_errors', 1);
error_reporting(E_ALL);
//$mysqli = new mysqli('192.168.11.144', 'root', '1234', 'intelectra_shop__');
//$mysqli = new mysqli('localhost', 'root', '1234', 'intelectra_shop__');
$mysqli = new mysqli('localhost', 'int-db-sql-shop', 'Msc7t24?381L', 'webshop-sql');
$items_table = '`items`';
$attribute_field = '`attribute_18`';
$ignore_fields = array('anr');
$item_ready_ids = array();
// Reset items update status
//$mysqli->query("UPDATE " . $items_table . " SET update_ready = 0");exit();
$starttime = microtime(true);
// Get items
$query = "
SELECT
id, number, name
FROM
" . $items_table . "
WHERE
update_ready = 0
-- number = '287513'
LIMIT
200
";
$rsItems = $mysqli->query($query);
$items2go = array();
while ($I = $rsItems->fetch_object()) {
$items2go[$I->number] = $I;
$item_ready_ids[] = $I->id;
}
// Get machine associations
$query = "
SELECT
anr, bezeichnungoriginal, bezeichnung1, nr
FROM
import_geraetezuordnung
WHERE
anr IN ('" . implode("','", array_keys($items2go)) . "')
";
$rsAssocs = $mysqli->query($query);
$bytesProcessed = 0;
while ($A = $rsAssocs->fetch_object()) {
if (isset($items2go[$A->anr])) {
if (!isset($items2go[$A->anr]->attributes) || !is_array($items2go[$A->anr]->attributes)) {
$items2go[$A->anr]->attributes = array();
}
foreach ($A as $fieldName => $fieldValue) {
if (!in_array($fieldName, $ignore_fields)) {
// echo $fieldValue, '<br>';
$searchWord = utf8_encode(str_replace(' ', '_', strtolower($fieldValue)));
$searchWord = preg_replace(
"@[^aA-zZ0-9_äÄüÜöÖß]@sui", '', $searchWord
);
$searchWord = utf8_decode(str_replace('_', ' ', $searchWord));
$items2go[$A->anr]->attributes[$searchWord] = $searchWord;
$bytesProcessed += strlen($searchWord);
}
}
}
// Way too slow; key = value instead
//$items2go[$A->anr]->attributes = array_keys($items2go[$A->anr]->attributes);
//$items2go[$A->anr]->attributes = array_unique($items2go[$A->anr]->attributes);
}
echo $bytesProcessed, 'b<br>';
// Make inserts for tmp table
$inserts = array();
foreach ($items2go as $itemNo => $itemData) {
if (isset($itemData->attributes) && is_array($itemData->attributes) && count($itemData->attributes) > 0) {
$inserts[] = "(" . $itemData->id . ", ' " . implode(' ', $itemData->attributes) . " ')";
}
}
// Create temp table for multi updates as a cache
$mysqli->query("
CREATE TEMPORARY TABLE
tmp_items_updates (
id INT,
text MEDIUMTEXT
)
");
// Insert changes into temp table
$insertQuery = "
INSERT INTO
tmp_items_updates (id, text)
VALUES
" . implode(', ', $inserts) . "
";
$mysqli->query($insertQuery);
// Update items
$updateQuery = "
UPDATE
" . $items_table . " i,
tmp_items_updates i_tmp
SET
i." . $attribute_field . " = i_tmp.text
WHERE
i.id = i_tmp.id
AND
i_tmp.id IS NOT NULL
";
$mysqli->query($updateQuery);
// Mark items as ready
if (count($item_ready_ids) > 0) {
$readyQuery = "
UPDATE
" . $items_table . "
SET
update_ready = 1
WHERE
id IN (" . implode(',', $item_ready_ids) . ")
";
$mysqli->query($readyQuery);
}
// Get items count to go
$queryCount = "
SELECT
COUNT(id) AS cnt
FROM
" . $items_table . "
WHERE
update_ready = 0
";
$rsCount = $mysqli->query($queryCount);
echo 'Items to go: ', $rsCount->fetch_object()->cnt, '<br>';
echo microtime(true) - $starttime;
?>
@@ -0,0 +1,46 @@
<?php
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
// get data
// connect import database
// database
/*$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra_shop__', $connection) or die("Konnte die Datenbank nicht waehlen.");*/
$connection = mysql_connect('localhost', 'int-db-sql-shop', 'Msc7t24?381L') or die("Verbindungsversuch fehlgeschlagen");
mysql_select_db('webshop-sql', $connection) or die("Konnte die Datenbank nicht waehlen.1");
$query = mysql_query('SELECT * FROM customer_addresses where house_number = ""') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$street = $obj->street;
// trenne strings
$length = strlen($street);
$found = -1;
for ($z=0;($found == -1 && $z<$length);$z++) {
if (is_numeric(substr($street,$z,1))) {
$found = $z;
}
}
if ($found != -1) {
$street_new = trim(substr($obj->street,0,$found));
$house_number = trim(substr($obj->street,$found,($length - $found)));
$sql = "
UPDATE customer_addresses
SET
street = '".mysql_real_escape_string($street_new)."',
house_number = '".mysql_real_escape_string($house_number)."'
WHERE id=".$obj->id."
";
// echo "<br>$street<br>".$sql;
mysql_query($sql);
}
}
?>
@@ -0,0 +1,48 @@
<?php
//ini_set("memory_limit","1024M");
set_time_limit(6000000);
ini_set('display_errors', 1);
error_reporting(E_ALL);
// old database
/*
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra_shop__', $connection) or die("Konnte die Datenbank nicht waehlen.1");
*/
$connection=mysql_connect('localhost', 'int-db-sql-shop', 'Msc7t24?381L') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('webshop-sql', $connection) or die("Konnte die Datenbank nicht waehlen.1");
echo "get items<br>";
// get items
$sql = "SELECT i.id, i.detail_description, iim.beschreibung FROM import_item_merkmale iim
LEFT JOIN items i ON i.old_id=iim.lid
WHERE iim.mid=77
";
$query = mysql_query($sql) or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data[] = $obj;
}
echo "imports<br>";
foreach ($data as $object) {
$sql = "
UPDATE items SET
detail_description=CONCAT(detail_description,'".mysql_real_escape_string('<br>'.$object->beschreibung)."')
WHERE id='".$object->id."'
";
$query = mysql_query($sql);
if (!$query) {
echo $sql;
echo "<br />";
}
}
echo "ende<br>";
?>
+32
View File
@@ -0,0 +1,32 @@
<?php
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
// get data
// connect import database
// database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra', $connection) or die("Konnte die Datenbank nicht waehlen.");
$query = mysql_query('SELECT * FROM items') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$query2 = mysql_query('SELECT * FROM item_files WHERE item_id='.$obj->id.' ORDER BY rang LIMIT 1') or die("Anfrage nicht erfolgreich");
$image = '';
while($obj2 = mysql_fetch_object($query2)) {
$image = $obj2->file_name;
}
$sql = "
UPDATE items
SET
default_image_file_name='".$image."'
WHERE id=".$obj->id."
";
echo "<br>".$sql;
mysql_query($sql);
}
?>
+36
View File
@@ -0,0 +1,36 @@
<?php
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
// database
$connection=mysql_connect('localhost', 'shop_topreef_de', 'b-7+ZgQn$!') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('shop_topreef_de', $connection) or die("Konnte die Datenbank nicht waehlen.");
$sql = "
SELECT items.id, items.parent_id, items.number, item_files.file_name as imagetable, items.default_image_file_name as childdefault, i2.default_image_file_name as parent_default
FROM items
LEFT JOIN item_files ON item_files.item_id=items.id
LEFT JOIN items i2 ON i2.id = items.parent_id
WHERE items.parent_id != 0 AND (
item_files.type=0 OR item_files.id IS NULL
)
AND item_files.file_name IS NULL
GROUP BY items.id
";
$query = mysql_query($sql) or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$sql = "
UPDATE items
SET
default_image_file_name='".$obj->parent_default."'
WHERE id=".$obj->id."
";
echo "<br>".$sql;
mysql_query($sql);
}
?>
@@ -0,0 +1,123 @@
<?php
// Mod DZ 2103-12-18
$table = 'items';
$limit = 10000;
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
// get data
// connect import database
function replace_num_entity($ord) {
$ord = $ord[1];
if (preg_match('/^x([0-9a-f]+)$/i', $ord, $match)) {
$ord = hexdec($match[1]);
} else {
$ord = intval($ord);
}
$no_bytes = 0;
$byte = array();
if ($ord < 128) {
return chr($ord);
} elseif ($ord < 2048) {
$no_bytes = 2;
} elseif ($ord < 65536) {
$no_bytes = 3;
} elseif ($ord < 1114112) {
$no_bytes = 4;
} else {
return;
}
switch ($no_bytes) {
case 2: {
$prefix = array(31, 192);
break;
}
case 3: {
$prefix = array(15, 224);
break;
}
case 4: {
$prefix = array(7, 240);
}
}
for ($i = 0; $i < $no_bytes; $i++) {
$byte[$no_bytes - $i - 1] = (($ord & (63 * pow(2, 6 * $i))) / pow(2, 6 * $i)) & 63 | 128;
}
$byte[0] = ($byte[0] & $prefix[0]) | $prefix[1];
$ret = '';
for ($i = 0; $i < $no_bytes; $i++) {
$ret .= chr($byte[$i]);
}
return utf8_decode($ret);
}
/* $connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra_shop__', $connection) or die("Konnte die Datenbank nicht waehlen.");
*/
$connection = mysql_connect('localhost', 'int-db-sql-shop', 'Msc7t24?381L') or die("Verbindungsversuch fehlgeschlagen");
mysql_select_db('webshop-sql', $connection) or die("Konnte die Datenbank nicht waehlen.1");
echo "get items";
$query = mysql_query("SELECT * FROM " . $table . " ORDER BY id LIMIT " . $limit) or die("Anfrage nicht erfolgreich");
$data = array();
echo "set description";
echo '<hr>' . "\r\n";
while ($obj = mysql_fetch_object($query)) {
$desc = strip_tags(str_replace('<br>', ' ', $obj->detail_description));
$desc = str_replace(array(
"\r\n", "\r", "\n", "\t"
), '', $desc);
// Mod DZ 2103-12-18
echo $obj->id, '<br>' . "\r\n";
echo mb_detect_encoding($desc, 'UTF-8, ISO-8859-1'), '<br>' . "\r\n";
echo $desc, '<br>' . "\r\n";
$hasHexStuff = preg_match('/&#([0-9a-fx]+);/mi', $desc);
$desc = preg_replace_callback('/&#([0-9a-fx]+);/mi', 'replace_num_entity', $desc);
echo $desc, '<br>' . "\r\n";
if (mb_detect_encoding($desc, 'UTF-8, ISO-8859-1') === 'UTF-8') {
echo 'isutf8<br>' . "\r\n";
$desc = utf8_decode($desc);
} else if ($hasHexStuff) {
//$desc = utf8_decode($desc);
}
$desc = htmlentities($desc);
// $desc = preg_replace("@[\s]{2,}@si", ' ', $desc);
// $desc = trim($desc);
echo $desc . "\r\n";
echo '<hr>' . "\r\n";
// End mod
$sql = "
UPDATE " . $table . "
SET
short_description='" . $desc . "'
WHERE id=" . $obj->id . "
";
$query2 = mysql_query($sql);
// echo mysql_error(), '<hr>';
// echo $sql, '<hr><hr>';
if (!$query2) {
// echo $sql;
// echo "<br />";
}
}
echo "ende";
?>
@@ -0,0 +1,80 @@
<?php
ini_set("memory_limit","1024M");
set_time_limit(600000);
// get data
// connect import database
/*
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra', $connection) or die("Konnte die Datenbank nicht waehlen.");
*/
$connection=mysql_connect('localhost', 'intelectra_shop_', 'Wwja71!3') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra_shop__', $connection) or die("Konnte die Datenbank nicht waehlen.1");
echo "get items";
$query = mysql_query("SELECT * FROM items WHERE name!='' and id > 8900") or die("Anfrage nicht erfolgreich");
$data = array();
echo "set uris";
while($obj = mysql_fetch_object($query)) {
// get number
$sql = 'SELECT bestellcode FROM passendwie WHERE nr="'.$obj->number.'" AND bestellcode != ""';
$query2 = mysql_query($sql) or die("Anfrage nicht erfolgreich".$sql);
$number = '';
$org_number = '';
while($obj2 = mysql_fetch_object($query2)) {
$org_number = $obj2->bestellcode;
$teilnr = split('=', $obj2->bestellcode);
foreach ($teilnr as $bestellcode) {
$number = preg_replace("@[^0-9\-]@si", "", $bestellcode.' ');
$number = str_replace('-', '', $number);
if ($number != '' && strlen($number) > 4) {
//echo '<hr>'.$number.'<br>';
//echo $org_number.'<br>';
}
if ($number != '') {
break;
}
}
if ($number != '') {
break;
}
}
//echo preg_replace("@[^0-9\-]@si", "", $number).'<br>';
$obj->name = utf8_encode($obj->name);
$short_uri = $obj->name.'-'.$number;
$short_uri = str_replace(array('ä', 'Ä', 'ö', 'Ö', 'ü', 'Ü', 'ß'), array('ae', 'Ae', 'oe', 'Oe', 'ue', 'Ue', 'ss'), $short_uri);
$short_uri = preg_replace("@[^0-9aA-zZ\-]@si", "-", $short_uri);
$short_uri = preg_replace("@(-{2,})@si", "-", $short_uri);
$new_uri = '';
$old_uri = $short_uri;
$i = 0;
while ($new_uri == '') {
$sql = "SELECT id FROM items WHERE short_uri = '$short_uri' AND id != ".$obj->id;
$result = mysql_query($sql);
if (mysql_num_rows($result) == 0) {
$new_uri = $short_uri;
} else {
$i++;
$short_uri = $old_uri . '_' . $i;
}
}
$sql = "
UPDATE items
SET
short_uri='".$short_uri."'
WHERE id=".$obj->id."
";
//echo $sql.'<br>';
$query2 = mysql_query($sql);
if (!$query2) {
echo $sql;
echo "<br />";
}
}
echo "ende";
?>
@@ -0,0 +1,28 @@
<?php
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
// get data
// connect import database
$connection=mysql_connect('localhost', 'emfa_kinderwelt_', 'sgfed/(&RT') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('emfa_kinderwelt_',$connection) or die("Konnte die Datenbank nicht waehlen.");
echo "get items";
$query = mysql_query('SELECT * FROM items') or die("Anfrage nicht erfolgreich");
$data = array();
echo "set structures";
while($obj = mysql_fetch_object($query)) {
$sql = "INSERT INTO item_structure_assign (item_id, structure_id) VALUES (".$obj->id.", ".$obj->{'structure_id'}.")";
$result = mysql_query($sql);
for ($i=2;$i<11;$i++) {
if ($obj->{'structure_id_'.$i} > 0) {
$sql = "INSERT INTO item_structure_assign (item_id, structure_id) VALUES (".$obj->id.", ".$obj->{'structure_id_'.$i}.")";
$result = mysql_query($sql);
}
}
}
echo "ende";
?>
@@ -0,0 +1,40 @@
<?php
ini_set("memory_limit","1024M");
set_time_limit(600000);
// connect import database
/*$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra_shop__', $connection) or die("Konnte die Datenbank nicht waehlen.");
*/
$connection=mysql_connect('localhost', 'int-db-sql-shop', 'Msc7t24?381L') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('webshop-sql', $connection) or die("Konnte die Datenbank nicht waehlen.1");
echo "get items";
$sql = "select * from item_structure_assign where structure_id=10649 and item_id=4";
$query = mysql_query($sql) or die("Anfrage nicht erfolgreich: $sql");
$data = array();
while($obj = mysql_fetch_object($query)) {
$data['test'.$obj->item_id] = 1;
}
$sql = "select * from items where name like '%Ersatz siehe Alternativartikel%' and id=4";
$query = mysql_query($sql) or die("Anfrage nicht erfolgreich: $sql");
while($obj = mysql_fetch_object($query)) {
if (!isset($data['test'.$obj->id])) {
$sql = "INSERT INTO item_structure_assign (
item_id,
structure_id
) VALUES (
".$obj->id.",
10649
)";
$query2 = mysql_query($sql);
if (!$query2) {
echo $sql;
echo "!!<br />";
}
}
}
echo "ende";
?>
@@ -0,0 +1,55 @@
<?php
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
include_once '../../libs/phImaginator/phImaginator.class.php';
// database
/*
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra_shop__', $connection) or die("Konnte die Datenbank nicht waehlen.1");
*/
$connection=mysql_connect('localhost', 'int-db-sql-shop', 'Msc7t24?381L') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('webshop-sql', $connection) or die("Konnte die Datenbank nicht waehlen.1");
$query = mysql_query("SELECT id FROM structure WHERE parent_id=357") or die("Anfrage nicht erfolgreich");
$data = array();
$s_ids = array();
while($obj = mysql_fetch_object($query)) {
$s_ids[] = $obj->id;
}
$query = mysql_query("SELECT id FROM structure WHERE parent_id in (".implode(',',$s_ids).") and (image like '%pdf')") or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$sql = "select s.id, s.name, isa.item_id, files.file_name from structure s
left join item_structure_assign isa on isa.structure_id=s.id
left join item_files files on files.item_id=isa.item_id
where files.type = 0 and s.id=".$obj->id.' limit 1';
$query2 = mysql_query($sql) or die("Anfrage nicht erfolgreich");
$image = '';
$image_path = '';
while($obj2 = mysql_fetch_object($query2)) {
if ($obj2->file_name) {
$image_path = "../../web/intelectra_shop/images/article/".$obj2->file_name;
$targetFile = "../../web/intelectra_shop/images/structure/".$obj2->file_name;
echo "$targetFile <br>";
copy ($image_path,$targetFile);
$imaginator = new phImaginator();
$imaginator->add($targetFile);
$imaginator->Resize_fitBoth(180, 180);
$imaginator->save();
$sql = "
UPDATE structure
SET
image='".$obj2->file_name."'
WHERE id=".$obj2->id."
";
//echo "<br>".$sql;
mysql_query($sql);
}
}
}
?>
@@ -0,0 +1,56 @@
<?php
//ini_set("memory_limit","1024M");
//set_time_limit(60000);
include_once '../../libs/phImaginator/phImaginator.class.php';
// database
/*$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra', $connection) or die("Konnte die Datenbank nicht waehlen.");
*/
$connection=mysql_connect('localhost', 'intelectra_shop_', 'Wwja71!3') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra_shop__', $connection) or die("Konnte die Datenbank nicht waehlen.1");
$query = mysql_query('SELECT id FROM structure WHERE id=357') or die("Anfrage nicht erfolgreich");
$data = array();
while($obj = mysql_fetch_object($query)) {
$query2 = mysql_query('
select s.id, s.name, isa.item_id, files.file_name from structure s
left join item_structure_assign isa on isa.structure_id=s.id
left join item_files files on files.item_id=isa.item_id
where s.parent_id='.$obj->id.'
group by s.id'
) or die("Anfrage nicht erfolgreich");
$image = '';
$image_path = '';
$i = 0;
while($obj2 = mysql_fetch_object($query2)) {
$i++;
$obj2->file_name = 'Warengruppe.jpg';
if ($obj2->file_name) {
$image_path = "../../web/intelectra_shop/images/structure/".$obj2->file_name;
$targetFile = "../../web/intelectra_shop/images/structure/".$i.$obj2->file_name;
//echo $targetFile.'<br>';
copy ($image_path,$targetFile);
$imaginator = new phImaginator();
$imaginator->add($targetFile);
$imaginator->Resize_fitBoth(180, 180);
//$imaginator->Box_fit(212, 212);
//$imaginator->nameAdd($targetFile);
$imaginator->save();
$sql = "
UPDATE structure
SET
image='".$i.$obj2->file_name."'
WHERE id=".$obj2->id."
";
echo "<br>".$sql;
mysql_query($sql);
}
}
}
?>
@@ -0,0 +1,54 @@
<?php
ini_set("memory_limit","1024M");
set_time_limit(600000);
// connect import database
$connection=mysql_connect('localhost', 'root', '1234') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('intelectra', $connection) or die("Konnte die Datenbank nicht waehlen.");
/*
$connection=mysql_connect('localhost', 'int-db-sql-shop', 'Msc7t24?381L') or die ("Verbindungsversuch fehlgeschlagen");
mysql_select_db('webshop-sql', $connection) or die("Konnte die Datenbank nicht waehlen.1");
*/
echo "get items";
$query = mysql_query("SELECT * FROM structure WHERE name!=''") or die("Anfrage nicht erfolgreich");
$data = array();
echo "set uris";
while($obj = mysql_fetch_object($query)) {
//echo preg_replace("@[^0-9\-]@si", "", $number).'<br>';
//$obj->name = utf8_encode($obj->name);
$short_uri = $obj->name;
$short_uri = str_replace(array('ä', 'Ä', 'ö', 'Ö', 'ü', 'Ü', 'ß'), array('ae', 'Ae', 'oe', 'Oe', 'ue', 'Ue', 'ss'), $short_uri);
$short_uri = preg_replace("@[^0-9aA-zZ\-]@si", "-", $short_uri);
$short_uri = preg_replace("@(-{2,})@si", "-", $short_uri);
$new_uri = '';
$old_uri = $short_uri;
$i = 0;
while ($new_uri == '') {
$sql = "SELECT id FROM structure WHERE short_uri = '$short_uri' AND id != ".$obj->id;
$result = mysql_query($sql);
if (mysql_num_rows($result) == 0) {
$new_uri = $short_uri;
} else {
$i++;
$short_uri = $old_uri . '_' . $i;
}
}
$sql = "
UPDATE structure
SET
short_uri='".$short_uri."'
WHERE id=".$obj->id."
";
echo $sql.'<br>';
$query2 = mysql_query($sql);
if (!$query2) {
echo $sql;
echo "!!<br />";
}
}
echo "ende";
?>
+141
View File
@@ -0,0 +1,141 @@
<?php
ini_set("memory_limit","2048M");
set_time_limit(6000000);
ini_set('display_errors', 1);
error_reporting(E_ALL);
//$mysqli = new mysqli('localhost', 'root', '1234', 'intelectra');
$mysqli = new mysqli('localhost', 'intelectra_shop_', 'Wwja71!3', 'intelectra_shop__');
$items_table = '`items`';
$attribute_field = '`attribute_18`';
$ignore_fields = array('anr');
$item_ready_ids = array();
// Reset items update status
//$mysqli->query("UPDATE " . $items_table . " SET update_ready = 0");
$starttime = microtime(true);
// Get items
$query = "
SELECT
id, number, name
FROM
" . $items_table . "
WHERE
update_ready = 0
LIMIT
60
";
$rsItems = $mysqli->query($query);
$items2go = array();
while ($I = $rsItems->fetch_object()) {
$items2go[$I->number] = $I;
$item_ready_ids[] = $I->id;
}
// Get machine associations
$query = "
SELECT
anr, bezeichnungoriginal, bezeichnung1, nr
FROM
import_geraetezuordnung
WHERE
anr IN ('" . implode("','", array_keys($items2go)) . "')
";
$rsAssocs = $mysqli->query($query);
while ($A = $rsAssocs->fetch_object()) {
if (isset($items2go[$A->anr])) {
if (!isset($items2go[$A->anr]->attributes) || !is_array($items2go[$A->anr]->attributes)) {
$items2go[$A->anr]->attributes = array();
}
foreach ($A as $fieldName => $fieldValue) {
if (!in_array($fieldName, $ignore_fields)) {
$searchWord = preg_replace(
"@[^aA-zZ0-9]|[_]@sui", '', strtolower($fieldValue)
);
$items2go[$A->anr]->attributes[$searchWord] = $searchWord;
}
}
}
// Way too slow; key = value instead
//$items2go[$A->anr]->attributes = array_keys($items2go[$A->anr]->attributes);
//$items2go[$A->anr]->attributes = array_unique($items2go[$A->anr]->attributes);
}
// Make inserts for tmp table
$inserts = array();
foreach ($items2go as $itemNo => $itemData) {
if (isset($itemData->attributes) && is_array($itemData->attributes) && count($itemData->attributes) > 0) {
$inserts[] = "(" . $itemData->id . ", '" . implode(' ', $itemData->attributes) . "')";
}
}
// Create temp table for multi updates as a cache
$mysqli->query("
CREATE TEMPORARY TABLE
tmp_items_updates (
id INT,
text MEDIUMTEXT
)
");
// Insert changes into temp table
$insertQuery = "
INSERT INTO
tmp_items_updates (id, text)
VALUES
" . implode(', ', $inserts) . "
";
$mysqli->query($insertQuery);
// Update items
$updateQuery = "
UPDATE
" . $items_table . " i,
tmp_items_updates i_tmp
SET
i." . $attribute_field . " = i_tmp.text
WHERE
i.id = i_tmp.id
AND
i_tmp.id IS NOT NULL
";
$mysqli->query($updateQuery);
// Mark items as ready
if (count($item_ready_ids) > 0) {
$readyQuery = "
UPDATE
" . $items_table . "
SET
update_ready = 1
WHERE
id IN (" . implode(',', $item_ready_ids) . ")
";
$mysqli->query($readyQuery);
}
// Get items count to go
$queryCount = "
SELECT
COUNT(id) AS cnt
FROM
" . $items_table . "
WHERE
update_ready = 0
";
$rsCount = $mysqli->query($queryCount);
echo 'Items to go: ', $rsCount->fetch_object()->cnt, '<br>';
echo microtime(true) - $starttime;
?>