Example #1
0
 public function actionAdmin()
 {
     $model = new Governorate('search');
     $model->unsetAttributes();
     if (isset($_GET['Governorate'])) {
         $model->setAttributes($_GET['Governorate']);
     }
     $this->render('admin', array('model' => $model));
 }
Example #2
0
<?php

$this->breadcrumbs = array($model->label(2) => array('index'), Yii::t('app', 'Manage'));
$this->menu = array(array('label' => Yii::t('app', 'List') . ' ' . $model->label(2), 'url' => array('index')), array('label' => Yii::t('app', 'Create') . ' ' . $model->label(), 'url' => array('create')));
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$.fn.yiiGridView.update('district-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>

<h1><?php 
echo Yii::t('app', 'Manage') . ' ' . GxHtml::encode($model->label(2));
?>
</h1>

<p>
You may optionally enter a comparison operator (&lt;, &lt;=, &gt;, &gt;=, &lt;&gt; or =) at the beginning of each of your search values to specify how the comparison should be done.
</p>

<?php 
echo GxHtml::link(Yii::t('app', 'Advanced Search'), '#', array('class' => 'search-button'));
?>
<div class="search-form">
<?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->

<?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'district-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array('id', 'code', 'ar_name', 'en_name', array('name' => 'governerate_id', 'value' => 'GxHtml::valueEx($data->governerate)', 'filter' => GxHtml::listDataEx(Governorate::model()->findAllAttributes(null, true))), array('class' => 'CButtonColumn'))));
Example #3
0
	<div class="row">
		<?php 
echo $form->label($model, 'en_name');
?>
		<?php 
echo $form->textField($model, 'en_name', array('maxlength' => 255));
?>
	</div>

	<div class="row">
		<?php 
echo $form->label($model, 'governerate_id');
?>
		<?php 
echo $form->dropDownList($model, 'governerate_id', GxHtml::listDataEx(Governorate::model()->findAllAttributes(null, true)), array('prompt' => Yii::t('app', 'All')));
?>
	</div>

	<div class="row buttons">
		<?php 
echo GxHtml::submitButton(Yii::t('app', 'Search'));
?>
	</div>

<?php 
$this->endWidget();
?>

</div><!-- search-form -->
Example #4
0
echo $form->textField($model, 'name', array('maxlength' => 20));
?>
		<?php 
echo $form->error($model, 'name');
?>
		</div><!-- row -->
		<div class="row">
		<?php 
echo $form->labelEx($model, 'code');
?>
		<?php 
echo $form->textField($model, 'code', array('maxlength' => 10));
?>
		<?php 
echo $form->error($model, 'code');
?>
		</div><!-- row -->

		<label><?php 
echo GxHtml::encode($model->getRelationLabel('governorates'));
?>
</label>
		<?php 
echo $form->checkBoxList($model, 'governorates', GxHtml::encodeEx(GxHtml::listDataEx(Governorate::model()->findAllAttributes(null, true)), false, true));
?>

<?php 
echo GxHtml::submitButton(Yii::t('app', 'Save'));
$this->endWidget();
?>
</div><!-- form -->
Example #5
0
<?php

$this->breadcrumbs = array(Governorate::label(2), Yii::t('app', 'Index'));
$this->menu = array(array('label' => Yii::t('app', 'Create') . ' ' . Governorate::label(), 'url' => array('create')), array('label' => Yii::t('app', 'Manage') . ' ' . Governorate::label(2), 'url' => array('admin')));
?>

<h1><?php 
echo GxHtml::encode(Governorate::label(2));
?>
</h1>

<?php 
$this->widget('zii.widgets.CListView', array('dataProvider' => $dataProvider, 'itemView' => '_view'));
Example #6
0
		<?php 
echo $form->labelEx($model, 'en_name');
?>
		<?php 
echo $form->textField($model, 'en_name', array('maxlength' => 255));
?>
		<?php 
echo $form->error($model, 'en_name');
?>
		</div><!-- row -->
		<div class="row">
		<?php 
echo $form->labelEx($model, 'governerate_id');
?>
		<?php 
echo $form->dropDownList($model, 'governerate_id', GxHtml::listDataEx(Governorate::model()->findAllAttributes(null, true)));
?>
		<?php 
echo $form->error($model, 'governerate_id');
?>
		</div><!-- row -->

		<label><?php 
echo GxHtml::encode($model->getRelationLabel('subdistricts'));
?>
</label>
		<?php 
echo $form->checkBoxList($model, 'subdistricts', GxHtml::encodeEx(GxHtml::listDataEx(Subdistrict::model()->findAllAttributes(null, true)), false, true));
?>

<?php