|
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 ] |
|---|
<?php
/**
* This is the model class for table "pbb.kalibrasi".
*
* The followings are the available columns in table 'pbb.kalibrasi':
* @property string $kd_propinsi
* @property string $kd_dati2
* @property string $kd_kecamatan
* @property string $kd_kelurahan
* @property string $thn_kalibrasi
* @property integer $indeks_kalibrasi
* @property string $tgl_kalibrasi
* @property string $nip_pengkalibrasi
* @property integer $createdby
* @property string $createdtime
* @property integer $updatedby
* @property string $updatedtime
*/
class Kalibrasi extends CBhumieRecord
{
/**
* Returns the static model of the specified AR class.
* @param string $className active record class name.
* @return Kalibrasi 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.kalibrasi';
}
/**
* @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('thn_kalibrasi', 'required'),
array('indeks_kalibrasi, createdby, updatedby', 'numerical', 'integerOnly'=>true),
array('kd_propinsi, kd_dati2', 'length', 'max'=>2),
array('kd_kecamatan, kd_kelurahan', 'length', 'max'=>3),
array('thn_kalibrasi', 'length', 'max'=>4),
array('nip_pengkalibrasi', 'length', 'max'=>18),
array('tgl_kalibrasi', 'safe'),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
array('kd_propinsi, kd_dati2, kd_kecamatan, kd_kelurahan, thn_kalibrasi, indeks_kalibrasi, tgl_kalibrasi, nip_pengkalibrasi, 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_propinsi' => 'Kd Propinsi',
'kd_dati2' => 'Kd Dati2',
'kd_kecamatan' => 'Kd Kecamatan',
'kd_kelurahan' => 'Kd Kelurahan',
'thn_kalibrasi' => 'Thn Kalibrasi',
'indeks_kalibrasi' => 'Indeks Kalibrasi',
'tgl_kalibrasi' => 'Tgl Kalibrasi',
'nip_pengkalibrasi' => 'Nip Pengkalibrasi',
'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_propinsi',$this->kd_propinsi,true);
$criteria->compare('kd_dati2',$this->kd_dati2,true);
$criteria->compare('kd_kecamatan',$this->kd_kecamatan,true);
$criteria->compare('kd_kelurahan',$this->kd_kelurahan,true);
$criteria->compare('thn_kalibrasi',$this->thn_kalibrasi,true);
$criteria->compare('indeks_kalibrasi',$this->indeks_kalibrasi);
$criteria->compare('tgl_kalibrasi',$this->tgl_kalibrasi,true);
$criteria->compare('nip_pengkalibrasi',$this->nip_pengkalibrasi,true);
$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 procCekData($txt_kd_propinsi, $txt_kd_dati2, $txt_kd_kecamatan, $txt_kd_kelurahan, $tahunPajak){
$qry = 'SELECT coalesce(MAX(INDEKS_KALIBRASI),0) as maxindeks
FROM pbb.KALIBRASI
WHERE KD_PROPINSI = :txt_kd_propinsi
AND KD_DATI2 = :txt_kd_dati2
AND KD_KECAMATAN = :txt_kd_kecamatan
AND THN_KALIBRASI = :txt_thn_pajak';
if(($txt_kd_kelurahan!="")){
$qry = $qry. " AND KD_KELURAHAN = :txt_kd_kelurahan";
}
$command = Yii::app()->db->createCommand($qry);
$command->bindParam(":txt_kd_propinsi",$txt_kd_propinsi,PDO::PARAM_STR);
$command->bindParam(":txt_kd_dati2",$txt_kd_dati2,PDO::PARAM_STR);
$command->bindParam(":txt_kd_kecamatan",$txt_kd_kecamatan,PDO::PARAM_STR);
if(($txt_kd_kelurahan!="")){
$command->bindParam(":txt_kd_kelurahan",$txt_kd_kelurahan,PDO::PARAM_STR);
}
$command->bindParam(":txt_thn_pajak",$tahunPajak,PDO::PARAM_STR);
$data = $command->queryAll();
return $data[0]['maxindeks'];
}
public function objekPajak($kd_propinsi, $kd_dati2, $kd_kecamatan, $kd_kelurahan, $thn_pajak)
{
$qryObjekPajak = 'SELECT COUNT(distinct(subjek_pajak_id)) as nsubjekpajak
FROM pbb.dat_objek_pajak
WHERE kd_propinsi = :txt_kd_propinsi
AND kd_dati2 = :txt_kd_dati2
AND kd_kecamatan = :txt_kd_kecamatan';
if($kd_kelurahan!=""){
$qryObjekPajak = $qryObjekPajak." AND kd_kelurahan = :txt_kd_kelurahan";
}
$command = Yii::app()->db->createCommand($qryObjekPajak);
$command->bindParam(":txt_kd_propinsi",$kd_propinsi,PDO::PARAM_STR);
$command->bindParam(":txt_kd_dati2",$kd_dati2,PDO::PARAM_STR);
$command->bindParam(":txt_kd_kecamatan",$kd_kecamatan,PDO::PARAM_STR);
if($kd_kelurahan!=""){
$command->bindParam(":txt_kd_kelurahan",$kd_kelurahan,PDO::PARAM_STR);
}
$data = $command->queryAll();
return $data[0]['nsubjekpajak'];
}
public function subjekPajak($kd_propinsi, $kd_dati2, $kd_kecamatan, $kd_kelurahan, $thn_pajak)
{
$qrySubjekPajak = 'SELECT DISTINCT subjek_pajak_id
FROM pbb.dat_objek_pajak
WHERE kd_propinsi = :txt_kd_propinsi AND
kd_dati2 = :txt_kd_dati2 AND
kd_kecamatan = :txt_kd_kecamatan AND
kd_kelurahan = :txt_kd_kelurahan';
$command = Yii::app()->db->createCommand($qrySubjekPajak);
$command->bindParam(":txt_kd_propinsi",$kd_propinsi,PDO::PARAM_STR);
$command->bindParam(":txt_kd_dati2",$kd_dati2,PDO::PARAM_STR);
$command->bindParam(":txt_kd_kecamatan",$kd_kecamatan,PDO::PARAM_STR);
$command->bindParam(":txt_kd_kelurahan",$kd_kelurahan,PDO::PARAM_STR);
$data = $command->queryAll();
return $data;
}
public function njoptkpTgh($vlc_subjek_pajak_id, $thn_pajak)
{
$qryfunc='SELECT pbb.NJOPTKP_TGH(\'%s\',\'%s\')';
$data = Yii::app()->db->createCommand(sprintf($qryfunc, $vlc_subjek_pajak_id, $thn_pajak))->execute();
// $qryfunc="SELECT pbb.NJOPTKP_TGH('".$vlc_subjek_pajak_id."', '".$thn_pajak."')";
// $data = Yii::app()->db->createCommand($qryfunc)->execute();
// $qryfunc='SELECT pbb.NJOPTKP_TGH(":txt_subjek_pajak_id", ":txt_thn_pajak")';
// $command = Yii::app()->db->createCommand($qrySubjekPajak);
// $command->bindParam(":txt_subjek_pajak_id",$vlc_subjek_pajak_id,PDO::PARAM_STR);
// $command->bindParam(":txt_thn_pajak",$thn_pajak,PDO::PARAM_STR);
// $data = $command->queryAll();
return $data;
}
public function qryKalibrasi($txt_kd_propinsi, $txt_kd_dati2, $txt_kd_kecamatan, $txt_kd_kelurahan, $txt_thn_pajak, $VLN_CEK, $nip_pegawai)
{
$qryKalibrasi = 'INSERT INTO pbb.KALIBRASI (KD_PROPINSI, KD_DATI2, KD_KECAMATAN, KD_KELURAHAN, THN_KALIBRASI, INDEKS_KALIBRASI, NIP_PENGKALIBRASI)
VALUES(:txt_kd_propinsi, :txt_kd_dati2, :txt_kd_kecamatan, :txt_kd_kelurahan, :txt_thn_pajak, :VLN_CEK, :NIP_USER)';
$command = Yii::app()->db->createCommand($qryKalibrasi);
$command->bindParam(":txt_kd_propinsi",$txt_kd_propinsi,PDO::PARAM_STR);
$command->bindParam(":txt_kd_dati2",$txt_kd_dati2,PDO::PARAM_STR);
$command->bindParam(":txt_kd_kecamatan",$txt_kd_kecamatan,PDO::PARAM_STR);
$command->bindParam(":txt_kd_kelurahan",$txt_kd_kelurahan,PDO::PARAM_STR);
$command->bindParam(":txt_thn_pajak",$txt_thn_pajak,PDO::PARAM_STR);
$command->bindParam(":VLN_CEK",$VLN_CEK,PDO::PARAM_INT);
$command->bindParam(":NIP_USER",$nip_pegawai,PDO::PARAM_STR);
$data = $command->execute();
return $data;
}
}