本文整理汇总了PHP中Model_User::updateUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Model_User::updateUser方法的具体用法?PHP Model_User::updateUser怎么用?PHP Model_User::updateUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model_User
的用法示例。
在下文中一共展示了Model_User::updateUser方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateAction
public function updateAction()
{
$frmUseruserForm = new Form_User();
$frmUseruserForm->setAction('/user/update');
$frmUseruserForm->removeElement('password');
$mdlUseruserModel = new Model_User();
if ($this->_request->isPost()) {
if ($frmUseruserForm->isValid($_POST)) {
$mdlUseruserModel->updateUser($frmUseruserForm->getValue('id'), $frmUseruserForm->getValue('username'), $frmUseruserForm->getValue('first_name'), $frmUseruserForm->getValue('last_name'), $frmUseruserForm->getValue('role'));
return $this->_forward('list');
}
} else {
$id = $this->_request->getParam('id');
$currentUser = $mdlUseruserModel->find($id)->current();
$frmUseruserForm->populate($currentUser->toArray());
}
$this->view->form = $frmUseruserForm;
}
示例2: redirect
$u = $p = "";
if (isset($_POST['edit_user'])) {
if ($_POST['txtuser'] == NULL) {
$error[] = "Please input your username";
} else {
$u = $_POST['txtuser'];
}
if ($_POST['txtpass'] != $_POST['txtrepass']) {
$error[] = "Password not match";
} else {
if ($_POST['txtpass'] != "") {
$p = $_POST['txtpass'];
} else {
$p = "none";
}
}
$l = $_POST['level'];
if ($u && $p && $l) {
$muser->setUsername($u);
$muser->setPassword($p);
$muser->setLevel($l);
if ($muser->checkUsername($id) == true) {
$muser->updateUser($id);
redirect("{$baseurl}/user/list");
} else {
$error[] = "Your user name has been registed";
}
}
}
$data = $muser->getUserById($id);
require "views/user/edit_view.php";
示例3: ussdProgress
public function ussdProgress($user, $message)
{
$menu_item_id = $user->menu_item_id;
// print_r($menu_item_id);
// exit;
$step = $user->step;
$menuModel = new Model_Menu();
$menu = $menuModel->getMenu($menu_item_id);
// print_r($menu);
// exit;
if ($menu['id'] == 0) {
$reply = "We could not understand your response";
$output = $this->mainMenu($user, $user['phoneno']);
return $reply . PHP_EOL . $output;
}
//
$menuType = $menu->type;
// print_r($menuType);
// exit;
// print_r($step);
// exit;
if ($menuType == 2) {
//no verification but feed it response and update step as you move on
if ($step > 0) {
$message = strtolower($message);
//feed the response to the table
// print_r($message);
// exit;
$valid = 1;
$valid = $this->validateResponse($menu->id, $message, $step);
// print_r($valid);
// exit;
if (is_array($valid) && $valid['valid'] == 0) {
$output = $valid['message'];
//print_r($output);
return $output;
}
$dataa = array('user_id' => $user['id'], 'menu_id' => $menu_item_id, 'step' => $step, 'response' => $message);
//print_r($dataa);
//exit;
$Response_Model = new Model_Response();
$result = $Response_Model->createResponse($dataa);
// print_r($result);
// exit;
if ($result) {
//check if we have another step, if we do, request, if we dont, compile the summary and confirm
$next_step = $step + 1;
// print_r($step);
// exit;
$menuItemsModel = new Model_MenuItems();
$menuItem = $menuItemsModel->getNextMenuStep($menu_item_id, $next_step);
// print_r($menuItem);
// exit;
if ($menuItem['id'] != 0) {
//update user data and next request and send back
$userModel = new Model_User();
$result = $userModel->updateUserMenuStep($user['id'], $next_step);
//$menuItem = $menuItemsModel -> getNextMenuStep($menu_item_id,$step);
return $menuItem->description;
//exit;
} else {
//compile summary for confirmation
//$menuItemsModel = new Model_MenuItems();
$MenuItems = $menuItemsModel->getMenuItems($menu_item_id);
//print_r($MenuItems);
//exit;
//build up the responses
$confirmation = "Confirm?: " . $menu->description;
foreach ($MenuItems as $key => $value) {
// print_r($value);
// exit;
//print_r($confirmation);
//exit;
//select the corresponding response
if ($value[4] != 'PIN') {
$phrase = $value[4];
//print_r($value[4]);
//$menu_item_id = $value['']
$response = $Response_Model->getResponse($user['id'], $menu_item_id, $value[3]);
//print_r($response['response']."<br>");
if ($value[4] == 'Gender') {
if ($response['response'] == 1) {
$response['response'] = 'Male';
} elseif ($response['response'] == 2) {
$response['response'] = 'Female';
}
} elseif ($value[4] == 'Language') {
if ($response['response'] == 1) {
$response['response'] = 'English';
} elseif ($response['response'] == 2) {
$response['response'] = 'Kiswahili';
}
} elseif ($value[4] == 'Card') {
if ($response['response'] == 1) {
$response['response'] = 'Bebapay';
} elseif ($response['response'] == 2) {
$response['response'] = 'Abiria';
} elseif ($response['response'] == 3) {
$response['response'] = '1963';
}
//.........这里部分代码省略.........
示例4: updateEnterpriseTransaction
//.........这里部分代码省略.........
$this->validateLandline($ficha['enterprise']['phone']);
$programaId = Zend_Registry::get('configDb')->competitionId;
// Validação Categoria do Premio
$updateCategoryAward = $this->validCategoryAward($registerEnterpriseData);
if (!$updateCategoryAward['status']) {
throw new Vtx_UserException($updateCategoryAward['messageError'], 10);
}
// 1.1 Empresa
$updateEnterprise = $this->updateEnterprise($enterpriseRow, $registerEnterpriseData);
if (!$updateEnterprise['status']) {
throw new Vtx_UserException($updateEnterprise['messageError'], 10);
}
// elegibilidade para questionario de diagnostico
//$Eligibility->doDiagnosticoEligibility($updateEnterprise['row']);
// 1.2 Endereço da Empresa
$updateAddressEnterprise = $AddressEnterprise->updateAddressEnterprise($addressEnterpriseRow, $registerAddressEnterpriseData);
if (!$updateAddressEnterprise['status']) {
throw new Vtx_UserException($updateAddressEnterprise['messageError'], 10);
}
// validação dos campos NewsLetter da Candidata (President)
$newsLetterValid = $President->isValidNewsletter($ficha['newsletter'], $registerPresidentData);
if (!$newsLetterValid['status']) {
throw new Vtx_UserException($newsLetterValid['messageError']);
}
// 2.1 Presidente da Empresa
$registerPresidentData['agree'] = $presidentRow->getAgree();
$updatePresident = $President->updatePresident($presidentRow, $registerPresidentData);
if (!$updatePresident['status']) {
throw new Vtx_UserException($updatePresident['messageError']);
}
// 2.2 Endereço da Presidente (candidata)
$updateAddressPresident = $AddressPresident->updateAddressPresident($addressPresidentRow, $registerAddressPresidentData);
if (!$updateAddressPresident['status']) {
throw new Vtx_UserException($updateAddressPresident['messageError']);
}
// 2.3 Programa do Presidente da Empresa
if ($registerPresidentProgramData) {
$PresidentProgram->deleteAllPresidentProgramByPresidentId($presidentId);
$createPresidentProgram = $PresidentProgram->createPresidentProgramByPresidentId($registerPresidentProgramData, $presidentId);
if (!$createPresidentProgram['status']) {
throw new Vtx_UserException($createPresidentProgram['messageError']);
}
}
$enterpriseId = $enterpriseRow->getId();
$hasCurrentECAC = $modelEntCatAwardCompetition->hasECAC($enterpriseId, $programaId);
if (!$hasCurrentECAC) {
$registerECAC = array();
$registerECAC['enterprise_id'] = $enterpriseId;
$registerECAC['competition_id'] = $programaId;
$registerECAC['category_award_id'] = $registerEnterpriseData['category_award_id'];
$insertECAC = $modelEntCatAwardCompetition->createECAC($registerECAC);
if (!$insertECAC['status']) {
throw new Vtx_UserException($insertECAC['messageError']);
}
// Log Cadastro da Empresa - ACEITE
$logCadastroEmpresa['user_id_log'] = $registerLogCadastro['user_id_log'];
$logCadastroEmpresa['enterprise_id'] = $enterpriseId;
$logCadastroEmpresa['programa_id'] = $programaId;
$logCadastroEmpresa['acao'] = 'aceite';
$insertlogCadastroEmpresa = $modelLogCadastroEmpresa->createLogCadastroEmpresa($logCadastroEmpresa);
if (!$insertlogCadastroEmpresa['status']) {
throw new Vtx_UserException($insertlogCadastroEmpresa['messageError']);
}
}
// 3.1 Usuário (nome + sobrenome)
$updateUser = $User->updateUser($userRow, $registerUserData);
if (!$updateUser['status']) {
throw new Vtx_UserException($updateUser['messageError']);
}
// Envia email com login/senha pro responsavel pelo cadastro
$pass = isset($registerUserData['keypass']) ? $registerUserData['keypass'] : null;
$enterpriseEmail = $registerEnterpriseData['email_default'];
$presidentEmail = $registerPresidentData['email'];
if ($enterpriseEmail != '') {
$this->sendMailEdit($enterpriseEmail, $registerUserData['first_name'], $registerUserData['login'], $pass, $enterpriseId);
if ($enterpriseEmail != $presidentEmail) {
$this->sendMailEdit($presidentEmail, $registerPresidentData['name'], $registerPresidentData['cpf'], $pass, $enterpriseId);
}
}
// Log Cadastro da Empresa - EDICAO CADASTRO
$logCadastroEmpresa['user_id_log'] = $registerLogCadastro['user_id_log'];
$logCadastroEmpresa['enterprise_id'] = $enterpriseId;
$logCadastroEmpresa['programa_id'] = $programaId;
$logCadastroEmpresa['acao'] = 'edicao_cadastro';
$insertlogCadastroEmpresaCad = $modelLogCadastroEmpresa->createLogCadastroEmpresa($logCadastroEmpresa);
if (!$insertlogCadastroEmpresaCad['status']) {
throw new Vtx_UserException($insertlogCadastroEmpresaCad['messageError']);
}
// update
// end transaction externo
Zend_Registry::get('db')->commit();
return array('status' => true);
} catch (Vtx_UserException $e) {
Zend_Registry::get('db')->rollBack();
return array('status' => false, 'messageError' => $e->getMessage(), 'errorCode' => $e->getCode());
} catch (Exception $e) {
Zend_Registry::get('db')->rollBack();
throw new Exception($e);
}
}