Server IP : 103.233.192.212 / Your IP : 52.14.238.102 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 : |
<?php /** * This is the model class for table "tb_download". * * The followings are the available columns in table 'tb_download': * @property integer $id * @property string $title * @property string $path * @property integer $type */ class tbHelpPersonDownload extends CActiveRecord { /** * @return string the associated database table name */ public function tableName() { return 'tb_helpperson_download'; } /** * @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('title, path, type', 'required','message'=>'{attribute} ## ห้ามเป็นข้อมูลว่าง.'), array('path', 'file', 'types'=>'doc,docx,pdf,ppt,pptx,xlsx,xls', 'maxSize' => 10485760, 'wrongType'=> 'กรุณาใช้ไฟล์ doc,docx,pdf,ppt,pptx,xlsx,xls เท่านั้น.','message'=>'{attribute} ## กรุณาใช้ไฟล์ doc,docx,pdf,ppt,pptx,xlsx,xls เท่านั้น. '), array('type', 'numerical', 'integerOnly'=>true), array('title', 'length', 'max'=>255), // The following rule is used by search(). // @todo Please remove those attributes that should not be searched. array('id, title, path, type', '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( 'id' => 'ID', 'title' => 'ชื่อ', 'path' => 'ไฟล์', 'type' => 'ประเภท', ); } /** * Retrieves a list of models based on the current search/filter conditions. * * Typical usecase: * - Initialize the model fields with values from filter form. * - Execute this method to get CActiveDataProvider instance which will filter * models according to data in model fields. * - Pass data provider to CGridView, CListView or any similar widget. * * @return CActiveDataProvider the data provider that can return the models * based on the search/filter conditions. */ public function search() { // @todo Please modify the following code to remove attributes that should not be searched. $criteria=new CDbCriteria; $criteria->compare('id',$this->id); $criteria->compare('title',$this->title,true); $criteria->compare('path',$this->path,true); $criteria->compare('type',$this->type); return new CActiveDataProvider($this, array( 'criteria'=>$criteria, )); } /** * Returns the static model of the specified AR class. * Please note that you should have this exact method in all your CActiveRecord descendants! * @param string $className active record class name. * @return TbDownload the static model class */ public static function model($className=__CLASS__) { return parent::model($className); } }