if ($result[0] == true) {
         echo $result[1];
     } else {
         echo "Произошла ошибка {$result[1]} при импорте офферов";
     }
     exit;
     break;
 case 'import_sales':
     // Convert currency
     $amount = convert_to_usd($_REQUEST['currency_code'], $_REQUEST['amount_value']);
     $leadsType = $_REQUEST['leadsType'];
     $str_subids = $_REQUEST['subids'];
     $pattern = '/\\d{14}x\\d{5}/';
     preg_match_all($pattern, $str_subids, $subids);
     foreach ($subids[0] as $key => $subid) {
         import_sale_info($leadsType, $amount, $subid);
     }
     break;
 case 'delete_link':
     $id = rq('id', 2);
     delete_offer($id);
     cache_links_update();
     exit;
     break;
 case 'restore_link':
     $id = rq('id', 2);
     delete_offer($id, 0);
     cache_links_update();
     exit;
     break;
 case 'delete_sale':
     if ($result[0] == true) {
         echo $result[1];
     } else {
         echo "Произошла ошибка {$result[1]} при импорте офферов";
     }
     exit;
     break;
 case 'import_sales':
     $currency_id = $_REQUEST['currency_id'];
     $amount = $_REQUEST['amount_value'];
     $leadsType = $_REQUEST['leadsType'];
     $str_subids = $_REQUEST['subids'];
     $pattern = '/\\d{14}x\\d{5}/';
     preg_match_all($pattern, $str_subids, $subids);
     foreach ($subids[0] as $key => $subid) {
         import_sale_info($leadsType, $amount, $currency_id, $subid);
     }
     break;
 case 'arch_link':
     $ids = rq('id', -2);
     $arch = rq('arch', 2);
     delete_offer($ids, $arch ? 2 : 0);
     cache_outs_update($ids);
     break;
 case 'fave_link':
     $ids = rq('id', 2);
     $fave = rq('fave', 2);
     delete_offer($ids, $fave ? 3 : 0);
     $out = array('have_favorits' => offers_have_status(3));
     echo json_encode($out);
     exit;