Commit 7f202ff6 by Prasong Putichanchai

Merge branch 'integration' into prasong

parents 8ddf3028 e9769db3
...@@ -177,7 +177,7 @@ class UsersController extends AppController { ...@@ -177,7 +177,7 @@ class UsersController extends AppController {
$dateNow = $today->i18nFormat('yyyy-MM-dd HH:mm:ss'); $dateNow = $today->i18nFormat('yyyy-MM-dd HH:mm:ss');
$hasher = new DefaultPasswordHasher(); $hasher = new DefaultPasswordHasher();
$firstname = $this->request->data['firstname']; $firstname = $this->request->data['firstname'];
// $phone_no = $this->request->data['phone_no']; // $moblie_no = $this->request->data['moblie_no'];
$lastname = $this->request->data['lastname']; $lastname = $this->request->data['lastname'];
$master_country_id = $this->request->data['master_country_id']; $master_country_id = $this->request->data['master_country_id'];
$master_province_id = $this->request->data['master_province_id']; $master_province_id = $this->request->data['master_province_id'];
...@@ -245,10 +245,10 @@ class UsersController extends AppController { ...@@ -245,10 +245,10 @@ class UsersController extends AppController {
return $this->redirect(['controller' => 'Users', 'action' => 'pinCode/' . $users['token']]); return $this->redirect(['controller' => 'Users', 'action' => 'pinCode/' . $users['token']]);
// return $this->redirect(['action' => 'signin']); // return $this->redirect(['action' => 'signin']);
} }
$this->Flash->error(__('Username or Email Address already used by others.')); $this->Flash->error(__('This email is already in the system.'));
return $this->redirect(['action' => 'signup']); return $this->redirect(['action' => 'signup']);
} else if (empty($this->request->data['accept'])) { } else if (empty($this->request->data['accept'])) {
$this->Flash->error(__('please accept')); $this->Flash->error(__('Please accept the Terms of Use.'));
return $this->redirect(['action' => 'signup']); return $this->redirect(['action' => 'signup']);
} }
$this->Flash->error(__('The article could not be saved. Please, try again.')); $this->Flash->error(__('The article could not be saved. Please, try again.'));
...@@ -361,7 +361,7 @@ class UsersController extends AppController { ...@@ -361,7 +361,7 @@ class UsersController extends AppController {
//pr($user_personals);die; //pr($user_personals);die;
$data_notification = []; $data_notification = [];
$data_notification['email'] = $this->request->data['email']; $data_notification['email'] = $this->request->data['email'];
$data_notification['pin_code'] = $users['pin_pass']; $data_notification['pin_code'] = $users['pin_pass'].'<br>Username:'.$users['username'];
$this->notification($data_notification); $this->notification($data_notification);
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
$this->Users->save($users); $this->Users->save($users);
......
...@@ -24,6 +24,7 @@ msgid "username" ...@@ -24,6 +24,7 @@ msgid "username"
msgstr "Username" msgstr "Username"
#: Controller/ProfilesController.php/index.ctp:68,69 #: Controller/ProfilesController.php/index.ctp:68,69
#: View/Users/signup:13
msgid "firstname" msgid "firstname"
msgstr "Firstname" msgstr "Firstname"
...@@ -72,6 +73,8 @@ msgid "SAVE" ...@@ -72,6 +73,8 @@ msgid "SAVE"
msgstr "SAVE" msgstr "SAVE"
#: Controller/ProfilesController.php/index.ctp:226 #: Controller/ProfilesController.php/index.ctp:226
#: View/Users:248
#: View/Users/signup:222
msgid "This email is already in the system." msgid "This email is already in the system."
msgstr "This email is already in the system." msgstr "This email is already in the system."
...@@ -80,14 +83,17 @@ msgid "only numbers" ...@@ -80,14 +83,17 @@ msgid "only numbers"
msgstr "Please enter only numbers" msgstr "Please enter only numbers"
#: Controller/ProfilesController.php/index.ctp:244 #: Controller/ProfilesController.php/index.ctp:244
#: View/Users/signup:261
msgid "Please enter your firstname." msgid "Please enter your firstname."
msgstr "Please enter your firstname." msgstr "Please enter your firstname."
#: Controller/ProfilesController.php/index.ctp:249 #: Controller/ProfilesController.php/index.ctp:249
#: View/Users/signup:266
msgid "Please enter your lastname." msgid "Please enter your lastname."
msgstr "Please enter your lastname." msgstr "Please enter your lastname."
#: Controller/ProfilesController.php/index.ctp:255 #: Controller/ProfilesController.php/index.ctp:255
#: View/Users/signup:293
msgid "Please enter your birthdate." msgid "Please enter your birthdate."
msgstr "Please enter your birthdate." msgstr "Please enter your birthdate."
...@@ -108,10 +114,12 @@ msgid "Email address format wrong, Please enter the correct number." ...@@ -108,10 +114,12 @@ msgid "Email address format wrong, Please enter the correct number."
msgstr "Email address format wrong, Please enter the correct number." msgstr "Email address format wrong, Please enter the correct number."
#: Controller/ProfilesController.php/index.ctp:291 #: Controller/ProfilesController.php/index.ctp:291
#: View/Users/signup:281
msgid "Please specify country" msgid "Please specify country"
msgstr "Please select country" msgstr "Please select country"
#: Controller/ProfilesController.php/index.ctp:296 #: Controller/ProfilesController.php/index.ctp:296
#: View/Users/signup:286
msgid "Please specify province" msgid "Please specify province"
msgstr "Please select province" msgstr "Please select province"
...@@ -128,10 +136,12 @@ msgid "Not update. Please, try again." ...@@ -128,10 +136,12 @@ msgid "Not update. Please, try again."
msgstr "Not update. Please, try again." msgstr "Not update. Please, try again."
#: Controller/UsersController.php/forgot_password.ctp:14 #: Controller/UsersController.php/forgot_password.ctp:14
#: View/Users/signup:102
msgid "Email" msgid "Email"
msgstr "Email" msgstr "Email"
#: Controller/UsersController.php/forgot_password.ctp:34 #: Controller/UsersController.php/forgot_password.ctp:34
#: View/Users/signup:310
msgid "Please enter your email." msgid "Please enter your email."
msgstr "Please enter your email." msgstr "Please enter your email."
...@@ -144,14 +154,17 @@ msgid "Forgot password" ...@@ -144,14 +154,17 @@ msgid "Forgot password"
msgstr "Forgot password" msgstr "Forgot password"
#: Controller/UsersController.php/pin_codepassword.ctp:3 #: Controller/UsersController.php/pin_codepassword.ctp:3
#: View/Users/pin_code:3
msgid "Verify PIN" msgid "Verify PIN"
msgstr "Verify PIN" msgstr "Verify PIN"
#: Controller/UsersController.php/pin_codepassword.ctp:18 #: Controller/UsersController.php/pin_codepassword.ctp:18
#: View/Users/pin_code:16
msgid "4 digit PIN in the email address specified for access" msgid "4 digit PIN in the email address specified for access"
msgstr "4 digit PIN in the email address specified for access" msgstr "4 digit PIN in the email address specified for access"
#: Controller/UsersController.php/pin_codepassword.ctp:40 #: Controller/UsersController.php/pin_codepassword.ctp:40
#: View/Users/pin_code:40
msgid "Re-send pin code" msgid "Re-send pin code"
msgstr "Re-send pin code" msgstr "Re-send pin code"
...@@ -170,6 +183,7 @@ msgstr "Submit" ...@@ -170,6 +183,7 @@ msgstr "Submit"
#: Controller/UsersController.php/change_forgotpassword.ctp:49 #: Controller/UsersController.php/change_forgotpassword.ctp:49
#: Controller/UsersController.php/change_forgotpassword.ctp:58 #: Controller/UsersController.php/change_forgotpassword.ctp:58
#: View/Users/signup:254
msgid "Please enter only English letters and numbers." msgid "Please enter only English letters and numbers."
msgstr "Please enter only English letters and numbers." msgstr "Please enter only English letters and numbers."
...@@ -182,10 +196,12 @@ msgid "Please enter a new password at least 8 characters." ...@@ -182,10 +196,12 @@ msgid "Please enter a new password at least 8 characters."
msgstr "Please enter a new password at least 8 characters." msgstr "Please enter a new password at least 8 characters."
#: Controller/UsersController.php/change_forgotpassword.ctp:77 #: Controller/UsersController.php/change_forgotpassword.ctp:77
#: View/Users/signup:322
msgid "Please enter your password." msgid "Please enter your password."
msgstr "Please enter your password." msgstr "Please enter your password."
#: Controller/UsersController.php/change_forgotpassword.ctp:82 #: Controller/UsersController.php/change_forgotpassword.ctp:82
#: View/Users/signup:327
msgid "Please enter at least 8 characters." msgid "Please enter at least 8 characters."
msgstr "Please enter at least 8 characters." msgstr "Please enter at least 8 characters."
...@@ -251,6 +267,7 @@ msgid "Firstname" ...@@ -251,6 +267,7 @@ msgid "Firstname"
msgstr "Firstname" msgstr "Firstname"
#: Controller/UserCardsController.php/view_card.ctp:87 #: Controller/UserCardsController.php/view_card.ctp:87
#: View/Users/signup:22
msgid "Lastname" msgid "Lastname"
msgstr "Lastname" msgstr "Lastname"
...@@ -317,4 +334,104 @@ msgstr "Save Complete" ...@@ -317,4 +334,104 @@ msgstr "Save Complete"
#: Controller/UserCardsController:309 #: Controller/UserCardsController:309
msgid "Already registered" msgid "Already registered"
msgstr "Already registered" msgstr "Already registered"
\ No newline at end of file
#: View/Users/signup:3
#: View/Users/signup:158
msgid "Register"
msgstr "Register"
#: View/Users/signup:31
msgid "Username"
msgstr "Username"
#: View/Users/signup:42
msgid "Country"
msgstr "Country"
#: View/Users/signup:63
msgid "Province"
msgstr "Province"
#: View/Users/signup:84
msgid "Birthdate"
msgstr "Birthdate"
#: View/Users/signup:94
msgid "Phone Number (Mobile)"
msgstr "Phone Number (Mobile)"
#: View/Users/signup:111
msgid "Password"
msgstr "Password"
#: View/Users/signup:121
msgid "Confirm password"
msgstr "Confirm password"
#: View/Users/signup:145
msgid "Close"
msgstr "Close"
#: View/Users/signup:153
msgid "Please accept the <b> Terms of Use </ b>."
msgstr "Please accept the <b> Terms of Use </ b>."
#: View/Users/signup:175
#: View/Users/signup:202
msgid "Please enter only text in English or numbers."
msgstr "Please enter only text in English or numbers."
#: View/Users/signup:184
#: View/Users/signup:193
#: View/Users/signup:211
msgid "Please enter text in English, Thai or only."
msgstr "Please enter text in English, Thai or only."
#: View/Users/signup:234
msgid "Please enter the phone number. Only numbers."
msgstr "Please enter the phone number. Only numbers."
#: View/Users/signup:241
msgid "Please enter the correct Thai or English text."
msgstr "Please enter the correct Thai or English text."
#: View/Users/signup:271
msgid "Please enter your username."
msgstr "Please enter your username."
#: View/Users/signup:276
msgid "Please enter a 4-10 character username."
msgstr "Please enter a 4-10 character username."
#: View/Users/signup:299
msgid "Please enter your phone number."
msgstr "Please enter your phone number."
#: View/Users/signup:304
msgid "Please enter a 10 digit phone number."
msgstr "Please enter a 10 digit phone number."
#: View/Users/signup:316
msgid "Wrong email address format Please enter the correct number."
msgstr "Wrong email address format Please enter the correct number."
#: View/Users/signup:332
msgid "Please verify your password."
msgstr "Please verify your password."
#: View/Users/signup:337
msgid "Please provide your password."
msgstr "Please provide your password."
#: View/Users/signup:251
msgid "Please accept the Terms of Use."
msgstr "Please accept the Terms of Use."
#: View/Users:322
msgid "Verify Completed."
msgstr "Verify Completed."
#: View/Users:325
msgid "Pin Code Invalid"
msgstr "Pin Code Invalid"
\ No newline at end of file
...@@ -96,6 +96,8 @@ msgid "Show QR Code to get permission" ...@@ -96,6 +96,8 @@ msgid "Show QR Code to get permission"
msgstr "แสดงคิวอาร์โค้ดเพื่อรับสิทธิ์" msgstr "แสดงคิวอาร์โค้ดเพื่อรับสิทธิ์"
#: View/Profiles/index:226 #: View/Profiles/index:226
#: View/Users:248
#: View/Users/signup:222
msgid "This email is already in the system." msgid "This email is already in the system."
msgstr "อีเมลนี้มีอยู่ในระบบอยู่แล้ว" msgstr "อีเมลนี้มีอยู่ในระบบอยู่แล้ว"
...@@ -104,14 +106,17 @@ msgid "only numbers" ...@@ -104,14 +106,17 @@ msgid "only numbers"
msgstr "กรอกเฉพาะหมายเลข" msgstr "กรอกเฉพาะหมายเลข"
#: View/Profiles/index:244 #: View/Profiles/index:244
#: View/Users/signup:261
msgid "Please enter your firstname." msgid "Please enter your firstname."
msgstr "กรุณากรอกชื่อของท่าน" msgstr "กรุณากรอกชื่อของท่าน"
#: View/Profiles/index:249 #: View/Profiles/index:249
#: View/Users/signup:266
msgid "Please enter your lastname." msgid "Please enter your lastname."
msgstr "กรุณากรอกนามสกุลของท่าน" msgstr "กรุณากรอกนามสกุลของท่าน"
#: View/Profiles/index:255 #: View/Profiles/index:255
#: View/Users/signup:293
msgid "Please enter your birthdate." msgid "Please enter your birthdate."
msgstr "กรุณากรอกวันเดือนปีเกิดของท่าน" msgstr "กรุณากรอกวันเดือนปีเกิดของท่าน"
...@@ -132,10 +137,12 @@ msgid "Email address format wrong, Please enter the correct number." ...@@ -132,10 +137,12 @@ msgid "Email address format wrong, Please enter the correct number."
msgstr "รูปแบบของที่อยู่อีเมลผิด กรุณากรอกให้ถูกต้อง" msgstr "รูปแบบของที่อยู่อีเมลผิด กรุณากรอกให้ถูกต้อง"
#: View/Profiles/index:291 #: View/Profiles/index:291
#: View/Users/signup:281
msgid "Please specify country" msgid "Please specify country"
msgstr "กรุณาระบุประเทศ" msgstr "กรุณาระบุประเทศ"
#: View/Profiles/index:296 #: View/Profiles/index:296
#: View/Users/signup:286
msgid "Please specify province" msgid "Please specify province"
msgstr "กรุณาระบุจังหวัด" msgstr "กรุณาระบุจังหวัด"
...@@ -167,10 +174,12 @@ msgid "Company Information" ...@@ -167,10 +174,12 @@ msgid "Company Information"
msgstr "ข้อมูลบริษัท" msgstr "ข้อมูลบริษัท"
#: View/UserCards/view_card:81 #: View/UserCards/view_card:81
#: View/Users/signup:13
msgid "Firstname" msgid "Firstname"
msgstr "ชื่อ" msgstr "ชื่อ"
#: View/UserCards/view_card:87 #: View/UserCards/view_card:87
#: View/Users/signup:22
msgid "Lastname" msgid "Lastname"
msgstr "นามสกุล" msgstr "นามสกุล"
...@@ -235,10 +244,12 @@ msgid "Forgot password" ...@@ -235,10 +244,12 @@ msgid "Forgot password"
msgstr "ลืมรหัสผ่าน" msgstr "ลืมรหัสผ่าน"
#: View/Users/forgot_password:14 #: View/Users/forgot_password:14
#: View/Users/signup:102
msgid "Email" msgid "Email"
msgstr "อีเมล" msgstr "อีเมล"
#: View/Users/forgot_password:34 #: View/Users/forgot_password:34
#: View/Users/signup:310
msgid "Please enter your email." msgid "Please enter your email."
msgstr "กรุณากรอกที่อยู่อีเมลของท่าน" msgstr "กรุณากรอกที่อยู่อีเมลของท่าน"
...@@ -260,6 +271,7 @@ msgstr "ยืนยันรหัสผ่าน" ...@@ -260,6 +271,7 @@ msgstr "ยืนยันรหัสผ่าน"
#: View/Users/change_forgotpassword:49 #: View/Users/change_forgotpassword:49
#: View/Users/change_forgotpassword:58 #: View/Users/change_forgotpassword:58
#: View/Users/signup:254
msgid "Please enter only English letters and numbers." msgid "Please enter only English letters and numbers."
msgstr "กรุณาใส่ข้อมูลที่เป็นตัวอักษรภาษาอังกฤษและตัวเลขเท่านั้น" msgstr "กรุณาใส่ข้อมูลที่เป็นตัวอักษรภาษาอังกฤษและตัวเลขเท่านั้น"
...@@ -272,10 +284,12 @@ msgid "Please enter a new password at least 8 characters." ...@@ -272,10 +284,12 @@ msgid "Please enter a new password at least 8 characters."
msgstr "กรุณาระบุรหัสผ่านใหม่อย่างน้อย 8 ตัวอักษร่" msgstr "กรุณาระบุรหัสผ่านใหม่อย่างน้อย 8 ตัวอักษร่"
#: View/Users/change_forgotpassword:77 #: View/Users/change_forgotpassword:77
#: View/Users/signup:322
msgid "Please enter your password." msgid "Please enter your password."
msgstr "กรุณากรอก ยืนยันรหัสผ่าน" msgstr "กรุณากรอก ยืนยันรหัสผ่าน"
#: View/Users/change_forgotpassword:82 #: View/Users/change_forgotpassword:82
#: View/Users/signup:327
msgid "Please enter at least 8 characters." msgid "Please enter at least 8 characters."
msgstr "กรุณาระบุยืนยันรหัสผ่านอย่างน้อย 8 ตัวอักษร" msgstr "กรุณาระบุยืนยันรหัสผ่านอย่างน้อย 8 ตัวอักษร"
...@@ -284,14 +298,17 @@ msgid "Please provide the same password." ...@@ -284,14 +298,17 @@ msgid "Please provide the same password."
msgstr "กรุณาระบุรหัสผ่านให้ตรงกัน" msgstr "กรุณาระบุรหัสผ่านให้ตรงกัน"
#: View/Users/pin_codepassword:3 #: View/Users/pin_codepassword:3
#: View/Users/pin_code:3
msgid "Verify PIN" msgid "Verify PIN"
msgstr "ยืนยัน PIN" msgstr "ยืนยัน PIN"
#: View/Users/pin_codepassword:18 #: View/Users/pin_codepassword:18
#: View/Users/pin_code:16
msgid "4 digit PIN in the email address specified for access" msgid "4 digit PIN in the email address specified for access"
msgstr "กรุณาใส่ PIN 4 หลัก ที่ถูกส่งไปยังอีเมลของท่าน" msgstr "รหัส PIN 4 หลัก ในอีเมลล์ที่ระบุเพื่อเข้าใช้งาน"
#: View/Users/pin_codepassword:40 #: View/Users/pin_codepassword:40
#: View/Users/pin_code:40
msgid "Re-send pin code" msgid "Re-send pin code"
msgstr "ส่ง PIN ใหม่อีกครั้ง" msgstr "ส่ง PIN ใหม่อีกครั้ง"
...@@ -337,4 +354,104 @@ msgstr "ลงทะเบียนอยู่แล้ว" ...@@ -337,4 +354,104 @@ msgstr "ลงทะเบียนอยู่แล้ว"
#: Controller/UserCardsController:313 #: Controller/UserCardsController:313
msgid "Data not found" msgid "Data not found"
msgstr "ไม่พบข้อมูล" msgstr "ไม่พบข้อมูล"
\ No newline at end of file
#: View/Users/signup:3
#: View/Users/signup:158
msgid "Register"
msgstr "สมัครสมาชิก"
#: View/Users/signup:31
msgid "Username"
msgstr "ชื่อผู้ใช้งาน"
#: View/Users/signup:42
msgid "Country"
msgstr "ประเทศ"
#: View/Users/signup:63
msgid "Province"
msgstr "จังหวัด"
#: View/Users/signup:84
msgid "Birthdate"
msgstr "วันเกิด"
#: View/Users/signup:94
msgid "Phone Number (Mobile)"
msgstr "เบอร์โทรศัพท์(มือถือ)"
#: View/Users/signup:111
msgid "Password"
msgstr "รหัสผ่าน"
#: View/Users/signup:121
msgid "Confirm password"
msgstr "ยืนยันรหัสผ่าน"
#: View/Users/signup:145
msgid "Close"
msgstr "ปิด"
#: View/Users/signup:153
msgid "Please accept the <b> Terms of Use </ b>."
msgstr "กรุณายอมรับ <b>เงื่อนไขการใช้งาน</b>"
#: View/Users/signup:175
#: View/Users/signup:202
msgid "Please enter only text in English or numbers."
msgstr "กรุณาใส่ข้อมูลที่เป็นตัวอักษรภาษาอังกฤษและตัวเลขเท่านั้น"
#: View/Users/signup:184
#: View/Users/signup:193
#: View/Users/signup:211
msgid "Please enter text in English, Thai or only."
msgstr "กรุณาใส่ข้อมูลที่เป็นตัวอักษรภาษาอังกฤษ,ไทยหรือตัวเลขเท่านั้น"
#: View/Users/signup:234
msgid "Please enter the phone number. Only numbers."
msgstr "กรุณาใส่ข้อมูลที่หมายเลขโทรศัพท์ เป็นตัวเลขเท่านั้น"
#: View/Users/signup:241
msgid "Please enter the correct Thai or English text."
msgstr "กรุณาใส่ข้อมูลที่เป็นตัวอักษรภาษาไทยหรือภาษาอังกฤษให้ถูกต้อง"
#: View/Users/signup:271
msgid "Please enter your username."
msgstr "กรุณากรอกชื่อผู้ใช้งานของท่าน"
#: View/Users/signup:276
msgid "Please enter a 4-10 character username."
msgstr "กรุณาระบุชื่อผู้ใช้งานความยาว 4-10 ตัวอักษร"
#: View/Users/signup:299
msgid "Please enter your phone number."
msgstr "กรุณากรอก เบอร์โทรศัพท์ของท่าน"
#: View/Users/signup:304
msgid "Please enter a 10 digit phone number."
msgstr "กรุณากรอกเบอร์โทรศัพท์ ให้ครบ 10 หลัก"
#: View/Users/signup:316
msgid "Wrong email address format Please enter the correct number."
msgstr "รูปแบบที่อยู่อีเมลผิด กรุณากรอกให้ถูกต้อง"
#: View/Users/signup:332
msgid "Please verify your password."
msgstr "กรุณายืนยันรหัสผ่าน"
#: View/Users/signup:337
msgid "Please provide your password."
msgstr "กรุณาระบุรหัสผ่านให้ตรงกัน"
#: View/Users/signup:251
msgid "Please accept the Terms of Use."
msgstr "กรุณายอมรับ เงื่อนไขการใช้งาน"
#: View/Users:322
msgid "Verify Completed."
msgstr "สมัครสมาชิกสำเร็จ"
#: View/Users:325
msgid "Pin Code Invalid"
msgstr "Pin Code ผิด"
\ No newline at end of file
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
</div> </div>
</div> </div>
<div> <div>
<button type="submit" class="btn btn-quaternary mr-xs mb-sm button-text-profile" id="checkbutton">ตรวจสอบ</button> <button type="submit" class="btn btn-quaternary mr-xs mb-sm button-text-profile" id="checkbutton"><?php echo __('Check') ?></button>
</div> </div>
<?php echo $this->Form->end(); ?> <?php echo $this->Form->end(); ?>
</div> </div>
...@@ -78,8 +78,8 @@ ...@@ -78,8 +78,8 @@
data = jQuery.parseJSON(data); data = jQuery.parseJSON(data);
if (data['chkuser'] == true) { if (data['chkuser'] == true) {
$("#noorg_th").text(''); $("#noorg_th").text('');
$("#noorg_th").text('ลงทะเบียนกับ ' + data[0]['org_name_th'] + $("#noorg_th").text(<?php echo __('Register with') ?> + data[0]['org_name_th'] +
' แล้ว'); <?php echo __('already') ?>);
$("#nameorg_th").text(''); $("#nameorg_th").text('');
$('#employee').attr("disabled", true); $('#employee').attr("disabled", true);
organize_id.val(''); organize_id.val('');
...@@ -94,10 +94,10 @@ ...@@ -94,10 +94,10 @@
} }
} else { } else {
$("#noorg_th").text(''); $("#noorg_th").text('');
$("#noorg_th").text('ไม่พบข้อมูล'); $("#noorg_th").text(<?php echo __('Data not found') ?>);
$("#nameorg_th").text(''); $("#nameorg_th").text('');
$("#noepm_th").text(''); $("#noepm_th").text('');
$("#nameemp_th").text(''); $("#nameemp_th").text('');
$('#employee').attr("disabled", true); $('#employee').attr("disabled", true);
organize_id.val(''); organize_id.val('');
employee.val(''); employee.val('');
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
data = jQuery.parseJSON(data); data = jQuery.parseJSON(data);
if (data['chkuser'] == true) { if (data['chkuser'] == true) {
$("#noepm_th").text(''); $("#noepm_th").text('');
$("#noepm_th").text('ลงทะเบียนแล้ว'); $("#noepm_th").text(<?php echo __('Registered') ?>);
$("#nameemp_th").text(''); $("#nameemp_th").text('');
$('#date').attr("disabled", true); $('#date').attr("disabled", true);
date.val(''); date.val('');
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
} }
} else { } else {
$("#noepm_th").text(''); $("#noepm_th").text('');
$("#noepm_th").text('"ไม่พบข้อมูลที่ต้องการ" กรุณากรอกรหัสข้อมูลที่ถูกต้องและกดตรวจสอบ'); $("#noepm_th").text(<?php echo __('"Did not find the information you need", Please enter the correct information and press the check.') ?>);
$("#nameemp_th").text(''); $("#nameemp_th").text('');
$('#date').attr("disabled", true); $('#date').attr("disabled", true);
date.val(''); date.val('');
...@@ -152,17 +152,17 @@ ...@@ -152,17 +152,17 @@
function check() { function check() {
if ($("#organize_code").val() == '') { if ($("#organize_code").val() == '') {
alert('กรุณากรอก Company Code'); alert(<?php echo __('Please enter Company Code.') ?>);
organize_id.focus(); organize_id.focus();
return false; return false;
} }
if (employee.val() == '') { if (employee.val() == '') {
alert('กรุณากรอก Ref1'); alert(<?php echo __('Please enter Ref1.') ?>);
employee.focus(); employee.focus();
return false; return false;
} }
if (date.val() == '') { if (date.val() == '') {
alert('กรุณากรอก Ref2'); alert(<?php echo __('Please enter Ref2.') ?>);
date.focus(); date.focus();
return false; return false;
} }
......
...@@ -227,7 +227,7 @@ use Cake\I18n\Time; ...@@ -227,7 +227,7 @@ use Cake\I18n\Time;
<?php echo $value['card_code'] ?> <?php echo $value['card_code'] ?>
</div> </div>
<div> <div>
<label style="font-size: 17px">ชื่อ</label> <label style="font-size: 17px"><?php echo __('Firstname') ?></label>
<?php echo $value['prefix_name_th'].$value['firstname_th'].' '.$value['lastname_th'] ?> <?php echo $value['prefix_name_th'].$value['firstname_th'].' '.$value['lastname_th'] ?>
</div> </div>
</div> </div>
...@@ -237,7 +237,7 @@ use Cake\I18n\Time; ...@@ -237,7 +237,7 @@ use Cake\I18n\Time;
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-10"> <div class="col-xs-10">
<label style="font-size: 17px">ตำแหน่ง</label> <label style="font-size: 17px"><?php echo __('Position') ?></label>
<?php echo $value['position_name'] ?> <?php echo $value['position_name'] ?>
</div> </div>
</div> </div>
...@@ -260,10 +260,10 @@ use Cake\I18n\Time; ...@@ -260,10 +260,10 @@ use Cake\I18n\Time;
</div> </div>
<div class="row text-center"> <div class="row text-center">
<div class="col-xs-6"> <div class="col-xs-6">
<label style="font-size: 17px">วันออกบัตร</label> <label style="font-size: 17px"><?php echo __('Card issue') ?></label>
</div> </div>
<div class="col-xs-6"> <div class="col-xs-6">
<label style="font-size: 17px">วันหมดออายุ</label> <label style="font-size: 17px"><?php echo __('Old age') ?></label>
</div> </div>
</div> </div>
</div> </div>
...@@ -276,42 +276,42 @@ use Cake\I18n\Time; ...@@ -276,42 +276,42 @@ use Cake\I18n\Time;
<div class="col-xs-12 col-sm-12 col-md-12"> <div class="col-xs-12 col-sm-12 col-md-12">
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12"> <div class="col-xs-12 col-sm-12 col-md-12">
<h4>ข้อมูลบริษัท</h4> <h4><?php echo __('Company Information') ?></h4>
</div> </div>
</div> </div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12"> <div class="col-xs-12 col-sm-12 col-md-12">
<label style="font-size: 17px" class="col-xs-4 col-sm-4 col-md-4">ชื่อ</label> <label style="font-size: 17px" class="col-xs-4 col-sm-4 col-md-4"><?php echo __('Firstname') ?></label>
<?php echo $value['prefix_name_th'].$value['firstname_th'] ?> <?php echo $value['prefix_name_th'].$value['firstname_th'] ?>
</div> </div>
</div> </div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12"> <div class="col-xs-12 col-sm-12 col-md-12">
<label style="font-size: 17px" class="col-xs-4 col-sm-4 col-md-4">นามสกุล</label> <label style="font-size: 17px" class="col-xs-4 col-sm-4 col-md-4"><?php echo __('Lastname') ?></label>
<?php echo $value['lastname_th'] ?> <?php echo $value['lastname_th'] ?>
</div> </div>
</div> </div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12"> <div class="col-xs-12 col-sm-12 col-md-12">
<label style="font-size: 17px" class="col-xs-4 col-sm-4 col-md-4">ชื่อบริษัท</label> <label style="font-size: 17px" class="col-xs-4 col-sm-4 col-md-4"><?php echo __('Company Name') ?></label>
<?php echo $value['morg']['org_name_th'] ?> <?php echo $value['morg']['org_name_th'] ?>
</div> </div>
</div> </div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12"> <div class="col-xs-12 col-sm-12 col-md-12">
<label style="font-size: 17px" class="col-xs-4 col-sm-4 col-md-4">แผนก</label> <label style="font-size: 17px" class="col-xs-4 col-sm-4 col-md-4"><?php echo __('Department') ?></label>
<?php echo $value['section_name'] ?> <?php echo $value['section_name'] ?>
</div> </div>
</div> </div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12"> <div class="col-xs-12 col-sm-12 col-md-12">
<label style="font-size: 17px" class="col-xs-4 col-sm-4 col-md-4">ตำแหน่ง</label> <label style="font-size: 17px" class="col-xs-4 col-sm-4 col-md-4"><?php echo __('Position') ?></label>
<?php echo $value['position_name'] ?> <?php echo $value['position_name'] ?>
</div> </div>
</div> </div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12"> <div class="col-xs-12 col-sm-12 col-md-12">
<label style="font-size: 17px" class="col-xs-4 col-sm-4 col-md-4">วันที่ออกบัตร</label> <label style="font-size: 17px" class="col-xs-4 col-sm-4 col-md-4"><?php echo __('Card issue') ?></label>
<?php <?php
$now = new Time($value['date_issued']); $now = new Time($value['date_issued']);
$dateIssued = $now->i18nFormat('yyyy-MM-dd'); $dateIssued = $now->i18nFormat('yyyy-MM-dd');
...@@ -321,7 +321,7 @@ use Cake\I18n\Time; ...@@ -321,7 +321,7 @@ use Cake\I18n\Time;
</div> </div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12"> <div class="col-xs-12 col-sm-12 col-md-12">
<label style="font-size: 17px" class="col-xs-4 col-sm-4 col-md-4">วันที่หมดอายุ</label> <label style="font-size: 17px" class="col-xs-4 col-sm-4 col-md-4"><?php echo __('Old age') ?></label>
<?php <?php
$now = new Time($value['date_expiry']); $now = new Time($value['date_expiry']);
$dateExpiry = $now->i18nFormat('yyyy-MM-dd'); $dateExpiry = $now->i18nFormat('yyyy-MM-dd');
......
...@@ -28,18 +28,35 @@ ...@@ -28,18 +28,35 @@
</div> </div>
<!-- ------------------------------- popup ----------------------------------- --> <!-- ------------------------------- popup ----------------------------------- -->
<script> <script>
// function validateForm() {
// var email = document.forms["forgotPressword"]["email"].value;
// if (email == null || email == "") {
// alert(<?php echo __('Please enter your email.');?>);
// return false;
// }
// // Validate Email
// var email = $("#fremail").val();
// if ((/(.+)@(.+){2,}\.(.+){2,}/.test(email)) || email=="" || email==null) { } else {
// alert(<?php echo __('Email address format wrong Please enter the correct.');?>);
// return false;
// }
// }
function validateForm() { function validateForm() {
var email = document.forms["forgotPressword"]["email"].value; var email = document.getElementById("email").value;
if (email == null || email == "") { if (email == null || email == "") {
alert(<?php echo __('Please enter your email.');?>); alert("Please enter your email.");
return false; return false;
} }
// Validate Email // Validate Email
var email = $("#fremail").val(); var email = $("#email").val();
if ((/(.+)@(.+){2,}\.(.+){2,}/.test(email)) || email=="" || email==null) { } else { if (/(.+)@(.+){2,}\.(.+){2,}/.test(email)) { } else {
alert(<?php echo __('Email address format wrong Please enter the correct.');?>); alert("Email address format wrong Please enter the correct.");
return false; return false;
} }
$("body").delegate(".is_active", "click", function () {
$('.is_active').not(this).prop('checked', false);
return true;
});
} }
</script> </script>
<style> <style>
......
<div> <div>
<div class=" row center"> <div class=" row center">
<div class="title_header"><?php echo __('กำหนดรหัส PIN');?></div> <div class="title_header"><?php echo __('Verify PIN');?></div>
</div> </div>
<div style="padding-top: 20px;"></div> <div style="padding-top: 20px;"></div>
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-md-12"> <div class="col-md-12">
<div class=" row center"> <div class=" row center">
<?php echo __('รหัส PIN 4 หลัก ในอีเมลล์ที่ระบุเพื่อเข้าใช้งาน');?> <?php echo __('4 digit PIN in the email address specified for access');?>
</div> </div>
</div> </div>
</div> </div>
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<div class="col-md-12"> <div class="col-md-12">
<div class=" row center"> <div class=" row center">
<?php <?php
echo $this->Html->link('ส่ง pin ใหม่อีกครั้ง', ['controller' => 'Users', 'action' => 'registersendpin/'.$token]); echo $this->Html->link('Re-send pin code', ['controller' => 'Users', 'action' => 'registersendpin/'.$token]);
?> ?>
</div> </div>
</div> </div>
......
<div class="row"> <div class="row">
<div class="center"> <div class="center">
<div class="title_header"><a href="javascript:history.go(-1)"><?php echo $this->Html->image('/img/core/img/back-icon@3x.png', ['style' => 'float: left;padding-left: 15px;padding-top: 5px;']); ?></a><?php echo __('สมัครสมาชิก');?></div> <div class="title_header"><a href="javascript:history.go(-1)"><?php echo $this->Html->image('/img/core/img/back-icon@3x.png', ['style' => 'float: left;padding-left: 15px;padding-top: 5px;']); ?></a><?php echo __('Register');?></div>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<?php echo $this->Form->create(null, ['url' => ['controller' => 'Users','action' => 'createAccount'],'class' => 'form-horizontal','id' => '','name' => 'createAccount','role' => 'form', 'onsubmit' => 'return validateForm()']);?> <?php echo $this->Form->create(null, ['url' => ['controller' => 'Users','action' => 'createAccount'],'class' => 'form-horizontal','id' => '','name' => 'createAccount','role' => 'form', 'onsubmit' => 'return validateForm()']);?>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<div> <div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-md-12"> <div class="col-md-12">
<label class="label-text-sub"><?php echo __('ชื่อ');?><em>* </em></label> <label class="label-text-sub"><?php echo __('Firstname');?><em>* </em></label>
<input type="text" name="firstname" id="firstname" value="" placeholder="FIRSTNAME" class="form-control-reg border-bottom-from"> <input type="text" name="firstname" id="firstname" value="" placeholder="FIRSTNAME" class="form-control-reg border-bottom-from">
</div> </div>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<div> <div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-md-12"> <div class="col-md-12">
<label class="label-text-sub"><?php echo __('นามสกุล');?><em>* </em></label> <label class="label-text-sub"><?php echo __('Lastname');?><em>* </em></label>
<input type="text" name="lastname" id="lastname" value="" placeholder="LASTNAME" class="form-control-reg border-bottom-from"> <input type="text" name="lastname" id="lastname" value="" placeholder="LASTNAME" class="form-control-reg border-bottom-from">
</div> </div>
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<div> <div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-md-12"> <div class="col-md-12">
<label class="label-text-sub"><?php echo __('ชื่อผู้ใช้งาน');?><em>* </em></label> <label class="label-text-sub"><?php echo __('Username');?><em>* </em></label>
<input type="text" name="username" id="username" value="" placeholder="USERNAME" class="form-control-reg border-bottom-from"> <input type="text" name="username" id="username" value="" placeholder="USERNAME" class="form-control-reg border-bottom-from">
</div> </div>
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<div> <div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-md-12"> <div class="col-md-12">
<label class="label-text-sub"><?php echo __('ประเทศ');?><em>* </em></label> <label class="label-text-sub"><?php echo __('Country');?><em>* </em></label>
<?php <?php
echo $this->Form->input( 'master_country_id', array( echo $this->Form->input( 'master_country_id', array(
'name'=>'master_country_id', 'name'=>'master_country_id',
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<div> <div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-md-12"> <div class="col-md-12">
<label class="label-text-sub"><?php echo __('จังหวัด');?><em>* </em></label> <label class="label-text-sub"><?php echo __('Province');?><em>* </em></label>
<?php <?php
echo $this->Form->input( 'master_province_id', [ echo $this->Form->input( 'master_province_id', [
'name'=>'master_province_id', 'name'=>'master_province_id',
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
<div> <div>
<div class="form-group has-feedback bootstrap-iso"> <div class="form-group has-feedback bootstrap-iso">
<div class="col-md-12"> <div class="col-md-12">
<label class="label-text-sub"><?php echo __('วันเกิด');?></label> <label class="label-text-sub"><?php echo __('Birthdate');?></label>
<input type="text" name="birthdate" id="date" placeholder="กรุณาระบุวันเดือนปีเกิด" value="" placeholder="DD-MM-YYYY" data-date-format="mm/dd/yyyy" class="form-control-reg border-bottom-from"> <input type="text" name="birthdate" id="date" placeholder="กรุณาระบุวันเดือนปีเกิด" value="" placeholder="DD-MM-YYYY" data-date-format="mm/dd/yyyy" class="form-control-reg border-bottom-from">
<span class="glyphicon glyphicon-calendar form-control-feedback"></span> <span class="glyphicon glyphicon-calendar form-control-feedback"></span>
</div> </div>
...@@ -91,15 +91,15 @@ ...@@ -91,15 +91,15 @@
<div> <div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-md-12"> <div class="col-md-12">
<label class="label-text-sub"><?php echo __('เบอร์โทรศัพท์(มือถือ)');?><em>* </em></label> <label class="label-text-sub"><?php echo __('Phone Number (Mobile)');?><em>* </em></label>
<input type="text" name="phone_no" id="phone_no" onkeypress="check_phone();" value="" maxlength="10" placeholder="000-000-0000" class="mask form-control-reg border-bottom-from"> <input type="text" name="moblie_no" id="moblie_no" onkeypress="check_phone();" value="" maxlength="10" placeholder="000-000-0000" class="mask form-control-reg border-bottom-from">
</div> </div>
</div> </div>
</div> </div>
<div> <div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-md-12"> <div class="col-md-12">
<label class="label-text-sub"><?php echo __('อีเมล');?><em>* </em></label> <label class="label-text-sub"><?php echo __('Email');?><em>* </em></label>
<input type="text" name="email" id="fremail" value="" placeholder="mail@xxx.com" class="form-control-reg border-bottom-from"> <input type="text" name="email" id="fremail" value="" placeholder="mail@xxx.com" class="form-control-reg border-bottom-from">
</div> </div>
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
<div> <div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-md-12"> <div class="col-md-12">
<label class="label-text-sub"><?php echo __('รหัสผ่าน');?><em>* </em></label> <label class="label-text-sub"><?php echo __('Password');?><em>* </em></label>
<input data-toggle="password" data-placement="before" type="password" name="password" id="password" value="" placeholder="********" class="form-control input-lg color-button-border border-bottom-from" style="padding:0px 0px !important;"> <input data-toggle="password" data-placement="before" type="password" name="password" id="password" value="" placeholder="********" class="form-control input-lg color-button-border border-bottom-from" style="padding:0px 0px !important;">
<!--<input type="password" name="data[password]" id="password" value="" placeholder="********" class="form-control-reg border-bottom-from" onkeyup='check();'>--> <!--<input type="password" name="data[password]" id="password" value="" placeholder="********" class="form-control-reg border-bottom-from" onkeyup='check();'>-->
<!--<span class="glyphicon glyphicon-eye-close form-control-feedback"></span>--> <!--<span class="glyphicon glyphicon-eye-close form-control-feedback"></span>-->
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
<div> <div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<div class="col-md-12"> <div class="col-md-12">
<label class="label-text-sub"><?php echo __('ยืนยันรหัสผ่าน');?><em>* </em></label> <label class="label-text-sub"><?php echo __('Confirm password');?><em>* </em></label>
<input data-toggle="password" data-placement="before" type="password" name="confirm_password" id="confirm_password" value="" placeholder="********" class="form-control input-lg color-button-border border-bottom-from" style="padding:0px 0px !important;"> <input data-toggle="password" data-placement="before" type="password" name="confirm_password" id="confirm_password" value="" placeholder="********" class="form-control input-lg color-button-border border-bottom-from" style="padding:0px 0px !important;">
<!--<input type="password" id="confirm_password" name="data[confirm_password]" value="" placeholder="********" class="form-control-reg border-bottom-from" onkeyup='check();'>--> <!--<input type="password" id="confirm_password" name="data[confirm_password]" value="" placeholder="********" class="form-control-reg border-bottom-from" onkeyup='check();'>-->
<!--<span class="glyphicon glyphicon-eye-close form-control-feedback" id='message'></span>--> <!--<span class="glyphicon glyphicon-eye-close form-control-feedback" id='message'></span>-->
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('ปิด');?></button> <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Close');?></button>
</div> </div>
</div> </div>
</div> </div>
...@@ -150,12 +150,12 @@ ...@@ -150,12 +150,12 @@
<!------------------Exit Model----------------------> <!------------------Exit Model---------------------->
<div class="switch switch-lg switch-warning" style="padding: 10px 0px 30px 0px;"> <div class="switch switch-lg switch-warning" style="padding: 10px 0px 30px 0px;">
<input type="checkbox" id="accept" name="accept" data-plugin-ios-switch data-toggle="modal" data-target="#largeModal"/> <input type="checkbox" id="accept" name="accept" data-plugin-ios-switch data-toggle="modal" data-target="#largeModal"/>
<span style="font-size: 17px;"><?php echo __('กรุณายอมรับ <b>เงื่อนไขการใช้งาน</b>');?></span> <span style="font-size: 17px;"><?php echo __('Please accept the <b> Terms of Use </ b>.');?></span>
</div> </div>
<div> <div>
<?php <?php
echo $this->Form->submit('สมัครสมาชิก', array('div' => false, 'class' => 'btn btn-quaternary mr-xs mb-sm button-text', echo $this->Form->submit('Register', array('div' => false, 'class' => 'btn btn-quaternary mr-xs mb-sm button-text',
'name' => 'btn', 'id' => '', 'title' => 'Title')); 'name' => 'btn', 'id' => '', 'title' => 'Title'));
?> ?>
</div> </div>
...@@ -172,7 +172,7 @@ ...@@ -172,7 +172,7 @@
var elem = document.getElementById('username').value; var elem = document.getElementById('username').value;
// console.log(elem); // console.log(elem);
if(!elem.match(/^([A-Za-z0-9])+$/i)){ if(!elem.match(/^([A-Za-z0-9])+$/i)){
alert("กรุณาใส่ข้อมูลที่เป็นตัวอักษรภาษาไทยหรือภาษาอังกฤษให้ถูกต้อง"); alert(<?php echo __("Please enter only text in English or numbers.");?>);
return false; return false;
} }
}) })
...@@ -181,7 +181,7 @@ ...@@ -181,7 +181,7 @@
var elem = document.getElementById('firstname').value; var elem = document.getElementById('firstname').value;
// console.log(elem); // console.log(elem);
if(!elem.match(/^([A-Za-z0-9ก-๙])+$/i)){ if(!elem.match(/^([A-Za-z0-9ก-๙])+$/i)){
alert("กรุณาใส่ข้อมูลที่เป็นตัวอักษรภาษาอังกฤษและตัวเลขเท่านั้น"); alert(<?php echo __("Please enter text in English, Thai or only.");?>);
return false; return false;
} }
}) })
...@@ -190,7 +190,7 @@ ...@@ -190,7 +190,7 @@
var elem = document.getElementById('lastname').value; var elem = document.getElementById('lastname').value;
// console.log(elem); // console.log(elem);
if(!elem.match(/^([A-Za-z0-9ก-๙])+$/i)){ if(!elem.match(/^([A-Za-z0-9ก-๙])+$/i)){
alert("กรุณาใส่ข้อมูลที่เป็นตัวอักษรภาษาอังกฤษและตัวเลขเท่านั้น"); alert(<?php echo __("Please enter text in English, Thai or only.");?>);
return false; return false;
} }
}) })
...@@ -199,7 +199,7 @@ ...@@ -199,7 +199,7 @@
var elem = document.getElementById('password').value; var elem = document.getElementById('password').value;
// console.log(elem); // console.log(elem);
if(!elem.match(/^([A-Za-z0-9])+$/i)){ if(!elem.match(/^([A-Za-z0-9])+$/i)){
alert("กรุณาใส่ข้อมูลที่เป็นตัวอักษรภาษาอังกฤษและตัวเลขเท่านั้น"); alert(<?php echo __("Please enter only text in English or numbers.");?>);
return false; return false;
} }
}) })
...@@ -208,7 +208,7 @@ ...@@ -208,7 +208,7 @@
var elem = document.getElementById('confirm_password').value; var elem = document.getElementById('confirm_password').value;
// console.log(elem); // console.log(elem);
if(!elem.match(/^([A-Za-z0-9])+$/i)){ if(!elem.match(/^([A-Za-z0-9])+$/i)){
alert("กรุณาใส่ข้อมูลที่เป็นตัวอักษรภาษาอังกฤษและตัวเลขเท่านั้น"); alert(<?php echo __("Please enter only text in English or numbers.");?>);
return false; return false;
} }
}) })
...@@ -219,7 +219,7 @@ ...@@ -219,7 +219,7 @@
// console.log(data); // console.log(data);
data = jQuery.parseJSON(data); data = jQuery.parseJSON(data);
if(data['chk'] == 'false'){ if(data['chk'] == 'false'){
alert("อีเมลนี้มีในระบบแล้ว"); alert(<?php echo __("This email is already in the system.");?>);
return false; return false;
} }
}); });
...@@ -231,20 +231,14 @@ ...@@ -231,20 +231,14 @@
// if (((e_k < 48) || (e_k > 57)) && e_k != 46 ) { // if (((e_k < 48) || (e_k > 57)) && e_k != 46 ) {
if (e_k = 10 && (e_k < 48) || (e_k > 59)) { if (e_k = 10 && (e_k < 48) || (e_k > 59)) {
event.returnValue = false; event.returnValue = false;
alert("กรุณาใส่ข้อมูลที่หมายเลขโทรศัพท์ เป็นตัวเลขเท่านั้น"); alert("Please enter the phone number. Only numbers.");
} }
} }
function check_notnum() { function check_notnum() {
// e_k=event.keyCode
// if ((e_k== 13 || e_k== 110) && (e_k > 48) || (e_k< 57)) {
// event.returnValue = false;
// alert("กรุณาใส่ข้อมูลที่เป็นตัวอักษรภาษาไทยหรือภาษาอังกฤษให้ถูกต้อง");
// }
var letters = /^[A-Za-zก-๙]+$/; var letters = /^[A-Za-zก-๙]+$/;
if(letters.test( event.key )==false){ if(letters.test( event.key )==false){
alert("กรุณาใส่ข้อมูลที่เป็นตัวอักษรภาษาไทยหรือภาษาอังกฤษให้ถูกต้อง"); alert("Please enter the correct Thai or English text.");
return false; return false;
} }
...@@ -257,96 +251,96 @@ function check_notnum() { ...@@ -257,96 +251,96 @@ function check_notnum() {
e_k = true; e_k = true;
}else{ }else{
e_k = false; e_k = false;
alert("กรุณาใส่ข้อมูลที่เป็นตัวอักษรภาษาอังกฤษและตัวเลขเท่านั้น"); alert("Please enter only English letters and numbers.");
} }
} }
function validateForm() { function validateForm() {
var firstname = document.getElementById("firstname").value; var firstname = document.getElementById("firstname").value;
if (firstname == null || firstname == "") { if (firstname == null || firstname == "") {
alert("กรุณากรอกชื่อ"); alert("Please enter your firstname.");
return false; return false;
} }
var lastname = document.getElementById("lastname").value; var lastname = document.getElementById("lastname").value;
if (lastname == null || lastname == "") { if (lastname == null || lastname == "") {
alert("กรุณากรอกนามสกุล"); alert("Please enter your lastname.");
return false; return false;
} }
var username = document.getElementById("username").value; var username = document.getElementById("username").value;
if (username == null || username == "") { if (username == null || username == "") {
alert("กรุณากรอกชื่อผู้ใช้งานของท่าน"); alert("Please enter your username.");
return false; return false;
} }
if(document.getElementById("username").value.length < 4 || document.getElementById("username").value.length > 10) if(document.getElementById("username").value.length < 4 || document.getElementById("username").value.length > 10)
{ {
alert('กรุณาระบุชื่อผู้ใช้งานความยาว 4-10 ตัวอักษร'); alert('Please enter a 4-10 character username.');
return false; return false;
} }
var master_country_id = document.getElementById("master_country_id").value; var master_country_id = document.getElementById("master_country_id").value;
if (master_country_id == null || master_country_id == "") { if (master_country_id == null || master_country_id == "") {
alert("กรุณาระบุประเทศ"); alert("Please specify country");
return false; return false;
} }
var master_province_id = document.getElementById("master_province_id").value; var master_province_id = document.getElementById("master_province_id").value;
if (master_province_id == null || master_province_id == "") { if (master_province_id == null || master_province_id == "") {
alert("กรุณาระบุจังหวัด"); alert("Please specify province");
return false; return false;
} }
var birthdate = document.getElementById("date").value; var birthdate = document.getElementById("date").value;
if (birthdate == null || birthdate == "") { if (birthdate == null || birthdate == "") {
alert("กรุณากรอก วันเดือนปีเกิดของท่าน"); alert("Please enter the date of your birth.");
return false; return false;
} }
var phone_no = document.getElementById("phone_no").value; var moblie_no = document.getElementById("moblie_no").value;
if (phone_no == null || phone_no == "") { if (moblie_no == null || moblie_no == "") {
alert("กรุณากรอก เบอร์โทรศัพท์ของท่าน"); alert("Please enter your phone number.");
return false; return false;
} }
if(document.getElementById("phone_no").value.length != 10) if(document.getElementById("moblie_no").value.length != 10)
{ {
alert('กรุณากรอกเบอร์โทรศัพท์ ให้ครบ 10 หลัก'); alert('Please enter a 10 digit phone number.');
return false; return false;
} }
var email = document.getElementById("fremail").value; var email = document.getElementById("fremail").value;
if (email == null || email == "") { if (email == null || email == "") {
alert("กรุณากรอกอีเมล"); alert("Please enter your email.");
return false; return false;
} }
// Validate Email // Validate Email
var email = $("#fremail").val(); var email = $("#fremail").val();
if (/(.+)@(.+){2,}\.(.+){2,}/.test(email)) { } else { if (/(.+)@(.+){2,}\.(.+){2,}/.test(email)) { } else {
alert("รูปแบบที่อยู่อีเมลผิด กรุณากรอกให้ถูกต้อง"); alert("Wrong email address format Please enter the correct number.");
return false; return false;
} }
var password = document.getElementById("password").value; var password = document.getElementById("password").value;
if (password == null || password == "") { if (password == null || password == "") {
alert("กรุณากรอกรหัสผ่าน"); alert("Please enter your password.");
return false; return false;
} }
if(document.forms["createAccount"]["password"].value.length < 8) if(document.forms["createAccount"]["password"].value.length < 8)
{ {
alert('กรุณาระบุรหัสผ่านอย่างน้อย 8 ตัวอักษร'); alert('Please enter at least 8 characters.');
return false; return false;
} }
var confirm_password = document.getElementById("confirm_password").value; var confirm_password = document.getElementById("confirm_password").value;
if (confirm_password == null || confirm_password == "") { if (confirm_password == null || confirm_password == "") {
alert("กรุณายืนยันรหัสผ่าน"); alert("Please verify your password.");
return false; return false;
} }
if(confirm_password = document.getElementById("password").value != document.getElementById("confirm_password").value){ if(confirm_password = document.getElementById("password").value != document.getElementById("confirm_password").value){
alert('กรุณาระบุรหัสผ่านให้ตรงกัน'); alert('Please provide your password.');
//document.createAccount.confirm_password.focus(); //document.createAccount.confirm_password.focus();
return false; return false;
} }
if($("#accept:checked").length==0){ if($("#accept:checked").length==0){
alert("กรุณายอมรับ เงื่อนไขการใช้งาน"); alert("Please accept the Terms of Use.");
return false; return false;
} }
...@@ -363,6 +357,7 @@ function check_notnum() { ...@@ -363,6 +357,7 @@ function check_notnum() {
} }
</script> </script>
<style> <style>
#alertBox { #alertBox {
position:relative; position:relative;
...@@ -569,7 +564,7 @@ function check_notnum() { ...@@ -569,7 +564,7 @@ function check_notnum() {
// alert("ขออภัยหมายเลขโทรศัพท์ ต้องเป็นตัวเลขเท่านั้น"); // alert("ขออภัยหมายเลขโทรศัพท์ ต้องเป็นตัวเลขเท่านั้น");
// } // }
// } // }
/*var check = function() { /*var check = function() {
if (document.getElementById('password').value == if (document.getElementById('password').value ==
document.getElementById('confirm_password').value) { document.getElementById('confirm_password').value) {
document.getElementById('message').style.color = 'green'; document.getElementById('message').style.color = 'green';
...@@ -578,7 +573,7 @@ function check_notnum() { ...@@ -578,7 +573,7 @@ function check_notnum() {
document.getElementById('message').style.color = 'red'; document.getElementById('message').style.color = 'red';
document.getElementById('message').innerHTML = ''; document.getElementById('message').innerHTML = '';
} }
}*/ }*/
</script> </script>
<!--------------------------------- date -------------------------------------> <!--------------------------------- date ------------------------------------->
<script> <script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment