Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php class Wyomind_Massstockupdate_Model_Import extends Mage_Core_Model_Abstract {..

Decoded Output download

<?php 
 
 
 
class Wyomind_Massstockupdate_Model_Import extends Mage_Core_Model_Abstract { 
 
 
 
 
 
public $_warnings    = array(); 
public $_notices     = array(); 
public $_sql         = array(); 
public $_columns     = array(); 
public $_products    = array(); 
public $_stocks      = array(); 
public $_autoInc     = 0; 
public $_tables      = array(); 
public $_total       = false; 
public $_is_in_stock = false; 
public $x12          = false; 
public $_output      = array(); 
public $x13          = array(); 
 
 
 
 
 
 
 
public function _construct() {  
	$x45 = "stristr"; 
	$x46 = "is_readable"; 
	$x47 = "log"; 
	$x48 = "trim"; 
	$x49 = "json_decode"; 
	$x4a = "in_array"; 
	$x4b = "array_splice"; 
	$x4c = "array_unshift"; 
	$x4d = "str_replace"; 
	$x4e = "count"; 
	$x4f = "implode"; 
	$x50 = "is_numeric"; 
	$x51 = "array_push"; 
	$x52 = "strtolower"; 
	$x53 = "strstr"; 
	$x54 = "explode"; 
	$x55 = "addslashes"; 
	$x56 = "time"; 
	parent::_construct(); 
	$this->_init("massstockupdate/import"); 
} 
 
 
 
 
 
 
 
protected function _beforeSave() {  
	$x45="stristr"; 
	$x46 = "is_readable"; 
	$x47 = "log"; 
	$x48 = "trim"; 
	$x49 = "json_decode"; 
	$x4a = "in_array"; 
	$x4b = "array_splice"; 
	$x4c = "array_unshift"; 
	$x4d = "str_replace"; 
	$x4e = "count"; 
	$x4f = "implode"; 
	$x50 = "is_numeric"; 
	$x51 = "array_push"; 
	$x52 = "strtolower"; 
	$x53 = "strstr"; 
	$x54 = "explode"; 
	$x55 = "addslashes"; 
	$x56 = "time"; 
	$x14 = new Varien_Io_File(); 
	$x15 = $x14->getCleanPath(Mage::getBaseDir() . "/" . $this->getFilePath()); 
	if (!$x14->fileExists($x15, false)) {  
		Mage::throwException(Mage::helper("massstockupdate")->__("Wrong file path. '%s' is not a file.", $x15)); 
	}  
	if ($x45($this->getFilePath(), ".csv") < 0) {  
		Mage::throwException(Mage::helper("massstockupdate")->__("Wrong file. '%s' is not a csv file.", $x15)); 
	}  
	if (!$x46($x15)) {  
		Mage::throwException(Mage::helper("massstockupdate")->__("Please make sure that '%s' is readable by web-server.", $x15)); 
	}  
	return parent::_beforeSave(); 
}  
 
 
 
 
 
 
 
 
 
public function x57() {  
	$x45="stristr"; 
	$x46 = "is_readable"; 
	$x47 = "log"; 
	$x48 = "trim"; 
	$x49 = "json_decode"; 
	$x4a = "in_array"; 
	$x4b = "array_splice"; 
	$x4c = "array_unshift"; 
	$x4d = "str_replace"; 
	$x4e = "count"; 
	$x4f ="implode"; 
	$x50 ="is_numeric"; 
	$x51 ="array_push"; 
	$x52 ="strtolower"; 
	$x53 ="strstr"; 
	$x54 = "explode"; 
	$x55 = "addslashes"; 
	$x56 = "t ime"; 
	$this->_warnings = array(); 
	$this->_notices = array(); 
	$this->_sql = array(); 
	$this->_columns = array(); 
	$this->_products = array(); 
	$this->_stocks = array(); 
	$this->_autoInc = 0; 
	$this->_tables = array(); 
	$this->_total = false; 
	$this->_output = array(); 
}  
 
 
 
 
 
 
public function importProcess() {  
	$x45="stristr"; 
	$x46="is_readable"; 
	$x47="log"; 
	$x48="trim"; 
	$x49="json_decode"; 
	$x4a="in_array"; 
	$x4b="array_splice"; 
	$x4c="array_unshift"; 
	$x4d="str_replace"; 
	$x4e="count"; 
	$x4f="implode"; 
	$x50="is_numeric"; 
	$x51="array_push"; 
	$x52="strtolower"; 
	$x53="strstr"; 
	$x54="explode"; 
 
	$x55="addslashes"; 
	$x56="time"; 
	Mage::$x47("-------------------- IMPORTATION PROCESS ---------------", null, "MassStockUpate.log"); 
	$this->x57(); 
	$x14 = new Varien_Io_File(); 
	$x15 = $x14->getCleanPath(Mage::getBaseDir() . "/" . $this->getFilePath()); 
	$x14->streamOpen($x15, "r"); 
	Mage::$x47("--> File opened : " . $x15, null, "MassStockUpate.log"); 
	$x16 = Mage::getModel("catalog/product")->getCollection()->addAttributeToSelect("sku"); 
	foreach ($x16 as $x17) {  
		$this->_products[$x48($x17->getSku())] = $x17->getId(); 
	}; 
	Mage::$x47("--> Products collected", null, "MassStockUpate.log"); 
	if (Mage::helper("core")->isModuleEnabled("Wyomind_Advancedinventory")) {  
		$x18 = Mage::getModel("advancedinventory/advancedinventoryproduct")->getCollection(); 
	foreach ($x18 as $x19) {  
		$this->_stocks[$x19->getProductId()] = $x19->getId(); 
	}; 
	Mage::$x47("--> Local stocks collected (Advanced Inventory)", null, "MassStockUpate.log"); 
	}  
	$x1a = array( 
		"ac" => "activation_code",  
		"ak" => "activation_key",  
		"bu" => "base_url",  
		"md" => "md5",  
		"th" => "this",  
		"dm" => "_demo",  
		"ext" => "msi",  
		"ver" => "3.5.0" 
	); 
	$x1b = Mage::getSingleton("core/resource"); 
	$x1c = $x1b->getConnection("core_read"); 
	$this->_tables["csi"] = Mage::getSingleton("core/resource")->getTableName("cataloginventory_stock_item"); 
	if (Mage::helper("core")->isModuleEnabled("Wyomind_Advancedinventory")) {  
		$this->_tables["aip"] = Mage::getSingleton("core/resource")->getTableName("advancedinventory_product"); 
		$this->_tables["ai"] = Mage::getSingleton("core/resource")->getTableName("advancedinventory"); 
		$x1d = "SELECT MAX(id) AS INC FROM " . $this->_tables["aip"] . " ;"; 
		$x1e = $x1c->fetchAll($x1d); 
		$this->_autoInc = $x1e[0]["INC"]; 
		Mage::$x47("--> Max increment found #" . $x1e[0]["INC"] . "(Advanced Inventory)", null, "MassStockUpate.log"); 
	}  
	$x1f = array(  
		"activation_key" => Mage::getStoreConfig("massstockupdate/license/activation_key"),  
		"activation_code" => Mage::getStoreConfig("massstockupdate/license/activation_code"),  
		"base_url" => Mage::getStoreConfig("web/secure/base_url"),  
	); 
	$x20 = $x49($this->getMapping()); 
	foreach ($x20->columns as $x21 => $x22) {  
		if (!$x4a($x22->id, array( 
			"not-used",  
			"total",  
			"is_in_stock",  
			"manage_local_stock"))) {  
			$this->_columns[] = $x22->id; 
		} elseif ($x4a($x22->id, array("total"))) {  
			$this->_columns[] = "total"; 
			$this->_total = $x21 + 1; 
		} elseif ($x4a($x22->id, array("is_in_stock"))) {  
			$this->_columns[] = "is_in_stock"; 
			$this->_is_in_stock = $x21 + 1; 
		} elseif ($x4a($x22->id, array("manage_local_stock"))) {  
			$this->_columns[] = "manage_local_stock"; 
		$this->_manage_local_stock = $x21 + 1; 
		} else {  
			$this->_columns[] = false; 
		}  
	}  
	Mage::$x47("--> Column mapping analyzed", null, "MassStockUpate.log"); 
	if ($x1f[$x1a["ac"]] != $x1a["md"]($x1a["md"]($x1f[$x1a["ak"]]) . $x1a["md"]($x1f[$x1a["bu"]]) . $x1a["md"]($x1a["ext"]) . $x1a["md"]($x1a["ver"]))) {  
		$$x1a["ext"] = "valid"; 
		$$x1a["th"]->$x1a["dm"] = true; 
	} else {  
		$$x1a["th"]->$x1a["dm"] = false; 
		$$x1a["ext"] = "valid"; 
	} if (!isset($$x1a["ext"]) || $$x1a["th"]->$x1a["dm"]) {  
		$$x1a["th"]->$x1a["dm"] = true; 
		return $$x1a["th"]; 
	}  
	Mage::$x47("--> Preparing MySql queries", null, "MassStockUpate.log"); 
	$x23 = $this->getSkuOffset() - 1; 
	$x24 = new Varien_Io_File(); 
	$x24->setAllowCreateFolders(true); 
	$x25 = Mage::getStoreConfig("massstockupdate/settings/sql_file"); 
	$x26 = Mage::getStoreConfig("massstockupdate/settings/sql_dir"); 
	$x15 = $x14->getCleanPath(Mage::getBaseDir() . '/' . $x26); 
	if (!$x24->fileExists($x15, false)) {  
		Mage::throwException(Mage::helper('massstockupdate')->__('Please create the specified folder "%s".', $x15)); 
	} if (!$x24->isWriteable($x15)) {  
		Mage::throwException(Mage::helper('massstockupdate')->__('Please make sure that "%s" is writable by web-server.', $x15)); 
	}  
	$x24->open(array('path' => $x26)); 
	$x24->streamOpen($x25, 'w'); 
	if ($this->getAutoSetTotal() == 2) {  
		$x24->streamWrite("ALTER TABLE `" . $this->_tables["ai"] . "` DROP FOREIGN KEY `CONST_advancedinventory_localstock_id`; 
	
"); 
	}  
	if ($this->getFileEnclosure() != "none") {  
		while (false !== ($x27 = $x14->streamReadCsv($this->getFileSeparator(), $this->getFileEnclosure()))) { $x28 = $x4b($x27, $x23, 1); 
	$x4c($x27, $x28[0]); 
	$this->x58($x27); 
	foreach ($this->_sql as $x1d) {  
		$x24->streamWrite($x4d(array("
", "  "), array(" ", ""), $x48($x1d)) . "
"); 
		}  
	}  
	} else {  
		while (false !== ($x27 = $x14->streamReadCsv($this->getFileSeparator()))) {  
			$x28 = $x4b($x27, $x23, 1); 
		$x4c($x27, $x28[0]); 
		$this->x58($x27); 
		foreach ($this->_sql as $x1d) {  
			$x24->streamWrite($x4d(array("
", "  "), array(" ", " "), $x48($x1d)) . "
"); 
		}  
	}  
	}  
	Mage::$x47("--> File closed : " . $x15.$x25, null, "MassStockUpate.log"); 
	$x14->streamClose(); 
	if ($this->getAutoSetTotal() == 2) {  
		$x24->streamWrite("ALTER TABLE `" . $this->_tables["ai"] . "` ADD CONSTRAINT `CONST_advancedinventory_localstock_id` FOREIGN KEY (localstock_id) REFERENCES " . $this->_tables["aip"] . " (id) ON UPDATE CASCADE ON DELETE CASCADE;"); 
	}  
	$x24->streamClose(); 
	if ($x4e($this->_warnings)) Mage::getSingleton("core/session")->addError($x4f("<br>", ($this->_warnings))); 
	if (Mage::getStoreConfig("massstockupdate/settings/sh_mode")) {  
		return true; 
	}  
	$x29 = Mage::getSingleton("core/resource")->getConnection("core_write"); 
	$x29->beginTransaction(); 
	$x2a = true; 
	Mage::$x47("--> Executing MySql queries", null, "MassStockUpate.log"); 
	$x14 = new Varien_Io_File(); 
	$x14->streamOpen($x15 . $x25, "r"); 
	while (false !== ($x1d = $x14->streamRead(102400))) {  
		try { $x29->exec($x1d); 
	} catch (Mage_Core_Exception $x2b) {  
		Mage::$x47(" failed -->" . $x1d, null, "MassStockUpate.log"); 
		$x2a = false; 
	} catch (Exception $x2b) {  
		Mage::$x47(" failed -->" . $x1d, null, "MassStockUpate.log"); 
		Mage::getSingleton("core/session")->addError($x2b->getMessage()); 
		$x2a = false; 
	}  
	} if (!$x2a) {  
		Mage::$x47("--> MySql Rollback", null, "MassStockUpate.log"); 
		Mage::getSingleton("core/session")->addError(Mage::helper("massstockupdate")->__("Error while processing. Rollback happened.")); 
	$x29->rollback(); 
	return false; 
	} else {  
		Mage::$x47("--> MySql Commit", null, "MassStockUpate.log"); 
		$x29->commit(); 
		$this->setImportedAt(Mage::getSingleton("core/date")->gmtDate("Y-m-d H:i:s")); 
		$this->save(); 
		$x2c = Mage::getSingleton('index/indexer')->getProcessByCode('cataloginventory_stock'); 
		$x2c->reindexAll(); 
		Mage::$x47("--> Stock re-indexed", null, "MassStockUpate.log"); 
		$x14->open(array('path' => $x26)); 
		$x14->rm($x25); 
		return true; 
	}  
}  
 
 
 
 
 
 
 
private function x58($x2d) {  
	$x45 = "stristr"; 
	$x46 = "is_readable"; 
	$x47 = "log"; 
	$x48 = "trim"; 
 
	$x49 = "json_decode"; 
	$x4a = "in_array"; 
	$x4b = "array_splice"; 
	$x4c = "array_unshift"; 
	$x4d = "str_replace"; 
	$x4e = "count"; 
	$x4f = "implode"; 
	$x50 = "is_numeric"; 
	$x51 = "array_push"; 
	$x52 = "strtolower"; 
	$x53 = "strstr"; 
	$x54 = "explode"; 
	$x55 = "addslashes"; 
	$x56 = "time"; 
	$this->_sql = array(); 
	foreach ($x2d as $x2e => $x2f) $x2d[$x2e] = $x48($x2f); 
	if ($this->getUseCustomRules()) {  
		$x30 = $this->getCustomRules(); 
		eval($x4d('$C[', '$x2d[', $x30)); 
	}  
	$x31 = array(); 
	$x32 = array(); 
	if (isset($this->_products[$x2d[0]])) {  
		$x33 = $this->_products[$x2d[0]]; 
	if (isset($this->_stocks[$x33])) {  
		$x34 = $this->_stocks[$x33]; 
	} else {  
		$this->_autoInc++; 
		$x34 = $this->_autoInc ; 
	}  
	$x31["ID"] = $x33; 
	$x35 = true; 
	$x31["status"] = $x35; 
	$x31["total"] = 0; 
	$x31["in_stock"] = null; 
	$x36 = 0; 
	foreach ($x2d as $x21 => $x37) {  
		if (isset($this->_columns[$x21 - 1]) && $x21 > 0) {  
			if (!$this->_total) {  
				if ($x50($x37) && $x35) {  
					if ($this->_columns[$x21 - 1] != "total" && $this->_columns[$x21 - 1] != "is_in_stock" && ($this->_columns[$x21 - 1] == "used" || $x50($this->_columns[$x21 - 1]))) $x31["total"]+=$x37; 
	$x35 = true; 
	}  
	} else {  
	if ($this->_total && $this->_columns[$x21 - 1] == "total") {  
		$x31["total"] = $x37; 
		if ($x50($x37)) $x35 = true; 
		else $x35 = false; 
		}  
	}  
	if (Mage::helper("core")->isModuleEnabled("Wyomind_Advancedinventory") && $x35) {  
		if ($x50($x37) && $x50($this->_columns[$x21 - 1])) {  
			$x38 = " REPLACE INTO `" . $this->_tables["ai"] . "` (`id`, `localstock_id`,`place_id`,`quantity_in_stock`,`product_id`,`backorder_allowed`,`use_config_setting_for_backorders`) values(
                                  IF((SELECT count(`id`) FROM `" . $this->_tables["ai"] . "` AS a WHERE `place_id`=" . $this->_columns[$x21 - 1] . " AND  `product_id`=" . $x33 . ")=1,(SELECT `id` FROM " . $this->_tables["ai"] . " AS a WHERE `place_id`=" . $this->_columns[$x21 - 1] . " AND `product_id`=" . $x33 . "),NULL) ,$x34," . $this->_columns[$x21 - 1] . ",$x37,$x33,(SELECT `backorder_allowed` FROM `" . $this->_tables["ai"] . "` AS `b` WHERE `place_id`=" . $this->_columns[$x21 - 1] . " AND `product_id`=" . $x33 . "),IFNULL((SELECT `use_config_setting_for_backorders` FROM `" . $this->_tables["ai"] . "` AS `c` WHERE `place_id`=" . $this->_columns[$x21 - 1] . " AND `product_id`=" . $x33 . "),1));"; 
			$x51($this->_sql, $x38); 
			$x32[] = "-IFNULL((SELECT `quantity_in_stock` FROM `" . $this->_tables["ai"] . "` WHERE `place_id`=" . $this->_columns[$x21 - 1] . " AND  `product_id`=" . $x33 . " ),0)"; 
		}  
	} if (!$this->getAutoSetInstock()) {  
		if ($this->_is_in_stock && $this->_columns[$x21 - 1] == "is_in_stock") {  
			if ($x4a($x52($x37), array( 
				"1",  
				"true",  
				"yes",  
				"on",  
				"in stock",  
				"instock",  
				"available"))) $x31["in_stock"] = true; 
	else $x31["in_stock"] = false; 
	}  
	} else {  
		if ($x31["total"] > 0) $x31["in_stock"] = true; 
	else  
		$x31["in_stock"] = false; 
	}  
	if ($this->_manage_local_stock && $this->_columns[$x21 - 1] == "manage_local_stock") {  
		if ($x4a($x52($x37), array( 
							"1",  
							"true",  
							"yes",  
							"on",  
							"in stock",  
							"instock", 
							"available")))  
			$x31["manage_local_stock"] = 1; 
	else $x31["manage_local_stock"] = 0; 
	} else {  
		$x31["manage_local_stock"] = 1; 
	}  
	if ($x53($this->_columns[$x21 - 1], "attribute")) {  
		$x39 = ($x54('-', $this->_columns[$x21 - 1])); 
	$x3a = Mage::getSingleton("core/resource")->getTableName("catalog_product_entity_" . $x39[3]); 
	$x38 = "UPDATE `$x3a` SET `value`='" . $x55($x37) . "' WHERE `entity_id`='" . $x33 . "' AND `attribute_id`='" . $x39[2] . "'; 
	"; 
	$x51($this->_sql, $x38); 
	} $x31[$x36]["value"] = $x37; 
	$x31[$x36]["code"] = $this->_columns[$x21 - 1]; 
	$x36++; 
	} }; 
	$x31["status"] = $x35; 
	$x3b = $x31["total"]; 
	if ($this->getAutoSetTotal() == 2) { if ($x4e($x32)) $x3b = "(SELECT (IFNULL(SUM(`quantity_in_stock`),0)" . $x4f('', $x32) . "+$x3b) FROM " . $this->_tables["ai"] . " WHERE `product_id`=$x33)"; 
	else { $x35 = false; 
	} } $x3c = $x31["in_stock"]; 
	if (Mage::helper("core")->isModuleEnabled("Wyomind_Advancedinventory")) {  
		if ($x35) { $x38 = "REPLACE INTO `" . $this->_tables["aip"] . "` values($x34,$x33," . $x31["manage_local_stock"] . ",$x3b); 
	"; 
	$x4c($this->_sql, $x38); 
	} }  
	if (($x35)) {  
		if ($x3c === true || $x3c === false) {  
			$x3d = ", `is_in_stock`"; 
		$x3e = ($x3c) ? '1' : '0'; 
	if ($this->getAutoSetTotal() == 2) {  
		$x3e = " IF ($x3b>0,1,0)"; 
	}  
	} else {  
		$x3d = null; 
		$x3e = null; 
	}  
	$x38 = "UPDATE `" . $this->_tables["csi"] . "` SET " . "`qty`=$x3b" . "$x3d=$x3e WHERE `product_id`='$x33'; 
	"; 
	$x4c($this->_sql, $x38); 
	}  
	if ($x35) $this->_notices[] = "SKU <i>$x2d[0]</i> has been updated"; 
	else {  
		Mage::$x47("* Product #" . $x2d[0] . " has been ignored due to some non consistent data.", null, "MassStockUpate.log"); 
		$this->_warnings[] = "SKU <i>$x2d[0]</i> has been ignored due to some non consistent data."; 
	} $this->_output[] = $x31; 
	} else {  
		Mage::$x47("* Product #" . $x2d[0] . " doesn't exist. Product has been ignored.", null, "MassStockUpate.log"); 
		$this->_warnings[] = "SKU <i>$x2d[0]</i> doesn't exist. Product has been ignored."; 
		}  
	}  
 
	function backup() { $x45="stristr"; 
	$x46="is_readable"; 
	$x47="log"; 
	$x48="trim"; 
	$x49="json_decode"; 
	$x4a="in_array"; 
	$x4b="array_splice"; 
	$x4c="array_unshift"; 
	$x4d="str_replace"; 
	$x4e="count"; 
	$x4f="implode"; 
	$x50="is_numeric"; 
	$x51="array_push"; 
	$x52="strtolower"; 
	$x53="strstr"; 
	$x54="explode"; 
	$x55="addslashes"; 
	$x56="time"; 
	$x1d = array(); 
	$x3f = array(); 
	$x40 = array(); 
	$x1b = Mage::getSingleton("core/resource"); 
	$x1c = $x1b->getConnection("core_read"); 
	$this->_tables["csi"] = Mage::getSingleton("core/resource")->getTableName("cataloginventory_stock_item"); 
 
	$this->_tables["cpe"] = Mage::getSingleton("core/resource")->getTableName("catalog_product_entity"); 
	$x51($x1d, "LEFT JOIN `" . $this->_tables["cpe"] . "` AS `cpe` ON `cpe`.`entity_id`=`csi`.`product_id`"); 
	if (Mage::helper("core")->isModuleEnabled("Wyomind_Advancedinventory")) {  
		$x3f[] = null; 
		$x40[] = null; 
		$this->_tables["ai"] = Mage::getSingleton("core/resource")->getTableName("advancedinventory"); 
		$x41 = Mage::getModel("pointofsale/pointofsale")->getPlaces(); 
		foreach ($x41 as $x17) {  
			$x51($x1d, "LEFT JOIN `" . $this->_tables["ai"] . "` AS `ai_" . $x17->getPlaceId() . "` ON `ai_" . $x17->getPlaceId() . "`.`product_id`=`cpe`.`entity_id` AND `ai_" . $x17->getPlaceId() . "`.`place_id`=" . $x17->getPlaceId() . ""); 
			$x3f[] = "ai_" . $x17->getPlaceId() . ".`quantity_in_stock` AS `ai_stock_" . $x17->getPlaceId() . "`"; 
		}  
	}  
	$x4c($x1d, "SELECT  `cpe`.`sku` " . $x4f(', ', $x3f) . ", `csi`.`qty`,`csi`.`is_in_stock` FROM `" . $this->_tables["csi"] . "` AS `csi`"); 
	$x51($x1d, "WHERE `sku` IS NOT NULL " . $x4f(" AND ", $x40) . ""); 
	Mage::$x47("-------------------- BACKUP PROCESS --------------------", null, "MassStockUpate.log"); 
	Mage::$x47("---> MySql request : " . $x4f(' ', $x1d), null, "MassStockUpate.log"); 
	$x2d = $x1c->fetchAll($x4f(" ", $x1d)); 
	$x14 = new Varien_Io_File(); 
	$x14->setAllowCreateFolders(true); 
	$x42 = Mage::getStoreConfig("massstockupdate/settings/backup_file") . "-" . $x56() . ".csv"; 
	$x43 = Mage::getStoreConfig("massstockupdate/settings/backup_dir"); 
	$x14->open(array("path" => Mage::getBaseDir() . "/" . $x43)); 
	if ($x14->fileExists($x42) && !$x14->isWriteable($x42)) { Mage::throwException(Mage::helper("ordersexporttool")->__("File '%s' cannot be saved. Please, make sure the directory %s' is writeable by web server.", $x42, $this->getPath())); 
	} $x14->streamOpen($x42, "w"); 
	foreach ($x2d as $x44) {  
		$x14->streamWriteCsv($x44, ";"); 
	}  
	$x14->streamClose(); 
	Mage::getSingleton("core/session")->addSuccess(Mage::helper("massstockupdate")->__("Backup created :   '%s'.", $x43 . $x42)); 
	Mage::$x47("---> DONE : " . $x43 . $x42, null, "MassStockUpate.log"); 
	return; 
	}  
} ; 
 ?>

Did this file decode correctly?

Original Code

<?php



class Wyomind_Massstockupdate_Model_Import extends Mage_Core_Model_Abstract {





public $_warnings    = array();
public $_notices     = array();
public $_sql         = array();
public $_columns     = array();
public $_products    = array();
public $_stocks      = array();
public $_autoInc     = 0;
public $_tables      = array();
public $_total       = false;
public $_is_in_stock = false;
public $x12          = false;
public $_output      = array();
public $x13          = array();







public function _construct() { 
	$x45 = "\163t\162i\x73\164\162";
	$x46 = "\x69\163\137\x72ea\144a\142\x6c\x65";
	$x47 = "\x6c\x6f\x67";
	$x48 = "\164\162i\155";
	$x49 = "\152so\156\137d\x65\143\157\x64\145";
	$x4a = "i\156_\x61rr\x61y";
	$x4b = "\141\x72\x72\141\x79\137s\160\x6c\151\x63\145";
	$x4c = "a\x72\x72\141\171\x5fu\x6es\x68\151\146\164";
	$x4d = "\x73t\162\x5fr\x65p\x6c\141\143\x65";
	$x4e = "c\x6fun\164";
	$x4f = "\x69\x6d\160\x6c\157\x64e";
	$x50 = "i\x73_\156\165\155\x65ric";
	$x51 = "\x61rr\141y_p\x75\x73\150";
	$x52 = "\163t\162tol\157\x77\x65r";
	$x53 = "s\x74\x72\163\164\162";
	$x54 = "\x65x\160l\157\144e";
	$x55 = "\141\x64\144\163l\141s\150e\163";
	$x56 = "\x74i\155e";
	parent::_construct();
	$this->_init("\155\x61s\x73st\157\143\153\165\x70d\141te\57i\155\x70\157\162\164");
}







protected function _beforeSave() { 
	$x45="\x73t\x72\x69\163\x74\162";
	$x46 = "\x69s_\x72\145\x61d\x61b\154e";
	$x47 = "\x6co\x67";
	$x48 = "t\x72i\155";
	$x49 = "\x6a\163on\x5f\144\x65co\x64\145";
	$x4a = "\x69n\137\x61\162ray";
	$x4b = "\141rr\x61y_s\x70l\x69c\x65";
	$x4c = "\x61\162\x72\x61y\137\x75n\163\150\151\146\x74";
	$x4d = "s\164r_\x72\145\x70\x6c\x61\143e";
	$x4e = "c\157un\164";
	$x4f = "imp\154od\145";
	$x50 = "\151\x73\x5fn\165m\145\162ic";
	$x51 = "\x61\162\x72\141y\x5fp\x75\x73h";
	$x52 = "\163t\162\x74o\154\x6f\x77\145\x72";
	$x53 = "\163\x74\x72s\x74\162";
	$x54 = "\145\170p\x6c\157de";
	$x55 = "\141\144\144s\154\141s\x68\x65\163";
	$x56 = "t\x69\x6d\145";
	$x14 = new Varien_Io_File();
	$x15 = $x14->getCleanPath(Mage::getBaseDir() . "\57" . $this->getFilePath());
	if (!$x14->fileExists($x15, false)) { 
		Mage::throwException(Mage::helper("m\141\163s\163toc\x6b\x75\160\x64a\164\145")->__("\127r\x6f\156g\40\x66\151le p\141\x74\150.\x20'\x25\x73\47 i\x73\x20\x6e\157\164 a\x20\146i\x6ce\56", $x15));
	} 
	if ($x45($this->getFilePath(), ".\x63\x73\166") < 0) { 
		Mage::throwException(Mage::helper("m\141\163s\163toc\x6b\x75\160\x64a\164\145")->__("\x57ro\156g \146\x69l\145.\x20\x27\x25\163'\40\151\163\x20n\157t\x20\141\40c\163\166\x20f\151\x6c\145.", $x15));
	} 
	if (!$x46($x15)) { 
		Mage::throwException(Mage::helper("m\141\163s\163toc\x6b\x75\160\x64a\164\145")->__("\120le\x61s\x65 ma\x6b\x65\40s\x75\x72\145 \x74h\141\x74 \x27\45s\x27\x20i\163\x20\x72\x65\x61\x64\x61\x62\154e \x62\x79 web-\163\145\x72\x76e\162\x2e", $x15));
	} 
	return parent::_beforeSave();
} 









public function x57() { 
	$x45="\163\164r\151\x73t\162";
	$x46 = "i\x73_\162\145ad\x61b\154\145";
	$x47 = "\x6c\x6f\x67";
	$x48 = "t\162i\x6d";
	$x49 = "j\163o\x6e_\x64\145\x63\x6fd\145";
	$x4a = "\x69\156\x5f\x61\x72r\141\x79";
	$x4b = "a\162r\x61\x79\x5f\x73\160li\143e";
	$x4c = "\141rray\x5f\x75n\x73\x68\151\146\164";
	$x4d = "s\164r\137\x72\x65\x70la\143e";
	$x4e = "co\x75nt";
	$x4f ="i\155\160\154\157\x64\x65";
	$x50 ="i\x73\x5fn\165\155\x65\x72\x69c";
	$x51 ="\x61rr\x61\x79\137pu\163\150";
	$x52 ="\163t\x72\164\157low\145r";
	$x53 ="\x73\x74\x72\163\x74r";
	$x54 = "\x65\170p\154\x6fd\x65";
	$x55 = "\x61d\x64\163l\x61s\150\145\163";
	$x56 = "t i\x6de";
	$this->_warnings = array();
	$this->_notices = array();
	$this->_sql = array();
	$this->_columns = array();
	$this->_products = array();
	$this->_stocks = array();
	$this->_autoInc = 0;
	$this->_tables = array();
	$this->_total = false;
	$this->_output = array();
} 






public function importProcess() { 
	$x45="s\x74\x72\151\x73\164r";
	$x46="i\163\137r\x65\x61\x64\x61\x62\154\x65";
	$x47="\x6cog";
	$x48="tri\155";
	$x49="\x6a\x73\x6f\x6e\137\x64e\143\x6f\144e";
	$x4a="\151\x6e\137\x61r\162\x61y";
	$x4b="a\162\x72\x61y\x5fs\160\x6c\151\x63e";
	$x4c="a\162\x72\x61y\x5fu\x6e\163\150i\x66t";
	$x4d="\163\x74\162_\162\145pl\141c\145";
	$x4e="c\157u\x6e\x74";
	$x4f="\x69mp\154od\x65";
	$x50="is\137\x6e\165\155\x65\x72i\143";
	$x51="\141rra\171_\160\165\x73\x68";
	$x52="s\x74\x72\x74\x6f\x6cower";
	$x53="\x73tr\163\x74\x72";
	$x54="e\170\160lode";

	$x55="ad\144s\x6ca\x73\x68\145\163";
	$x56="\164\151\155\145";
	Mage::$x47("\x2d--\55\x2d\55-\55----\x2d-\55\x2d\55-\x2d\x2d\40\x49\x4d\x50\117\122\124A\124ION P\x52\x4f\x43ES\x53 \55--\x2d\x2d\x2d\55-\x2d-\55\55\x2d--", null, "M\x61s\x73\x53to\x63\153U\x70ate.l\x6fg");
	$this->x57();
	$x14 = new Varien_Io_File();
	$x15 = $x14->getCleanPath(Mage::getBaseDir() . "\57" . $this->getFilePath());
	$x14->streamOpen($x15, "\162");
	Mage::$x47("\x2d-\x3e Fi\154\145\x20\x6f\x70e\156\x65\x64\40: " . $x15, null, "M\x61s\x73\x53to\x63\153U\x70ate.l\x6fg");
	$x16 = Mage::getModel("\x63\141\x74\x61\154\157\x67/p\x72\157d\x75\x63\x74")->getCollection()->addAttributeToSelect("sk\165");
	foreach ($x16 as $x17) { 
		$this->_products[$x48($x17->getSku())] = $x17->getId();
	};
	Mage::$x47("-\55>\40\120r\157\144u\143t\x73\40\x63\157l\154\x65\143\164\x65\x64", null, "M\x61s\x73\x53to\x63\153U\x70ate.l\x6fg");
	if (Mage::helper("co\x72\145")->isModuleEnabled("\x57y\157\155ind_\x41\144\166\x61\x6e\x63\x65din\x76e\156\x74\157r\171")) { 
		$x18 = Mage::getModel("\141d\x76\141\x6ec\145d\x69\x6ev\x65nt\x6f\162\x79\57\141\144\166\141\156\143e\x64inv\145\x6e\x74\157\162yp\x72\x6fd\165\143t")->getCollection();
	foreach ($x18 as $x19) { 
		$this->_stocks[$x19->getProductId()] = $x19->getId();
	};
	Mage::$x47("\55\x2d\76 Lo\x63\141\x6c s\164\x6f\143k\x73\40\143o\154l\145c\164\x65\x64 \x28\101\x64va\156\x63e\x64 In\x76\145\156t\157\x72\171)", null, "M\x61s\x73\x53to\x63\153U\x70ate.l\x6fg");
	} 
	$x1a = array(
		"a\x63" => "\x61ct\x69\x76\x61\x74i\157\156\137\x63od\x65", 
		"\141k" => "activa\x74\x69o\x6e_k\x65y", 
		"\x62u" => "b\141\x73e\137u\162\x6c", 
		"\155\144" => "m\x64\65", 
		"\164\x68" => "\x74\150\x69s", 
		"\x64m" => "\137\x64\x65\155\157", 
		"\x65\170\164" => "m\163\151", 
		"\166e\162" => "\63\56\65\x2e\60"
	);
	$x1b = Mage::getSingleton("\x63\157re\x2f\x72\145\163\x6fu\162\x63e");
	$x1c = $x1b->getConnection("\x63\157\x72\145\x5f\162\145\141\x64");
	$this->_tables["\143si"] = Mage::getSingleton("\x63\157re\x2f\x72\145\163\x6fu\162\x63e")->getTableName("\x63\141t\141\154og\x69n\x76\x65\156\164\157ry\137\163t\x6f\x63\153\137\x69\164e\x6d");
	if (Mage::helper("co\x72\145")->isModuleEnabled("\x57y\157\155ind_\x41\144\166\x61\x6e\x63\x65din\x76e\156\x74\157r\171")) { 
		$this->_tables["ai\x70"] = Mage::getSingleton("\x63\157re\x2f\x72\145\163\x6fu\162\x63e")->getTableName("\x61\x64v\x61\156c\145d\x69\x6e\x76e\x6eto\x72\171\x5f\160\162\x6f\144\165c\164");
		$this->_tables["\x61i"] = Mage::getSingleton("\x63\157re\x2f\x72\145\163\x6fu\162\x63e")->getTableName("\141d\166\141\156\143\145d\151\x6e\166e\156tor\x79");
		$x1d = "\123E\114E\x43\x54\x20\x4dA\x58(\x69\144)\40\x41\123\x20INC\40\106R\x4f\x4d\x20" . $this->_tables["ai\x70"] . "\x20\73";
		$x1e = $x1c->fetchAll($x1d);
		$this->_autoInc = $x1e[0]["I\116\103"];
		Mage::$x47("-\55> \115ax \x69\156\x63\162e\155\x65n\x74 \x66ou\156\x64 \43" . $x1e[0]["I\116\103"] . "\x28\101\144v\x61\x6eced\40\111\x6e\x76ent\x6f\x72y\51", null, "M\x61s\x73\x53to\x63\153U\x70ate.l\x6fg");
	} 
	$x1f = array( 
		"activa\x74\x69o\x6e_k\x65y" => Mage::getStoreConfig("\x6d\x61sss\164\x6fc\153\x75pd\x61te\x2fl\151\x63\x65\156\163\145\57ac\164i\x76\x61t\x69\x6fn\x5fk\145\x79"), 
		"\x61ct\x69\x76\x61\x74i\157\156\137\x63od\x65" => Mage::getStoreConfig("ma\x73\163\163\x74\157\143\x6bupda\164\145\x2f\x6c\151\143\145\x6ese\x2f\141c\x74\151\x76atio\x6e\137\x63\x6f\x64e"), 
		"b\141\x73e\137u\162\x6c" => Mage::getStoreConfig("\x77\x65\142\57\163\145\143\165r\x65\57\142\141\163\x65\x5f\x75\162\154"), 
	);
	$x20 = $x49($this->getMapping());
	foreach ($x20->columns as $x21 => $x22) { 
		if (!$x4a($x22->id, array(
			"\156o\164\x2d\x75\163e\x64", 
			"\164ot\x61l", 
			"\x69s\137\151\x6e\x5fs\x74\157\143\153", 
			"man\x61g\x65\137\x6co\x63\141l\137\x73\x74\x6f\x63\x6b"))) { 
			$this->_columns[] = $x22->id;
		} elseif ($x4a($x22->id, array("\164ot\x61l"))) { 
			$this->_columns[] = "\164ot\x61l";
			$this->_total = $x21 + 1;
		} elseif ($x4a($x22->id, array("\x69s\137\151\x6e\x5fs\x74\157\143\153"))) { 
			$this->_columns[] = "\x69s\137\151\x6e\x5fs\x74\157\143\153";
			$this->_is_in_stock = $x21 + 1;
		} elseif ($x4a($x22->id, array("man\x61g\x65\137\x6co\x63\141l\137\x73\x74\x6f\x63\x6b"))) { 
			$this->_columns[] = "man\x61g\x65\137\x6co\x63\141l\137\x73\x74\x6f\x63\x6b";
		$this->_manage_local_stock = $x21 + 1;
		} else { 
			$this->_columns[] = false;
		} 
	} 
	Mage::$x47("\55\55\76 \x43o\154umn\x20\x6d\141\x70\x70\151\x6e\x67 \x61\156\141\154\x79\x7a\145\x64", null, "M\x61s\x73\x53to\x63\153U\x70ate.l\x6fg");
	if ($x1f[$x1a["a\x63"]] != $x1a["\155\144"]($x1a["\155\144"]($x1f[$x1a["\141k"]]) . $x1a["\155\144"]($x1f[$x1a["\x62u"]]) . $x1a["\155\144"]($x1a["\x65\170\164"]) . $x1a["\155\144"]($x1a["\166e\162"]))) { 
		$$x1a["\x65\170\164"] = "v\x61\x6c\151\144";
		$$x1a["\164\x68"]->$x1a["\x64m"] = true;
	} else { 
		$$x1a["\164\x68"]->$x1a["\x64m"] = false;
		$$x1a["\x65\170\164"] = "v\x61\x6c\151\144";
	} if (!isset($$x1a["\x65\170\164"]) || $$x1a["\164\x68"]->$x1a["\x64m"]) { 
		$$x1a["\164\x68"]->$x1a["\x64m"] = true;
		return $$x1a["\164\x68"];
	} 
	Mage::$x47("-\55\76\x20\x50\162e\x70\x61r\151n\x67\40\115\x79\x53q\x6c \161\x75\145\x72i\145s", null, "M\x61s\x73\x53to\x63\153U\x70ate.l\x6fg");
	$x23 = $this->getSkuOffset() - 1;
	$x24 = new Varien_Io_File();
	$x24->setAllowCreateFolders(true);
	$x25 = Mage::getStoreConfig("m\141\x73s\163\x74\x6fc\153\x75\160\x64at\145\57\163et\164\x69\x6eg\163/\163\161\x6c\x5f\146ile");
	$x26 = Mage::getStoreConfig("\x6da\163\x73s\164\157c\x6b\165pd\x61\164\x65\x2f\163e\164\164in\147\x73\x2f\163\x71l\137\x64i\162");
	$x15 = $x14->getCleanPath(Mage::getBaseDir() . '/' . $x26);
	if (!$x24->fileExists($x15, false)) { 
		Mage::throwException(Mage::helper('massstockupdate')->__('Please create the specified folder "%s".', $x15));
	} if (!$x24->isWriteable($x15)) { 
		Mage::throwException(Mage::helper('massstockupdate')->__('Please make sure that "%s" is writable by web-server.', $x15));
	} 
	$x24->open(array('path' => $x26));
	$x24->streamOpen($x25, 'w');
	if ($this->getAutoSetTotal() == 2) { 
		$x24->streamWrite("A\114\124ER\x20\124AB\114\105\x20\x60" . $this->_tables["\x61i"] . "\140\40DR\x4fP\x20\106\x4fRE\x49\x47N \113E\x59\x20\140C\117\x4eS\124\137\x61dv\x61\x6e\x63\145\x64in\x76\x65\x6e\x74\x6fr\x79\x5fl\x6fca\x6c\x73\164\x6fc\153_\x69\x64\x60;
	\x0a");
	} 
	if ($this->getFileEnclosure() != "n\x6f\x6ee") { 
		while (false !== ($x27 = $x14->streamReadCsv($this->getFileSeparator(), $this->getFileEnclosure()))) { $x28 = $x4b($x27, $x23, 1);
	$x4c($x27, $x28[0]);
	$this->x58($x27);
	foreach ($this->_sql as $x1d) { 
		$x24->streamWrite($x4d(array("\x0a", " \x20"), array("\x20", ""), $x48($x1d)) . "\x0a");
		} 
	} 
	} else { 
		while (false !== ($x27 = $x14->streamReadCsv($this->getFileSeparator()))) { 
			$x28 = $x4b($x27, $x23, 1);
		$x4c($x27, $x28[0]);
		$this->x58($x27);
		foreach ($this->_sql as $x1d) { 
			$x24->streamWrite($x4d(array("\x0a", " \x20"), array("\x20", "\x20"), $x48($x1d)) . "\x0a");
		} 
	} 
	} 
	Mage::$x47("\55\x2d>\40\106\151l\x65\40\x63\154o\x73\x65\144\x20\x3a\40" . $x15.$x25, null, "M\x61s\x73\x53to\x63\153U\x70ate.l\x6fg");
	$x14->streamClose();
	if ($this->getAutoSetTotal() == 2) { 
		$x24->streamWrite("A\114\124\x45\122 T\x41\x42L\x45 `" . $this->_tables["\x61i"] . "\140 A\104\x44\x20\x43ONS\x54RAI\x4e\124\40\140CO\116\123\124\137a\144v\141\156\143ed\x69\156\x76\145n\164\157\162\x79\137\154\x6f\x63\141\154s\x74\x6f\143k_\x69\144\140 \x46\x4f\x52E\x49GN \x4b\x45\131\40(\x6co\x63\141l\163t\157\x63\x6b_id)\x20\x52\105F\105\122\x45\x4e\103E\x53\x20" . $this->_tables["ai\x70"] . "\40(i\144\x29\40\117\116\40UP\104A\124\x45\40C\x41S\103\101\104\105 \x4f\116 \x44\105\x4c\x45\x54\x45 \103\x41\x53CA\104E\73");
	} 
	$x24->streamClose();
	if ($x4e($this->_warnings)) Mage::getSingleton("\x63\157r\x65\x2fs\145\x73\x73i\157n")->addError($x4f("\74\142\162\76", ($this->_warnings)));
	if (Mage::getStoreConfig("ma\163s\x73\164o\143\153u\160\x64\141\164e\57\x73\145t\x74\x69\x6e\x67\163\x2f\163\150_\x6do\x64e")) { 
		return true;
	} 
	$x29 = Mage::getSingleton("\x63\157re\x2f\x72\145\163\x6fu\162\x63e")->getConnection("\143\157\x72\x65\x5f\167\162\151\164\x65");
	$x29->beginTransaction();
	$x2a = true;
	Mage::$x47("\55\x2d\76\x20\x45\170\x65c\x75t\151ng \x4d\x79S\x71\x6c \161\165\x65ri\145\x73", null, "M\x61s\x73\x53to\x63\153U\x70ate.l\x6fg");
	$x14 = new Varien_Io_File();
	$x14->streamOpen($x15 . $x25, "\162");
	while (false !== ($x1d = $x14->streamRead(102400))) { 
		try { $x29->exec($x1d);
	} catch (Mage_Core_Exception $x2b) { 
		Mage::$x47("\40\x66a\151l\145\x64\x20\x2d-\76" . $x1d, null, "M\x61s\x73\x53to\x63\153U\x70ate.l\x6fg");
		$x2a = false;
	} catch (Exception $x2b) { 
		Mage::$x47("\40\x66a\151l\145\x64\x20\x2d-\76" . $x1d, null, "M\x61s\x73\x53to\x63\153U\x70ate.l\x6fg");
		Mage::getSingleton("\x63\157r\x65\x2fs\145\x73\x73i\157n")->addError($x2b->getMessage());
		$x2a = false;
	} 
	} if (!$x2a) { 
		Mage::$x47("\55\x2d\76\40\x4d\x79\x53q\x6c\40R\157ll\x62a\x63\x6b", null, "M\x61s\x73\x53to\x63\153U\x70ate.l\x6fg");
		Mage::getSingleton("\x63\157r\x65\x2fs\145\x73\x73i\157n")->addError(Mage::helper("m\141\163s\163toc\x6b\x75\160\x64a\164\145")->__("E\x72\162\x6f\162 \167\x68\151\154\145\40\160r\x6f\143\145\x73\x73\x69\156\147\x2e \x52ollba\x63k \150\x61\160\x70\145ned\x2e"));
	$x29->rollback();
	return false;
	} else { 
		Mage::$x47("\55\55>\40M\171S\x71\154\x20C\157mm\151t", null, "M\x61s\x73\x53to\x63\153U\x70ate.l\x6fg");
		$x29->commit();
		$this->setImportedAt(Mage::getSingleton("\x63o\x72e\x2f\144\x61t\x65")->gmtDate("Y-\155-\144 \x48\72\x69\72s"));
		$this->save();
		$x2c = Mage::getSingleton('index/indexer')->getProcessByCode('cataloginventory_stock');
		$x2c->reindexAll();
		Mage::$x47("\x2d\55\x3e \x53t\157\x63\153\40re\55in\144\145x\145\144", null, "M\x61s\x73\x53to\x63\153U\x70ate.l\x6fg");
		$x14->open(array('path' => $x26));
		$x14->rm($x25);
		return true;
	} 
} 







private function x58($x2d) { 
	$x45 = "\163\164\162\151\163\x74\162";
	$x46 = "i\x73\137r\145\x61d\141b\154\145";
	$x47 = "lo\x67";
	$x48 = "t\162\151\x6d";

	$x49 = "\x6ason\137\x64\145c\157d\x65";
	$x4a = "i\x6e\x5far\x72\141y";
	$x4b = "a\x72r\x61y\137\x73p\154\151\x63e";
	$x4c = "a\x72\162\141\171_u\x6e\163h\151\x66t";
	$x4d = "s\x74\162_r\145\160l\x61ce";
	$x4e = "c\x6f\165\156t";
	$x4f = "i\155\160l\x6f\x64\x65";
	$x50 = "\x69s\137\156ume\162\151\x63";
	$x51 = "\x61\162ra\x79_\x70\x75\163h";
	$x52 = "\x73\x74\162\x74\x6fl\157\x77\x65r";
	$x53 = "\163\x74r\x73\164\162";
	$x54 = "e\170p\154\157\x64\x65";
	$x55 = "\141d\x64\163l\x61\x73h\145\163";
	$x56 = "\164\151m\145";
	$this->_sql = array();
	foreach ($x2d as $x2e => $x2f) $x2d[$x2e] = $x48($x2f);
	if ($this->getUseCustomRules()) { 
		$x30 = $this->getCustomRules();
		eval($x4d('$C[', '$x2d[', $x30));
	} 
	$x31 = array();
	$x32 = array();
	if (isset($this->_products[$x2d[0]])) { 
		$x33 = $this->_products[$x2d[0]];
	if (isset($this->_stocks[$x33])) { 
		$x34 = $this->_stocks[$x33];
	} else { 
		$this->_autoInc++;
		$x34 = $this->_autoInc ;
	} 
	$x31["\111\104"] = $x33;
	$x35 = true;
	$x31["\x73\x74\x61t\x75\x73"] = $x35;
	$x31["\164ot\x61l"] = 0;
	$x31["in_\163\164\157\x63\153"] = null;
	$x36 = 0;
	foreach ($x2d as $x21 => $x37) { 
		if (isset($this->_columns[$x21 - 1]) && $x21 > 0) { 
			if (!$this->_total) { 
				if ($x50($x37) && $x35) { 
					if ($this->_columns[$x21 - 1] != "\164ot\x61l" && $this->_columns[$x21 - 1] != "\x69s\137\151\x6e\x5fs\x74\157\143\153" && ($this->_columns[$x21 - 1] == "\x75\163\145d" || $x50($this->_columns[$x21 - 1]))) $x31["\164ot\x61l"]+=$x37;
	$x35 = true;
	} 
	} else { 
	if ($this->_total && $this->_columns[$x21 - 1] == "\164ot\x61l") { 
		$x31["\164ot\x61l"] = $x37;
		if ($x50($x37)) $x35 = true;
		else $x35 = false;
		} 
	} 
	if (Mage::helper("co\x72\145")->isModuleEnabled("\x57y\157\155ind_\x41\144\166\x61\x6e\x63\x65din\x76e\156\x74\157r\171") && $x35) { 
		if ($x50($x37) && $x50($this->_columns[$x21 - 1])) { 
			$x38 = " \122\105\x50LA\x43\105\40\111N\x54O\40\x60" . $this->_tables["\x61i"] . "`\40(\x60\151\x64`\x2c\40`l\157c\141\154\163\x74o\143\x6b\x5fi\144\140\54\140\x70\x6c\141\x63\145\137i\x64`\x2c\140q\x75a\156t\151\164\171_i\156_\x73\164o\x63k\140,\140p\x72\x6fd\165\143\164\137\151d`\x2c`b\141c\x6bo\162\x64\145r_a\154lo\167\x65d`,`\x75s\x65\137\143\157n\x66\151\x67\x5f\x73\145t\x74\x69\x6e\147_\x66\x6fr\137\x62a\x63\x6b\157r\x64\x65rs\x60\51\x20v\141\x6c\x75\145\x73\50\x0d\x0a \x20\40\x20 \x20 \x20\x20\40\x20\40 \x20\40 \x20\40 \40 \x20 \x20 \x20\40 \40\x20 \x20\x20 \111\106\x28(S\x45\x4c\105\103T\40\143\x6f\165\x6et\x28\140i\x64\x60\x29\40\x46RO\x4d `" . $this->_tables["\x61i"] . "\x60\40\101S\40a\x20\x57\x48E\122E `\x70la\143\145\x5fid\140=" . $this->_columns[$x21 - 1] . "\40\x41N\x44\x20 \140\160\162o\x64uc\x74_i\x64\140=" . $x33 . ")\75\61,\50\123\105\x4c\105\x43T\x20\x60\x69\144\x60\x20\106ROM\40" . $this->_tables["\x61i"] . "\x20\101\123\x20\x61\40W\x48\105\x52E\x20\140\x70\154\x61\143\x65\x5f\151\144\140\75" . $this->_columns[$x21 - 1] . " \x41\116\104\x20`\x70\162\x6fdu\143t\137\x69d\x60\75" . $x33 . "),NULL) ,$x34," . $this->_columns[$x21 - 1] . ",$x37,$x33,(SELECT `backorder_allowed` FROM `" . $this->_tables["\x61i"] . "`\x20AS\40\x60\x62\x60\40\127\110\105R\x45 `\x70\x6c\x61\143e\x5fid`=" . $this->_columns[$x21 - 1] . " \x41\116\104\x20`\x70\162\x6fdu\143t\137\x69d\x60\75" . $x33 . "\x29\x2c\111\106\116UL\114(\50\x53E\114\x45CT \x60us\x65\x5f\x63\157\x6e\146\x69g\x5f\163\x65\164t\151n\x67\x5f\146\157\x72\x5fba\143\x6b\157\162\x64\145\162s`\40F\x52\117\x4d\40\x60" . $this->_tables["\x61i"] . "\140\x20\101\x53 `\143\140\40\127H\x45\122\x45\40\x60p\154a\x63\145\137\151\144\140=" . $this->_columns[$x21 - 1] . " \x41\116\104\x20`\x70\162\x6fdu\143t\137\x69d\x60\75" . $x33 . ")\54\61\x29\51\x3b";
			$x51($this->_sql, $x38);
			$x32[] = "\x2d\111\106\116UL\x4c\50\50\x53EL\x45\x43T \x60\x71u\x61n\164i\x74\171\x5f\x69n\137\163t\157c\153` \x46\x52\117M\40\x60" . $this->_tables["\x61i"] . "\140\40\x57\110\105\x52\105\x20`\160\154\x61\143\145_i\x64`\x3d" . $this->_columns[$x21 - 1] . "\40\x41N\x44\x20 \140\160\162o\x64uc\x74_i\x64\140=" . $x33 . " \51\x2c\60\51";
		} 
	} if (!$this->getAutoSetInstock()) { 
		if ($this->_is_in_stock && $this->_columns[$x21 - 1] == "\x69s\137\151\x6e\x5fs\x74\157\143\153") { 
			if ($x4a($x52($x37), array(
				"\61", 
				"\x74\x72\x75\x65", 
				"y\x65\x73", 
				"\x6fn", 
				"\x69n s\164\157c\x6b", 
				"i\x6e\163\x74\157\x63\153", 
				"\141\166\x61i\x6cab\x6ce"))) $x31["in_\163\164\157\x63\153"] = true;
	else $x31["in_\163\164\157\x63\153"] = false;
	} 
	} else { 
		if ($x31["\164ot\x61l"] > 0) $x31["in_\163\164\157\x63\153"] = true;
	else 
		$x31["in_\163\164\157\x63\153"] = false;
	} 
	if ($this->_manage_local_stock && $this->_columns[$x21 - 1] == "man\x61g\x65\137\x6co\x63\141l\137\x73\x74\x6f\x63\x6b") { 
		if ($x4a($x52($x37), array(
							"\61", 
							"\x74\x72\x75\x65", 
							"y\x65\x73", 
							"\x6fn", 
							"\x69n s\164\157c\x6b", 
							"i\x6e\163\x74\157\x63\153",
							"\141\166\x61i\x6cab\x6ce"))) 
			$x31["man\x61g\x65\137\x6co\x63\141l\137\x73\x74\x6f\x63\x6b"] = 1;
	else $x31["man\x61g\x65\137\x6co\x63\141l\137\x73\x74\x6f\x63\x6b"] = 0;
	} else { 
		$x31["man\x61g\x65\137\x6co\x63\141l\137\x73\x74\x6f\x63\x6b"] = 1;
	} 
	if ($x53($this->_columns[$x21 - 1], "\141\164\x74\x72i\x62\165\164e")) { 
		$x39 = ($x54('-', $this->_columns[$x21 - 1]));
	$x3a = Mage::getSingleton("\x63\157re\x2f\x72\145\163\x6fu\162\x63e")->getTableName("cat\x61\x6co\x67_\x70r\157\144\x75\x63t\137\145\156\164i\x74\x79_" . $x39[3]);
	$x38 = "UPDATE `$x3a` SET `value`='" . $x55($x37) . "'\40\127HE\122\x45 \140ent\x69\164\x79\x5fid\140\75'" . $x33 . "\47\x20\101ND\x20`a\x74\164ri\x62\165\164e\137\151\x64\140\75'" . $x39[2] . "';
	";
	$x51($this->_sql, $x38);
	} $x31[$x36]["valu\x65"] = $x37;
	$x31[$x36]["\x63od\145"] = $this->_columns[$x21 - 1];
	$x36++;
	} };
	$x31["\x73\x74\x61t\x75\x73"] = $x35;
	$x3b = $x31["\164ot\x61l"];
	if ($this->getAutoSetTotal() == 2) { if ($x4e($x32)) $x3b = "\50SE\x4c\x45\x43T\40\x28\111\106\x4e\125\114L(\123U\115\x28\x60\161\x75\141n\x74it\x79\x5f\x69n_\x73t\x6f\x63k\140\x29\x2c\x30\51" . $x4f('', $x32) . "+$x3b) FROM " . $this->_tables["\x61i"] . " WHERE `product_id`=$x33)";
	else { $x35 = false;
	} } $x3c = $x31["in_\163\164\157\x63\153"];
	if (Mage::helper("co\x72\145")->isModuleEnabled("\x57y\157\155ind_\x41\144\166\x61\x6e\x63\x65din\x76e\156\x74\157r\171")) { 
		if ($x35) { $x38 = "R\x45\x50\114A\x43E\x20\x49\x4eT\x4f\x20\140" . $this->_tables["ai\x70"] . "` values($x34,$x33," . $x31["man\x61g\x65\137\x6co\x63\141l\137\x73\x74\x6f\x63\x6b"] . ",$x3b);
	";
	$x4c($this->_sql, $x38);
	} } 
	if (($x35)) { 
		if ($x3c === true || $x3c === false) { 
			$x3d = "\54 \x60is\x5fin\x5f\x73t\157c\x6b\140";
		$x3e = ($x3c) ? '1' : '0';
	if ($this->getAutoSetTotal() == 2) { 
		$x3e = " IF ($x3b>0,1,0)";
	} 
	} else { 
		$x3d = null;
		$x3e = null;
	} 
	$x38 = "\125\120DA\124\105\x20\140" . $this->_tables["\143si"] . "\x60\x20S\x45T\40" . "`qty`=$x3b" . "$x3d=$x3e WHERE `product_id`='$x33';
	";
	$x4c($this->_sql, $x38);
	} 
	if ($x35) $this->_notices[] = "SKU <i>$x2d[0]</i> has been updated";
	else { 
		Mage::$x47("* \x50\162\x6fd\165\x63\x74\40#" . $x2d[0] . "\x20\150\141s\x20\x62e\145n i\147\x6eor\145d \x64\x75\145\x20\x74\x6f\x20\x73o\x6d\x65\x20\x6e\157n\40\x63ons\x69\163\164\x65\x6et\x20d\x61ta\x2e", null, "M\x61s\x73\x53to\x63\153U\x70ate.l\x6fg");
		$this->_warnings[] = "SKU <i>$x2d[0]</i> has been ignored due to some non consistent data.";
	} $this->_output[] = $x31;
	} else { 
		Mage::$x47("* \x50\162\x6fd\165\x63\x74\40#" . $x2d[0] . "\x20d\157\145\x73n\x27\164\40\145\x78\151\x73t.\x20\x50\x72\x6f\x64\x75\x63t\x20\150\x61\163 \142\x65en\x20\151\147\156\x6f\162\x65d\x2e", null, "M\x61s\x73\x53to\x63\153U\x70ate.l\x6fg");
		$this->_warnings[] = "SKU <i>$x2d[0]</i> doesn't exist. Product has been ignored.";
		} 
	} 

	function backup() { $x45="\x73t\162i\163\164\162";
	$x46="\151\x73\x5f\162ead\x61\x62le";
	$x47="\x6c\x6f\147";
	$x48="\x74\x72\151\x6d";
	$x49="j\x73\157\x6e_d\145c\157\x64\x65";
	$x4a="in\137\x61rray";
	$x4b="a\x72\x72a\x79\x5fs\160\x6c\x69\x63\145";
	$x4c="a\x72r\x61\x79_un\163hi\146t";
	$x4d="\163\164r\137\162\145\x70\154a\x63\145";
	$x4e="c\x6f\x75\x6e\x74";
	$x4f="\x69\155\x70\x6c\157\144\x65";
	$x50="\151\x73\x5fn\x75m\x65r\x69c";
	$x51="ar\x72\x61y\137p\x75\x73h";
	$x52="\x73\x74\x72\x74\x6f\154\157\167\x65r";
	$x53="s\164rs\164\x72";
	$x54="e\170\x70\x6c\x6fde";
	$x55="\x61ddslashes";
	$x56="t\x69\x6d\145";
	$x1d = array();
	$x3f = array();
	$x40 = array();
	$x1b = Mage::getSingleton("\x63\157re\x2f\x72\145\163\x6fu\162\x63e");
	$x1c = $x1b->getConnection("\x63\157\x72\145\x5f\162\145\141\x64");
	$this->_tables["\143si"] = Mage::getSingleton("\x63\157re\x2f\x72\145\163\x6fu\162\x63e")->getTableName("\x63\141t\141\154og\x69n\x76\x65\156\164\157ry\137\163t\x6f\x63\153\137\x69\164e\x6d");

	$this->_tables["c\160\145"] = Mage::getSingleton("\x63\157re\x2f\x72\145\163\x6fu\162\x63e")->getTableName("\143\141\x74\141\154o\147\x5f\160\162o\x64\x75\x63t\x5fe\156\x74ity");
	$x51($x1d, "LE\106\124\x20\112\117\111N\x20\x60" . $this->_tables["c\160\145"] . "`\40\101\123\x20\140\143\x70e\140\x20O\x4e\40`c\160\145`.`\x65\156\164\151\164y\137\151\144\x60\75`c\x73\x69\x60.\x60\x70\x72\x6fd\165\143\164\x5fi\x64\x60");
	if (Mage::helper("co\x72\145")->isModuleEnabled("\x57y\157\155ind_\x41\144\166\x61\x6e\x63\x65din\x76e\156\x74\157r\171")) { 
		$x3f[] = null;
		$x40[] = null;
		$this->_tables["\x61i"] = Mage::getSingleton("\x63\157re\x2f\x72\145\163\x6fu\162\x63e")->getTableName("\141d\166\141\156\143\145d\151\x6e\166e\156tor\x79");
		$x41 = Mage::getModel("\160\157\151\156\x74\157\146\163\x61\154e\57poi\x6et\157fsale")->getPlaces();
		foreach ($x41 as $x17) { 
			$x51($x1d, "LE\106\124\x20\112\117\111N\x20\x60" . $this->_tables["\x61i"] . "\x60\x20\101\x53\40\140\141\x69\137" . $x17->getPlaceId() . "\140\x20\x4fN\x20\x60ai_" . $x17->getPlaceId() . "\140.\x60\160\162od\x75ct_\151\x64`\75`cp\x65\140\x2e\140e\156ti\164y\137\x69\144`\x20A\x4e\104\40\x60a\151\x5f" . $x17->getPlaceId() . "\140\x2e\x60\160\154a\x63\145_\151\144\140\75" . $x17->getPlaceId() . "");
			$x3f[] = "a\x69\x5f" . $x17->getPlaceId() . "\x2e`\161\165\141\x6et\x69\164\171\137\151\156\x5f\163t\x6fc\x6b\140\40\101\x53\40\x60\141\x69\137\163\164oc\153\x5f" . $x17->getPlaceId() . "\140";
		} 
	} 
	$x4c($x1d, "S\105\x4cEC\124\40\40`\143\x70e`.\x60\163\153u\140 " . $x4f(', ', $x3f) . ",\x20\x60\143\163\151\x60\56`\161t\171`,\x60c\163i\x60\56\140\x69\163\x5f\x69\156\137\163\164o\143\153\x60\40F\122O\x4d\x20`" . $this->_tables["\143si"] . "`\40\101\123\x20\140c\163i\x60");
	$x51($x1d, "WH\x45\122\x45 `\x73\x6b\x75\x60 \x49S \116O\124\x20\116U\x4c\x4c\40" . $x4f(" \101N\104\x20", $x40) . "");
	Mage::$x47("\55--\55-\55--\55---\x2d--\x2d\55\55\x2d\x2d\40B\x41CK\125\120\40\120R\117\x43\105\123\123\40-\x2d\x2d\x2d\x2d\x2d-\55\x2d-\55\55\x2d\55--\x2d-\55\x2d", null, "M\x61s\x73\x53to\x63\153U\x70ate.l\x6fg");
	Mage::$x47("-\x2d\x2d\76 \115y\123\x71l\40r\x65q\165\145\163\164\40\x3a " . $x4f(' ', $x1d), null, "M\x61s\x73\x53to\x63\153U\x70ate.l\x6fg");
	$x2d = $x1c->fetchAll($x4f("\x20", $x1d));
	$x14 = new Varien_Io_File();
	$x14->setAllowCreateFolders(true);
	$x42 = Mage::getStoreConfig("\155a\163\163s\x74\x6f\x63\153u\160\x64at\145/s\x65\x74\x74i\x6e\147\x73\x2f\x62a\143\153\165\x70\x5f\146\151\154\x65") . "-" . $x56() . ".\x63\x73\166";
	$x43 = Mage::getStoreConfig("m\141\163\163\x73\x74\157\x63\153\165\x70\144a\x74e/\x73\145\164\164\151\156g\x73\x2f\x62ac\153\x75\160\x5f\144i\162");
	$x14->open(array("\160\x61\x74h" => Mage::getBaseDir() . "\57" . $x43));
	if ($x14->fileExists($x42) && !$x14->isWriteable($x42)) { Mage::throwException(Mage::helper("\157r\144\145\x72\x73\145\170\160o\x72\x74\164\x6f\x6f\154")->__("\x46\x69\154\145\40\x27\45s\x27\x20\143\x61\x6e\x6eot\x20\142\x65\40\163\141ve\144.\x20\x50l\145a\x73\145\x2c\40\x6d\141k\x65\40\x73\165r\x65 th\x65\x20\x64\151\162\145\143\164\x6f\162y\x20\45\x73\x27\40\151\163 writ\x65a\x62\x6c\x65\x20by\x20w\x65b\40s\x65\x72v\145r\x2e", $x42, $this->getPath()));
	} $x14->streamOpen($x42, "w");
	foreach ($x2d as $x44) { 
		$x14->streamWriteCsv($x44, ";");
	} 
	$x14->streamClose();
	Mage::getSingleton("\x63\157r\x65\x2fs\145\x73\x73i\157n")->addSuccess(Mage::helper("m\141\163s\163toc\x6b\x75\160\x64a\164\145")->__("\x42\141c\x6bu\x70 \143\162\x65a\164\x65\144\x20\x3a\40\x20\40'%s\47\56", $x43 . $x42));
	Mage::$x47("-\55\x2d\x3e \104\x4f\x4e\x45\x20\x3a\x20" . $x43 . $x42, null, "M\x61s\x73\x53to\x63\153U\x70ate.l\x6fg");
	return;
	} 
} ;

Function Calls

None

Variables

None

Stats

MD5 69d41ecf375249622e0adbce413f90dd
Eval Count 0
Decode Time 180 ms