public function actionAdmin() { $model = new Country('search'); $model->unsetAttributes(); if (isset($_GET['Country'])) { $model->setAttributes($_GET['Country']); } $this->render('admin', array('model' => $model)); }
/** * Manages all models. */ public function actionAdmin() { $model = new Country('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Country'])) { $model->attributes = $_GET['Country']; } $this->render('admin', array('model' => $model)); }
/** * Displays a particular model. * @param integer $id the ID of the model to be displayed */ public function actionView($id) { //Countries with given Time Zone $country = new Country('search'); $country->unsetAttributes(); // clear any default values $country->timeZoneID = $id; if (isset($_GET['Country'])) { $country->attributes = $_GET['Country']; } //Users with given Time Zone $profile = new Profile('search'); $profile->unsetAttributes(); $profile->timeZoneID = $id; if (isset($_GET['Profile'])) { $profile->attributes = $_GET['Profile']; } $this->render('view', array('model' => $this->loadModel($id), 'country' => $country, 'profile' => $profile)); }
/** * Lists all models. */ public function actionIndex() { parent::actionIndex(); $model = new Country('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Country'])) { $model->attributes = $_GET['Country']; } if (isset($_GET['pageSize'])) { Yii::app()->user->setState('pageSize', (int) $_GET['pageSize']); unset($_GET['pageSize']); // would interfere with pager and repetitive page size change } $this->render('index', array('model' => $model)); }
<?php $form = $this->beginWidget('CActiveForm', array('id' => 'province-form', 'enableAjaxValidation' => false)); $this->widget('ToolbarButton', array('isSave' => true, 'UrlSave' => 'province/write', 'isCancel' => true, 'UrlCancel' => 'province/cancelwrite')); echo $form->hiddenField($model, 'provinceid'); ?> <div class="row"> <?php echo $form->labelEx($model, 'countryid'); echo $form->hiddenField($model, 'countryid'); ?> <input type="text" name="countryname" id="countryname" readonly > <?php $this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'country_dialog', 'options' => array('title' => Yii::t('app', 'Country'), 'width' => 'auto', 'autoOpen' => false, 'modal' => true))); $country = new Country('searchwstatus'); $country->unsetAttributes(); // clear any default values if (isset($_GET['Country'])) { $country->attributes = $_GET['Country']; } $this->widget('zii.widgets.grid.CGridView', array('id' => 'product-grid', 'dataProvider' => $country->Searchwstatus(), 'filter' => $country, 'template' => '{summary}{pager}<br>{items}{pager}{summary}', 'columns' => array(array('header' => '', 'type' => 'raw', 'value' => 'CHtml::Button("+", array("name" => "send_product", "id" => "send_product", "onClick" => "$(\\"#country_dialog\\").dialog(\\"close\\"); $(\\"#countryname\\").val(\\"$data->countryname\\"); $(\\"#Province_countryid\\").val(\\"$data->countryid\\"); "))'), array('name' => 'countryid', 'visible' => false, 'value' => '$data->countryid', 'htmlOptions' => array('width' => '1%')), 'countryname'))); $this->endWidget('zii.widgets.jui.CJuiDialog'); echo CHtml::Button('...', array('onclick' => '$("#country_dialog").dialog("open"); return false;')); ?> <?php echo $form->error($model, 'countryid'); ?>
/** * Manages all models. */ public function actionAdmin() { if ($this->CanAccess("admin")) { $model = new Country('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Country'])) { $model->attributes = $_GET['Country']; } $this->render('admin', array('model' => $model)); } else { throw new CHttpException(405, Yii::t('app', 'You do not have permissions to access this page.')); } }