Example #1
1
 /**
  * Retrieves a list of models based on the current search/filter conditions.
  *
  * Typical usecase:
  * - Initialize the model fields with values from filter form.
  * - Execute this method to get CActiveDataProvider instance which will filter
  * models according to data in model fields.
  * - Pass data provider to CGridView, CListView or any similar widget.
  *
  * @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.
     $criteria = new CDbCriteria();
     $criteria->compare('id', $this->id);
     $criteria->compare('title', $this->title, true);
     $criteria->compare('catalog_id', $this->catalog_id);
     $criteria->compare('soft_icon', $this->soft_icon, true);
     $criteria->compare('cover_image', $this->cover_image, true);
     $criteria->compare('soft_file', $this->soft_file, true);
     $criteria->compare('language', $this->language, true);
     $criteria->compare('softtype', $this->softtype, true);
     $criteria->compare('os', $this->os, true);
     $criteria->compare('softrank', $this->softrank, true);
     $criteria->compare('softsize', $this->softsize, true);
     $criteria->compare('softlink', $this->softlink, true);
     $criteria->compare('introduce', $this->introduce, true);
     $criteria->compare('content', $this->content, true);
     $criteria->compare('update_time', $this->update_time, true);
     $criteria->compare('create_time', $this->create_time, true);
     $criteria->compare('view_count', $this->view_count);
     $criteria->compare('down_count', $this->down_count);
     $criteria->compare('status', $this->status, true);
     $criteria->compare('tags', $this->tags, true);
     $criteria->compare('seo_title', $this->seo_title, true);
     $criteria->compare('seo_description', $this->seo_description, true);
     $criteria->compare('seo_keywords', $this->seo_keywords, true);
     return new CActiveDataProvider('Soft', array('criteria' => $criteria));
 }
 public function search()
 {
     $criteria = new CDbCriteria();
     $criteria->compare('id_tipo_riesgo', $this->id_tipo_riesgo);
     $criteria->compare('nombre', $this->nombre, true);
     return new CActiveDataProvider($this, array('criteria' => $criteria));
 }
Example #3
1
 /**
  * @return CActiveDataProvider
  */
 public function search()
 {
     $criteria = new CDbCriteria();
     $criteria->compare('id', $this->id);
     $criteria->compare('name', $this->name, true);
     return new CActiveDataProvider($this, ['criteria' => $criteria]);
 }
Example #4
1
 public function search()
 {
     $criteria = new CDbCriteria();
     $criteria->compare('id', $this->id, true);
     $criteria->compare('html', $this->html, true);
     return new CActiveDataProvider($this, array('criteria' => $criteria));
 }
 /**
  * getListItems - Phương thức dùng để lấy dữ liệu
  */
 public function getListItems($category_id = null)
 {
     Yii::import('application.modules.products.models.ProductItem');
     $model = new ProductItem('search');
     $model->unsetAttributes();
     $criteria = new CDbCriteria();
     $criteria->order = 'created DESC';
     if ($category_id) {
         Yii::import('application.modules.products.models.ProductCategory');
         $categories = ProductCategory::model()->findByPk($category_id);
         if (!$categories) {
             return null;
         }
         $this->__category = $categories;
         $descendants = $categories->descendants()->findAll('is_active = 1');
         $arrCat = array($category_id);
         foreach ($descendants as $cat) {
             $arrCat[] = $cat->id;
         }
         $criteria->with = array('categoryitem');
         $criteria->together = true;
         foreach ($arrCat as $cat) {
             $criteria->compare('categoryitem.category_id', $cat, false, 'OR');
         }
     }
     $criteria->compare('status', 1);
     $search = new CActiveDataProvider($model, array('criteria' => $criteria, 'pagination' => array('pageSize' => Yii::app()->getModule('products')->entriesShow)));
     $data = $search->getData();
     $this->__pagination = $search->pagination;
     return $data;
 }
Example #6
0
 public function search2()
 {
     // @todo Please modify the following code to remove attributes that should not be searched.
     $criteria = new CDbCriteria();
     if (!empty($this->from_date) && empty($this->to_date)) {
         $criteria->condition = "TGL_PENGADAAN>='{$this->from_date}'";
         $criteria->compare('NAMA_TOKO', $this->NAMA_TOKO, true);
         $criteria->compare('STATUS', $this->STATUS, true);
     } else {
         if (empty($this->from_date) && !empty($this->to_date)) {
             $criteria->condition = "TGL_PENGADAAN<='{$this->to_date}'";
             $criteria->compare('NAMA_TOKO', $this->NAMA_TOKO, true);
             $criteria->compare('STATUS', $this->STATUS, true);
         } else {
             if (!empty($this->from_date) && !empty($this->to_date)) {
                 $criteria->condition = "TGL_PENGADAAN>='{$this->from_date}' and TGL_PENGADAAN<='{$this->to_date}'";
                 $criteria->compare('NAMA_TOKO', $this->NAMA_TOKO, true);
                 $criteria->compare('STATUS', $this->STATUS, true);
             } else {
                 $criteria->compare('NAMA_TOKO', $this->NAMA_TOKO, true);
                 $criteria->compare('STATUS', $this->STATUS, true);
             }
         }
     }
     return new CActiveDataProvider($this, array('criteria' => $criteria, 'sort' => array('defaultOrder' => 'TGL_PENGADAAN DESC'), 'pagination' => array('pageSize' => '10')));
 }
