<?php

$sql_query = 'UPDATE ' . $config['table_prefix'] . 'module_sms_gates SET ';
$sql_query .= <<<'EOT'
code = '
    function send_sms() {
global $config, $smsc, $sms;
 require_once $config[\'site_path\'] . \'/modules/sms/webcom.php\';
$params = [
        \'login\' => $smsc[\'login\'],
        \'phone\' => $sms[\'phone\'],
        \'sender\' => $sms[\'sender\'],
        \'text\' => $sms[\'text\']
    ];
return Webcom::webcom_send_sms($params);
}',
check_status ='
function check_sms_status($smsc, $id_sms)
{
    global $config;
    require_once $config[\'site_path\'] . \'/modules/sms/webcom.php\';

    $params = [
        \'login\' => $smsc[\'login\'],
        \'state\' => $id_sms
    ];
    return Webcom::webcom_check_sms_status($params);
}' WHERE id = 3
EOT;
run_query($sql_query);