%s

'; $label = function($data) { return array('#text' => $data, '#class' => ['label'], '#style' => ['float:none;']); }; //$form['form_attributes']['enctype'] = 'multipart/form-data'; $form['form_attributes']['js'][] = 'engine/classes/WebAppRaiser/forms/CostAnaliceForm.js'; $form['woid'] = array( 'inputs' => array( '#type'=> 'hidden', ), ); $form['object_id'] = array( 'inputs' => array( '#type'=> 'hidden', ), ); // Анализ стоимости $form['markup_cost_analice'] = array( '#prefix' => '
', 'inputs' => array( '#type' => 'markup', '#value' => sprintf($header, 'Анализ стоимости квартиры'), ), '#suffix' => '
', ); $form['objectType'] = array( //'label'=> $label('Объект оценки'), // Тип объекта оценки 'inputs' => array( '#type'=> 'hidden', '#value' => 'FLAT', ), ); $form['address'] = array( '#prefix' => '
', 'label'=> $label('Адрес объекта'), // Адрес объекта оценки 'inputs' => array( '#type'=> 'textarea', '#required'=> true, '#inputs_style' => 'float:none; width:90%', ), ); $form['cadNum'] = array( 'label'=> $label('Кадастровый номер объекта'), 'inputs' => array( '#type'=> 'text', '#inputs_style' => 'float:none; width:90%', ), ); $form['latitude'] = array( '#prefix' => '
', 'label'=> $label('Широта'), 'inputs' => array( '#type'=> 'text', '#required'=> true, '#inputs_style' => 'float:none; width:90%', ), '#suffix' => '
', ); $form['longitude'] = array( '#prefix' => '
', 'label'=> $label('Долгота'), 'inputs' => array( '#type'=> 'text', '#required'=> true, '#inputs_style' => 'float:none; width:90%', ), '#suffix' => '
', ); $form['floor'] = array( '#prefix' => '
', 'label'=> $label('Этаж'), 'inputs' => array( '#type'=> 'text', '#required'=> true, '#inputs_style' => 'float:none; width:90%', ), '#suffix' => '
', ); $form['totalFloors'] = array( '#prefix' => '
', 'label'=> $label('Количество этажей в доме'), 'inputs' => array( '#type'=> 'text', '#required'=> true, '#inputs_style' => 'float:none; width:90%', ), '#suffix' => '
', ); $form['square'] = array( '#prefix' => '
', 'label'=> $label('Площадь объекта'), 'inputs' => array( '#type'=> 'text', '#required'=> true, '#inputs_style' => 'float:none; width:90%', ), '#suffix' => '
', ); $form['buildYear'] = array( '#prefix' => '
', 'label'=> $label('Год постройки дома'), 'inputs' => array( '#type'=> 'text', '#required'=> true, '#inputs_style' => 'float:none; width:90%', ), '#suffix' => '
', ); $form['buildingStage'] = array( '#prefix' => '
', 'label'=> $label('Стадия строительства'), 'inputs' => array( '#type'=> 'select', '#required'=> true, '#options' => WebAppRaiserAPI::getDict('BUILDING_STAGE'), '#inputs_style' => 'float:none; width:90%', ), ); $form['decorationType'] = array( 'label'=> $label('Состояние отделки помещения'), 'inputs' => array( '#type'=> 'select', '#required'=> true, '#options' => WebAppRaiserAPI::getDict('DECORATION_TYPE'), '#inputs_style' => 'float:none; width:90%', ), ); $form['wallMaterial'] = array( 'label'=> $label('Материал стен дома'), 'inputs' => array( '#type'=> 'select', '#required'=> true, '#options' => WebAppRaiserAPI::getDict('WALL_MATERIAL'), '#inputs_style' => 'float:none; width:90%', ), ); $form['contractCost'] = array( 'label'=> $label('Стоимость в договоре'), // Стоимость объекта при покупке 'inputs' => array( '#type'=> 'text', '#required'=> false, '#inputs_style' => 'float:none; width:90%', ), '#suffix' => '
', ); $form['submit'] = array( 'inputs' => array( '#type'=> 'submit', '#value'=> 'Рассчитать стоимость', ), ); return $form; } public function validate() { $status = parent::validate(); return $status; } public function submit($status, &$page, WebAppRaiserAPI $WebAppRaiserAPI) { parent::submit($status, $page, $WebAppRaiserAPI); $page['status'] = $status['code']; $page['msg'] = array_merge($page['msg'], $status['message']); parent::redirect($page); // По сути этот сабмит не работает так как происходит AJAX запрос } }