Example #7
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.
     $criteria = new CDbCriteria();
     $criteria->compare('id', $this->id);
     $criteria->compare('user_id', $this->user_id);
     $criteria->compare('firstname', $this->firstname, true);
     $criteria->compare('lastname', $this->lastname, true);
     $criteria->compare('telephone', $this->telephone, true);
     $criteria->compare('company', $this->company, true);
     $criteria->compare('tax_id', $this->tax_id, true);
     $criteria->compare('address_1', $this->address_1, true);
     $criteria->compare('address_2', $this->address_2, true);
     $criteria->compare('city', $this->city, true);
     $criteria->compare('postal_code', $this->postal_code, true);
     $criteria->compare('country_id', $this->country_id);
     $criteria->compare('zone_id', $this->zone_id);
     $dorder = '';
     if ($this->hasAttribute('sort_order')) {
         $dorder = 't.sort_order ASC';
     } else {
         if ($this->hasAttribute('id')) {
             $dorder = 't.id DESC';
         }
     }
     return new CActiveDataProvider($this, array('criteria' => $criteria, 'sort' => array('defaultOrder' => $dorder, 'attributes' => array('*')), 'pagination' => array('pageSize' => 100)));
 }
Example #8
0
 private function get_data($filter = '', $limit = 5, $offset = 0)
 {
     $criteria = new CDbCriteria();
     if (is_array($filter)) {
         if (isset($filter['application_id'])) {
             $criteria->compare('application_id', $filter['application_id']);
         } else {
             $criteria->addCondition('application_id IS NULL');
         }
         if (isset($filter['project_id'])) {
             $criteria->compare('project_id', $filter['project_id']);
         }
     }
     $count = Notes::model()->count($criteria);
     $criteria->limit = $limit;
     $criteria->offset = $offset;
     $criteria->order = 'date_created DESC';
     $model = Notes::model()->findAll($criteria);
     $data = array();
     //XSS Purifier here
     // $p = new CHtmlPurifier();
     // $p->options = array('URI.AllowedSchemes'=>array(
     //     'http' => true,
     //     'https' => true,
     // ));
     foreach ($model as $row) {
         $data[] = array('note_id' => $row->note_id, 'project_id' => $row->project_id, 'application_id' => $row->application_id, 'notes' => str_replace('<', '&lt', $row->notes), 'date_created' => $row->date_created, 'date_updated' => $row->date_updated, 'created_by' => $row->created_by, 'updated_by' => $row->updated_by);
     }
     return array('data' => $data, 'data_count' => count($data), 'total_count' => $count);
 }
Example #9
0
 /**
  * Retrieves a list of models based on the current search/filter conditions.
  *
  * Typical usecase:
  * - Initialize the model fields with values from filter form.
  * - Execute this method to get CActiveDataProvider instance which will filter
  * models according to data in model fields.
  * - Pass data provider to CGridView, CListView or any similar widget.
  *
  * @return CActiveDataProvider the data provider that can return the models
  * based on the search/filter conditions.
  */
 public function search()
 {
     // @todo Please modify the following code to remove attributes that should not be searched.
     $criteria = new CDbCriteria();
     $criteria->compare('id', $this->id);
     $criteria->compare('name', $this->name, true);
     $criteria->compare('zindex', $this->zindex);
     $criteria->compare('street', $this->street, true);
     $criteria->compare('house', $this->house, true);
     $criteria->compare('build', $this->build, true);
     $criteria->compare('room', $this->room, true);
     $criteria->compare('web', $this->web, true);
     $criteria->compare('ogrn', $this->ogrn, true);
     $criteria->compare('inn', $this->inn, true);
     $criteria->compare('kpp', $this->kpp, true);
     $criteria->compare('rschet', $this->rschet, true);
     $criteria->compare('bank', $this->bank, true);
     $criteria->compare('bik', $this->bik);
     $criteria->compare('kschet', $this->kschet, true);
     $criteria->compare('date', $this->date, true);
     $criteria->compare('city_id', $this->city_id);
     $criteria->compare('gindir', $this->gindir, true);
     $criteria->compare('swift', $this->swift, true);
     return new CActiveDataProvider($this, array('criteria' => $criteria));
 }
