/** * Lists all models. */ public function actionIndex() { $this->layout = '//layouts/header_default'; //Если нет таблиц в базе редиректим на контроллер миграции if (Holes::getDbConnection()->getSchema()->getTable(Holes::tableName()) === null) { $this->redirect(array('migration/index')); } $model = new Holes('search'); $model->unsetAttributes(); // clear any default values $model->PREMODERATED = 1; if (isset($_POST['Holes']) || isset($_GET['Holes'])) { $model->attributes = isset($_POST['Holes']) ? $_POST['Holes'] : $_GET['Holes']; } if ($model->ADR_CITY == "Город") { $model->ADR_CITY = ''; } $dataProvider = $model->search(); $this->render('index', array('model' => $model, 'dataProvider' => $dataProvider)); }
<h1><?php echo $this->title; ?> </h1> </div></div> <br clear="all"> <div class="mainCols"> <div class="lCol"> </div> <div class="rCol"> <?php if (Holes::getDbConnection()->getSchema()->getTable(Holes::tableName()) === null) { ?> <?php echo CHtml::ajaxLink('Cоздать структуру данных > ', $this->createUrl('makedata'), array('update' => '#makedata_result', 'beforeSend' => 'function(){ $("#makedata_result").addClass("loading"); }', 'complete' => 'function(){ $("#makedata_result").removeClass("loading"); }')); ?> <div id="makedata_result"></div> <?php } ?> <?php if (BHoles::getDbConnection()->getSchema()->getTable(BHoles::tableName())) { ?>