diff --git a/common/messages/en/app.php b/common/messages/en/app.php index 5015c50..8390678 100644 --- a/common/messages/en/app.php +++ b/common/messages/en/app.php @@ -61,8 +61,28 @@ return [ 'Signup' => 'Signup', + 'Special meal' => 'Special meal', + 'Meal1' => 'Halal', + 'Meal2' => 'Kashrut', + 'Meal3' => 'Vegetarian', + 'Working language' => 'Working language', + 'RusW' => 'Russian', + 'EngW' => 'English', + 'FrW' => 'French', + 'Need visa' => 'Do your need a visa to enter Ukraine?', + 'Passport number' => 'Number ', + 'Passport date' => 'Date of issue', + 'Passport place' => 'Place of issue', + 'Passport valid' => 'Valid untill', + 'Passport details' => 'Passport details:', + 'Phone own' => 'Telephone', + 'Phone office' => 'Telephone (office)', + 'Phone other' => 'Telephone (other)', + 'fax' => 'Fax', + 'Acceptance' => 'Acceptance', + 'Acc text1' => 'I, the undersigned, hereby accept the invitation of the Government of Ukraine and the United Nations (UNECE) to participate in the 9th International Forum on energy for sustainable development, which will take place in Kyiv, Ukraine.', ]; diff --git a/common/messages/fr/app.php b/common/messages/fr/app.php index 9864b76..6fe09c1 100644 --- a/common/messages/fr/app.php +++ b/common/messages/fr/app.php @@ -64,15 +64,26 @@ return [ 'Female' => 'femelle', 'Signup' => 'S\'inscrire', - - - - - - - - - + 'Special meal' => 'Alimentation spéciale', + 'Meal1' => 'Halal', + 'Meal2' => 'Kashrut', + 'Meal3' => 'Végétarien', + 'Working language' => 'Langue de travail', + 'RusW' => 'Russe', + 'EngW' => 'Anglais', + 'FrW' => 'Français', + 'Need visa' => 'Avez-vous besoin d\'un visa pour entrer en Ukraine?', + 'Passport number' => 'Nombre', + 'Passport date' => 'Date d\'Emission', + 'Passport place' => 'Lieu d\'émission', + 'Passport valid' => 'Valide jusqu\'à', + 'Passport details' => 'Informations du passeport:', + 'Phone own' => 'Telephone', + 'Phone office' => 'Telephone (bureau)', + 'Phone other' => 'Telephone (autre)', + 'fax' => 'Fax', + 'Acceptance' => 'Acceptation', + 'Acc text1' => 'Je, soussigné, accepte l’invitation du Gouvernement ukrainien et de l’Organisation des Nations Unies (CEE-ONU) à participer au 9ème Forum international sur l’énergie pour le développement durable, qui se tiendra à Kiev, en Ukraine. ', diff --git a/common/messages/ru/app.php b/common/messages/ru/app.php index d4ea571..b05d63e 100644 --- a/common/messages/ru/app.php +++ b/common/messages/ru/app.php @@ -60,6 +60,35 @@ return [ 'Partners' => 'Международные партнеры', 'Male' => 'мужской', 'Female' => 'женский', + 'Special meal' => 'Особенное питание', + 'Meal1' => 'Халяль', + 'Meal2' => 'Кашрут', + 'Meal3' => 'Вегитарианец', + 'Working language' => 'Рабочий язык', + 'RusW' => 'Русский', + 'EngW' => 'Английский', + 'FrW' => 'Французский', + 'Need visa' => 'Нужна ли Вам виза для въезда в Украину?', + 'Passport number' => 'Серия, номер', + 'Passport date' => 'Дата выдачи', + 'Passport place' => 'Орган выдачи', + 'Passport valid' => 'Действителен до', + 'Passport details' => 'Паспортные данные:', + 'Phone own' => 'Телефон', + 'Phone office' => 'Телефон (рабочий)', + 'Phone other' => 'Телефон (дополнительный)', + 'fax' => 'Факс', + 'Acceptance' => 'СОГЛАСИЕ', + 'Acc text1' => 'Я, нижеподписавшийся, настоящим принимаю приглашение правительства Украины и Организации Объединенных Наций (ЕЭК ООН) принять участие в 9-м Международном форуме по энергетике для устойчивого развития, который состоится в Киеве, Украина.', + + + + + + + + + diff --git a/common/messages/ua/app.php b/common/messages/ua/app.php index f45ab85..eac533c 100644 --- a/common/messages/ua/app.php +++ b/common/messages/ua/app.php @@ -14,8 +14,8 @@ return [ 'Organization' => 'Місце роботи, посада', 'Conference' => 'Міністерська конференція', - 'Geee' => 'Група експертів з енергоефективності(GEEE)', - 'Gere' => 'Група експертів з відновлювальної ененргетики (GERE)', + 'Geee' => 'Група експертів з енергоефективності (GEEE)', + 'Gere' => 'Група експертів з відновлювальної енергетики (GERE)', 'Participation in events' => 'Участь у заходах', 'mark required' => 'відмітити необхідне', @@ -59,7 +59,32 @@ return [ 'Male' => 'чоловік', 'Female' => 'жінка', - 'Signup' => 'Реєстрацiя' + 'Signup' => 'Реєстрацiя', + 'Special meal' => 'ОСОБЛИВЕ ХАРЧУВАННЯ', + 'Meal1' => 'Халяль', + 'Meal2' => 'Кашрут', + 'Meal3' => 'Вегітаріанець', + 'Working language' => 'РОБОЧА МОВА', + 'RusW' => 'Російська', + 'EngW' => 'Англійська', + 'FrW' => 'Французька', + 'Need visa' => 'Чи потрібна Вам віза для в\'їзду в Україну', + 'Passport number' => 'Серія та номер', + 'Passport date' => 'Дата видачі', + 'Passport place' => 'Орган видачі', + 'Passport valid' => 'Дійсний до', + 'Passport details' => 'Паспортні дані:', + 'Phone own' => 'Телефон', + 'Phone office' => 'Телефон (робочий)', + 'Phone other' => 'Телефон (додатковий)', + 'fax' => 'Факс', + 'Acceptance' => 'ЗГОДА', + 'Acc text1' => 'Я, що нижче підписався, цим приймаю запрошення уряду України та Організації Об\'єднаних Націй (ЄЕК ООН) взяти участь у 9-му Міжнародному форумі з енергетики для сталого розвитку, який відбудеться в Києві, Україна.', + + + + + diff --git a/common/models/Customer.php b/common/models/Customer.php index 9297806..6e4f9b8 100644 --- a/common/models/Customer.php +++ b/common/models/Customer.php @@ -24,10 +24,35 @@ * @property bool $conference * @property bool $geee * @property bool $gere + * + * + * New properties + * @property string $phone_own + * @property string $phone_office + * @property string $phone_other + * @property string $fax + * @property integer $passport_number + * @property integer $passport_date + * @property string $passport_place + * @property integer $passport_valid + * @property boolean $need_visa + * @property string $special_meal + * + * @property boolean $working_language_ru + * @property boolean $working_language_en + * @property boolean $working_language_fr + * @property boolean $meal_halal + * @property boolean $meal_kashrut + * @property boolean $meal_vegan + * + * */ class Customer extends \yii\db\ActiveRecord { public $file; + + public $acceptance; + const STATUS_NEW = 2; const STATUS_ACTIVE = 1; const STATUS_NO = 0; @@ -62,6 +87,7 @@ 'gender', 'status', 'language_id', + 'acceptance' ], 'integer', ], @@ -74,6 +100,14 @@ 'conference', 'geee', 'gere', + 'need_visa', + 'working_language_ru', + 'working_language_en', + 'working_language_fr', + 'meal_halal', + 'meal_kashrut', + 'meal_vegan', + ], 'boolean', ], @@ -87,10 +121,26 @@ 'passport', 'email', 'image', + 'passport_place', + 'special_meal', + 'passport_number', + 'passport_date', + 'passport_valid', ], 'string', 'max' => 255, ], + [ + [ + 'phone_own', + 'phone_office', + 'phone_other', + 'fax' + ], + 'string', + 'max' => 30, + ], + [ [ 'gender' ], 'in', @@ -104,14 +154,25 @@ 'gender', 'organization', 'name', - 'secondname', + #'secondname', 'birth', 'citizenship', - 'passport', + #'passport', 'email', + 'passport_number', + 'passport_date', + 'passport_place', + 'passport_valid', + 'need_visa', + 'acceptance' ], 'required', ], + [ + ['acceptance'], + 'compare', + 'compareValue' => 1 + ], ['email', 'email'], ['file', 'file', 'skipOnEmpty' => false, 'checkExtensionByMimeType'=>false,'extensions' => ['png', 'jpg', 'gif'], 'maxSize' => 1024*1024*1024*2] @@ -124,22 +185,32 @@ public function attributeLabels() { return [ - 'id' => Yii::t('app', 'ID'), - 'name' => Yii::t('app', 'Name'), - 'secondname' => Yii::t('app', 'Secondname'), - 'dignity' => Yii::t('app', 'Dignity'), - 'gender' => Yii::t('app', 'Gender'), - 'birth' => Yii::t('app', 'Birth'), - 'citizenship' => Yii::t('app', 'Citizenship'), - 'passport' => Yii::t('app', 'Passport'), - 'email' => Yii::t('app', 'Email'), - 'organization' => Yii::t('app', 'Organization'), - 'status' => Yii::t('app', 'Status'), - 'language_id' => Yii::t('app', 'Language ID'), - 'image' => Yii::t('app', 'Image'), - 'conference' => Yii::t('app', 'Conference'), - 'geee' => Yii::t('app', 'Geee'), - 'gere' => Yii::t('app', 'Gere'), + 'id' => Yii::t('app', 'ID'), + 'name' => Yii::t('app', 'Name'), + 'secondname' => Yii::t('app', 'Secondname'), + 'dignity' => Yii::t('app', 'Dignity'), + 'gender' => Yii::t('app', 'Gender'), + 'birth' => Yii::t('app', 'Birth'), + 'citizenship' => Yii::t('app', 'Citizenship'), + 'passport' => Yii::t('app', 'Passport'), + 'email' => Yii::t('app', 'Email'), + 'organization' => Yii::t('app', 'Organization'), + 'status' => Yii::t('app', 'Status'), + 'language_id' => Yii::t('app', 'Language ID'), + 'image' => Yii::t('app', 'Image'), + 'conference' => Yii::t('app', 'Conference'), + 'geee' => Yii::t('app', 'Geee'), + 'gere' => Yii::t('app', 'Gere'), + 'need_visa' => Yii::t('app', 'Need visa'), + 'passport_number' => Yii::t('app', 'Passport number'), + 'passport_date' => Yii::t('app', 'Passport date'), + 'passport_place' => Yii::t('app', 'Passport place'), + 'passport_valid' => Yii::t('app', 'Passport valid'), + 'phone_own' => Yii::t('app', 'Phone own'), + 'phone_office' => Yii::t('app', 'Phone office'), + 'phone_other' => Yii::t('app', 'Phone other'), + 'fax' => Yii::t('app', 'fax'), + 'acceptance' => Yii::t('app', 'acceptance'), ]; } diff --git a/console/migrations/m180905_072743_customer_add_columns.php b/console/migrations/m180905_072743_customer_add_columns.php new file mode 100644 index 0000000..27eb5b2 --- /dev/null +++ b/console/migrations/m180905_072743_customer_add_columns.php @@ -0,0 +1,72 @@ + office +* 2 phone ==> other +* 3 fax +* 4 phone ==> own +* 5 passport +* 1) number +* 2) date +* 3) place +* 4) valid until +* 6 need visa +* 7 special meal +* 1) halal +* 2) kashrut +* 3) vegetarian +* 8 working language +* 1) rus +* 2) eng +* 3) french + * */ + + public function up() + { + $this->addColumn('customer','phone_own',$this->string(30)); + $this->addColumn('customer','phone_office',$this->string(30)); + $this->addColumn('customer','phone_other',$this->string(30)); + $this->addColumn('customer','fax',$this->string(30)); + $this->addColumn('customer','passport_number',$this->integer()); + $this->addColumn('customer','passport_date',$this->integer()); + $this->addColumn('customer','passport_place',$this->string(200)); + $this->addColumn('customer','passport_valid',$this->integer()); + $this->addColumn('customer','need_visa',$this->boolean()); + #$this->addColumn('customer','working_language',$this->tinyInteger()); + $this->addColumn('customer','special_meal',$this->string(255)->defaultValue('none')); + + + $this->addCommentOnColumn('customer','passport_date','когда выдан'); + $this->addCommentOnColumn('customer','passport_place','кем выдан'); + $this->addCommentOnColumn('customer','passport_valid','действителен до'); + + + + + + } + + public function down() + { + $this->dropColumn('customer','phone_own'); + $this->dropColumn('customer','phone_office'); + $this->dropColumn('customer','phone_other'); + $this->dropColumn('customer','fax'); + $this->dropColumn('customer','passport_number'); + $this->dropColumn('customer','passport_date'); + $this->dropColumn('customer','passport_place'); + $this->dropColumn('customer','passport_valid'); + $this->dropColumn('customer','need_visa'); + $this->dropColumn('customer','special_meal'); + + } + +} diff --git a/console/migrations/m180905_082107_customer_change_some_new_fields.php b/console/migrations/m180905_082107_customer_change_some_new_fields.php new file mode 100644 index 0000000..20c965b --- /dev/null +++ b/console/migrations/m180905_082107_customer_change_some_new_fields.php @@ -0,0 +1,28 @@ +alterColumn('customer','passport_place',$this->string(255)); + $this->alterColumn('customer','special_meal',$this->string(255)); + $this->alterColumn('customer','passport_date',$this->string(255)); + $this->alterColumn('customer','passport_valid',$this->string(255)); + $this->alterColumn('customer','passport_number',$this->string(255)); + } + + public function down() + { + + } + +} diff --git a/console/migrations/m180905_085556_customer_add_work_and_meal_cols.php b/console/migrations/m180905_085556_customer_add_work_and_meal_cols.php new file mode 100644 index 0000000..43cd7cf --- /dev/null +++ b/console/migrations/m180905_085556_customer_add_work_and_meal_cols.php @@ -0,0 +1,35 @@ +addColumn('customer','working_language_ru',$this->boolean()); + $this->addColumn('customer','working_language_en',$this->boolean()); + $this->addColumn('customer','working_language_fr',$this->boolean()); + $this->addColumn('customer','meal_halal',$this->boolean()); + $this->addColumn('customer','meal_kashrut',$this->boolean()); + $this->addColumn('customer','meal_vegan',$this->boolean()); + } + + public function down() + { + $this->dropColumn('customer','working_language_ru'); + $this->dropColumn('customer','working_language_en'); + $this->dropColumn('customer','working_language_fr'); + $this->dropColumn('customer','meal_halal'); + $this->dropColumn('customer','meal_kashrut'); + $this->dropColumn('customer','meal_vegan'); + + } + +} diff --git a/frontend/controllers/SiteController.php b/frontend/controllers/SiteController.php index 932d9b8..ce43451 100755 --- a/frontend/controllers/SiteController.php +++ b/frontend/controllers/SiteController.php @@ -174,7 +174,7 @@ public function actionRegister() { $model = new Customer(); - if ($model->load(\Yii::$app->request->post())) { + if ($model->load(\Yii::$app->request->post()) && $model->acceptance!==0) { $model->file = UploadedFile::getInstance($model, 'file'); if ($model->upload() and $model->save()) { \Yii::$app->session->setFlash( @@ -200,6 +200,7 @@ return $this->redirect([ 'site/index' ]); } + } return $this->render( 'signup', diff --git a/frontend/views/site/signup.php b/frontend/views/site/signup.php index 07fd5cd..a54c997 100755 --- a/frontend/views/site/signup.php +++ b/frontend/views/site/signup.php @@ -32,95 +32,241 @@ $js=$dp->getDatepickerJs();
-
-
- field($model, 'secondname')->textInput(['class' => ''])?> -
+
+
field($model, 'name')->textInput(['class' => ''])?>
- -
- field($model, 'dignity')->textInput(['class' => ''])?> -
- -
-
-
- field($model, 'gender')->dropDownList([ - Customer::MALE => \Yii::t('app', 'Male'), - Customer::FEMALE => \Yii::t('app', 'Female'), - ],['class' => ''])?> -
+
+ field($model, 'organization')->textInput(['class' => ''])?>
-
-
- field($model, 'birth')->textInput(['class' => '_datepicer'])?> -
+
+ field($model, 'email')->textInput(['class' => ''])?>
-
- -
- field($model, 'citizenship')->textInput(['class' => ''])?> -
- -
- field($model, 'passport')->textInput(['class' => ''])?> -
-
- field($model, 'email')->textInput(['class' => ''])?> -
-
- field($model, 'organization')->textInput(['class' => ''])?> -
+ +
+ field($model, 'phone_office')->textInput(['class' => ''])?> +
+ +
+ field($model, 'phone_other')->textInput(['class' => ''])?> +
+ +
+ field($model, 'fax')->textInput(['class' => ''])?> +
+
+ field($model, 'phone_own')->textInput(['class' => ''])?> +
+ +
+ field($model, 'passport_number')->textInput(['class' => ''])?> +
+ +
+ field($model, 'passport_date')->textInput(['class' => '_datepicer'])?> +
+
+ field($model, 'passport_place')->textInput(['class' => ''])?> +
+
+ field($model, 'passport_valid')->textInput(['class' => '_datepicer'])?> +
+
- - ()
- + + ()
+ - + - +
+ + + +
+
+ +
+ + + + + + +
+ + + + + +
+
+ +
+ + +
+ + + + + + + + + + + + + + + +
+
+ +
+ + + + + + + + + + +
+ field($model, 'dignity')->textInput(['class' => ''])?> +
+ + +
+
+
+ field($model, 'gender')->dropDownList([ + Customer::MALE => \Yii::t('app', 'Male'), + Customer::FEMALE => \Yii::t('app', 'Female'), + ],['class' => ''])?> +
+
+
+
+ field($model, 'birth')->textInput(['class' => '_datepicer'])?> +
+
+
+ +
+ field($model, 'citizenship') + ->textInput(['class' => ''])?> +
+
+
+
+ +
+ + + +
- + +
- field($model, 'file',[ + field($model, 'file',[ 'template' => '{label}{input}', ])->fileInput()->label(\Yii::t('app', ' '.\Yii::t("app","Add photo").''))?>
- +
- +
diff --git a/frontend/web/css/changes.css b/frontend/web/css/changes.css index ddd6728..8fab251 100644 --- a/frontend/web/css/changes.css +++ b/frontend/web/css/changes.css @@ -4,4 +4,14 @@ .li_to_upper > li { text-transform: uppercase; +} + + +/* +Стили для текста вне формы(прим: Пасспортные данные), чтобы весь текст имел одинаковый размер +*/ +.signup_text1{ + margin-top: 13px; + float: left; + font-size: 15px; } \ No newline at end of file -- libgit2 0.21.4