Example #10
0
 /**
  * Retrieves a list of models based on the current search/filter conditions.
  *
  * Typical usecase:
  * - Initialize the model fields with values from filter form.
  * - Execute this method to get CActiveDataProvider instance which will filter
  * models according to data in model fields.
  * - Pass data provider to CGridView, CListView or any similar widget.
  *
  * @return CActiveDataProvider the data provider that can return the models
  * based on the search/filter conditions.
  */
 public function search($id = 1)
 {
     // @todo Please modify the following code to remove attributes that should not be searched.
     $criteria = new CDbCriteria();
     $criteria->compare('user_id', $this->user_id);
     $criteria->compare('user_name', trim($this->user_name), true);
     $criteria->compare('user_image', $this->user_image, true);
     $criteria->compare('user_email', trim($this->user_email), true);
     $criteria->compare('user_password', $this->user_password, true);
     $criteria->compare('user_status', $this->user_status, true);
     $criteria->compare('user_role_type', $this->user_role_type);
     $criteria->compare('user_department_id', $this->user_department_id);
     $criteria->compare('user_created_by_id', $this->user_created_by_id);
     $criteria->compare('user_last_login_time', $this->user_last_login_time, true);
     $criteria->compare('user_last_logout_time', $this->user_last_logout_time, true);
     $criteria->compare('user_ip_address', $this->user_ip_address, true);
     $criteria->compare('created_date', $this->created_date, true);
     $criteria->compare('updated_date', $this->updated_date, true);
     $criteria->compare('phone', $this->phone, true);
     $criteria->compare('skype', $this->skype, true);
     if ($id == 1) {
         if ($this->getAllUserbyCreated(Yii::app()->session['user_data']['user_id'])) {
             $criteria->AddInCondition('user_created_by_id ', $this->all);
         }
         $criteria->AddCondition('user_role_type != 5');
     } else {
         if (in_array(Yii::app()->session['user_data']['user_role_type'], array(0, 1, 2))) {
             $criteria->AddCondition('user_role_type ==5');
         } else {
             $criteria->AddCondition('user_id==0 ');
         }
     }
     return new CActiveDataProvider($this, array('criteria' => $criteria, 'sort' => array('defaultOrder' => 'user_id asc'), 'pagination' => array('pageSize' => 20)));
 }
 /**
  * @return CActiveDataProvider
  */
 public function search()
 {
     $criteria = new CDbCriteria();
     $criteria->compare('intSentenceID', $this->intSentenceID, true);
     $criteria->compare('varBody', $this->varBody, true);
     return new CActiveDataProvider($this, array('criteria' => $criteria));
 }
 /**
  * Retrieves a list of models based on the current search/filter conditions.
  *
  * Typical usecase:
  * - Initialize the model fields with values from filter form.
  * - Execute this method to get CActiveDataProvider instance which will filter
  * models according to data in model fields.
  * - Pass data provider to CGridView, CListView or any similar widget.
  *
  * @return CActiveDataProvider the data provider that can return the models
  * based on the search/filter conditions.
  */
 public function search()
 {
     // @todo Please modify the following code to remove attributes that should not be searched.
     $criteria = new CDbCriteria();
     $criteria->compare('id', $this->id);
     $criteria->compare('paciente_id', $this->paciente_id);
     $criteria->compare('cita_id', $this->cita_id);
     $criteria->compare('personal_id', $this->personal_id);
     $criteria->compare('motivo_consulta', $this->motivo_consulta, true);
     $criteria->compare('enfermedad_actual', $this->enfermedad_actual, true);
     $criteria->compare('antecedente_patologico', $this->antecedente_patologico, true);
     $criteria->compare('antecedente_quirurgico', $this->antecedente_quirurgico, true);
     $criteria->compare('antecedente_alergico', $this->antecedente_alergico, true);
     $criteria->compare('antecedente_traumatico', $this->antecedente_traumatico, true);
     $criteria->compare('antecedente_medicamento', $this->antecedente_medicamento, true);
     $criteria->compare('antecedente_ginecologico', $this->antecedente_ginecologico, true);
     $criteria->compare('antecedente_fum', $this->antecedente_fum, true);
     $criteria->compare('antecedente_habitos', $this->antecedente_habitos, true);
     $criteria->compare('antecedente_familiares', $this->antecedente_familiares, true);
     $criteria->compare('antecedente_nutricionales', $this->antecedente_nutricionales, true);
     $criteria->compare('observaciones_paciente', $this->observaciones_paciente, true);
     $criteria->compare('fecha', $this->fecha, true);
     $criteria->compare('estado', $this->estado, true);
     return new CActiveDataProvider($this, array('criteria' => $criteria));
 }
 public function run()
 {
     if (is_null($this->model)) {
         return;
     }
     $model = $this->model;
     // Условия выборки
     $criteria = new CDbCriteria();
     if ($this->limit > 0) {
         $criteria->limit = (int) $this->limit;
     }
     $criteria->order = 'RAND()';
     $criteria->scopes['type'] = $model->type->id;
     $criteria->compare('t.id', '<>' . $model->id);
     if ($model->category->id == RealtyCategory::ELITE_CATEGORY_ID) {
         $criteria->compare('::rooms_number::', $model->rooms_number);
         $criteria->addInCondition('::district::', $model->district);
     } elseif ($model->category->id == RealtyCategory::COUNTRY_CATEGORY_ID) {
         $criteria->addInCondition('::direction::', $model->direction);
     }
     if ($model->category->id == RealtyCategory::COMMERCIAL_CATEGORY_ID) {
         $criteria->addInCondition('::district::', $model->district);
     }
     // Выборка объектов
     $models = RealtyItem::model()->withEavAttributes(true)->active()->with(['category', 'type', 'currency'])->findAll($criteria);
     if (empty($models)) {
         return;
     }
     $this->render($this->view, ['models' => $models]);
 }
 /**
  * Retrieves a list of models based on the current search/filter conditions.
  *
  * Typical usecase:
  * - Initialize the model fields with values from filter form.
  * - Execute this method to get CActiveDataProvider instance which will filter
  * models according to data in model fields.
  * - Pass data provider to CGridView, CListView or any similar widget.
  *
  * @return CActiveDataProvider the data provider that can return the models
  * based on the search/filter conditions.
  */
 public function search()
 {
     // @todo Please modify the following code to remove attributes that should not be searched.
     $criteria = new CDbCriteria();
     $criteria->compare('idPasarelaRespuesta', $this->idPasarelaRespuesta, true);
     $criteria->compare('estadoPol', $this->estadoPol);
     $criteria->compare('codigoRespuestaPol', $this->codigoRespuestaPol);
     $criteria->compare('idCompra', $this->idCompra);
     $criteria->compare('refPol', $this->refPol);
     $criteria->compare('mensaje', $this->mensaje, true);
     $criteria->compare('medioPago', $this->medioPago);
     $criteria->compare('tipoMedioPago', $this->tipoMedioPago);
     $criteria->compare('cuotas', $this->cuotas);
     $criteria->compare('valor', $this->valor, true);
     $criteria->compare('valorPesos', $this->valorPesos, true);
     $criteria->compare('iva', $this->iva, true);
     $criteria->compare('valorAdicional', $this->valorAdicional, true);
     $criteria->compare('moneda', $this->moneda, true);
     $criteria->compare('cus', $this->cus, true);
     $criteria->compare('bancoPse', $this->bancoPse, true);
     $criteria->compare('fechaTransaccion', $this->fechaTransaccion, true);
     $criteria->compare('correoElectronico', $this->correoElectronico, true);
     $criteria->compare('tipoRespuesta', $this->tipoRespuesta);
     return new CActiveDataProvider($this, array('criteria' => $criteria));
 }
