Preview: PinForm.php
                Size: 1.60 KB
              
              
                
              
            
            /home/jambtst2015/public_html/protected/models/PinForm.php
            <?php
/**
 * ContactForm class.
 * ContactForm is the data structure for keeping
 * contact form data. It is used by the 'contact' action of 'SiteController'.
 */
class PinForm extends CFormModel
{
	public $pinfile;
	public $verifyCode;
	public $validity;
	public $pin_type;
	public $userid;
	public $password;
	
	/**
	 * Declares the validation rules.
	 */
	public function rules()
	{
		
		//echo Helpers::get_controler_name(5);
		return array(
			// name, email, subject and body are required
			
			//array('pinfile', 'ext.validators.fileUploadErrorValidator'),
			//array('pinfile', 'required'),
			//array('pinfile', 'file', 'types'=>'csv', 'message'=>'Jpg files only', 'allowEmpty'=>false, 'on'=>'insert', 'on'=>'update'),
			//array('pinfile', 'file', 'types'=>'jpg')
			//array('pinfile', 'file', 'types'=>'jpg, gif, png'),
			
			array('pinfile', 'file', 'allowEmpty' => true, 'safe' => true, 'types' => 'jpg, jpeg, gif, png'),
			array('pin_type,userid,password','safe')
			//, 'allowEmpty'=>true, 'wrongType'=>Yii::t('app','bad_file')
			
			// email has to be a valid email address
			//array('email', 'email'),
			// verifyCode needs to be entered correctly
			//array('verifyCode', 'captcha', 'allowEmpty'=>!CCaptcha::checkRequirements()),
		);
	}
	/**
	 * Declares customized attribute labels.
	 * If not declared here, an attribute would have a label that is
	 * the same as its name with the first letter in upper case.
	 */
	public function attributeLabels()
	{
		return array(
			//'verifyCode'=>'Verification Code',
			//'pinfile'=>'Verification Code',
		);
		
	}
}
                                          Directory Contents
Dirs: 0 × Files: 45