This repository has been archived by the owner on Apr 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
349 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
/** | ||
* Форма согласия на обработку персональных данных | ||
* Class AcceptProgressDataForm | ||
*/ | ||
class AcceptProgressDataForm extends CFormModel | ||
{ | ||
/** | ||
* @var boolean | ||
*/ | ||
public $accept; | ||
|
||
/** | ||
* @var Users | ||
*/ | ||
protected $_user; | ||
|
||
/** | ||
* AcceptProgressDataForm constructor. | ||
* @param $user Users | ||
* @param string $scenario | ||
*/ | ||
public function __construct($user, $scenario = '') | ||
{ | ||
parent::__construct($scenario); | ||
$this->_user = $user; | ||
} | ||
|
||
/** | ||
* Declares the validation rules. | ||
*/ | ||
public function rules() | ||
{ | ||
return array( | ||
array('accept', 'boolean','allowEmpty'=>false, 'message' => tt('Вы должны дать согласие на обработку ваших персональных данных')), | ||
array('accept','compare','compareValue'=>true, 'message' => tt('Вы должны дать согласие на обработку ваших персональных данных')), | ||
); | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function attributeLabels() | ||
{ | ||
return [ | ||
'accept' => tt('Я даю согласие на обработку моих персональных данных') | ||
]; | ||
} | ||
|
||
/** | ||
* Сохрарение | ||
* @return bool | ||
* @throws CDbException | ||
*/ | ||
public function save(){ | ||
if(!$this->validate()) | ||
return false; | ||
|
||
return $this->_user->saveAttributes([ | ||
'u16' => date('Y-m-d H:i:s') | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?php | ||
|
||
/** | ||
* This is the model class for table "stpfwork". | ||
* | ||
* The followings are the available columns in table 'stpfwork': | ||
* @property integer $stpfwork1 | ||
* @property string $stpfwork2 | ||
* @property string $stpfwork3 | ||
* | ||
* The followings are the available model relations: | ||
* @property St $stpfwork10 | ||
*/ | ||
class Stpfwork extends CActiveRecord | ||
{ | ||
/** | ||
* @return string the associated database table name | ||
*/ | ||
public function tableName() | ||
{ | ||
return 'stpfwork'; | ||
} | ||
|
||
/** | ||
* @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('stpfwork1', 'numerical', 'integerOnly'=>true), | ||
array('stpfwork2, stpfwork3', 'length', 'max'=>400), | ||
); | ||
} | ||
|
||
/** | ||
* @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( | ||
'stpfwork10' => array(self::BELONGS_TO, 'St', 'stpfwork1'), | ||
); | ||
} | ||
|
||
/** | ||
* @return array customized attribute labels (name=>label) | ||
*/ | ||
public function attributeLabels() | ||
{ | ||
return array( | ||
'stpfwork1' => tt('Студент'), | ||
'stpfwork2' => tt('Будущее место проведения интернатуры'), | ||
'stpfwork3' => tt('Будущее место трудоустройства'), | ||
); | ||
} | ||
|
||
/** | ||
* 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 Stpfwork the static model class | ||
*/ | ||
public static function model($className=__CLASS__) | ||
{ | ||
return parent::model($className); | ||
} | ||
} |
Oops, something went wrong.