コード例 #1
0
ファイル: _form.php プロジェクト: hatems30/cars
	<div class="row">
            <!--
		<?php 
// echo $form->labelEx($model,'supplier_id');
?>
		<?php 
//echo $form->textField($model,'supplier_id');
?>
		
            -->
            <?php 
echo '<b>المورد</b>';
?>
            <?php 
echo $form->dropDownList($model, 'supplier_id', CHtml::listData(suppliers::model()->findAll(), 'supplier_id', 'supplier_name'));
?>
  
            <?php 
echo $form->error($model, 'supplier_id');
?>
	</div>

	<div class="row buttons">
		<?php 
echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save');
?>
	</div>

<?php 
$this->endWidget();
コード例 #2
0
 /**
  * Lists all models.
  */
 public function actionIndex()
 {
     $criteria = new CDbCriteria();
     $count = suppliers::model()->count($criteria);
     //echo $count;
     $pages = new CPagination($count);
     // results per page
     $pages->pageSize = 2;
     $pages->applyLimit($criteria);
     $models = Suppliers::model()->with('suppliersContacts')->findAll($criteria);
     $this->render('index', array('models' => $models, 'pages' => $pages));
 }