コード例 #1
0
ファイル: options.php プロジェクト: ASDAFF/bitrix-casco
    } catch (Exception $e) {
        echo CAdminMessage::ShowMessage(array('TYPE' => 'ERROR', 'MESSAGE' => GetMessage('SPM_MESSAGE_SAVE_ERR'), 'DETAILS' => $e->getMessage(), 'HTML' => true));
    }
}
echo '<form method="post" action="' . $APPLICATION->GetCurPage() . '?mid=' . htmlspecialcharsbx($mid) . '&lang=' . LANG . '">';
echo bitrix_sessid_post();
$tabControl->Begin();
$tabControl->BeginNextTab();
?>
	<tr>
		<td><label for="smartpolis_auth_type_token"><?php 
echo GetMessage('SPM_OPTION_AT_TOKEN');
?>
</label></td>
		<td><input type="radio" id="smartpolis_auth_type_token" name="smartpolis_auth_type" value="by_token"<?php 
echo $settings->get('smartpolis_auth_type') == 'by_token' ? ' checked="checked"' : '';
?>
></td>
	</tr>
	<tr>
		<td><label for="smartpolis_auth_type_ip"><?php 
echo GetMessage('SPM_OPTION_AT_IP');
?>
</label></td>
		<td><input type="radio" id="smartpolis_auth_type_ip" name="smartpolis_auth_type" value="by_ip"<?php 
echo $settings->get('smartpolis_auth_type') == 'by_ip' ? ' checked="checked"' : '';
?>
></td>
	</tr>
	<tr>
		<td><label for="smartpolis_auth_token"><?php 
コード例 #2
0
ファイル: component.php プロジェクト: ASDAFF/bitrix-casco
/**
 * Компонент Умный Полис
 *
 */
if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) {
    die;
}
IncludeModuleLangFile(__FILE__);
//if ($_REQUEST['ajax'] === 'Y')
$arParams['CACHE_TYPE'] = 0;
if ($this->StartResultCache($arParams['CACHE_TYPE'] === 'N' ? 0 : (is_numeric($arParams['CACHE_TIME']) ? $arParams['CACHE_TIME'] : '3600'))) {
    CModule::IncludeModule('smartpolis');
    $settings = new SmartpolisSettings();
    $api = new SmartpolisCascoApi($settings);
    $arResult = array('TEXT_BEFORE_BUTTON' => $settings->get('smartpolis_message_before_button'), 'HEADER_BEFORE_FORM' => $settings->get('smartpolis_header_before_form'), 'MESSAGE_BEFORE_FORM' => $settings->get('smartpolis_message_before_form'), 'YEARS' => array(), 'DRIVERS' => array(), 'SHOW_TYPE' => $settings->get('smartpolis_show_type'), 'CAR_BRANDS' => array());
    if (!empty($_POST)) {
        $brands = json_decode($api->getCarMarks());
        $carBrand = 'Производитель не указан';
        foreach ($brands as $brand) {
            if ($brand->id == $_POST['CAR_BRAND']) {
                $carBrand = $brand->title;
                break;
            }
        }
        $api->setValue('car_mark', $_POST['CAR_BRAND']);
        $models = json_decode($api->getCarModels());
        $carModel = 'Модель не указана';
        foreach ($models as $model) {
            if ($model->id == $_POST['CAR_MODEL']) {
                $carModel = $model->title;