Example #1
0
?>
</p>
	<p><?php 
echo tt('Separators are ";".');
?>
</p>
</div>

<?php 
$columns = array(array('class' => 'CCheckBoxColumn', 'header' => tt('Select'), 'id' => 'itemsSelectedExport'), array('name' => 'id', 'htmlOptions' => array('class' => 'apartments_id_column', 'style' => 'text-align: center;'), 'sortable' => false), array('name' => 'active', 'type' => 'raw', 'value' => 'Yii::app()->controller->returnControllerStatusHtml($data, "apartments-grid", 1)', 'htmlOptions' => array('class' => 'apartments_status_column'), 'filter' => Apartment::getModerationStatusArray(), 'sortable' => false), array('name' => 'type', 'type' => 'raw', 'value' => 'Apartment::getNameByType($data->type)', 'htmlOptions' => array('style' => 'width: 100px;'), 'filter' => Apartment::getTypesArray(), 'sortable' => false));
if (issetModule('location')) {
    $columns[] = array('name' => 'loc_country', 'value' => '$data->loc_country ? $data->locCountry->name : ""', 'htmlOptions' => array('style' => 'width: 150px;'), 'sortable' => false, 'filter' => Country::getCountriesArray(0, 1));
    $columns[] = array('name' => 'loc_region', 'value' => '$data->loc_region ? $data->locRegion->name : ""', 'htmlOptions' => array('style' => 'width: 150px;'), 'sortable' => false, 'filter' => Region::getRegionsArray($model->loc_country, 0, 1));
    $columns[] = array('name' => 'loc_city', 'value' => '$data->loc_city ? $data->locCity->name : ""', 'htmlOptions' => array('style' => 'width: 150px;'), 'sortable' => false, 'filter' => City::getCitiesArray($model->loc_region, 0, 1));
} else {
    $columns[] = array('name' => 'city_id', 'value' => '(isset($data->city ) && $data->city_id) ? $data->city->name : ""', 'htmlOptions' => array('style' => 'width: 150px;'), 'filter' => ApartmentCity::getAllCity(), 'sortable' => false);
}
$columns[] = array('name' => 'ownerEmail', 'htmlOptions' => array('style' => 'width: 150px;'), 'type' => 'raw', 'value' => '(isset($data->user) && $data->user->role != "admin") ? CHtml::link(CHtml::encode($data->user->email), array("/users/backend/main/view","id" => $data->user->id)) : tt("administrator", "common")');
$columns[] = array('header' => tc('Name'), 'name' => 'title_' . Yii::app()->language, 'type' => 'raw', 'value' => 'CHtml::link(CHtml::encode($data->{"title_".Yii::app()->language}), $data->getUrl())', 'sortable' => false);
?>


<div class="form">
	<?php 
$this->widget('CustomHistoryGridView', array('id' => 'export-grid', 'dataProvider' => $model->searchExport(), 'filter' => $model, 'selectableRows' => 2, 'selectionChanged' => 'js:selItemsSelected', 'columns' => $columns));
?>

	<?php 
$form = $this->beginWidget('CActiveForm', array('id' => 'export-form', 'method' => 'post', 'action' => $this->createAbsoluteUrl('/iecsv/backend/main/export'), 'enableClientValidation' => false));
echo $form->hiddenField($model, 'itemsSelectedExport');
echo $form->error($model, 'itemsSelectedExport');
Example #2
0
<?php