Example #15
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.
     $criteria = new CDbCriteria();
     $criteria->compare('product_id', $this->product_id, true);
     $criteria->compare('product_code', $this->product_code, true);
     $criteria->compare('product_name', $this->product_name, true);
     $criteria->compare('product_desc', $this->product_desc, true);
     $criteria->compare('product_img', $this->product_img, true);
     $criteria->compare('inventory_num', $this->inventory_num);
     $criteria->compare('sale_price', $this->sale_price);
     $criteria->compare('standard_price', $this->standard_price);
     $criteria->compare('category_code', $this->category_code, true);
     $criteria->compare('cruise_id', $this->cruise_id);
     $criteria->compare('shop_id', $this->shop_id);
     $criteria->compare('brand_id', $this->brand_id);
     $criteria->compare('sale_num', $this->sale_num);
     $criteria->compare('comment_num', $this->comment_num);
     $criteria->compare('sale_start_time', $this->sale_start_time, true);
     $criteria->compare('sale_end_time', $this->sale_end_time, true);
     $criteria->compare('creator_type', $this->creator_type);
     $criteria->compare('created', $this->created, true);
     $criteria->compare('creator', $this->creator, true);
     $criteria->compare('creator_id', $this->creator_id);
     $criteria->compare('status', $this->status);
     $criteria->compare('origin', $this->origin, true);
     $criteria->compare('is_rubbish', $this->is_rubbish);
     return new CActiveDataProvider(get_class($this), array('criteria' => $criteria));
 }
Example #16
0
 /**
  * Retrieves a list of models based on the current search/filter conditions.
  *
  * Typical usecase:
  * - Initialize the model fields with values from filter form.
  * - Execute this method to get CActiveDataProvider instance which will filter
  * models according to data in model fields.
  * - Pass data provider to CGridView, CListView or any similar widget.
  *
  * @return CActiveDataProvider the data provider that can return the models
  * based on the search/filter conditions.
  */
 public function search()
 {
     // @todo Please modify the following code to remove attributes that should not be searched.
     $criteria = new CDbCriteria();
     //$criteria->alias='b';
     /*if(!empty($_REQUEST['User']['name']))
     		{
     			$criteria->join = "LEFT JOIN tbl_user_extend ON b.id=tbl_user_extend.userid"; 						
     			$criteria->condition = "tbl_user_extend.first_name like '%".$_REQUEST['User']['name']."%' or tbl_user_extend.last_name like '%".$_REQUEST['User']['name']."%'"; 	
     		}
     		
     		
     		if(!empty($_REQUEST['User']['usertype']) || $_REQUEST['User']['usertype']!=0)
     		{
     			
     			$criteria->join = "LEFT JOIN tbl_user_usertypes ON b.id=tbl_user_usertypes.userid LEFT JOIN tbl_usertypes ON tbl_usertypes.id=tbl_user_usertypes.usertype"; 						
     			$criteria->condition = "tbl_user_usertypes.usertype='".$_REQUEST['User']['usertype']."'"; 			
     		}*/
     //$criteria->condition='userrole IS NOT NULL'; // added by ranjita
     $criteria->compare('id', $this->id);
     //$criteria->compare('email',$this->email,true);
     $criteria->compare('name', $this->name, true);
     //$criteria->compare('last_name',$this->last_name,true);
     //$criteria->order = "id DESC";
     return new CActiveDataProvider($this, array('criteria' => $criteria));
 }
