コード例 #1
0
 /**
  * Retrieves a list of models based on the current search/filter conditions.
  * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
  */
 public function search()
 {
     // Warning: Please modify the following code to remove attributes that
     // should not be searched.
     $commodityId = $_GET['commodityId'];
     $consumables = MyUtility::getNotDeleted('consumable', $commodityId);
     $criteria = new CDbCriteria();
     $criteria->compare('id', $this->id);
     $criteria->compare('commodity_id', $this->commodity_id);
     $criteria->compare('item_id', $this->item_id);
     $criteria->compare('blocked_by', $this->blocked_by);
     $criteria->compare('blocked_on', $this->blocked_on, true);
     $criteria->compare('blocked_from', $this->blocked_from, true);
     $criteria->compare('blocked_to', $this->blocked_to, true);
     $criteria->compare('unblock_by', $this->unblock_by);
     $criteria->compare('unblock_on', $this->unblock_on, true);
     $criteria->compare('blocked_for', $this->blocked_for);
     $criteria->compare('flag', $this->flag, true);
     $criteria->addCondition("unblock_by IS NULL");
     $criteria->addCondition("commodity_id = {$commodityId}");
     $criteria->addInCondition('item_id', $consumables);
     return new CActiveDataProvider($this, array('criteria' => $criteria));
 }
コード例 #2
0
ファイル: _form.php プロジェクト: anjanababu/Asset-Management
	    	<div class="col-md-3 col-sm-6">
	            <div class="span2"><?php 
echo $form->labelEx($model, 'name', array('class' => 'inline-labels'));
?>
</div>
	            <div class="span3"><?php 
echo $form->textField($model, 'name', array('span' => 3, 'maxlength' => 50));
?>
</div>
                    <div class="span2"><?php 
echo $form->labelEx($model, 'category_id', array('class' => 'inline-labels'));
?>
</div>
                    <?php 
// GET ONLY NOT DELETED CATEGORIES
$notDeletedCategories = MyUtility::getNotDeleted('category');
$ccRow = CommodityCategory::model()->findAllByAttributes(array('commodity_id' => $value, 'category_id' => $notDeletedCategories));
?>
                    <div class="span3"><?php 
echo $form->dropDownList($model, 'category_id', CHtml::listData($ccRow, 'path', 'path'), array('span' => 2, 'prompt' => '---'));
?>
</div>
                </div>
	    </div>
	    </tr>
        <tr>
	    	<div class="row">
		    	<div class="col-md-3 col-sm-6">
		            <div class="span2"><?php 
echo $form->labelEx($model, 'location_id', array('class' => 'inline-labels'));
?>