Yii::app()->getModule('userads');
//if(!Yii::app()->request->isAjaxRequest){
//    echo '<h1>'.tt('Manage apartments', 'apartments').'</h1>';
//}
$this->pageTitle .= ' - ' . tt('Manage apartments', 'apartments');
if (!isset($this->breadcrumbs)) {
    $this->breadcrumbs = array(Yii::t('common', 'Control panel') => array('/usercpanel/main/index'), tt('Manage apartments', 'apartments'));
}
//echo CHtml::button(tc('Add ad', 'apartments'), array('onclick' => 'document.location.href="'.Yii::app()->createUrl('/userads/main/create').'"', 'class' => 'button-blue'));
Yii::app()->clientScript->registerScript('ajaxSetStatus', "\n\t\tfunction ajaxSetStatus(elem, id){\n\t\t\t\$.ajax({\n\t\t\t\turl: \$(elem).attr('href'),\n\t\t\t\tsuccess: function(){\n\t\t\t\t\t\$('#'+id).yiiGridView.update(id);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t", CClientScript::POS_HEAD);
$columns = array(array('name' => 'id', 'headerHtmlOptions' => array('class' => 'apartments_id_column')), array('name' => 'active', 'type' => 'raw', 'value' => 'UserAds::returnStatusHtml($data, "userads-grid", 0)', 'headerHtmlOptions' => array('class' => 'userads_status_column'), 'filter' => Apartment::getModerationStatusArray(), 'sortable' => false), array('name' => 'owner_active', 'type' => 'raw', 'value' => 'UserAds::returnStatusOwnerActiveHtml($data, "userads-grid", 1)', 'headerHtmlOptions' => array('class' => 'userads_owner_status_column'), 'filter' => array('0' => tc('Inactive'), '1' => tc('Active')), 'sortable' => false), array('name' => 'type', 'type' => 'raw', 'value' => 'Apartment::getNameByType($data->type)', 'filter' => Apartment::getTypesArray(), 'sortable' => false), array('name' => 'obj_type_id', 'type' => 'raw', 'value' => '(isset($data->objType) && $data->objType) ? $data->objType->name : ""', 'filter' => Apartment::getObjTypesArray(), 'sortable' => false), array('header' => tc('Name'), 'name' => 'title_' . Yii::app()->language, 'type' => 'raw', 'value' => 'CHtml::link(CHtml::encode($data->{"title_".Yii::app()->language}), $data->getUrl())'));
if (issetModule('location') && param('useLocation', 1)) {
    $columns[] = array('name' => 'loc_country', 'value' => '$data->loc_country ? $data->locCountry->name : ""', 'htmlOptions' => array('style' => 'width: 150px;'), 'sortable' => false, 'filter' => Country::getCountriesArray(0, 1));
    $columns[] = array('name' => 'loc_region', 'value' => '$data->loc_region ? $data->locRegion->name : ""', 'htmlOptions' => array('style' => 'width: 150px;'), 'sortable' => false, 'filter' => Region::getRegionsArray($model->loc_country, 0, 1));
    $columns[] = array('name' => 'loc_city', 'value' => '$data->loc_city ? $data->locCity->name : ""', 'htmlOptions' => array('style' => 'width: 150px;'), 'sortable' => false, 'filter' => City::getCitiesArray($model->loc_region, 0, 1));
} else {
    $columns[] = array('name' => 'city_id', 'value' => '$data->city_id ? $data->city->name : ""', 'sortable' => false, 'filter' => ApartmentCity::getAllCity());
}
if (issetModule('paidservices')) {
    $columns[] = array('header' => tc('Paid services'), 'value' => '$data->getPaidHtml(false, false, true)', 'type' => 'raw', 'htmlOptions' => array('class' => 'width70 center'));
}
$columns[] = array('class' => 'CButtonColumn', 'deleteConfirmation' => tc('Are you sure you want to delete this item?'), 'viewButtonUrl' => '$data->getUrl()', 'buttons' => array('update' => array('url' => 'Yii::app()->createUrl("/userads/main/update", array("id" => $data->id))'), 'delete' => array('url' => 'Yii::app()->createUrl("/userads/main/delete", array("id" => $data->id))')));
$this->widget('NoBootstrapGridView', array('id' => 'userads-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => $columns));
    ?>
        </div>
    <?php 
    $cities = City::getCitiesArray($this->getFilterValue('region_id'));
}
$objTypes = CArray::merge(array(0 => ''), ApartmentObjType::getList());
$typeList = CArray::merge(array(0 => ''), Apartment::getTypesArray());
?>

    <div class="">
        <div class=""><?php 
echo Yii::t('common', 'City');
?>
:</div>
        <?php 
$cities = isset($cities) && count($cities) ? $cities : CArray::merge(array(0 => tc('select city')), ApartmentCity::getAllCity());
echo CHtml::dropDownList('filter[city_id]', $this->getFilterValue('city_id'), $cities, array('class' => ' searchField', 'id' => 'ap_city'));
?>
    </div>

    <div class="rowold">
        <div class=""><?php 
echo tc('Type');
?>
:</div>
        <?php 
echo CHtml::dropDownList('filter[type]', $this->getFilterValue('type'), $typeList);
?>
    </div>

    <div class="rowold">
Example #4
0
<?php

$this->pageTitle = Yii::app()->name . ' - ' . IecsvModule::t('Import / Export');
$this->breadcrumbs = array(tt('Import'));
$this->adminTitle = tt('Import');
?>

<div>
	<p><?php 
echo tt('Please select ads for import.');
?>
</p>
</div>

<?php 
$this->widget('CustomHistoryGridView', array('id' => 'import-grid', 'dataProvider' => $itemsProvider, 'enablePagination' => true, 'selectableRows' => 2, 'selectionChanged' => 'js:selItemsSelected', 'columns' => array(array('class' => 'CCheckBoxColumn', 'header' => tt('Select'), 'id' => 'itemsSelectedImport'), array('header' => tt('Type', 'apartments'), 'name' => 'type', 'type' => 'raw', 'value' => 'Apartment::getNameByType($data["type"])', 'htmlOptions' => array('style' => 'width: 100px;'), 'sortable' => false, 'filter' => false), array('header' => tt('City', 'apartments'), 'name' => 'city_id', 'value' => '$data["cityName"] ? $data["cityName"] : ""', 'htmlOptions' => array('style' => 'width: 150px;'), 'filter' => ApartmentCity::getAllCity(), 'sortable' => false), array('header' => tc('Name'), 'name' => 'title_' . Yii::app()->language, 'type' => 'raw', 'value' => 'CHtml::encode($data["title_".Yii::app()->language])', 'sortable' => false, 'filter' => false))));
?>

<div class="form">
	<?php 
$form = $this->beginWidget('CActiveForm', array('id' => 'import-form', 'method' => 'post', 'action' => $this->createAbsoluteUrl('/iecsv/backend/main/importProcess'), 'enableClientValidation' => false));
echo $form->hiddenField($model, 'itemsSelectedImport');
echo CHtml::hiddenField('is_submit', 0, array('id' => 'is_submit'));
echo $form->hiddenField($model, 'selectedImportUser');
?>

	<div class="clear">&nbsp;</div>
	<div class="rowold">
		<?php 
echo $form->labelEx($model, 'selectedImportUser');
if (!isset($areasSelected) || !$areasSelected) {