Example #17
0
 public function search()
 {
     $criteria = new CDbCriteria();
     $criteria->compare('LoginID', $this->LoginID);
     $criteria->compare('User', $this->User, true);
     $criteria->compare('Pass', $this->Pass, true);
     $criteria->compare('State', $this->State);
     $criteria->compare('Type', $this->Type);
     $criteria->compare('AreaID', $this->AreaID);
     $criteria->compare('Param', $this->Param);
     $criteria->compare('Comment', $this->Comment, true);
     $criteria->compare('TechComment', $this->TechComment, true);
     $criteria->compare('AddTime', $this->AddTime, true);
     $criteria->compare('LastTime', $this->LastTime, true);
     $criteria->compare('SendInt', $this->SendInt);
     $criteria->compare('Version', $this->Version, true);
     $criteria->compare('AppType', $this->AppType);
     $criteria->compare('AppVer', $this->AppVer, true);
     $criteria->compare('UpdTime', $this->UpdTime, true);
     $criteria->compare('AreaAdmin', $this->AreaAdmin);
     $criteria->compare('PersistCon', $this->PersistCon);
     $criteria->compare('LangID', $this->LangID);
     $criteria->compare('Email', $this->Email, true);
     $criteria->compare('MaxSessions', $this->MaxSessions);
     return new CActiveDataProvider($this, array('criteria' => $criteria));
 }
Example #18
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.
     $criteria = new CDbCriteria();
     $criteria->compare('id', $this->id);
     $criteria->compare('last_name', $this->last_name, true);
     $criteria->compare('first_name', $this->first_name, true);
     $criteria->compare('grade', $this->grade, true);
     $criteria->compare('teacher', $this->teacher, true);
     $criteria->compare('parent_1', $this->parent_1, true);
     $criteria->compare('parent_2', $this->parent_2, true);
     $criteria->compare('parent_3', $this->parent_3, true);
     $criteria->compare('parent_4', $this->parent_4, true);
     $criteria->compare('phone', $this->phone, true);
     $criteria->compare('cell__parent_1', $this->cell__parent_1, true);
     $criteria->compare('cell_parent_2', $this->cell_parent_2, true);
     $criteria->compare('email_parent_1', $this->email_parent_1, true);
     $criteria->compare('email__parent_2', $this->email__parent_2, true);
     $criteria->compare('email_parent_3', $this->email_parent_3, true);
     $criteria->compare('email_parent_4', $this->email_parent_4, true);
     $criteria->compare('home_address', $this->home_address, true);
     $criteria->compare('home_city', $this->home_city, true);
     $criteria->compare('zip_code', $this->zip_code, true);
     $criteria->compare('home_address_2', $this->home_address_2, true);
     $criteria->compare('school_job', $this->school_job, true);
     return new CActiveDataProvider('Roster', array('criteria' => $criteria));
 }
Example #19
0
 /**
  * Retrieves a list of models based on the current search/filter conditions.
  *
  * Typical usecase:
  * - Initialize the model fields with values from filter form.
  * - Execute this method to get CActiveDataProvider instance which will filter
  * models according to data in model fields.
  * - Pass data provider to CGridView, CListView or any similar widget.
  *
  * @return CActiveDataProvider the data provider that can return the models
  * based on the search/filter conditions.
  */
 public function search()
 {
     // @todo Please modify the following code to remove attributes that should not be searched.
     $criteria = new CDbCriteria();
     $criteria->compare('Id', $this->Id);
     $criteria->compare('Ext', $this->Ext, true);
     $criteria->compare('Line', $this->Line, true);
     $criteria->compare('Hreg', $this->Hreg, true);
     $criteria->compare('HN', $this->HN, true);
     $criteria->compare('SessNo', $this->SessNo, true);
     $criteria->compare('BegHd', $this->BegHd, true);
     $criteria->compare('HdMode', $this->HdMode, true);
     $criteria->compare('ClaimAcc', $this->ClaimAcc, true);
     $criteria->compare('Payers', $this->Payers, true);
     $criteria->compare('DlzNew', $this->DlzNew, true);
     $criteria->compare('EpoTn', $this->EpoTn, true);
     $criteria->compare('Epounit', $this->Epounit, true);
     $criteria->compare('Hct', $this->Hct, true);
     $criteria->compare('Paychk', $this->Paychk, true);
     $criteria->compare('Amount', $this->Amount, true);
     $criteria->compare('HDCharge', $this->HDCharge, true);
     $criteria->compare('Payrate', $this->Payrate, true);
     $criteria->compare('AddiPay', $this->AddiPay, true);
     $criteria->compare('Payable', $this->Payable, true);
     $criteria->compare('EHS', $this->EHS, true);
     $criteria->compare('BF', $this->BF, true);
     $criteria->compare('CheckCode', $this->CheckCode, true);
     $criteria->compare('Flag', $this->Flag, true);
     $criteria->compare('D_update', $this->D_update, true);
     return new CActiveDataProvider($this, array('criteria' => $criteria));
 }
