Exemplo n.º 1
0
<?php

$this->breadcrumbs = array($model->label(2) => array('index'), 'Manage');
$this->menu = array(array('label' => 'List' . ' ' . $model->label(2), 'url' => array('index')), array('label' => '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('inventory-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>

<h1><?php 
echo '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('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' => 'inventory-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array('inventory_id', array('name' => 'film_id', 'value' => 'GxHtml::valueEx($data->film)', 'filter' => GxHtml::listDataEx(Film::model()->findAllAttributes(null, true))), array('name' => 'store_id', 'value' => 'GxHtml::valueEx($data->store)', 'filter' => GxHtml::listDataEx(Store::model()->findAllAttributes(null, true))), 'last_update', array('class' => 'CButtonColumn'))));
Exemplo n.º 2
0
echo $form->textField($model, 'last_name', array('maxlength' => 45));
?>
		<?php 
echo $form->error($model, 'last_name');
?>
		</div><!-- row -->
		<div class="row">
		<?php 
echo $form->labelEx($model, 'last_update');
?>
		<?php 
echo $form->textField($model, 'last_update');
?>
		<?php 
echo $form->error($model, 'last_update');
?>
		</div><!-- row -->

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

<?php 
echo GxHtml::submitButton('Save');
$this->endWidget();
?>
</div><!-- form -->
Exemplo n.º 3
0
<?php

$this->breadcrumbs[] = Yii::t('crud', 'Inventories');
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\$('.search-form').toggle();\nreturn false;\n});\n\$('.search-form form').submit(function(){\n\$.fn.yiiGridView.update('inventory-grid', {\ndata: \$(this).serialize()\n});\nreturn false;\n});\n");
?>

<?php 
$this->widget("TbBreadcrumbs", array("links" => $this->breadcrumbs));
?>
<h1>
    <?php 
echo Yii::t('crud', 'Inventories');
?>
 <small><?php 
echo Yii::t('crud', 'Manage');
?>
</small>
</h1>

<?php 
$this->renderPartial("_toolbar", array("model" => $model));
$this->widget('TbGridView', array('id' => 'inventory-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'pager' => array('class' => 'TbPager', 'displayFirstAndLast' => true), 'columns' => array(array('class' => 'editable.EditableColumn', 'name' => 'inventory_id', 'editable' => array('url' => $this->createUrl('/sakila/hybrid/inventory/editableSaver'))), array('name' => 'film_id', 'value' => 'CHtml::value($data,\'film.itemLabel\')', 'filter' => CHtml::listData(Film::model()->findAll(array('limit' => 1000)), 'film_id', 'itemLabel')), array('name' => 'store_id', 'value' => 'CHtml::value($data,\'store.itemLabel\')', 'filter' => CHtml::listData(Store::model()->findAll(array('limit' => 1000)), 'store_id', 'itemLabel')), array('class' => 'editable.EditableColumn', 'name' => 'last_update', 'editable' => array('url' => $this->createUrl('/sakila/hybrid/inventory/editableSaver'))), array('class' => 'TbButtonColumn', 'viewButtonUrl' => "Yii::app()->controller->createUrl('view', array('inventory_id' => \$data->inventory_id))", 'updateButtonUrl' => "Yii::app()->controller->createUrl('update', array('inventory_id' => \$data->inventory_id))", 'deleteButtonUrl' => "Yii::app()->controller->createUrl('delete', array('inventory_id' => \$data->inventory_id))"))));
Exemplo n.º 4
0
<?php 
$this->breadcrumbs[] = Yii::t('crud', 'Inventories');
Yii::app()->clientScript->registerScript('search', "\n    \$('.search-button').click(function(){\n        \$('.search-form').toggle();\n        return false;\n    });\n    \$('.search-form form').submit(function(){\n        \$.fn.yiiGridView.update(\n            'inventory-grid',\n            {data: \$(this).serialize()}\n        );\n        return false;\n    });\n    ");
?>

<?php 
$this->widget("TbBreadcrumbs", array("links" => $this->breadcrumbs));
?>
<h1>
    
    <?php 
echo Yii::t('crud', 'Inventories');
?>
    <small><?php 
echo Yii::t('crud', 'Manage');
?>
</small>
    
</h1>

<?php 
$this->renderPartial("_toolbar", array("model" => $model));
?>



<?php 
$this->widget('TbGridView', array('id' => 'inventory-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'template' => '{pager}{items}{pager}{summary}', 'pager' => array('class' => 'TbPager', 'displayFirstAndLast' => true), 'columns' => array(array('class' => 'CLinkColumn', 'header' => '', 'labelExpression' => '$data->itemLabel', 'urlExpression' => 'Yii::app()->controller->createUrl("view", array("inventory_id" => $data["inventory_id"]))'), array('class' => 'editable.EditableColumn', 'name' => 'inventory_id', 'editable' => array('url' => $this->createUrl('/sakila/slim/inventory/editableSaver'))), array('name' => 'film_id', 'value' => 'CHtml::value($data,\'film.itemLabel\')', 'filter' => CHtml::listData(Film::model()->findAll(array('limit' => 1000)), 'film_id', 'itemLabel')), array('name' => 'store_id', 'value' => 'CHtml::value($data,\'store.itemLabel\')', 'filter' => CHtml::listData(Store::model()->findAll(array('limit' => 1000)), 'store_id', 'itemLabel')), array('class' => 'editable.EditableColumn', 'name' => 'last_update', 'editable' => array('url' => $this->createUrl('/sakila/slim/inventory/editableSaver'))), array('class' => 'TbButtonColumn', 'viewButtonUrl' => 'Yii::app()->controller->createUrl("view", array("inventory_id" => $data->inventory_id))', 'updateButtonUrl' => 'Yii::app()->controller->createUrl("update", array("inventory_id" => $data->inventory_id))', 'deleteButtonUrl' => 'Yii::app()->controller->createUrl("delete", array("inventory_id" => $data->inventory_id))'))));
Exemplo n.º 5
0
 public function loadModel($id)
 {
     $model = Film::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, Yii::t('crud', 'The requested page does not exist.'));
     }
     return $model;
 }
Exemplo n.º 6
0
?>

	<p class="note">
		Fields with <span class="required">*</span> are required.
	</p>

	<?php 
echo $form->errorSummary($model);
?>

		<div class="row">
		<?php 
echo $form->labelEx($model, 'film_id');
?>
		<?php 
echo $form->dropDownList($model, 'film_id', GxHtml::listDataEx(Film::model()->findAllAttributes(null, true)));
?>
		<?php 
echo $form->error($model, 'film_id');
?>
		</div><!-- row -->
		<div class="row">
		<?php 
echo $form->labelEx($model, 'store_id');
?>
		<?php 
echo $form->dropDownList($model, 'store_id', GxHtml::listDataEx(Store::model()->findAllAttributes(null, true)));
?>
		<?php 
echo $form->error($model, 'store_id');
?>