本文整理汇总了PHP中Application_Form_FrmLanguages::getCurrentlanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP Application_Form_FrmLanguages::getCurrentlanguage方法的具体用法?PHP Application_Form_FrmLanguages::getCurrentlanguage怎么用?PHP Application_Form_FrmLanguages::getCurrentlanguage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application_Form_FrmLanguages
的用法示例。
在下文中一共展示了Application_Form_FrmLanguages::getCurrentlanguage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
$tr = Application_Form_FrmLanguages::getCurrentlanguage();
$request = Zend_Controller_Front::getInstance()->getRequest();
$db = new Application_Model_DbTable_DbGlobal();
//user typefilter
$sql = 'SELECT user_type_id,user_type FROM rsv_acl_user_type';
$rs = $db->getGlobalDb($sql);
$options = array('All');
$usertype = $request->getParam('user_type_filter');
foreach ($rs as $read) {
$options[$read['user_type_id']] = $read['user_type'];
}
$user_type_filter = new Zend_Form_Element_Select('user_type_filter');
$user_type_filter->setMultiOptions($options);
$user_type_filter->setAttribs(array('id' => 'user_type_filter', 'class' => 'validate[required]', 'onchange' => 'this.form.submit()'));
$user_type_filter->setValue($usertype);
$this->addElement($user_type_filter);
//uer title
$user_title = new Zend_Form_Element_Select("title");
$user_title->setMultiOptions(array("Mr" => "Mr", "Ms" => "Ms"));
$this->addElement($user_title);
//user full name
$user_fullname = new Zend_Form_Element_Text("fullname");
$user_fullname->setAttribs(array('id' => 'fullname', 'class' => 'validate[required]'));
$this->addElement($user_fullname);
//user name
$user_name = new Zend_Form_Element_Text('username');
$user_name->setAttribs(array('id' => 'username', 'class' => 'validate[required]'));
$this->addElement($user_name);
//email
$email = new Zend_Form_Element_Text('email');
$email->setAttribs(array('id' => 'email', 'class' => 'validate[required]'));
$this->addElement($email);
//password
$password = new Zend_Form_Element_Password('password');
$password->setAttribs(array('id' => 'password', 'class' => 'validate[required]'));
$this->addElement($password);
//confirm password
$confirm_password = new Zend_Form_Element_Password('confirm_password');
$confirm_password->setAttribs(array('id' => 'confirm_password', 'class' => 'validate[required]'));
$this->addElement($confirm_password);
//user type
$sql = 'SELECT user_type_id,user_type FROM rsv_acl_user_type';
$rs = $db->getGlobalDb($sql);
$options = array('' => $tr->translate('Please_Select'));
foreach ($rs as $read) {
$options[$read['user_type_id']] = $read['user_type'];
}
$user_type_id = new Zend_Form_Element_Select('user_type_id');
$user_type_id->setMultiOptions($options);
$user_type_id->setAttribs(array('id' => 'user_type_id', 'class' => 'validate[required]'));
$this->addElement($user_type_id);
//location
$rs = $db->getGlobalDb('SELECT LocationId, Name FROM tb_sublocation WHERE Name!="" AND status=1 ORDER BY LocationId DESC');
$option = array("1" => $tr->translate("Please_Select"), "-1" => $tr->translate("Add_New_Location"));
if (!empty($rs)) {
foreach ($rs as $read) {
$option[$read['LocationId']] = $read['Name'];
}
}
$locationID = new Zend_Form_Element_Select('LocationId');
$locationID->setMultiOptions($option);
$locationID->setattribs(array('id' => 'LocationId', 'Onchange' => 'AddLocation()', 'class' => 'demo-code-language'));
$this->addElement($locationID);
}
示例2: init
public function init()
{
$this->tr = Application_Form_FrmLanguages::getCurrentlanguage();
$this->tvalidate = 'dijit.form.ValidationTextBox';
$this->filter = 'dijit.form.FilteringSelect';
$this->text = 'dijit.form.TextBox';
}
示例3: AllAction
public function AllAction($data = null)
{
$tr = Application_Form_FrmLanguages::getCurrentlanguage();
$newElement = new Zend_Form_Element_Submit('New');
$newElement->setLabel($tr->translate("NEW"));
$this->addElement($newElement);
$saveElement = new Zend_Form_Element_Submit('Save');
$saveElement->setAttribs(array('class' => 'save'));
$saveElement->setLabel($tr->translate("SAVE_CLOSE"));
$this->addElement($saveElement);
$saveNewElement = new Zend_Form_Element_Submit('SaveNew');
$saveNewElement->setAttribs(array('class' => 'savenew'));
$saveNewElement->setLabel($tr->translate("SAVE_NEW"));
$this->addElement($saveNewElement);
$updateElement = new Zend_Form_Element_Submit('Update');
$updateElement->setAttribs(array('class' => 'update'));
$updateElement->setLabel($tr->translate("UPDATE"));
$this->addElement($updateElement);
$deactiveElement = new Zend_Form_Element_Submit('Deactive');
$deactiveElement->setAttribs(array('class' => 'deactive'));
$deactiveElement->setLabel($tr->translate("DEACTIVE"));
$this->addElement($deactiveElement);
$activeElement = new Zend_Form_Element_Submit('Active');
$activeElement->setAttribs(array('class' => 'activate'));
$activeElement->setLabel($tr->translate("ACTIVE"));
$this->addElement($activeElement);
$CancelElement = new Zend_Form_Element_Submit('Cancel');
$CancelElement->setAttribs(array('class' => 'cancel'));
$this->addElement($CancelElement);
return $this;
}
示例4: init
public function init()
{
$this->tr=Application_Form_FrmLanguages::getCurrentlanguage();
/* Initialize action controller here */
header('content-type: text/html; charset=utf8');
defined('BASE_URL') || define('BASE_URL', Zend_Controller_Front::getInstance()->getBaseUrl());
}
示例5: addBrand
public function addBrand($data = null)
{
$tr = Application_Form_FrmLanguages::getCurrentlanguage();
$db = new Application_Model_DbTable_DbGlobal();
$rowsbrand = $db->getGlobalDb('SELECT branch_id, Name
FROM tb_branch WHERE Name!="" ');
$options = array('' => $tr->translate('Please_Select'));
if ($rowsbrand) {
foreach ($rowsbrand as $readBrand) {
$options[$readBrand['branch_id']] = $readBrand['Name'];
}
}
$brandElement = new Zend_Form_Element_Select('Parent brand');
$brandElement->setAttribs(array('class' => 'demo-code-language'));
$brandElement->setMultiOptions($options);
$this->addElement($brandElement);
$b_nameElement = new Zend_Form_Element_Text('brand Name');
$b_nameElement->setAttribs(array('class' => 'validate[required]'));
$this->addElement($b_nameElement);
$optionsStatus = array(1 => $tr->translate("ACTIVE"), 2 => $tr->translate('DEACTIVE'));
$statusElement = new Zend_Form_Element_Select('status');
$statusElement->setAttribs(array('class' => 'demo-code-language'));
$statusElement->setMultiOptions($optionsStatus);
$this->addElement($statusElement);
if ($data != null) {
$idElement = new Zend_Form_Element_Hidden('id');
$this->addElement($idElement);
$statusElement->setValue($data["IsActive"]);
$idElement->setValue($data['branch_id']);
$b_nameElement->setValue($data['Name']);
$brandElement->setValue($data['parent_id']);
}
return $this;
}
示例6: addDateFieldCalDOB
/**
* Get Datepicker with event Onselect
* @param array() $date_fields
* @example
* addDateFieldCalDOB(array(array('dob_1','age_1'), array('dob_2','age_2')));
*/
public static function addDateFieldCalDOB($date_fields)
{
$tr = Application_Form_FrmLanguages::getCurrentlanguage();
$template = '$("#template").datepicker({"changeYear":"true","changeMonth":"true","yearRange":"-40:+100","dateFormat":"dd-mm-yy" , onslect});';
$script = '<script language="javascript"> $(document).ready(function() { #template# });</script>';
$onselect = 'onSelect: function(dateText, inst) {
var prefix = " ' . $tr->translate("YEARS") . '";
var _d = dateText.split("-");
var d = new Date(_d[2], _d[1], _d[0]);
var now = new Date();
var age = now.getFullYear() - d.getFullYear();
$("#dob_id").val(age + " " + prefix);
}';
$value = '';
if (is_array($date_fields)) {
foreach ($date_fields as $read) {
$tmpsel = str_replace('#dob_id', '#' . $read[1], $onselect);
$tmptem = str_replace('onslect', $tmpsel, $template);
$value .= str_replace('#template', '#' . $read[0], $tmptem);
}
} else {
$tmpsel = str_replace('#dob_id', '#' . $read[1], $onselect);
$tmptem = str_replace('onslect', $tmpsel, $template);
$value .= str_replace('#template', '#' . $read[0], $tmptem);
}
echo str_replace('#template#', $value, $script);
}
示例7: indexAction
public function indexAction()
{
$formfilter = new RsvAcl_Form_FrmUser();
$this->view->formfilter = $formfilter;
$where = "";
// action body
$tr = Application_Form_FrmLanguages::getCurrentlanguage();
$getUser = new RsvAcl_Model_DbTable_DbUser();
if ($this->getRequest()->getParam('user_type_filter')) {
$user_type_id = $this->getRequest()->getParam('user_type_filter');
$where = " where user_type_id=" . $user_type_id;
}
$userQuery = "select \n \t\t\t\t\tu.`user_id`,\n \t\t\t\t\tu.`username`,\n \t\t\t\t\tu.`created_date`,\n \t\t\t\t\tu.`modified_date`, \n \t\t\t\t\t(SELECT ut.`user_type` FROM `rsv_acl_user_type` AS ut WHERE ut.`user_type_id` = u.`user_type_id`) as u_type,\n \t\t\t\t\t(SELECT c.`name_sh` FROM `fi_cso` AS c WHERE c.`id` = \n \t\t\t\t\t\t(SELECT i.`cso_id` FROM `fi_users_info` AS i WHERE i.`id` = u.`user_id`)\n \t\t\t\t\t) as cso_name,\n \t\t\t\t\tu.`status` \n \t\t\t from rsv_acl_user as u";
$userQuery = $userQuery . $where;
$rows = $getUser->getUserInfo($userQuery);
if ($rows) {
$imgnone = '<img src="' . BASE_URL . '/images/icon/none.png"/>';
$imgtick = '<img src="' . BASE_URL . '/images/icon/tick.png"/>';
foreach ($rows as $i => $row) {
if ($row['status'] == 1) {
$rows[$i]['status'] = $imgtick;
} else {
$rows[$i]['status'] = $imgnone;
}
}
$link = array("rsvAcl", "user", "view-user");
$links = array('username' => $link);
$list = new Application_Form_Frmlist();
$columns = array('NAME', 'CREATED_DATE', 'MODIFIED_DATE', 'TYPE_OF', 'CSO', 'STATUS');
$this->view->form = $list->getCheckList('radio', $columns, $rows, $links);
} else {
$this->view->form = $tr->translate('NO_RECORD_FOUND');
}
Application_Model_Decorator::removeAllDecorator($formfilter);
}
示例8: message
public static function message($msg)
{
$tr = Application_Form_FrmLanguages::getCurrentlanguage();
echo '<script language="javascript">
alert("' . $tr->translate($msg) . '");
</script>';
}
示例9: editUserTypeAction
public function editUserTypeAction()
{
$user_type_id = $this->getRequest()->getParam('id');
if (!$user_type_id) {
$user_type_id = 0;
}
$form = new RsvAcl_Form_FrmUserType();
$db = new RsvAcl_Model_DbTable_DbUserType();
$rs = $db->getUserTypeInfo('SELECT * FROM rsv_acl_user_type where user_type_id=' . $user_type_id);
Application_Model_Decorator::setForm($form, $rs);
$this->view->form = $form;
$this->view->user_id = $user_type_id;
$tr = Application_Form_FrmLanguages::getCurrentlanguage();
if ($this->getRequest()->isPost()) {
$post = $this->getRequest()->getPost();
if ($rs[0]['user_type'] == $post['user_type']) {
Application_Form_FrmMessage::message($tr->translate('ROW_AFFECTED'));
$db->updateUserType($post, $rs[0]['user_type_id']);
Application_Form_FrmMessage::redirector('/rsvAcl/user-type/index');
} else {
if (!$db->isUserTypeExist($post['user_type'])) {
$db->updateUserType($post, $rs[0]['user_type_id']);
Application_Form_FrmMessage::message($tr->translate('ROW_AFFECTED'));
Application_Form_FrmMessage::redirector('/rsvAcl/user-type/index');
} else {
Application_Form_FrmMessage::message('User had existed already');
}
}
}
}
示例10: editAclAction
public function editAclAction()
{
$acl_id = $this->getRequest()->getParam('id');
if (!$acl_id) {
$acl_id = 0;
}
$form = new RsvAcl_Form_FrmAcl();
$db = new RsvAcl_Model_DbTable_DbAcl();
$rs = $db->getUserInfo('SELECT * FROM rsv_acl_acl where acl_id=' . $acl_id);
Application_Model_Decorator::setForm($form, $rs);
$this->view->form = $form;
$this->view->acl_id = $acl_id;
if ($this->getRequest()->isPost()) {
$post = $this->getRequest()->getPost();
if ($rs[0]['action'] == $post['action']) {
$db->updateAcl($post, $rs[0]['acl_id']);
$tr = Application_Form_FrmLanguages::getCurrentlanguage();
Application_Form_FrmMessage::message($tr->translate('ROW_AFFECTED'));
Application_Form_FrmMessage::redirector('/rsvAcl/acl/index');
} else {
if (!$db->isActionExist($post['action'])) {
$db->updateAcl($post, $rs[0]['acl_id']);
$tr = Application_Form_FrmLanguages::getCurrentlanguage();
Application_Form_FrmMessage::message($tr->translate('ROW_AFFECTED'));
Application_Form_FrmMessage::redirector('/rsvAcl/acl/index');
} else {
Application_Form_FrmMessage::message('Action had existed already');
}
}
}
}
示例11: init
public function init()
{
$request = Zend_Controller_Front::getInstance()->getRequest();
$db = new Application_Model_DbTable_DbGlobal();
/////////////Filter stock/////////////////
$tr = Application_Form_FrmLanguages::getCurrentlanguage();
$nameElement = new Zend_Form_Element_Text('s_name');
$nameValue = $request->getParam('s_name');
$nameElement->setValue($nameValue);
$this->addElement($nameElement);
$phonevalue = $request->getParam('phone');
$phoneElement = new Zend_Form_Element_Text('phone');
$phoneElement->setValue($phonevalue);
$this->addElement($phoneElement);
$rs = $db->getGlobalDb('SELECT LocationId,Name FROM tb_sublocation ORDER BY LocationId DESC ');
$options = array('' => $tr->translate('Please_Select'));
$agentValue = $request->getParam('stock_location');
foreach ($rs as $read) {
$options[$read['LocationId']] = $read['Name'];
}
$sale_agent = new Zend_Form_Element_Select('stock_location');
$sale_agent->setMultiOptions($options);
$sale_agent->setAttribs(array('id' => 'LocationId', 'class' => 'demo-code-language'));
$sale_agent->setValue($agentValue);
$this->addElement($sale_agent);
return $this;
}
示例12: messageError
public static function messageError($sms, $err)
{
Application_Model_DbTable_DbGlobal::writeMessageErr($err);
$tr = Application_Form_FrmLanguages::getCurrentlanguage();
echo '<script language="javascript">
alert("' . $tr->translate("{$sms}") . '");
</script>';
}
示例13: indexAction
public function indexAction()
{
$this->_helper->layout()->disableLayout();
///sopharat disablelayout to display login
$tr = Application_Form_FrmLanguages::getCurrentlanguage();
if ($this->getRequest()->isPost()) {
$formdata = $this->getRequest()->getPost();
$db_user = new Application_Model_DbTable_DbUsers();
$email = $formdata['txt_email'];
$password = $formdata['txt_password'];
if ($db_user->checkEmail($email)) {
if ($db_user->userAuthenticate($email, $password)) {
$user_id = $db_user->getUserID($email);
$user_info = $db_user->getUserInfo($user_id);
$arr_acl = $db_user->getArrAcl($user_info['user_type_id']);
//in case user have no right to access any module of the system
if (!$arr_acl) {
$this->view->msg = $tr->translate('LOGIN_FAIL_NO_MODULE');
} else {
$session_user = new Zend_Session_Namespace('auth');
$session_user->unlock();
$session_user->user_id = $user_id;
$session_user->fullname = $user_info['fullname'];
$session_user->user_name = $user_info['username'];
$session_user->level = $user_info['user_type_id'];
$session_user->user_type = $user_info['user_type'];
$session_user->location_id = $user_info['LocationId'];
$session_user->email = $email;
for ($i = 0; $i < count($arr_acl); $i++) {
$arr_module[$i] = $arr_acl[$i]['module'];
}
$arr_module = array_unique($arr_module);
$session_user->arr_acl = $arr_acl;
$session_user->arr_module = $arr_module;
$session_user->lock();
//echo $session_user->user_name;sales/sales-order
//echo $session_user->user_id=$user_id;exit();
//$_url=($arr_acl[0]!=='')? '/'.$arr_acl[0]['module']:'/default/index/home' ;//before
//$_url=($arr_acl[0]!=='')? '/default/index/dashboad':'/default/index/home' ;//after
//print_r($arr_acl[0]);
//exit();
//$this->_redirect("/sales/sales-order");
$_url = $arr_acl[0] !== '' ? '/default/index/dashboad' : '/sales/sales-order';
//after
$this->_redirect($_url);
}
} elseif (!$db_user->checkStatusByEmail($email)) {
$this->view->msg = $tr->translate('LOGIN_FAIL_COMFIRM');
} else {
$this->view->msg = $tr->translate('LOGIN_FAIL');
}
} else {
$this->view->msg = $tr->translate('EMAIL_NOT');
}
}
}
示例14: getAllDegree
public function getAllDegree($id = null)
{
$tr = Application_Form_FrmLanguages::getCurrentlanguage();
$opt_degree = array(1 => $this->tr->translate("Diploma"), 2 => $this->tr->translate("Associate"), 3 => $this->tr->translate("Bechelor"), 4 => $this->tr->translate("Master"), 5 => $this->tr->translate("PhD"));
if ($id == null) {
return $opt_degree;
} else {
return $opt_degree[$id];
}
}
示例15: getAllMonths
public function getAllMonths($id = null)
{
$tr = Application_Form_FrmLanguages::getCurrentlanguage();
$opt_month = array('' => '----ជ្រើសរើស----', 1 => 'មករា', 2 => 'កុម្ភះ', 3 => 'មីនា', 4 => 'មេសា', 5 => 'ឧសភា', 6 => 'មិថុនា', 7 => 'កក្តដា', 8 => 'សីហា', 9 => 'កញ្ញា', 10 => 'តុលា', 11 => 'វិចិ្ឆកា', 12 => 'ធ្នូ');
if ($id == null) {
return $opt_month;
} else {
return $opt_month[$id];
}
}