public function actionClients() { $this->layout = '//layouts/clients'; $country = Yii::app()->request->getParam('country'); $city = Yii::app()->request->getParam('city'); $objType = Yii::app()->request->getParam('objType'); $renttype = !is_null(Yii::app()->request->getParam('renttype')) ? Yii::app()->request->getParam('renttype') : 1; $sql = 'SELECT * FROm `bt_apartments_rents` WHERE `type`=' . $renttype; if (!is_null($country)) { $sql .= ' AND `loc_country_id`=' . $country; } if (!is_null($city)) { $sql .= ' AND `loc_city_id`=' . $city; } if (!is_null($objType)) { $sql .= ' AND `objTypeId`=' . $objType; } $rentorders = ApartmentsRents::model()->findAllBySql($sql); $this->render('clients', ['rentorders' => $rentorders]); }
echo Apartment::model()->count('type=:typeId AND owner_id=:userId', [':typeId' => (int) $_GET['type'], ':userId' => $user->id]); ?> </span></li> <li><a href="#">Избранные</a><span>3</span></li> <li><a href="/usercpanel/main/rentorders">Разместить</a></li> <li><a href="/usercpanel/xmlfeed">XML-фид</a></li> </ul> </li> <li id="lm2"><a href="#">Заявки</a> <ul class="sub-menu"> <li><a href="/usercpanel/main/rentsdisplay/?type=1">Аренда</a><span><?php echo !is_null(ApartmentsRents::model()->findByAttributes(['type' => [1, 2], 'userFrom' => Yii::app()->user->id])) ? ApartmentsRents::model()->findByAttributes(['type' => [1, 2], 'userFrom' => Yii::app()->user->id])->count() : 0; ?> </span></li> <li><a href="/usercpanel/main/rentsdisplay/?type=3">Продажа</a><span><?php echo !is_null(ApartmentsRents::model()->findByAttributes(['type' => 3, 'userFrom' => Yii::app()->user->id])) ? ApartmentsRents::model()->findByAttributes(['type' => 3, 'userFrom' => Yii::app()->user->id])->count() : 0; ?> </span></li> <li><a href="/usercpanel/main/rents">Разместить</a></li> </ul> </li> <li id="lm5"><a href="#">Клиенты</a> <ul class="sub-menu"> <li><a href="#">Мои клиенты</a><span>2</span></li> <li><a href="/usercpanel/main/clients">Поиск клиентов</a></li> <li><a href="#">Комментарии</a><span>0</span></li> <li><a href="/usercpanel/main/negatives">Жалобы</a></li> </ul> </li> <li id="lm6"><a href="#">Архив</a></li> <li id="lm3"><a href="#">Сообщения</a>
<td><?php echo 'Общая:' . $rentorder->square . 'м2 Кухня:' . $rentorder->squareKitchen . 'м2'; ?> </td> <td> <?php echo $rentorder->price . ($rentorder->moneyType == 1 ? 'р.' : '$') . "<br>" . ApartmentsRents::getStrLabels($rentorder->searchRequirements); ?> </td> <td>Не важно</td> <td><?php echo !($rentorder->objTypeId == 4 || $rentorder->objTypeId == 19) ? $rentorder->floor . '/' . $rentorder->numOfFloors : $rentorder->numOfFloors; ?> </td> <td><?php echo ApartmentsRents::getStrLabels($rentorder->conditions); ?> </td> <td><table width="100%" border="0" cellspacing="0"> <tbody> <tr> <td class="tableComnt"><div class="comntNote"> Активно с: <?php echo $rentorder->createDate; ?> </div> <br> <?php echo $rentorder->additional; ?> </tr> </tbody>