Example #1
0
 public static function getImgForSlider()
 {
     $ownerActiveCond = '';
     if (param('useUserads')) {
         $ownerActiveCond = ' AND owner_active = ' . Apartment::STATUS_ACTIVE . ' ';
     }
     $sql = "  SELECT i.id, i.id_object, i.file_name, i.file_name_modified, i.is_main, a.title_" . Yii::app()->language . " AS title\n\t\t\t\t  FROM {{images}} i\n\t\t\t\t  INNER JOIN {{apartment}} a ON a.id = i.id_object\n\t\t\t\t  INNER JOIN {{apartment_paid}} ap ON ap.apartment_id = i.id_object\n\t\t\t\t  WHERE ap.paid_id = :paid_id AND ap.status = 1 AND a.active=" . Apartment::STATUS_ACTIVE . " {$ownerActiveCond} AND i.is_main=1 GROUP BY ap.apartment_id";
     $images = Yii::app()->db->createCommand($sql)->queryAll(true, array(':paid_id' => PaidServices::ID_ADD_IN_SLIDER));
     $imgs = array();
     if ($images) {
         foreach ($images as $image) {
             $imgs[$image['id_object']]['url'] = Apartment::getUrlById($image['id_object']);
             $imgs[$image['id_object']]['title'] = $image['title'];
             $imgs[$image['id_object']]['src'] = $class = Yii::app()->theme->name != 'classic' ? Images::getThumbUrl($image, 663, 380) : Images::getThumbUrl($image, param('slider_img_width', 500), param('slider_img_height', 280));
         }
     }
     return $imgs;
 }
Example #2
0
    echo tc('Add amount of');
    ?>
			<?php 
    echo CHtml::textField('amount', 100) . ' ' . Currency::getDefaultCurrencyName();
    ?>
		</div>
	</p>
<?php 
} else {
    ?>
	<p>
		<?php 
    echo tc('Will be used for listings');
    ?>
		ID: <?php 
    echo CHtml::link($ad_id, Apartment::getUrlById($ad_id));
    ?>
	</p>
<?php 
}
?>

<?php 
Yii::app()->getModule('payment');
if ($paidService->id != PaidServices::ID_ADD_FUNDS) {
    $paySystems = Paysystem::getPaysystems();
} else {
    $paySystems = Paysystem::getPaysystemsWithoutBalance();
}
$paySystemsArray = CHtml::listData($paySystems, 'id', 'name');
echo '<p>';