<?php
/** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*      Copyright (c) 2015-2017 LLC Alt-team. All rights reserved.           *
*                                                                           *
*  This is commercial software, only users who have purchased a valid       *
*  license and accept to the terms of the License Agreement can install     *
*  and use this program.                                                    *
*                                                                           *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*  PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE       *
*  "pd_copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE.         *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

use Tygh\Registry;

if ( !defined('BOOTSTRAP') ) { die('Access denied'); }

if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    if ($mode == 'update') {
        fn_targetsms_update_company_statuses_text($_REQUEST['statuses_data'], $_REQUEST['company_id'], DESCR_SL);
    }
}

if ($mode == 'update') {
    Registry::set('navigation.tabs.targetsms', array(
        'title' => __('targetsms.targetsms'),
        'js' => true
    ));
    $statuses = fn_get_statuses(STATUSES_ORDER, array(), false, false, DESCR_SL);
    $statuses_values = fn_targetsms_get_company_statuses_text($_REQUEST['company_id'], DESCR_SL);
    Tygh::$app['view']->assign('statuses', $statuses);
    Tygh::$app['view']->assign('statuses_values', $statuses_values);
}

