// Clean ajax.php

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16081 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rGaillard
2012-06-19 13:20:07 +00:00
parent 8a5ee83850
commit 2efce57799
3 changed files with 46 additions and 36 deletions
@@ -2490,5 +2490,45 @@ class AdminImportControllerCore extends AdminController
{
$this->warnings[] = $product_name.(isset($product_id) ? ' (ID '.$product_id.')' : '').' '.Tools::displayError($message);
}
public function ajaxProcessSaveImportMatchs()
{
if ($this->tabAccess['edit'] === '1')
{
$match = implode('|', Tools::getValue('type_value'));
Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'import_match` (
`id_import_match` ,
`name` ,
`match`,
`skip`
)
VALUES (
NULL ,
\''.pSQL(Tools::getValue('newImportMatchs')).'\',
\''.pSQL($match).'\',
\''.pSQL(Tools::getValue('skip')).'\'
)');
die('{"id" : "'.Db::getInstance()->Insert_ID().'"}');
}
}
public function ajaxProcessLoadImportMatchs()
{
if ($this->tabAccess['edit'] === '1')
{
$return = Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'import_match` WHERE `id_import_match` = '.(int)Tools::getValue('idImportMatchs'));
die('{"id" : "'.$return[0]['id_import_match'].'", "matchs" : "'.$return[0]['match'].'", "skip" : "'.$return[0]['skip'].'"}');
}
}
public function ajaxProcessDeleteImportMatchs()
{
if ($this->tabAccess['edit'] === '1')
{
Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'import_match` WHERE `id_import_match` = '.(int)Tools::getValue('idImportMatchs'));
die;
}
}
}