$json = json_encode($return_data); echo $json; exit; } break; case 'delete_manufacturers_images': if ($this->ADMIN_USER) { $return_data = array(); $image_filename = $this->post['image_filename']; $mid = 0; if ($this->post['mid'] > 0) { $mid = $this->post['mid']; } $filter = array(); $filter[] = 'manufacturers_image=\'' . addslashes($image_filename) . '\''; $count = mslib_befe::getCount('', 'tx_multishop_manufacturers', '', $filter); if ($count < 2) { // Only delete the file is we have found 1 category using it mslib_befe::deleteManufacturerImage($image_filename); } if ($mid > 0) { $updateArray = array(); $updateArray['manufacturers_image'] = ''; $query = $GLOBALS['TYPO3_DB']->UPDATEquery('tx_multishop_manufacturers', 'manufacturers_id=\'' . $mid . '\'', $updateArray); $res = $GLOBALS['TYPO3_DB']->sql_query($query); } if ($this->ms['MODULES']['ADMIN_CROP_MANUFACTURERS_IMAGES']) { if (is_numeric($cid) && $cid > 0) { $qry = $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_multishop_manufacturers_crop_image_coordinate', 'image_filename=\'' . addslashes($image_filename) . '\' and manufacturers_id=\'' . $pid . '\''); } else { $qry = $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_multishop_manufacturers_crop_image_coordinate', 'image_filename=\'' . addslashes($image_filename) . '\'');
public function deleteManufacturer($id) { if (is_numeric($id)) { $record = mslib_befe::getRecord($id, 'tx_multishop_manufacturers', 'manufacturers_id'); if ($record['manufacturers_image']) { $filter = array(); $filter[] = 'manufacturers_image=\'' . addslashes($record['manufacturers_image']) . '\''; $count = mslib_befe::getCount('', 'tx_multishop_manufacturers', '', $filter); if ($count < 2) { // Only delete the file is we have found 1 category using it mslib_befe::deleteManufacturersImage($record['manufacturers_image']); } } $qry = $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_multishop_manufacturers', 'manufacturers_id=' . $id); $qry = $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_multishop_manufacturers_cms', 'manufacturers_id=' . $id); $qry = $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_multishop_manufacturers_info', 'manufacturers_id=' . $id); } }
case 'tr_parent_name_en': $colType = 'varchar(50) default \'\''; break; } if ($colType) { $str = 'ALTER TABLE `tx_multishop_orders` ADD ' . $type . '_' . $col . ' ' . $colType . ', ADD KEY `' . $type . '_' . $col . '` (`' . $type . '_' . $col . '`)'; //error_log($str); $qry = $GLOBALS['TYPO3_DB']->sql_query($str); $messages[] = $str; } } } } $filter = array(); $filter[] = 'billing_tr_iso_nr=0'; $count = mslib_befe::getCount('', 'tx_multishop_orders', '', $filter); if ($count) { $str = 'SELECT o.orders_id, o.billing_country,o.delivery_country, o.billing_tr_iso_nr, o.delivery_tr_iso_nr from tx_multishop_orders o'; $query = $GLOBALS['TYPO3_DB']->sql_query($str); $rows = $GLOBALS['TYPO3_DB']->sql_num_rows($query); while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($query)) != false) { if (!$row['billing_tr_iso_nr']) { $types = array(); $types[] = 'billing'; $types[] = 'delivery'; foreach ($types as $type) { $str2 = 'select st.* from static_countries sc, static_territories st where sc.cn_short_en=\'' . addslashes($row[$type . '_country']) . '\' and st.tr_iso_nr=sc.cn_parent_tr_iso_nr'; $query2 = $GLOBALS['TYPO3_DB']->sql_query($str2); $rows2 = $GLOBALS['TYPO3_DB']->sql_num_rows($query2); if ($rows2) { $row2 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($query2);