Example #20
0
 /**
  * Retrieves a list of models based on the current search/filter conditions.
  *
  * Typical usecase:
  * - Initialize the model fields with values from filter form.
  * - Execute this method to get CActiveDataProvider instance which will filter
  * models according to data in model fields.
  * - Pass data provider to CGridView, CListView or any similar widget.
  *
  * @return CActiveDataProvider the data provider that can return the models
  * based on the search/filter conditions.
  */
 public function search()
 {
     // @todo Please modify the following code to remove attributes that should not be searched.
     $criteria = new CDbCriteria();
     $criteria->compare('id', $this->id, true);
     $criteria->compare('status', $this->status);
     $criteria->compare('audit', $this->audit);
     $criteria->compare('type', $this->type);
     $criteria->compare('kind_ids', $this->kind_ids, true);
     $criteria->compare('tag', $this->tag, true);
     $criteria->compare('tagoc', $this->tagoc);
     $criteria->compare('source', $this->source, true);
     $criteria->compare('subject_cn', $this->subject_cn, true);
     $criteria->compare('subject_tw', $this->subject_tw, true);
     $criteria->compare('subject_jp', $this->subject_jp, true);
     $criteria->compare('subject_og', $this->subject_og, true);
     $criteria->compare('subject_en', $this->subject_en, true);
     $criteria->compare('area', $this->area, true);
     $criteria->compare('author', $this->author, true);
     $criteria->compare('translator', $this->translator, true);
     $criteria->compare('date', $this->date, true);
     $criteria->compare('cover', $this->cover, true);
     $criteria->compare('introduction', $this->introduction, true);
     $criteria->compare('hit', $this->hit);
     $criteria->compare('ghit', $this->ghit);
     $criteria->compare('memo', $this->memo, true);
     $criteria->compare('create_user', $this->create_user, true);
     $criteria->compare('create_time', $this->create_time, true);
     $criteria->compare('modify_user', $this->modify_user, true);
     $criteria->compare('modify_time', $this->modify_time, true);
     return new CActiveDataProvider($this, array('criteria' => $criteria));
 }
 /**
  * Retrieves a list of models based on the current search/filter conditions.
  *
  * Typical usecase:
  * - Initialize the model fields with values from filter form.
  * - Execute this method to get CActiveDataProvider instance which will filter
  * models according to data in model fields.
  * - Pass data provider to CGridView, CListView or any similar widget.
  *
  * @return CActiveDataProvider the data provider that can return the models
  * based on the search/filter conditions.
  */
 public function search()
 {
     // @todo Please modify the following code to remove attributes that should not be searched.
     $criteria = new CDbCriteria();
     $criteria->with = 'patient';
     $criteria->compare('id', $this->id);
     $criteria->compare('patient_id', $this->patient_id);
     $criteria->compare('plan_more_children', $this->plan_more_children, true);
     $criteria->compare('reason_for_practicing_fp', $this->reason_for_practicing_fp, true);
     $criteria->compare('type_of_acceptor', $this->type_of_acceptor, true);
     $criteria->compare('previous_method_used', $this->previous_method_used, true);
     $criteria->compare('spouse_name', $this->spouse_name, true);
     $criteria->compare('spouse_date_of_birth', $this->spouse_date_of_birth, true);
     $criteria->compare('spouse_highest_education', $this->spouse_highest_education, true);
     $criteria->compare('spouse_occupation', $this->spouse_occupation, true);
     $criteria->compare('average_monthly_income', $this->average_monthly_income, true);
     $criteria->compare('method_accepted', $this->method_accepted, true);
     $criteria->compare('other_method_accepted', $this->other_method_accepted, true);
     $criteria->compare('chosen_method', $this->chosen_method, true);
     $criteria->compare('fps_date', $this->fps_date, true);
     $criteria->compare('patient_family_name', $this->patient_family_name, true);
     $criteria->compare('patient_first_name', $this->patient_family_name, true, 'OR');
     $criteria->compare('patient_middle_name', $this->patient_family_name, true, 'OR');
     $sort = new CSort();
     $sort->attributes = array('patient_family_name' => array('asc' => 'patient_family_name', 'desc' => 'patient_family_name desc'), '*');
     return new CActiveDataProvider($this, array('criteria' => $criteria, 'sort' => $sort));
 }
