本文整理汇总了PHP中UserModel::fetchRow方法的典型用法代码示例。如果您正苦于以下问题:PHP UserModel::fetchRow方法的具体用法?PHP UserModel::fetchRow怎么用?PHP UserModel::fetchRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserModel
的用法示例。
在下文中一共展示了UserModel::fetchRow方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: imageAction
public function imageAction()
{
$userModel = new UserModel();
$userData = $userModel->fetchRow($userModel->getUserById($_GET['user']));
//print_r($userData);
if ($userData['nmuserimage'] == '') {
$userData['nmuserimage'] = 'noUserPhoto_flat.png';
}
$this->view->image = $userData['nmuserimage'];
}
示例2: alterAction
public function alterAction()
{
$cdusergslab = $this->_request->getParam("cdusergslab");
$userModel = new UserModel();
$dataUser = $userModel->fetchRow($userModel->getUserByCd($cdusergslab));
$arrayPopulateForm = array();
foreach ($dataUser as $id => $value) {
$arrayPopulateForm["_" . $id] = $value;
}
$this->_form->addAttributesForm($this->view->baseUrl . "/cadastre/user/save", "user_cadastre_form");
$buttonInclude = $this->_form->createButton("Hidden", "Incluir Função", "include", $this->view->baseUrl . "/cadastre/role", "_blank", "includeForm");
$buttonPrint = $this->_form->createButton("Hidden", "Impressões", "prints", "#", "_blank", "print_btn");
$params = array("includeForm" => $buttonInclude, "print_btn" => $buttonPrint);
$this->_form->createFormToolbar(true, true, $params, true);
$this->_form->setValues($arrayPopulateForm);
$this->_form->addElementsForm();
$this->view->form = $this->_form;
}
示例3: __updateSession
public function __updateSession()
{
Zend_Loader::loadClass('UserModel');
$model = new UserModel();
if ($this->_user) {
$user = $model->fetchRow("user_id= " . $this->_user->user_id)->toArray();
unset($user['password']);
$std_user = new stdClass();
foreach ($user as $key => $value) {
$std_user->{$key} = $value;
}
$auth = Zend_Auth::getInstance();
$auth->getStorage()->write($std_user);
$this->_user = $std_user;
}
}
示例4: myactivityAction
public function myactivityAction()
{
$usertable = new UserModel();
$db1 = $usertable->getAdapter();
$uid = $_SESSION["userinfo"][0][id];
$user = $usertable->fetchRow($db1->quoteInto('id=?', $uid))->toArray();
$table = new User_ActivityModel();
$db2 = $table->getAdapter();
$activitytable = new ActivityModel();
$db3 = $activitytable->getAdapter();
//$where = $db2->quoteInto('userid = ? ', $uid);
//$flag0 = count($table->fetchAll($where) ->toArray()) ;
$result = $db3->query('SELECT activity.* FROM activity,userconactivity WHERE activity.id = userconactivity.activityid and userconactivity.userid =? order by activity.begin desc', $uid)->fetchAll();
$this->view->result = $result;
$this->view->type = $user['type'];
}
示例5: myreplyAction
public function myreplyAction()
{
$page = $this->getRequest()->getParam('page');
$account = $_COOKIE["account"];
$usertable = new UserModel();
$db1 = $usertable->getAdapter();
$answertable = new AnswerModel();
$db3 = $answertable->getAdapter();
//查找当前用户ID
$result = $usertable->fetchRow($db1->quoteInto('email = ?', $account))->toArray();
$uid = $result['id'];
$num = $db3->query('SELECT COUNT(*) as num FROM answer,User WHERE answer.userid = User.id and User.id =? order by time desc', $uid)->fetchAll()[0][num];
$pages = ceil($num / 3);
if ($page == "") {
$page = 0;
}
if ($page < 3) {
if ($pages > 3) {
$set = array(1, 2, 3, 4);
} else {
$set = array();
for ($i = 1; $i <= $pages; $i++) {
$set[] = $i;
}
}
} else {
if ($page >= 3) {
if ($page + 3 <= $pages) {
$set = array($page, $page + 1, $page + 2, $page + 3);
} else {
$set = array();
for ($i = $page; $i <= $pages; $i++) {
$set[] = $i;
}
}
}
}
$count = 6;
$offset = $page * 6;
$select = $db3->select();
$select->from('answer', '*');
$select->join('question', 'answer.questionid=question.id', '*');
$select->where('answer.userid=?', 7)->limit($count, $offset);
$sql = $select->__toString();
$questions = $db3->fetchAll($sql);
// print_r($questions);
/*
$where = $db3->quoteInto('userid = ?', 7);
$order = 'begin by time desc';
$count = 6;
$offset =$page*6;
$questions = $answertable->fetchAll($where, $order, $count, $offset)->toArray();
*/
$this->view->results = $questions;
$this->view->user = $result;
$this->view->page = $page;
$this->view->count = $set;
}