AnonSec Team
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/protected/models/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : C:/xampp5/htdocs/bhumie/protected/models/KelasBangunan.php
<?php

/**
 * This is the model class for table "pbb.kelas_bangunan".
 *
 * The followings are the available columns in table 'pbb.kelas_bangunan':
 * @property string $kd_kls_bng
 * @property string $thn_awal_kls_bng
 * @property string $thn_akhir_kls_bng
 * @property double $nilai_min_bng
 * @property double $nilai_max_bng
 * @property double $nilai_per_m2_bng
 * @property integer $createdby
 * @property string $createdtime
 * @property integer $updatedby
 * @property string $updatedtime
 * @property string $warna
 */
class KelasBangunan extends CBhumieRecord
{
        public $thn_kelas_bng;
		public $pageSize;
		public $numb;
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return KelasBangunan 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_bangunan';
	}

	/**
	 * @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_bng, thn_awal_kls_bng, createdby, createdtime, updatedby, updatedtime', 'required'),
			array('createdby, updatedby', 'numerical', 'integerOnly'=>true),
			array('nilai_min_bng, nilai_max_bng, nilai_per_m2_bng', 'numerical'),
			array('kd_kls_bng', 'length', 'max'=>3),
			array('thn_awal_kls_bng, thn_akhir_kls_bng', 'length', 'max'=>4),
			//array('warna', 'length', 'max'=>7),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			//array('kd_kls_bng, thn_awal_kls_bng, thn_akhir_kls_bng, nilai_min_bng, nilai_max_bng, nilai_per_m2_bng, createdby, createdtime, updatedby, updatedtime, warna', 'safe', 'on'=>'search'),
			array('kd_kls_bng, thn_awal_kls_bng, thn_akhir_kls_bng, nilai_min_bng, nilai_max_bng, nilai_per_m2_bng, 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_bng' => 'Kd Kls Bng',
			'thn_awal_kls_bng' => 'Thn Awal Kls Bng',
			'thn_akhir_kls_bng' => 'Thn Akhir Kls Bng',
			'nilai_min_bng' => 'Nilai Min Bng',
			'nilai_max_bng' => 'Nilai Max Bng',
			'nilai_per_m2_bng' => 'Nilai Per M2 Bng',
			'createdby' => 'Createdby',
			'createdtime' => 'Createdtime',
			'updatedby' => 'Updatedby',
			'updatedtime' => 'Updatedtime',
			//'warna' => 'Warna',
		);
	}

	/**
	 * 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_bng',$this->kd_kls_bng,true);
		$criteria->compare('thn_awal_kls_bng',$this->thn_awal_kls_bng,true);
		$criteria->compare('thn_akhir_kls_bng',$this->thn_akhir_kls_bng,true);
		$criteria->compare('nilai_min_bng',$this->nilai_min_bng);
		$criteria->compare('nilai_max_bng',$this->nilai_max_bng);
		$criteria->compare('nilai_per_m2_bng',$this->nilai_per_m2_bng);
		$criteria->compare('createdby',$this->createdby);
		$criteria->compare('createdtime',$this->createdtime,true);
		$criteria->compare('updatedby',$this->updatedby);
		$criteria->compare('updatedtime',$this->updatedtime,true);
		//$criteria->compare('warna',$this->warna,true);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
	
	public function searchKlsBangunan()
	{
		$criteriaKlsBng=new CDbCriteria;
		
		$criteriaKlsBng->select = "0+row_number() OVER(ORDER BY kd_kls_bng, thn_awal_kls_bng, thn_akhir_kls_bng, nilai_min_bng, nilai_max_bng, nilai_per_m2_bng) as numb, kd_kls_bng, thn_awal_kls_bng, thn_akhir_kls_bng, nilai_min_bng, nilai_max_bng, nilai_per_m2_bng";
		$criteriaKlsBng->compare('kd_kls_bng',$this->kd_kls_bng,true);
		$criteriaKlsBng->compare('thn_awal_kls_bng',$this->thn_awal_kls_bng,true);
		$criteriaKlsBng->compare('thn_akhir_kls_bng',$this->thn_akhir_kls_bng,true);
		$criteriaKlsBng->compare('nilai_min_bng',$this->nilai_min_bng);
		$criteriaKlsBng->compare('nilai_max_bng',$this->nilai_max_bng);
		$criteriaKlsBng->compare('nilai_per_m2_bng',$this->nilai_per_m2_bng);
		if($this->thn_awal_kls_bng == '') {
			$this->thn_awal_kls_bng = date('Y');
			$criteriaKlsBng->condition = "thn_awal_kls_bng <= '$this->thn_awal_kls_bng' AND thn_akhir_kls_bng >= '$this->thn_awal_kls_bng'";
		} else {
			$criteriaKlsBng->condition = "thn_awal_kls_bng <= '$this->thn_awal_kls_bng' AND thn_akhir_kls_bng >= '$this->thn_awal_kls_bng'";
		}
		
		return new CActiveDataProvider($this, array(
			'pagination'=>array(
				'pageSize'=>Yii::app()->user->getState('pageSize',Yii::app()->params['defaultPageSize']),
			),
			'criteria'=>$criteriaKlsBng,
			/*'pagination'=>array(
				'pageSize'=>20,
			)*/
		));
	}
}

AnonSec - 2021