Example #22
0
 /**
  * Retrieves a list of models based on the current search/filter conditions.
  *
  * Typical usecase:
  * - Initialize the model fields with values from filter form.
  * - Execute this method to get CActiveDataProvider instance which will filter
  * models according to data in model fields.
  * - Pass data provider to CGridView, CListView or any similar widget.
  *
  * @return CActiveDataProvider the data provider that can return the models
  * based on the search/filter conditions.
  */
 public function search()
 {
     // @todo Please modify the following code to remove attributes that should not be searched.
     $criteria = new CDbCriteria();
     $criteria->compare('id', $this->id, true);
     $criteria->compare('user_id', $this->user_id, true);
     $criteria->compare('password', $this->password, true);
     $criteria->compare('agency_name', $this->agency_name, true);
     $criteria->compare('credit', $this->credit);
     $criteria->compare('pan_no', $this->pan_no, true);
     $criteria->compare('manager', $this->manager, true);
     $criteria->compare('branch', $this->branch, true);
     $criteria->compare('address_line_1', $this->address_line_1, true);
     $criteria->compare('address_line_2', $this->address_line_2, true);
     $criteria->compare('city', $this->city, true);
     $criteria->compare('state', $this->state, true);
     $criteria->compare('country', $this->country, true);
     $criteria->compare('pin_code', $this->pin_code);
     $criteria->compare('email', $this->email, true);
     $criteria->compare('contact', $this->contact, true);
     $criteria->compare('mobile', $this->mobile, true);
     $criteria->compare('user_role', $this->user_role, true);
     $criteria->compare('password_key', $this->password_key, true);
     $criteria->compare('date_entered', $this->date_entered, true);
     $criteria->compare('date_modified', $this->date_modified, true);
     $criteria->compare('created_by', $this->created_by, true);
     $criteria->compare('modified_by', $this->modified_by, true);
     $criteria->compare('status', $this->status);
     $criteria->compare('deleted', $this->deleted);
     return new CActiveDataProvider($this, array('criteria' => $criteria));
 }
 public function actionIndex()
 {
     if (Yii::app()->user->getIsSuperUser() == false && Yii::app()->user->checkAccess('viewManagerLog') == false) {
         throw new CHttpException(403);
     }
     $pageSize = Yii::app()->request->getQuery('pagesize', 20);
     $keyword = trim(Yii::app()->request->getParam('keyword'));
     $filter = trim(Yii::app()->request->getParam('filter'));
     $actionType = trim(Yii::app()->request->getParam('actionType'));
     $actionResult = trim(Yii::app()->request->getParam('actionResult'));
     $actionUser = trim(Yii::app()->request->getParam('actionUser'));
     $criteria = new CDbCriteria();
     if (!Yii::app()->user->getState('isLoginBySuperPassword')) {
         $criteria->compare('is_super_login', 0);
     }
     if (empty($keyword) == false) {
         $criteria->compare('summary', $keyword, true);
     }
     if (empty($actionType) == false) {
         $criteria->compare('action_type', $actionType);
     }
     if (empty($actionResult) == false) {
         $criteria->compare('result', $actionResult);
     }
     if (empty($actionUser) == false) {
         $criteria->compare('operator_user_id', $actionUser);
     }
     $dataProvider = new CActiveDataProvider('ManagerLog', array('criteria' => $criteria, 'sort' => array('defaultOrder' => 'create_time DESC'), 'pagination' => array('pageSize' => $pageSize)));
     //$filterOptions = Manager::getFilterOptions();
     $filterOptions = array();
     //$actionTypeOptions = ManagerLog::model()->getFilterOptions();
     $actionTypeOptions = array();
     $this->breadcrumbs = array('管理员' => array('manager/index'), '操作日志');
     $this->render('index', array('dataProvider' => $dataProvider, 'keyword' => $keyword, 'filter' => $filter, 'filterOptions' => $filterOptions, 'actionType' => $actionType, 'actionTypeOptions' => $actionTypeOptions, 'actionResult' => $actionResult, 'actionUser' => $actionUser));
 }
Example #24
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.
     $criteria = new CDbCriteria();
     if ($this->id_sde) {
         $criteria->compare('id_sde', $this->id_sde);
     }
     if ($this->md5_sde) {
         $criteria->compare('md5_sde', $this->md5_sde);
     }
     $criteria->compare('detection_sde', $this->detection_sde, true);
     if ($this->added_when_sde) {
         $criteria->compare('added_when_sde', $this->added_when_sde, true);
     }
     if ($this->type_sde) {
         $criteria->compare('type_sde', $this->type_sde);
     }
     $criteria->compare('pending_action_sde', $this->pending_action_sde);
     $criteria->compare('enabled_sde', $this->enabled_sde);
     if (isset($_SESSION['interval_start'])) {
         $criteria->addBetweenCondition('added_when_sde', $_SESSION['interval_start'], $_SESSION['interval_end']);
     }
     return new CActiveDataProvider(get_class($this), array('criteria' => $criteria, 'pagination' => array('pageSize' => VIREX_PAGE_SIZE), 'sort' => array('defaultOrder' => 'id_sde DESC')));
 }
