Ejemplo n.º 1
0
 protected function makeDemands()
 {
     $row = $this->row;
     $out = '';
     if (!empty($row['FlatDemands'])) {
         $demands = $row['FlatDemands'];
         foreach ($demands as $a) {
             $type = array(4 => 'Квартира', 6 => 'Дом');
             if ($a['data_class'] == 4) {
                 $href = $this->getExchangeFlatUrl($a['id']);
             } elseif ($a['data_class'] == 6) {
                 $href = $this->getExchangeHouseUrl($a['id']);
             }
             $annotation = '<a href="' . $href . '" class="domstor_link">' . $a['code'] . '</a> ' . $type[$a['data_class']];
             $rooms = '';
             if ($a['new_building']) {
                 $annotation .= ', Новостройка';
             }
             for ($room = 1; $room < 6; $room++) {
                 if ($a['room_count_' . $room]) {
                     $rooms .= $room . ', ';
                 }
             }
             $rooms = substr($rooms, 0, -2);
             if ($rooms) {
                 $annotation .= ', ' . $rooms . ' комн.';
             }
             if ($a['in_communal']) {
                 $annotation .= ', (в коммуналке)';
             }
             if ($a['object_floor_limit']) {
                 $annotation .= ', ' . $a['object_floor_limit'] . ' эт.';
             }
             if ($a['district']) {
                 $annotation .= ', ' . $a['district'];
             }
             $price = Domstor_Detail_Demand::getPriceFromTo($a['price_full_min'], $a['price_full_max'], $a['price_currency']);
             if ($price) {
                 $annotation .= ', ' . $price;
             }
             if ($a['note_addition']) {
                 $annotation .= ', ' . $a['note_addition'];
             }
             $out .= '<p>Заявка: ' . $annotation . '</p>';
         }
     }
     return $out;
 }
Ejemplo n.º 2
0
    public function getDemandsBlock()
    {
        $obj =& $this->object;
        $out = '';
        if ($obj['Demands'] and $this->_action == 'exchange') {
            $type = array(4 => 'Квартира', 6 => 'Дом');
            foreach ($obj['Demands'] as $a) {
                if ($a['data_class'] == 4) {
                    $href = $this->getExchangeFlatUrl($a['id']);
                } elseif ($a['data_class'] == 6) {
                    $href = $this->getExchangeHouseUrl($a['id']);
                }
                $annotation = '<a href="' . $href . '" class="domstor_link">' . $a['code'] . '</a> ' . $type[$a['data_class']];
                $rooms = '';
                if ($a['new_building']) {
                    $annotation .= ', Новостройка';
                }
                for ($room = 1; $room < 6; $room++) {
                    if ($a['room_count_' . $room]) {
                        $rooms .= $room . ', ';
                    }
                }
                $rooms = substr($rooms, 0, -2);
                if ($rooms) {
                    $annotation .= ', ' . $rooms . ' комн.';
                }
                if ($a['in_communal']) {
                    $annotation .= ', (в коммуналке)';
                }
                if ($a['object_floor_limit']) {
                    $annotation .= ', ' . $a['object_floor_limit'] . ' эт.';
                }
                if ($a['district']) {
                    $annotation .= ', ' . $a['district'];
                }
                $price = Domstor_Detail_Demand::getPriceFromTo($a['price_full_min'], $a['price_full_max'], $a['price_currency']);
                if ($price) {
                    $annotation .= ', ' . $price;
                }
                if ($a['note_addition']) {
                    $annotation .= ', ' . $a['note_addition'];
                }
                $out .= '<p>' . $annotation . '</p>';
            }
        }
        if ($out) {
            $out = '<div class="domstor_object_demands">
						<h3>Заявки</h3>' . $out . '
					</div>';
        }
        return $out;
    }