Exec($sql);
echo mysql_insert_id();
}
}
if ($task == 'editPoint') {
$array['itemid'] = Tools_Http::Post('itemid', true);
$array['name'] = $DB->Escape(Tools_Http::Post('name'));
$array['address'] = $DB->Escape(Tools_Http::Post('address'));
$array['information'] = $DB->Escape(Tools_Http::Post('information'));
$array['city_id'] = Tools_Http::Post('city_id', true);
$errors = array();
if (sizeof($errors)) {
?>
} else {
$points = new Products_deliveryPoints();
if($array['itemid']>0)
$result = $points -> updatePoint ($array['itemid'],$array);
else
$result = $points -> insertPoint ($array);
?>
}
exit;
}
if ($task == 'editCity') {
$array['itemid'] = Tools_Http::Post('itemid', true);
$array['name'] = $DB->Escape(Tools_Http::Post('name'));
$errors = array();
if (sizeof($errors)) {
?>
} else {
$points = new Products_deliveryPoints();
if($array['itemid']>0)
$result = $points -> updateCity ($array['itemid'],$array);
else
$result = $points -> addCity ($array);
?>
}
exit;
}
if (!empty($errors)) {
echo 'ER|'.$err_msg.'|'.implode(',',$errors);
}