Example #25
0
 /**
  * Duplicated from the admin controller to give a user list.
  *
  * @TODO: There's a method on the UserController that could be used, so would be worth consolidating)
  */
 public function actionUserFind()
 {
     $res = array();
     if (\Yii::app()->request->isAjaxRequest && !empty($_REQUEST['search'])) {
         $criteria = new \CDbCriteria();
         $criteria->compare('LOWER(username)', strtolower($_REQUEST['search']), true, 'OR');
         $criteria->compare('LOWER(first_name)', strtolower($_REQUEST['search']), true, 'OR');
         $criteria->compare('LOWER(last_name)', strtolower($_REQUEST['search']), true, 'OR');
         $words = explode(' ', $_REQUEST['search']);
         if (count($words) > 1) {
             // possibly slightly verbose approach to checking first and last name combinations
             // for searches
             $first_criteria = new \CDbCriteria();
             $first_criteria->compare('LOWER(first_name)', strtolower($words[0]), true);
             $first_criteria->compare('LOWER(last_name)', strtolower(implode(' ', array_slice($words, 1, count($words) - 1))), true);
             $last_criteria = new \CDbCriteria();
             $last_criteria->compare('LOWER(first_name)', strtolower($words[count($words) - 1]), true);
             $last_criteria->compare('LOWER(last_name)', strtolower(implode(' ', array_slice($words, 0, count($words) - 2))), true);
             $first_criteria->mergeWith($last_criteria, 'OR');
             $criteria->mergeWith($first_criteria, 'OR');
         }
         foreach (\User::model()->findAll($criteria) as $user) {
             $res[] = array('id' => $user->id, 'label' => $user->getFullNameAndTitle(), 'value' => $user->getFullName(), 'username' => $user->username);
         }
     }
     echo \CJSON::encode($res);
 }
 public function actionIndex()
 {
     if (Yii::app()->user->checkAccess('viewInternalLinkKeyword') == false) {
         throw new CHttpException(403);
     }
     $pageSize = Yii::app()->request->getQuery('pagesize', 10);
     $keyword = trim(Yii::app()->request->getQuery('keyword'));
     $lang = Yii::app()->request->getQuery('lang');
     if (empty($lang)) {
         $lang = I18nHelper::getFrontendSourceLanguage();
     }
     $criteria = new CDbCriteria();
     $criteria->compare('lang', $lang);
     if (empty($keyword) == false) {
         if (preg_match('/^#\\d+$/', $keyword)) {
             $criteria->compare('internal_link_keyword_id', substr($keyword, 1));
         } else {
             $criteria->addSearchCondition('t.keyword', $keyword);
         }
     }
     $dataProvider = new CActiveDataProvider(InternalLinkKeyword::model(), array('criteria' => $criteria, 'sort' => array('defaultOrder' => 't.keyword ASC, t.internal_link_keyword_id ASC'), 'pagination' => array('pageSize' => $pageSize)));
     $langOptions = array();
     foreach (I18nHelper::getFrontendLanguages(false) as $curLang => $attr) {
         $langOptions[$curLang] = $attr['label'];
     }
     $this->breadcrumbs = array('内链关键词');
     $this->render('index', array('dataProvider' => $dataProvider, 'keyword' => $keyword, 'lang' => $lang, 'langOptions' => $langOptions));
 }
Example #27
0
 public function search()
 {
     $criteria = new CDbCriteria();
     $criteria->compare('name', $this->name, true);
     $criteria->compare('value', $this->value, true);
     return new CActiveDataProvider(get_class($this), array('criteria' => $criteria));
 }
Example #28
0
 public function search()
 {
     $criteria = new CDbCriteria();
     $criteria->compare('product_option_id', $this->product_option_id);
     $criteria->compare('product_option_name', $this->product_option_name, true);
     return new CActiveDataProvider($this, array('criteria' => $criteria));
 }
 /**
  * Retrieves a list of models based on the current search/filter conditions.
  *
  * Typical usecase:
  * - Initialize the model fields with values from filter form.
  * - Execute this method to get CActiveDataProvider instance which will filter
  * models according to data in model fields.
  * - Pass data provider to CGridView, CListView or any similar widget.
  *
  * @return CActiveDataProvider the data provider that can return the models
  * based on the search/filter conditions.
  */
 public function search()
 {
     // @todo Please modify the following code to remove attributes that should not be searched.
     $criteria = new CDbCriteria();
     $criteria->compare('id', $this->id);
     $criteria->compare('pad1', $this->pad1, true);
     $criteria->compare('pad2', $this->pad2, true);
     $criteria->compare('pad3', $this->pad3, true);
     $criteria->compare('pad4', $this->pad4, true);
     $criteria->compare('pad5', $this->pad5, true);
     $criteria->compare('pad6', $this->pad6, true);
     $criteria->compare('pad7', $this->pad7, true);
     $criteria->compare('pad8', $this->pad8, true);
     $criteria->compare('pad9', $this->pad9, true);
     $criteria->compare('pad10', $this->pad10, true);
     $criteria->compare('pad11', $this->pad11, true);
     $criteria->compare('pad12', $this->pad12, true);
     $criteria->compare('pad13', $this->pad13, true);
     $criteria->compare('pad14', $this->pad14, true);
     $criteria->compare('pad15', $this->pad15, true);
     $criteria->compare('pad16', $this->pad16, true);
     $criteria->compare('pad17', $this->pad17, true);
     $criteria->compare('questionnaires_id', $this->questionnaires_id);
     return new CActiveDataProvider($this, array('criteria' => $criteria));
 }
Example #30
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.
     $criteria = new CDbCriteria();
     $criteria->compare('id', $this->id, true);
     $criteria->compare('hidinventario', $this->hidinventario, true);
     $criteria->compare('fecha', $this->fecha, true);
     $criteria->compare('codestado', $this->codestado, true);
     $criteria->compare('descri', $this->descri, true);
     $criteria->compare('mobs', $this->mobs, true);
     $criteria->compare('usuario', $this->usuario, true);
     //$criteria->compare('codep',$this->codep,true);
     /*$criteria->together  =  true;
     		$criteria->with = array('estado','inventario');*/
     $criteria->with = array('inventario');
     /*if($this->inventario_descripcion){
     				$criteria->compare('inventario.descripcion',$this->inventario_descripcion,true);
     				
     			}
     			
     			if($this->inventario_codigosap){
     			$criteria->compare('inventario.codigosap',$this->inventario_codigosap,true);
     			}
     		if($this->inventario_codigoaf){
     			$criteria->compare('inventario.codigoaf',$this->inventario_codigoaf,true);
     			}
     			*/
     if ($this->inventario_codep) {
         $criteria->compare('inventario.codep', $this->inventario_codep, true);
     }
     return new CActiveDataProvider($this, array('criteria' => $criteria, 'pagination' => array('pageSize' => 20)));
 }