|
Server IP : 127.0.0.1 / Your IP : 127.0.0.1 Web Server : Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.6.3 System : Windows NT WIN-R7LTCC7BPLI 6.3 build 9200 (Windows Server 2012 R2 Datacenter Edition) i586 User : GerbangSIPAD ( 0) PHP Version : 5.6.3 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF Directory (0777) : C:/xampp5/htdocs/bhumie/upload/../protected/models/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
/**
* This is the model class for table "pbb.kelas_tanah".
*
* The followings are the available columns in table 'pbb.kelas_tanah':
* @property string $kd_kls_tanah
* @property string $thn_awal_kls_tanah
* @property string $thn_akhir_kls_tanah
* @property double $nilai_min_tanah
* @property double $nilai_max_tanah
* @property double $nilai_per_m2_tanah
* @property integer $createdby
* @property string $createdtime
* @property integer $updatedby
* @property string $updatedtime
*/
class KelasTanah extends CBhumieRecord
{
public $thn_kelas_tanah;
public $pageSize;
public $numb;
/**
* Returns the static model of the specified AR class.
* @param string $className active record class name.
* @return KelasTanah the static model class
*/
public static function model($className=__CLASS__)
{
return parent::model($className);
}
/**
* @return string the associated database table name
*/
public function tableName()
{
return 'pbb.kelas_tanah';
}
/**
* @return array validation rules for model attributes.
*/
public function rules()
{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
array('kd_kls_tanah, thn_awal_kls_tanah', 'required'),
array('createdby, updatedby', 'numerical', 'integerOnly'=>true),
array('nilai_min_tanah, nilai_max_tanah, nilai_per_m2_tanah', 'numerical'),
array('kd_kls_tanah', 'length', 'max'=>3),
array('thn_awal_kls_tanah, thn_akhir_kls_tanah', 'length', 'max'=>4),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
array('kd_kls_tanah, thn_awal_kls_tanah, thn_akhir_kls_tanah, nilai_min_tanah, nilai_max_tanah, nilai_per_m2_tanah, createdby, createdtime, updatedby, updatedtime', 'safe', 'on'=>'search'),
);
}
/**
* @return array relational rules.
*/
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
);
}
/**
* @return array customized attribute labels (name=>label)
*/
public function attributeLabels()
{
return array(
'kd_kls_tanah' => 'Kd Kls Tanah',
'thn_awal_kls_tanah' => 'Thn Awal Kls Tanah',
'thn_akhir_kls_tanah' => 'Thn Akhir Kls Tanah',
'nilai_min_tanah' => 'Nilai Min Tanah',
'nilai_max_tanah' => 'Nilai Max Tanah',
'nilai_per_m2_tanah' => 'Nilai Per M2 Tanah',
'createdby' => 'Createdby',
'createdtime' => 'Createdtime',
'updatedby' => 'Updatedby',
'updatedtime' => 'Updatedtime',
);
}
/**
* 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('kd_kls_tanah',$this->kd_kls_tanah,true);
$criteria->compare('thn_awal_kls_tanah',$this->thn_awal_kls_tanah,true);
$criteria->compare('thn_akhir_kls_tanah',$this->thn_akhir_kls_tanah,true);
$criteria->compare('nilai_min_tanah',$this->nilai_min_tanah);
$criteria->compare('nilai_max_tanah',$this->nilai_max_tanah);
$criteria->compare('nilai_per_m2_tanah',$this->nilai_per_m2_tanah);
$criteria->compare('createdby',$this->createdby);
$criteria->compare('createdtime',$this->createdtime,true);
$criteria->compare('updatedby',$this->updatedby);
$criteria->compare('updatedtime',$this->updatedtime,true);
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
}
public function searchKlsTanah()
{
$criteriaKlsTanah=new CDbCriteria;
$criteriaKlsTanah->select = "0+row_number() OVER(ORDER BY kd_kls_tanah, thn_awal_kls_tanah, thn_akhir_kls_tanah, nilai_min_tanah, nilai_max_tanah, nilai_per_m2_tanah) as numb, kd_kls_tanah, thn_awal_kls_tanah, thn_akhir_kls_tanah, nilai_min_tanah, nilai_max_tanah, nilai_per_m2_tanah";
$criteriaKlsTanah->compare('kd_kls_tanah',$this->kd_kls_tanah,true);
$criteriaKlsTanah->compare('thn_awal_kls_tanah',$this->thn_awal_kls_tanah,true);
$criteriaKlsTanah->compare('thn_akhir_kls_tanah',$this->thn_akhir_kls_tanah,true);
$criteriaKlsTanah->compare('nilai_min_tanah',$this->nilai_min_tanah);
$criteriaKlsTanah->compare('nilai_max_tanah',$this->nilai_max_tanah);
$criteriaKlsTanah->compare('nilai_per_m2_tanah',$this->nilai_per_m2_tanah);
if($this->thn_awal_kls_tanah == '') {
$this->thn_awal_kls_tanah = date('Y');
$criteriaKlsTanah->condition = "thn_awal_kls_tanah <= '$this->thn_awal_kls_tanah' AND thn_akhir_kls_tanah >= '$this->thn_awal_kls_tanah'";
} else {
$criteriaKlsTanah->condition = "thn_awal_kls_tanah <= '$this->thn_awal_kls_tanah' AND thn_akhir_kls_tanah >= '$this->thn_awal_kls_tanah'";
}
return new CActiveDataProvider($this, array(
'pagination'=>array(
'pageSize'=>Yii::app()->user->getState('pageSize',Yii::app()->params['defaultPageSize']),
),
'criteria'=>$criteriaKlsTanah,
/*'pagination'=>array(
'pageSize'=>20,
)*/
));
}
}