public function __construct($serviceLocator, $options = null) { parent::__construct('AccountIndex'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $filter = $this->getInputFilter(); $group = new DisplayGroup('Subject'); $group->setLabel('Thêm danh mục môn học'); $this->add($group); // name $name = new Text('name'); $name->setLabel('Tên danh mục:'); $name->setAttributes(['maxlength' => 255]); $this->add($name); $group->addElement($name); $filter->add(array('name' => 'name', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập tên danh mục')))))); // code $description = new Textarea('description'); $description->setLabel('Mô tả danh mục:'); $description->setAttributes(['maxlength' => 255, 'class' => 'form-control basicEditor ', 'style' => 'min-height: 300px;']); $this->add($description); $group->addElement($description); $filter->add(array('name' => 'description', 'required' => false, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập mô tả danh mục')))))); $this->add(array('name' => 'afterSubmit', 'type' => 'radio', 'attributes' => array('value' => '/admin/subject/addcategory'), 'options' => array('layout' => 'fluid', 'clearBefore' => true, 'label' => 'Sau khi lưu dữ liệu:', 'value_options' => array('/admin/subject/addcategory' => 'Tiếp tục nhập', '/admin/subject/category' => 'Hiện danh sách vừa nhập')))); $this->add(array('name' => 'submit', 'options' => array('clearBefore' => true), 'attributes' => array('type' => 'submit', 'value' => 'Lưu', 'id' => 'btnSave', 'class' => 'btn btn-primary'))); }
/** * @param null|string $name */ public function __construct($serviceLocator, $options = null) { parent::__construct('signin'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $this->setOptions(['layout' => 'fluid']); $filter = $this->getInputFilter(); //$groupBasic = new DisplayGroup('groupBasic'); //$this->add($groupBasic); $csrf = new Csrf('csrf'); $this->add($csrf); $filter->add(array('name' => 'csrf', 'required' => false, 'filters' => array(array('name' => 'StringTrim')))); $mail = new Text('mail'); $mail->setLabel('Email:'); $mail->setAttributes(array('type' => 'text', 'id' => 'mail')); $this->add($mail); //$groupBasic->addElement($username); $filter->add(array('name' => 'mail', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập email đăng nhập'))), array('name' => 'EmailAddress', 'break_chain_on_failure' => true, 'options' => array('messages' => array('emailAddressInvalidFormat' => 'Địa chỉ email không hợp lệ')))))); $password = new Password('password'); $password->setAttributes(array('type' => 'password', 'id' => 'password')); $password->setLabel('Mật khẩu:'); $this->add($password); //$groupBasic->addElement($password); $filter->add(array('name' => 'password', 'required' => true, 'validators' => array(array('name' => 'NotEmpty', 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập mật khẩu')))))); $config = $this->getServiceLocator()->get('Config'); $this->captcha = new ReCaptcha(array('pubkey' => $config['captcha']['reCAPTCHA']['publicKey'], 'privkey' => $config['captcha']['reCAPTCHA']['privateKey'], 'ssl' => !isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off' ? false : true)); $captcha = new Captcha('captcha'); $captcha->setLabel('Mã bảo mật:'); $captcha->setCaptcha($this->captcha); $this->add($captcha); //$groupBasic->addElement($captcha); $filter->add(array('name' => 'captcha', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập captcha'))), $this->captcha))); $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Đăng nhập', 'id' => 'btnSignin', 'class' => 'btn btn-primary col-md-12'))); //$groupBasic->addElement($this->get('submit')); }
/** * @param null|string $name */ public function __construct($serviceLocator, $options = null) { parent::__construct('signin'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $this->setOptions(['layout' => 'fluid']); $filter = $this->getInputFilter(); //$groupBasic = new DisplayGroup('groupBasic'); //$this->add($groupBasic); $fullName = new Text('fullName'); $fullName->setLabel('Tên đầy đủ:'); $this->add($fullName); //$groupBasic->addElement($username); $filter->add(array('name' => 'fullName', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập tên')))))); $cityId = new Select('cityId'); $this->loadCities($cityId); $filter->add(array('name' => 'cityId', 'required' => false, 'filters' => array())); $this->add($cityId); $districtId = new Select('districtId'); $this->loadDistricts($districtId, $cityId, $options); $this->add($districtId); $filter->add(array('name' => 'districtId', 'required' => false, 'filters' => array())); $address = new Text('address'); $address->setLabel('Địa chỉ: '); $filter->add(array('name' => 'address', 'required' => false, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập người dùng')))))); $this->add($address); // code $description = new Textarea('description'); $description->setLabel('Mô tả bản thân:'); $description->setAttributes(['class' => 'form-control basicEditor ', 'style' => 'min-height: 300px;']); $this->add($description); $filter->add(array('name' => 'description', 'required' => false, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập mô tả')))))); $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Lưu', 'id' => 'btnSignin', 'class' => 'btn btn btn-primary'))); //$groupBasic->addElement($this->get('submit')); }
/** * @author KienNN * @param unknown $serviceLocator * @param string $options */ public function __construct($serviceLocator, $options = null) { parent::__construct(); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'GET'); $filter = $this->getInputFilter(); $filter = $this->getInputFilter(); $daterangepicker = new Text('daterangepicker'); $daterangepicker->setAttributes(['class' => 'date-range-picker']); $this->add($daterangepicker); $filter->add(array('name' => 'daterangepicker', 'required' => false, 'filters' => array(array('name' => 'StringTrim')))); if ($options && isset($options['displayMode']) && $options['displayMode']) { $displayMode = new Select('displayMode'); if (is_array($options['displayMode'])) { $displayMode->setValueOptions($options['displayMode']); } else { $displayMode->setValueOptions(array('day' => 'Theo ngày', 'month' => 'Theo tháng')); } $this->add($displayMode); $filter->add(array('name' => 'displayMode', 'required' => false, 'filters' => array(array('name' => 'StringTrim')))); } $companyId = $this->addElementCompany('companyId', null, ['required' => false]); $departmentId = new Select('departmentId'); $departmentId->setValueOptions(['' => '- Phòng ban -']); $this->add($departmentId); $this->loadDepartments($departmentId, $companyId); $filter->add(array('name' => 'departmentId', 'required' => false, 'filters' => array(array('name' => 'StringTrim')))); }
/** * @param null|string $name */ public function __construct($serviceLocator, $options = null) { parent::__construct('userManageFilter'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'POST'); $filter = $this->getInputFilter(); $groupBasic = new DisplayGroup('groupBasic'); $this->add($groupBasic); $fromCompanyId = new Text('fromCompanyId'); $fromCompanyId->setLabel('From companyId:'); $fromCompanyId->setAttributes(['maxlength' => 255, 'autocomplete' => 'off']); $this->add($fromCompanyId); $groupBasic->addElement($fromCompanyId); $filter->add(array('name' => 'fromCompanyId', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập fromCompanyId')))))); $fromRoleId = new Text('fromRoleId'); $fromRoleId->setLabel('From role:'); $fromRoleId->setAttributes(['autocomplete' => 'off']); $this->add($fromRoleId); $groupBasic->addElement($fromRoleId); $filter->add(array('name' => 'fromRoleId', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập fromRole')))))); $toCompanyId = new Text('toCompanyId'); $toCompanyId->setLabel('To CompanyIds:'); $toCompanyId->setAttributes(['autocomplete' => 'off']); $this->add($toCompanyId); $groupBasic->addElement($toCompanyId); $filter->add(array('name' => 'toCompanyId', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập toCompanyId')))))); $asRole = new Text('asRole'); $asRole->setLabel('As role:'); $asRole->setAttributes(['maxlength' => 255, 'autocomplete' => 'off']); $this->add($asRole); $groupBasic->addElement($asRole); $filter->add(array('name' => 'asRole', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập as role')))))); $this->add(array('name' => 'submit', 'options' => array('clearBefore' => true), 'attributes' => array('type' => 'submit', 'value' => 'Lưu', 'id' => 'btnSaveCrmContact', 'class' => 'btn btn-primary'))); }
/** * @param null|string $productName */ public function __construct($serviceLocator, $options = null) { parent::__construct('crmContract'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $filter = $this->getInputFilter(); $mainBasic = new DisplayGroup('mainBasic'); $mainBasic->setLabel('Sản phẩm mẫu'); $this->add($mainBasic); $todeleteBasic = new DisplayGroup('todeleteBasic'); $todeleteBasic->setLabel('Sản phẩm sẽ xóa'); $this->add($todeleteBasic); $mainCompanyId = $this->addElementCompany('mainCompanyId', $mainBasic, ['required' => true]); $mainProductId = new Select('mainProductId'); $mainProductId->setLabel('Sản phẩm mẫu:'); $this->add($mainProductId); $mainBasic->addElement($mainProductId); $this->loadProducts($mainProductId, $mainCompanyId, $options); $filter->add(array('name' => 'mainProductId', 'required' => true, 'filters' => array(array('name' => 'StringTrim'), array('name' => 'Digits')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập sản phẩm'))), array('name' => 'Digits', 'break_chain_on_failure' => true, 'options' => array('messages' => array(\Zend\Validator\Digits::INVALID => 'Dữ liệu sản phẩm không hợp lệ')))))); $toDeleteCompanyId = $this->addElementCompany('toDeleteCompanyId', $todeleteBasic, ['required' => true]); $toDeleteProductId = new Select('toDeleteProductId'); $toDeleteProductId->setLabel('Sản phẩm sẽ xóa:'); $this->add($toDeleteProductId); $todeleteBasic->addElement($toDeleteProductId); $this->loadProducts($toDeleteProductId, $toDeleteCompanyId, $options); $filter->add(array('name' => 'toDeleteProductId', 'required' => true, 'filters' => array(array('name' => 'StringTrim'), array('name' => 'Digits')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập sản phẩm'))), array('name' => 'Digits', 'break_chain_on_failure' => true, 'options' => array('messages' => array(\Zend\Validator\Digits::INVALID => 'Dữ liệu sản phẩm không hợp lệ')))))); $this->add(array('name' => 'submit', 'options' => array('clearBefore' => true), 'attributes' => array('type' => 'submit', 'value' => 'Hợp nhất', 'id' => 'btnSaveCrmContract', 'class' => 'btn btn-primary btnSaveCrmContract'))); }
/** * @param null|string $name */ public function __construct($serviceLocator, $options = null) { parent::__construct('passwordForgot'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $filter = $this->getInputFilter(); $groupBasic = new DisplayGroup('groupBasic'); $this->add($groupBasic); $email = new Text('email'); $email->setLabel('Email:'); $email->setAttributes(['maxlength' => 255, 'autocomplete' => 'off']); $email->setOptions(['descriptions' => ['Nhập email khi bạn đăng ký tài khoản']]); $this->add($email); $groupBasic->addElement($email); $filter->add(array('name' => 'email', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập email'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('max' => 50, 'min' => 4, 'messages' => array(StringLength::TOO_LONG => 'Tên đăng nhập giới hạn 4-50 kí tự', StringLength::TOO_SHORT => 'Tên đăng nhập giới hạn 4-50 kí tự'))), array('name' => 'EmailAddress', 'break_chain_on_failure' => true, 'options' => array('messages' => array('emailAddressInvalidFormat' => 'Địa chỉ email không hợp lệ')))))); $config = $this->getServiceLocator()->get('Config'); $this->captcha = new ReCaptcha(array('pubkey' => $config['captcha']['reCAPTCHA']['publicKey'], 'privkey' => $config['captcha']['reCAPTCHA']['privateKey'], 'ssl' => !isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off' ? false : true)); $this->captcha->setPrivkey($config['captcha']['reCAPTCHA']['privateKey']); $this->captcha->setPubkey($config['captcha']['reCAPTCHA']['publicKey']); $captcha = new Captcha('captcha'); $captcha->setLabel('Mã bảo mật:'); $captcha->setCaptcha($this->captcha); $this->add($captcha); $groupBasic->addElement($captcha); $filter->add(array('name' => 'captcha', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập email'))), $this->captcha))); $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Khôi phục mật khẩu', 'id' => 'btnSubmit', 'class' => 'htmlBtn first btn btn-primary'), 'options' => array('clearBefore' => true, 'decorator' => array('type' => 'li', 'attributes' => array('class' => 'btns'))))); }
public function __construct($serviceLocator, $options = null) { parent::__construct('fTransaction'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $filter = $this->getInputFilter(); $basicGroup = new DisplayGroup('basicGroup'); $this->add($basicGroup); $companyId = $this->addElementCompany('companyId', $basicGroup, ['required' => true]); $applyDate = new Text('applyDate'); $applyDate->setLabel('Ngày hạch toán:'); $applyDate->setAttribute('class', 'datepicker'); $this->add($applyDate); $basicGroup->addElement($applyDate); $applyDate->setValue(DateBase::toDisplayDate(DateBase::getCurrentDate())); $filter->add(array('name' => 'applyDate', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập ngày hạch toán')))))); $description = new Text('description'); $description->setLabel('Nội dung:'); $this->add($description); $basicGroup->addElement($description); $filter->add(array('name' => 'description', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập nội dung phiếu thu')))))); $accountId = new Select('accountId'); $accountId->setLabel('Quỹ thu:'); $accountId->setValueOptions(['' => '- Quỹ thu -']); $this->loadAccountingAccount($accountId, $companyId); $this->add($accountId); $basicGroup->addElement($accountId); $filter->add(array('name' => 'accountId', 'required' => true, 'filters' => array(array('name' => 'StringTrim'), array('name' => 'Digits')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập quỹ thu'))), array('name' => 'InArray', 'break_chain_on_failure' => true, 'options' => array('haystack' => array_keys($accountId->getValueOptions()), 'messages' => array('notInArray' => 'Bạn chưa nhập quỹ thu')))))); $items = new Hidden('items'); $this->add($items); $filter->add(array('name' => 'items', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập chi tiết các khoản thu')))))); $this->add(array('name' => 'afterSubmit', 'type' => 'radio', 'attributes' => array('value' => '/accounting/transaction/addreqrecieve'), 'options' => array('layout' => 'fluid', 'clearBefore' => true, 'label' => 'Sau khi lưu dữ liệu:', 'value_options' => array('/accounting/transaction/addreqrecieve' => 'Tiếp tục nhập', '/accounting/transaction/index' => 'Hiện danh sách vừa nhập')))); $this->add(array('name' => 'btnSubmit', 'options' => array('clearBefore' => true), 'attributes' => array('type' => 'button', 'value' => 'Lưu', 'id' => 'btnSave', 'class' => 'btn btn-primary'))); }
public function __construct($serviceLocator, $options = null) { parent::__construct('transactionItem'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $filter = $this->getInputFilter(); $id = new Hidden('id'); $this->add($id); $filter->add(array('name' => 'id', 'required' => false, 'filters' => array(array('name' => 'StringTrim'), array('name' => 'Digits')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập id')))))); $transactionId = new Hidden('transactionId'); $this->add($transactionId); $filter->add(array('name' => 'transactionId', 'required' => false, 'filters' => array(array('name' => 'StringTrim'), array('name' => 'Digits')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập mã code')))))); $accountId = new Text('accountId'); $this->add($accountId); $filter->add(array('name' => 'accountId', 'required' => false, 'filters' => array(array('name' => 'StringTrim'), array('name' => 'Digits')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập quỹ')))))); if ($options && isset($options['accountIds']) && is_array($options['accountIds'])) { $filter->get('accountId')->getValidatorChain()->attach(new \Zend\Validator\InArray(array('haystack' => $options['accountIds']))); } $expenseCategoryId = new Text('expenseCategoryId'); $this->add($expenseCategoryId); $filter->add(array('name' => 'expenseCategoryId', 'required' => true, 'filters' => array(array('name' => 'StringTrim'), array('name' => 'Digits')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập khoản mục chi tiêu')))))); if ($options && isset($options['expenseCategoryIds']) && is_array($options['expenseCategoryIds'])) { $filter->get('expenseCategoryId')->getValidatorChain()->attach(new \Zend\Validator\InArray(array('haystack' => $options['expenseCategoryIds']))); } $amount = new Text('amount'); $this->add($amount); $filter->add(array('name' => 'amount', 'required' => true, 'filters' => array(array('name' => 'StringTrim'), array('name' => 'Digits')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập giá trị')))))); $vat = new Text('vat'); $this->add($vat); $filter->add(array('name' => 'vat', 'required' => false, 'filters' => array(array('name' => 'StringTrim'), array('name' => 'Digits')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập giá trị')))))); $description = new Text('description'); $this->add($description); $filter->add(array('name' => 'description', 'required' => false, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập giá trị')))))); }
/** * * @param null|string $name */ public function __construct($serviceLocator) { parent::__construct('transactionFilter'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'GET'); $filter = $this->getInputFilter(); $id = new Text('id'); $id->setAttributes(['placeholder' => 'ID']); $this->add($id); $filter->add(array('name' => 'id', 'required' => false, 'filters' => array(array('name' => 'StringTrim'), array('name' => 'Digits')))); $companyId = $this->addElementCompany('companyId', null, ['required' => false]); $transaction = new \Accounting\Model\Transaction(); $status = new Select('status'); $status->setValueOptions(['' => '- Trạng thái -'] + $transaction->getStatuses()); $this->add($status); $filter->add(array('name' => 'status', 'required' => false, 'filters' => array(array('name' => 'StringTrim'), array('name' => 'Digits')))); $type = new Select('type'); $type->setValueOptions(['' => '- Loại phiếu -'] + $transaction->getTypes()); $this->add($type); $filter->add(array('name' => 'type', 'required' => false, 'filters' => array(array('name' => 'StringTrim'), array('name' => 'Digits')))); $applyDateRange = new Text('applyDateRange'); $applyDateRange->setAttributes(array('placeholder' => 'Ngày hạch toán', 'class' => 'date-range-picker')); $this->add($applyDateRange); $filter->add(array('name' => 'applyDateRange', 'required' => false, 'filters' => array(array('name' => 'StringTrim')))); $createdByName = new Text('createdByName'); $createdByName->setAttributes(array('placeholder' => 'Người tạo')); $this->add($createdByName); $filter->add(array('name' => 'createdByName', 'required' => false, 'filters' => array(array('name' => 'StringTrim')))); $createdById = new Hidden('createdById'); $this->add($createdById); $filter->add(array('name' => 'createdById', 'required' => false, 'filters' => array(array('name' => 'StringTrim'), array('name' => 'Digits')))); $this->add(array('name' => 'submit', 'options' => array(), 'attributes' => array('type' => 'submit', 'value' => 'Lọc', 'id' => 'btnFilterCompanyContact', 'class' => 'btn btn-primary'))); }
public function __construct($serviceLocator, $options = null) { parent::__construct('updatecode'); $this->setServiceLocator($serviceLocator); $filter = $this->getInputFilter(); $code = new Text('code'); $this->add($code); $filter->add(array('name' => 'code', 'required' => true, 'filters' => array(array('name' => 'StringTrim'), array('name' => 'Digits')), 'validators' => array(array('name' => 'NotEmpty', 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập mã nhân viên hoặc mã nhân viên không hợp lệ.'))), array('name' => 'StringLength', 'options' => array('min' => '1', 'max' => '4', 'messages' => array(\Zend\Validator\StringLength::INVALID => 'Mã nhân viên không hợp lệ.', \Zend\Validator\StringLength::TOO_SHORT => 'Mã nhân viên không hợp lệ. Là chuỗi số từ 1 đến 4 chữ số', \Zend\Validator\StringLength::TOO_LONG => 'Mã nhân viên không hợp lệ. Là chuỗi số từ 1 đến 4 chữ số')))))); }
/** * @param null|string $name */ public function __construct($serviceLocator, $options = null) { parent::__construct('userManageFilter'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'GET'); $filter = $this->getInputFilter(); $companyId = $this->addElementCompany('companyId', null, ['required' => false]); $compareCompanyId = $this->addElementCompany('compareCompanyId', null, ['required' => false]); $this->add(array('name' => 'submit', 'options' => array(), 'attributes' => array('type' => 'submit', 'value' => 'Lọc', 'id' => 'btnFilterCrmContact', 'class' => 'btn btn-primary'))); }
/** * * @param null|string $name */ public function __construct($serviceLocator) { parent::__construct('ideaFilter'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'GET'); $filter = $this->getInputFilter(); $name = new Text('name'); $name->setAttributes(['maxlength' => 255, 'placeholder' => 'Tên danh mục']); $this->add($name); $filter->add(array('name' => 'name', 'required' => false, 'filters' => array(array('name' => 'StringTrim')))); $this->add(array('name' => 'submit', 'options' => array(), 'attributes' => array('type' => 'submit', 'value' => 'Lọc', 'id' => 'btnFilterCompanyContact', 'class' => 'btn btn-primary'))); }
/** * @param null|string $name */ public function __construct($serviceLocator, $options = null) { parent::__construct('activityPhonecall'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $filter = $this->getInputFilter(); $contractId = new Text('contractId'); $this->add($contractId); $filter->add(array('name' => 'contractId', 'required' => false, 'filters' => array(array('name' => 'StringTrim'), array('name' => 'Digits')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập id'))), array('name' => 'Digits', 'break_chain_on_failure' => true, 'options' => array('messages' => array(\Zend\Validator\Digits::INVALID => 'id phải là số')))))); $fileUpload = new File('fileUpload'); $this->add($fileUpload); $filter->add(array('name' => 'fileUpload', 'type' => '\\Zend\\InputFilter\\FileInput', 'required' => false, 'allowEmpty' => true, 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa chọn file'))), array('name' => 'File\\Size', 'break_chain_on_failure' => true, 'options' => array('max' => '4MB', 'messages' => array(\Zend\Validator\File\Size::TOO_BIG => 'File upload phải < 4Mb'))), array('name' => 'File\\MimeType', 'break_chain_on_failure' => true, 'options' => array('mimeType' => array('image', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.ms-excel.sheet.macroenabled.12', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/pdf'), 'messages' => array(\Zend\Validator\File\MimeType::FALSE_TYPE => 'File upload phải là file ảnh, excel, hoặc msword')))))); }
/** * @param null|string $username */ public function __construct($serviceLocator) { parent::__construct('userManageFilter'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'GET'); $filter = $this->getInputFilter(); $companyId = $this->addElementCompany('companyId', null, ['required' => false]); $departmentId = new Select('departmentId'); $departmentId->setValueOptions(['' => '- Phòng ban -']); $this->add($departmentId); $this->loadDepartments($departmentId, $companyId); $filter->add(array('name' => 'departmentId', 'required' => false, 'filters' => array(array('name' => 'StringTrim')))); $id = new Text('id'); $id->setAttributes(['maxlength' => 255, 'placeholder' => 'ID']); $this->add($id); $filter->add(array('name' => 'id', 'required' => false, 'filters' => array(array('name' => 'StringTrim')))); $username = new Text('username'); $username->setAttributes(['maxlength' => 255, 'placeholder' => 'Họ tên']); $this->add($username); $filter->add(array('name' => 'username', 'required' => false, 'filters' => array(array('name' => 'StringTrim')))); $email = new Text('email'); $email->setAttributes(['maxlength' => 255, 'placeholder' => 'Email']); $this->add($email); $filter->add(array('name' => 'email', 'required' => false, 'filters' => array(array('name' => 'StringTrim')))); //phân quyền riêng $hasPrivateRole = new Select('hasPrivateRole'); $hasPrivateRole->setValueOptions(array('' => '- Phân quyền riêng -', '1' => 'Có ', '-1' => 'Không ')); $this->add($hasPrivateRole); $filter->add(array('name' => 'hasPrivateRole', 'required' => false)); $user = new \User\Model\User(); $roleValues = array('' => '- Quyền hạn -') + $user->getRoleDisplays(); unset($roleValues[$user::ROLE_SUPERADMIN]); $role = new Select('role'); $role->setValueOptions($roleValues); $this->add($role); $filter->add(array('name' => 'role', 'required' => false, 'filters' => array(array('name' => 'StringTrim'), array('name' => 'Digits')))); $roleCompany = new Select('roleCompany'); $roleCompany->setValueOptions(['' => '- Nhóm quyền -']); $this->add($roleCompany); $this->loadRole($roleCompany, $companyId); $filter->add(array('name' => 'roleCompany', 'required' => false, 'filters' => array(array('name' => 'StringTrim')))); $active = new Select('active'); $active->setValueOptions(array('' => '- Kích hoạt', '1' => 'Đã kích hoạt', '-1' => 'Chưa kích hoạt')); $this->add($active); $filter->add(array('name' => 'active', 'required' => false, 'filters' => array(array('name' => 'StringTrim')))); $locked = new Select('locked'); $locked->setValueOptions(array('' => '- Khóa -', '1' => 'Đã khóa', '-1' => 'Chưa khóa')); $this->add($locked); $filter->add(array('name' => 'locked', 'required' => false, 'filters' => array(array('name' => 'StringTrim')))); $this->add(array('name' => 'submit', 'options' => array(), 'attributes' => array('type' => 'submit', 'value' => 'Lọc', 'id' => 'btnFilterCrmContact', 'class' => 'btn btn-primary'))); }
/** * @param null|string $name */ public function __construct($serviceLocator, $options = null) { parent::__construct('activityPhonecall'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $filter = $this->getInputFilter(); $ideaId = new Text('ideaId'); $this->add($ideaId); $filter->add(array('name' => 'ideaId', 'required' => true, 'filters' => array(array('name' => 'StringTrim'), array('name' => 'Digits')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập id'))), array('name' => 'Digits', 'break_chain_on_failure' => true, 'options' => array('messages' => array(\Zend\Validator\Digits::INVALID => 'id phải là số')))))); $fileUpload = new File('fileUpload'); $this->add($fileUpload); $filter->add(array('name' => 'fileUpload', 'type' => '\\Zend\\InputFilter\\FileInput', 'required' => true, 'allowEmpty' => true, 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa chọn file'))), array('name' => 'File\\Size', 'break_chain_on_failure' => true, 'options' => array('max' => '4MB', 'messages' => array(\Zend\Validator\File\Size::TOO_BIG => 'File upload phải < 4Mb'))), array('name' => 'File\\Extension', 'break_chain_on_failure' => true, 'options' => array('extension' => array('jpg', 'jpeg', 'gif', 'png', 'doc', 'docx', 'xml', 'csv', 'xls', 'xlsx'), 'messages' => array(\Zend\Validator\File\Extension::FALSE_EXTENSION => 'File upload phải là file ảnh, excel, hoặc msword')))))); $this->addFileUploadRenameFilter(); }
/** * * @param null|string $name */ public function __construct($serviceLocator) { parent::__construct('ideaFilter'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'GET'); $filter = $this->getInputFilter(); //CompanyId $companyId = new Select('companyId'); $companyId->setLabel('Chọn công ty:'); $this->add($companyId); $this->loadCompanies($companyId); $filter->add(array('name' => 'companyId', 'required' => false, 'filters' => array(array('name' => 'StringTrim')))); $this->add(array('name' => 'submit', 'options' => array(), 'attributes' => array('type' => 'submit', 'value' => 'Lọc', 'id' => 'btnFilterCompanyContact', 'class' => 'btn btn-primary'))); }
public function __construct($serviceLocator, $options = null) { parent::__construct('AccountIndex'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $filter = $this->getInputFilter(); $group = new DisplayGroup('Accountgroup'); $this->add($group); /* * $parentId = new Select('parentId'); $parentId->setLabel('Công ty mẹ:'); $parentId->setAttributes([ 'maxlength' => 19 ]); $this->add($parentId); $groupCompany->addElement($parentId); $this->loadCompanies($parentId); $filter->add(array( 'name' => 'parentId', 'required' => false )); */ // companyId select $companyId = $this->addElementCompany('companyId', $group, ['required' => true]); $this->add(array('name' => 'afterSubmit', 'type' => 'radio', 'attributes' => array('value' => '/accounting/account/initnewcompany'), 'options' => array('layout' => 'fluid', 'clearBefore' => true, 'label' => 'Sau khi lưu dữ liệu:', 'value_options' => array('/accounting/account/initnewcompany' => 'Tiếp tục nhập', '/accounting/account/index' => 'Hiện danh sách vừa nhập')))); $this->add(array('name' => 'submit', 'options' => array('clearBefore' => true), 'attributes' => array('type' => 'submit', 'value' => 'Tạo', 'id' => 'btnSave', 'class' => 'btn btn-primary'))); }
public function __construct($serviceLocator, $options = null) { parent::__construct('ExpenseCategoryIndex'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $filter = $this->getInputFilter(); $group = new DisplayGroup('Expensegroup'); $group->setLabel('Thêm tài khoản'); $this->add($group); /* * $parentId = new Select('parentId'); $parentId->setLabel('Công ty mẹ:'); $parentId->setAttributes([ 'maxlength' => 19 ]); $this->add($parentId); $groupCompany->addElement($parentId); $this->loadCompanies($parentId); $filter->add(array( 'name' => 'parentId', 'required' => false )); */ // companyId $companyId = $this->addElementCompany('companyId', $group, ['required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa chọn công ty'))))]); // name $name = new Text('name'); $name->setLabel('Tên khoản mục:'); $name->setAttributes(['maxlength' => 255]); $this->add($name); $group->addElement($name); $filter->add(array('name' => 'name', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập tên khoản mục')))))); // parent Text $parentName = new Text('parentName'); $parentName->setLabel('Thuộc khoản mục:'); $this->add($parentName); $group->addElement($parentName); $filter->add(array('name' => 'parentName', 'required' => false)); // parent hidden $parentId = new Hidden('parentId'); $this->add($parentId); $group->addElement($parentId); $filter->add(array('name' => 'parentId', 'required' => false)); // code $code = new Text('code'); $code->setLabel('Mã code:'); $code->setAttributes(['maxlength' => 255]); $this->add($code); $group->addElement($code); $filter->add(array('name' => 'code', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập mã code')))))); // id hidden $id = new Hidden('id'); $this->add($id); $group->addElement($id); $filter->add(array('name' => 'id', 'required' => false)); $this->add(array('name' => 'afterSubmit', 'type' => 'radio', 'attributes' => array('value' => '/accounting/expense/addcategory'), 'options' => array('layout' => 'fluid', 'clearBefore' => true, 'label' => 'Sau khi lưu dữ liệu:', 'value_options' => array('/accounting/expense/addcategory' => 'Tiếp tục nhập', '/accounting/expense/category' => 'Hiện danh sách vừa nhập')))); $this->add(array('name' => 'submit', 'options' => array('clearBefore' => true), 'attributes' => array('type' => 'submit', 'value' => 'Lưu', 'id' => 'btnSave', 'class' => 'btn btn-primary'))); }
public function __construct($serviceLocator, $options = null) { parent::__construct('AccountIndex'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $filter = $this->getInputFilter(); $group = new DisplayGroup('Subject'); $group->setLabel('Thêm mentor'); $this->add($group); // name $userName = new Text('userName'); $userName->setLabel('Người dùng: '); $userName->setAttributes(['maxlength' => 255]); if ($options == 'edit') { $userName->setAttribute('disabled', 'disabled'); } $this->add($userName); $group->addElement($userName); $filter->add(array('name' => 'userName', 'required' => $options == 'edit' ? false : true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập người dùng')))))); $userId = new Hidden('userId'); $this->add($userId); $group->addElement($userId); $filter->add(array('name' => 'userId', 'required' => $options == 'edit' ? false : true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập người dùng')))))); // code $description = new Textarea('description'); $description->setLabel('Mô tả mentor:'); $description->setAttributes(['class' => 'form-control basicEditor ', 'style' => 'min-height: 300px;']); $this->add($description); $group->addElement($description); $filter->add(array('name' => 'description', 'required' => false, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập mô tả môn học')))))); $subject = new Text('subject'); $subject->setLabel('Tên môn:'); $subject->setAttributes(['maxlength' => 255, 'style' => 'width:100% !important', 'placeholder' => 'Tên môn học']); $subject->setOptions(array('tagsinput' => true, 'description' => 'Tên môn học')); $this->add($subject); $group->addElement($subject); $filter->add(array('name' => 'subject', 'required' => false, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập tên môn')))))); $subjectId = new Hidden('subjectId'); $subjectId->setLabel('Tên môn:'); $this->add($subjectId); $group->addElement($subjectId); $filter->add(array('name' => 'subjectId', 'required' => false, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập tên môn')))))); $this->add(array('name' => 'afterSubmit', 'type' => 'radio', 'attributes' => array('value' => '/admin/expert/add'), 'options' => array('layout' => 'fluid', 'clearBefore' => true, 'label' => 'Sau khi lưu dữ liệu:', 'value_options' => array('/admin/expert/add' => 'Tiếp tục nhập', '/admin/expert/index' => 'Hiện danh sách vừa nhập')))); $this->add(array('name' => 'submit', 'options' => array('clearBefore' => true), 'attributes' => array('type' => 'submit', 'value' => 'Lưu', 'id' => 'btnSave', 'class' => 'btn btn-primary'))); }
public function __construct($serviceLocator, $options = null) { parent::__construct('AccountIndex'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $filter = $this->getInputFilter(); $group = new DisplayGroup('Search'); $group->setLabel('Tìm kiếm trợ giúp'); $this->add($group); // search $search = new Text('search'); $search->setLabel('Tôi cần giúp về: '); $search->setAttributes(['maxlength' => 255]); $this->add($search); $group->addElement($search); $filter->add(array('name' => 'search', 'required' => false, 'filters' => array(array('name' => 'StringTrim')))); $this->add(array('name' => 'submit', 'options' => array('clearBefore' => true), 'attributes' => array('type' => 'submit', 'value' => 'Lưu', 'id' => 'btnSave', 'class' => 'btn btn-primary'))); }
public function __construct($serviceLocator, $options = null) { parent::__construct('AccountIndex'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $filter = $this->getInputFilter(); $group = new DisplayGroup('Search'); $group->setLabel('Tìm kiếm trợ giúp ??'); $this->add($group); // search $search = new Text('search'); $search->setLabel('Tôi cần giúp về: '); $search->setAttributes(['maxlength' => 255, 'class' => 'input-title', 'placeholder' => 'e.g. Need help debugging SASS/CSS for frontend in Rails app']); $this->add($search); $group->addElement($search); $filter->add(array('name' => 'search', 'required' => false, 'filters' => array(array('name' => 'StringTrim')))); $searchDetail = new Textarea('searchDetail'); $searchDetail->setAttributes(['placeholder' => 'Thêm chi tiết giúp bạn nhận hỗ trợ nhanh hơn', 'class' => 'input-description']); $this->add($searchDetail); $group->addElement($searchDetail); $filter->add(array('name' => 'searchDetail', 'required' => false, 'filters' => array(array('name' => 'StringTrim')))); $subject = new Text('subject'); $subject->setAttributes(['placeholder' => 'Thêm môn học']); $this->add($subject); $filter->add(array('name' => 'subject', 'required' => false, 'filters' => array(array('name' => 'StringTrim')))); $subjectId = new Hidden('subjectId'); $this->add($subjectId); $filter->add(array('name' => 'subjectId', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn cần điền ít nhất là 1 môn học')))))); $budget = new Radio('budget'); $budget->setValueOptions(['5' => '20', '10' => '40']); $this->add($budget); $filter->add(array('name' => 'budget', 'required' => false, 'filters' => array(array('name' => 'StringTrim')))); $email = new Text('email'); $email->setLabel('Email'); $this->add($email); $filter->add(array('name' => 'email', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập email'))), array('name' => 'EmailAddress', 'break_chain_on_failure' => true, 'options' => array('messages' => array('emailAddressInvalidFormat' => 'Địa chỉ email không hợp lệ')))))); $password = new Password('password'); $password->setAttributes(array('type' => 'password', 'id' => 'password')); $password->setLabel('Mật khẩu:'); $this->add($password); //$groupBasic->addElement($password); $filter->add(array('name' => 'password', 'required' => false, 'validators' => array(array('name' => 'NotEmpty', 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập mật khẩu')))))); $this->add(array('name' => 'submit', 'options' => array('clearBefore' => true), 'attributes' => array('type' => 'submit', 'value' => 'Lưu', 'id' => 'btnSave', 'class' => 'btn btn-primary'))); }
/** * @param null|string $name */ public function __construct($serviceLocator, $options = null) { parent::__construct($serviceLocator); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $this->setAttribute('class', 'f'); $this->setAttribute('autocomplete', 'off'); $this->setOptions(['layout' => 'form-2-cols']); $filter = $this->getInputFilter(); $group = new DisplayGroup('Signup'); $group->setLabel('Đăng kí'); $this->add($group); $fullName = new Text('fullName'); $fullName->setLabel('Tên đầy đủ của bạn'); $fullName->setAttributes(['maxlength' => 255, 'class' => 'input-xlarge inputFieldWithTitle']); $group->addElement($fullName); $this->add($fullName); $filter->add(array('name' => 'fullName', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập tên của bạn')))))); $username = new Text('username'); $username->setLabel('Tên đăng nhập:'); $username->setAttributes(['maxlength' => 255, 'class' => 'input-xlarge inputFieldWithTitle']); $this->add($username); $group->addElement($username); $filter->add(array('name' => 'username', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập tên đăng nhập'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('min' => 4, 'messages' => array('stringLengthTooShort' => 'Tên đăng nhập phải có từ 4 đến 32 kí tự'))), array('name' => 'Regex', 'break_chain_on_failure' => true, 'options' => array('pattern' => "/^[a-z0-9_-]{4,32}\$/", 'messages' => array('regexNotMatch' => 'Chỉ chấp nhận các kí tự là chữ, chữ số, dấu - và dấu _'))), array('name' => 'Db\\NoRecordExists', 'options' => array('table' => 'users', 'field' => 'username', 'adapter' => \Zend\Db\TableGateway\Feature\GlobalAdapterFeature::getStaticAdapter(), 'messages' => array('recordFound' => "Tên đăng nhập này đã được sử dụng")))))); // code $password = new Password('password'); $password->setLabel('Mật khẩu'); $password->setAttributes(['class' => 'input-xlarge inputFieldWithTitle']); $this->add($password); $group->addElement($password); $filter->add(array('name' => 'password', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập Mật khẩu'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('min' => 6, 'messages' => array('stringLengthTooShort' => 'Mật khẩu phải có từ 6 kí tự trở lên')))))); $password2 = new Password('password2'); $password2->setLabel('Xác nhận mật khẩu:'); $password2->setAttributes(['class' => 'input-xlarge inputFieldWithTitle']); $this->add($password2); $group->addElement($password2); $filter->add(array('name' => 'password2', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập Mật khẩu'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('min' => 6, 'messages' => array('stringLengthTooShort' => 'Mật khẩu phải có từ 6 kí tự trở lên'))), array('name' => 'Identical', 'break_chain_on_failure' => true, 'options' => array('token' => 'password', 'messages' => array('notSame' => 'Xác nhận mật khẩu không chính xác')))))); $this->add(array('name' => 'submit', 'options' => array('clearBefore' => true), 'attributes' => array('type' => 'submit', 'value' => 'Đăng kí', 'id' => 'btnSave', 'class' => 'btn btn-primary'))); }
/** * @param null|string $name */ public function __construct($serviceLocator, $options = null) { parent::__construct('passwordForgot'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $filter = $this->getInputFilter(); $groupBasic = new DisplayGroup('groupBasic'); $this->add($groupBasic); $password = new Password('password'); $password->setLabel('Mật khẩu mới:'); $password->setAttributes(['maxlength' => 32, 'autocomplete' => 'off']); $this->add($password); $groupBasic->addElement($password); $filter->add(array('name' => 'password', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập Mật khẩu'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('max' => 32, 'min' => 6, 'messages' => array(StringLength::TOO_LONG => 'Mật khẩu giới hạn 6-32 kí tự', StringLength::TOO_SHORT => 'Mật khẩu giới hạn 6-32 kí tự')))))); $rePassword = new Password('rePassword'); $rePassword->setLabel('Nhập lại mật khẩu mới:'); $rePassword->setAttributes(['maxlength' => 32, 'autocomplete' => 'off']); $this->add($rePassword); $groupBasic->addElement($rePassword); $filter->add(array('name' => 'rePassword', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập lại Mật khẩu'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('max' => 32, 'min' => 6, 'messages' => array(StringLength::TOO_LONG => 'Mật khẩu giới hạn 6-32 kí tự', StringLength::TOO_SHORT => 'Mật khẩu giới hạn 6-32 kí tự'))), array('name' => 'Identical', 'break_chain_on_failure' => true, 'options' => array('token' => 'password', 'messages' => array('notSame' => 'Xác nhận mật khẩu không chính xác')))))); $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Đặt lại mật khẩu', 'id' => 'btnSubmit', 'class' => 'htmlBtn first btn btn-primary'), 'options' => array('clearBefore' => true, 'decorator' => array('type' => 'li', 'attributes' => array('class' => 'btns'))))); }
/** * @param null|string $name */ public function __construct($serviceLocator, $options = null) { parent::__construct($serviceLocator); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $this->setAttribute('class', 'f'); $this->setAttribute('autocomplete', 'off'); $this->setOptions(['layout' => 'form-2-cols']); $filter = $this->getInputFilter(); $group = new DisplayGroup('Signup'); $group->setLabel('Đăng kí'); $this->add($group); // name $email = new Text('email'); $email->setLabel('Email:'); $email->setAttributes(['maxlength' => 255]); $this->add($email); $group->addElement($email); $filter->add(array('name' => 'email', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập địa chỉ email'))), array('name' => 'EmailAddress', 'break_chain_on_failure' => true, 'options' => array('messages' => array('emailAddressInvalidFormat' => 'Địa chỉ email không hợp lệ', 'emailAddressInvalidHostname' => 'Không tồn tại máy chủ mail', 'hostnameInvalidHostname' => 'Không tồn tại hostname như trên', 'hostnameInvalidLocalName' => 'Không tồn tại hostname như trên', 'hostnameLocalNameNotAllowed' => 'Không tồn tại hostname như vậy', 'emailAddressDotAtom' => 'Không tồn tại định dạng E-mail như trên', 'emailAddressQuotedString' => "Định dạng không hợp lệ", 'emailAddressInvalidLocalPart' => 'Định dạng không hợp lệ', 'hostnameUnknownTld' => 'Domain name không hợp lệ'))), array('name' => 'Db\\NoRecordExists', 'options' => array('table' => 'users', 'field' => 'email', 'adapter' => \Zend\Db\TableGateway\Feature\GlobalAdapterFeature::getStaticAdapter(), 'messages' => array('recordFound' => "Email này đã được sử dụng")))))); $username = new Text('username'); $username->setLabel('Tên đăng nhập:'); $username->setAttributes(['maxlength' => 255]); $this->add($username); $group->addElement($username); $filter->add(array('name' => 'username', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập tên đăng nhập'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('min' => 4, 'messages' => array('stringLengthTooShort' => 'Tên đăng nhập phải có từ 4 đến 32 kí tự'))), array('name' => 'Regex', 'break_chain_on_failure' => true, 'options' => array('pattern' => "/^[a-z0-9_-]{4,32}\$/", 'messages' => array('regexNotMatch' => 'Chỉ chấp nhận các kí tự là chữ thường, chữ số, dấu - và dấu _'))), array('name' => 'Db\\NoRecordExists', 'options' => array('table' => 'users', 'field' => 'username', 'adapter' => \Zend\Db\TableGateway\Feature\GlobalAdapterFeature::getStaticAdapter(), 'messages' => array('recordFound' => "Tên đăng nhập này đã được sử dụng")))))); // code $password = new Password('password'); $password->setLabel('Mật khẩu'); $this->add($password); $group->addElement($password); $filter->add(array('name' => 'password', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập Mật khẩu'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('min' => 6, 'messages' => array('stringLengthTooShort' => 'Mật khẩu phải có từ 6 kí tự trở lên'))), array('name' => 'Regex', 'break_chain_on_failure' => true, 'options' => array('pattern' => "/^[a-zA-Z0-9]{4,32}\$/", 'messages' => array('regexNotMatch' => 'Mật khẩu chỉ bao gồm chữ hoa, thường và số')))))); $password2 = new Password('password2'); $password2->setLabel('Xác nhận mật khẩu:'); $this->add($password2); $group->addElement($password2); $filter->add(array('name' => 'password2', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa xác nhận Mật khẩu'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('min' => 6, 'messages' => array('stringLengthTooShort' => 'Mật khẩu phải có từ 6 kí tự trở lên'))), array('name' => 'Identical', 'break_chain_on_failure' => true, 'options' => array('token' => 'password', 'messages' => array('notSame' => 'Xác nhận mật khẩu không chính xác')))))); $this->add(array('name' => 'submit', 'options' => array('clearBefore' => true), 'attributes' => array('type' => 'submit', 'value' => 'Đăng kí', 'id' => 'btnSave', 'class' => 'btn btn-primary'))); }
public function __construct($serviceLocator, $options = null) { parent::__construct('AccountIndex'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $filter = $this->getInputFilter(); $group = new DisplayGroup('Subject'); $group->setLabel('Thêm mentor'); $this->add($group); $subject = new Text('subject'); $subject->setLabel('Tên môn:'); $subject->setAttributes(['maxlength' => 255, 'style' => 'width:100% !important', 'placeholder' => 'Tên môn học']); $subject->setOptions(array('tagsinput' => true, 'description' => 'Tên môn học')); $this->add($subject); $group->addElement($subject); $filter->add(array('name' => 'subject', 'required' => false, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập tên môn')))))); $subjectId = new Hidden('subjectId'); $subjectId->setLabel('Tên môn:'); $this->add($subjectId); $group->addElement($subjectId); $filter->add(array('name' => 'subjectId', 'required' => false, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập tên môn')))))); $this->add(array('name' => 'submit', 'options' => array('clearBefore' => true), 'attributes' => array('type' => 'submit', 'value' => 'Lưu', 'id' => 'btnSave', 'class' => 'btn btn-primary'))); }
/** * @param null|string $name */ public function __construct($serviceLocator, $options = null) { parent::__construct('taskRequirement'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $filter = $this->getInputFilter(); if ($options && isset($options['id']) && $options['id']) { $this->id = $options['id']; } $taskFile = new \Work\Model\TaskFile(); $taskFile->setTaskId($this->id); $taskFile->setCreatedDateTime(DateBase::getCurrentDateTime()); $targetFolder = Uri::getSavePath($taskFile); if (!file_exists($targetFolder)) { $oldmask = umask(0); mkdir($targetFolder, 0777, true); umask($oldmask); } $task = new Task(); $fileUpload = new File('fileUpload'); $this->add($fileUpload); $filter->add(array('name' => 'fileUpload', 'type' => '\\Zend\\InputFilter\\FileInput', 'required' => true, 'allowEmpty' => true, 'filters' => array(new \Zend\Filter\File\RenameUpload(array('target' => $targetFolder, 'use_upload_name' => true, 'overwrite' => true))), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa chọn file'))), array('name' => 'File\\Size', 'break_chain_on_failure' => true, 'options' => array('max' => Task::MAX_FILE_SIZE . 'MB', 'messages' => array(\Zend\Validator\File\Size::TOO_BIG => 'File upload phải < 100Mb'))), array('name' => 'File\\Extension', 'break_chain_on_failure' => true, 'options' => array('extension' => $task->getAllowExtension(), 'messages' => array(\Zend\Validator\File\Extension::FALSE_EXTENSION => 'File upload phải là file ảnh, excel, hoặc msword,pds,pdf')))))); }
public function __construct($serviceLocator, $options = null) { parent::__construct('AccountIndex'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $filter = $this->getInputFilter(); $group = new DisplayGroup('Subject'); $group->setLabel('Trở thành mentor '); $this->add($group); // name $name = new Text('name'); $name->setLabel('Tên danh mục:'); $name->setAttributes(['maxlength' => 255, 'placeholder' => 'Tên']); $this->add($name); $group->addElement($name); $filter->add(array('name' => 'name', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập tên')))))); $email = new Text('email'); $email->setLabel('Tên danh mục:'); $email->setAttributes(['maxlength' => 255, 'placeholder' => 'Email']); $this->add($email); $group->addElement($email); $filter->add(array('name' => 'email', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập tên')))))); $this->add(array('name' => 'submit', 'options' => array('clearBefore' => true), 'attributes' => array('type' => 'submit', 'value' => 'Lưu', 'id' => 'btnSave', 'class' => 'btn btn-primary'))); }
public function __construct($serviceLocator, $options = null) { parent::__construct('AccountIndex'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $filter = $this->getInputFilter(); $group = new DisplayGroup('Subject'); $group->setLabel('Trở thành mentor '); $this->add($group); // name $fullname = new Text('fullname'); $fullname->setLabel('Họ và tên:'); $fullname->setAttributes(['maxlength' => 255, 'placeholder' => 'Tên']); $this->add($fullname); $group->addElement($fullname); $filter->add(array('name' => 'fullname', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập tên')))))); $email = new Text('email'); $email->setLabel('Email của Anh/Chị :'); $email->setAttributes(['maxlength' => 255, 'placeholder' => 'Email']); $this->add($email); $group->addElement($email); $filter->add(array('name' => 'email', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập email'))), array('name' => 'EmailAddress', 'break_chain_on_failure' => true, 'options' => array('messages' => array('emailAddressInvalidFormat' => 'Địa chỉ email không hợp lệ')))))); $skype = new Text('skype'); $skype->setLabel('Skype:'); $skype->setAttributes(['maxlength' => 255, 'placeholder' => 'Skype']); $this->add($skype); $group->addElement($skype); $filter->add(array('name' => 'skype', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập skype')))))); $mobile = new Text('mobile'); $mobile->setLabel('Số điện thoại:'); $mobile->setAttributes(['maxlength' => 12, 'placeholder' => 'Số điện thoại']); $this->add($mobile); $group->addElement($mobile); $filter->add(array('name' => 'mobile', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập số điện thoại')))))); $social = new Text('social'); $social->setLabel('Link tới tài khoản mạng xã hội của bạn:'); $social->setAttributes(['maxlength' => 255, 'placeholder' => 'Mạng xã hội']); $this->add($social); $group->addElement($social); $filter->add(array('name' => 'social', 'required' => false, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập skype')))))); $isTeaching = new Radio('isTeaching'); $isTeaching->setLabel('Bạn đã từng giảng dạy chưa?'); $isTeaching->setValueOptions(['1' => 'Đã từng', '2' => 'Chưa bao giờ']); $this->add($isTeaching); $group->addElement($isTeaching); $filter->add(array('name' => 'isTeaching', 'required' => false, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa chọn')))))); $description = new Textarea('description'); $description->setLabel('Mô tả công việc giảng dạy của bạn:'); $description->setAttributes(['class' => ' inputBox', 'style' => 'min-height: 300px;', 'placeholder' => 'Mô tả']); $this->add($description); $group->addElement($description); $filter->add(array('name' => 'description', 'required' => false, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập mô tả công việc giảng day của bạn')))))); $cityId = new Select('cityId'); $cityId->setLabel('Thành phố:'); $this->loadCities($cityId); $filter->add(array('name' => 'cityId', 'required' => false, 'filters' => array())); $this->add($cityId); $districtId = new Select('districtId'); $districtId->setLabel('Quận/huyện: '); $this->loadDistricts($districtId, $cityId, $options); $this->add($districtId); $filter->add(array('name' => 'districtId', 'required' => false, 'filters' => array())); $address = new Text('address'); $address->setLabel('Địa chỉ: '); $filter->add(array('name' => 'address', 'required' => false, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập địa chỉ của bạn')))))); $this->add($address); // $birthday = new Text('birthday'); // $birthday->setLabel('Tên danh mục:'); // $birthday->setAttributes([ // 'maxlength' => 255, // 'placeholder' => 'Ngày sinh', // 'class' => 'datepicker inputBox' // ]); // $this->add($birthday); // $group->addElement($birthday); // $filter->add(array( // 'name' => 'birthday', // 'required' => false, // 'filters' => array( // array( // 'name' => 'StringTrim' // ) // ), // 'validators' => array( // array( // 'name' => 'NotEmpty', // 'break_chain_on_failure' => true, // 'options' => array( // 'messages' => array( // 'isEmpty' => 'Bạn chưa nhập ngày sinh' // ) // ) // ), // ) // )); $this->add(array('name' => 'submit', 'options' => array('clearBefore' => true), 'attributes' => array('type' => 'submit', 'value' => 'Lưu', 'id' => 'btnSave', 'class' => 'btn btn-primary'))); }
/** * @param null|string $name */ public function __construct($serviceLocator, $options = null) { parent::__construct('fUserAdd'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $filter = $this->getInputFilter(); $groupBasic = new DisplayGroup('groupBasic'); $groupBasic->setLabel('Thông tin cơ bản'); $this->add($groupBasic); $username = new Text('username'); $username->setLabel('Tên đăng nhập:'); $username->setAttributes(['maxlength' => 50, 'autocomplete' => 'off']); $this->add($username); $groupBasic->addElement($username); $filter->add(array('name' => 'username', 'required' => true, 'filters' => array(array('name' => 'StringTrim'), array('name' => 'StringToLower')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập tên đăng nhập'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('max' => 50, 'min' => 4, 'messages' => array(StringLength::TOO_LONG => 'Tên đăng nhập giới hạn 4-50 kí tự', StringLength::TOO_SHORT => 'Tên đăng nhập giới hạn 4-50 kí tự'))), array('name' => 'Regex', 'break_chain_on_failure' => true, 'options' => array('pattern' => "/^[a-z0-9_-]{4,32}\$/", 'messages' => array('regexNotMatch' => 'Chỉ chấp nhận các kí tự là chữ, chữ số, dấu - và dấu _'))), array('name' => 'Db\\NoRecordExists', 'options' => array('table' => 'users', 'field' => 'username', 'adapter' => \Zend\Db\TableGateway\Feature\GlobalAdapterFeature::getStaticAdapter(), 'messages' => array('recordFound' => "Tên đăng nhập này đã được sử dụng")))))); $fulName = new Text('fullName'); $fulName->setLabel('Họ tên:'); $fulName->setAttributes(['maxlength' => 255, 'autocomplete' => 'off']); $this->add($fulName); $groupBasic->addElement($fulName); $filter->add(array('name' => 'fullName', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập họ tên'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('max' => 255, 'min' => 4, 'messages' => array(StringLength::TOO_LONG => 'Tên đăng nhập giới hạn 4-250 kí tự', StringLength::TOO_SHORT => 'Tên đăng nhập giới hạn 4-250 kí tự')))))); $email = new Text('email'); $email->setLabel('Email:'); $email->setAttributes(['maxlength' => 255, 'autocomplete' => 'off']); $this->add($email); $groupBasic->addElement($email); $filter->add(array('name' => 'email', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập email'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('max' => 50, 'min' => 4, 'messages' => array(StringLength::TOO_LONG => 'Tên đăng nhập giới hạn 4-50 kí tự', StringLength::TOO_SHORT => 'Tên đăng nhập giới hạn 4-50 kí tự'))), array('name' => 'EmailAddress', 'break_chain_on_failure' => true, 'options' => array('messages' => array('emailAddressInvalidFormat' => 'Địa chỉ email không hợp lệ'))), array('name' => 'Db\\NoRecordExists', 'options' => array('table' => 'users', 'field' => 'email', 'adapter' => \Zend\Db\TableGateway\Feature\GlobalAdapterFeature::getStaticAdapter(), 'messages' => array('recordFound' => "Email này đã được sử dụng")))))); $user = new \User\Model\User(); $role = new Select('role'); $role->setLabel('Phân quyền:'); $role->setValueOptions(['' => '- Phân quyền -'] + $user->getRoleDisplays()); $this->add($role); $groupBasic->addElement($role); $filter->add(array('name' => 'role', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa chọn Phân quyền')))))); $password = new Password('password'); $password->setLabel('Mật khẩu:'); $password->setAttributes(['maxlength' => 32, 'autocomplete' => 'off']); $this->add($password); $groupBasic->addElement($password); $filter->add(array('name' => 'password', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập Mật khẩu'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('max' => 32, 'min' => 6, 'messages' => array(StringLength::TOO_LONG => 'Mật khẩu giới hạn 6-32 kí tự', StringLength::TOO_SHORT => 'Mật khẩu giới hạn 6-32 kí tự')))))); $rePassword = new Password('rePassword'); $rePassword->setLabel('Nhập lại Mật khẩu:'); $rePassword->setAttributes(['maxlength' => 32, 'autocomplete' => 'off']); $this->add($rePassword); $groupBasic->addElement($rePassword); $filter->add(array('name' => 'rePassword', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập lại Mật khẩu'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('max' => 32, 'min' => 6, 'messages' => array(StringLength::TOO_LONG => 'Mật khẩu giới hạn 6-32 kí tự', StringLength::TOO_SHORT => 'Mật khẩu giới hạn 6-32 kí tự'))), array('name' => 'Identical', 'break_chain_on_failure' => true, 'options' => array('token' => 'password', 'messages' => array('notSame' => 'Xác nhận mật khẩu không chính xác')))))); $mobile = new Text('mobile'); $mobile->setLabel('Mobile:'); $mobile->setAttributes(['maxlength' => 15]); $mobile->setOptions(['leftIcon' => 'fa fa-mobile']); $this->add($mobile); $groupBasic->addElement($mobile); $filter->add(array('name' => 'mobile', 'required' => false, 'filters' => array(array('name' => 'StringTrim'), array('name' => 'Digits')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập Mobile'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('min' => 10, 'max' => 11, 'messages' => array(StringLength::INVALID => 'Mobile phải là dạng 10 hoặc 11 chữ số', StringLength::TOO_SHORT => 'Mobile phải là dạng 10 hoặc 11 chữ số', StringLength::TOO_LONG => 'Mobile phải là dạng 10 hoặc 11 chữ số')))))); // group additional $groupAdditional = new DisplayGroup('groupAdditional'); $groupAdditional->setLabel('Thông tin cá nhân'); $this->add($groupAdditional); $gender = new Select('gender'); $this->add($gender); $groupAdditional->addElement($gender); $gender->setLabel('Giới tính:'); $gender->setValueOptions(array('' => '- Giới tính -', \Home\Model\Consts::GENDER_MALE => 'Nam', \Home\Model\Consts::GENDER_FEMALE => 'Nữ')); $filter->add(array('name' => 'gender', 'required' => false, 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập Giới tính')))))); $birthdate = new Text('birthdate'); $birthdate->setLabel('Ngày sinh:'); $birthdate->setAttributes(['class' => 'datetimepicker', 'data-date-format' => "DD/MM/YYYY"]); $birthdate->setOptions(['leftIcon' => 'fa fa-calendar']); $this->add($birthdate); $groupAdditional->addElement($birthdate); $filter->add(array('name' => 'birthdate', 'required' => false, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'Date', 'break_chain_on_failure' => true, 'options' => array('format' => DateBase::getDisplayDateFormat(), 'messages' => array('dateInvalid' => 'Ngày sinh không hợp lệ', 'dateInvalidDate' => 'Ngày sinh không hợp lệ', 'dateFalseFormat' => 'Ngày sinh không hợp lệ')))))); $cityId = new Select('cityId'); $cityId->setLabel('Thành phố:'); $cityId->setValueOptions(array('' => '- Thành phố -')); $this->add($cityId); $groupAdditional->addElement($cityId); $filter->add(array('name' => 'cityId', 'required' => false, 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập thành phố'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('max' => 250, 'messages' => array(StringLength::INVALID => 'Địa chỉ chỉ giới hạn nhỏ hơn 250 kí tự')))))); $districtId = new Select('districtId'); $districtId->setLabel('Quận huyện:'); $districtId->setValueOptions(array('' => '- Quận huyện -')); $this->add($districtId); $groupAdditional->addElement($districtId); $filter->add(array('name' => 'districtId', 'required' => false, 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập thành phố')))))); $address = new Text('address'); $address->setLabel('Địa chỉ:'); $address->setAttributes(['maxlength' => 255]); $this->add($address); $groupAdditional->addElement($address); $filter->add(array('name' => 'address', 'required' => false, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập địa chỉ')))))); $this->add(array('name' => 'afterSubmit', 'type' => 'radio', 'attributes' => array('value' => '/system/user/add'), 'options' => array('layout' => 'fluid', 'clearBefore' => true, 'label' => 'Sau khi lưu dữ liệu:', 'value_options' => array('/system/user/add' => 'Tiếp tục nhập người dùng', '/system/user/index' => 'Hiện danh sách người dùng')))); $this->add(array('name' => 'submit', 'options' => array('clearBefore' => true), 'attributes' => array('type' => 'submit', 'value' => 'Lưu', 'id' => 'btnSaveCrmContact', 'class' => 'btn btn-primary'))); }