本文整理汇总了PHP中Account::select方法的典型用法代码示例。如果您正苦于以下问题:PHP Account::select方法的具体用法?PHP Account::select怎么用?PHP Account::select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Account
的用法示例。
在下文中一共展示了Account::select方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: signin
public function signin() {
$email = $this->f3->get('POST.email');
$password = $this->f3->get('POST.password');
$v = new Valitron\Validator(array('Email' => $email, 'Password' => $password));
$v->rule('required', ['Email', 'Password']);
$v->rule('email', 'Email');
if ($v->validate()) {
$account = new Account($this->db);
$pwd = md5($password);
$acc = $account->select("*", "email='$email' and password='$pwd'");
if ($acc) {
$this->f3->set('SESSION.acc', $acc);
$acc = $acc[0];
$acc['lastlogin'] = date('Y-m-d H:i:s');
$account->update($acc,'id='.$acc['id']);
$this->f3->reroute('/dashboard');
} else {
$this->f3->set('email', $email);
$this->f3->set('errors', array(array('Login fail, wrong username or password')));
echo Template::instance()->render('index.html');
}
} else {
$this->f3->set('email', $email);
$this->f3->set('errors', $v->errors());
echo Template::instance()->render('index.html');
}
}
示例2: parseBrowse
function parseBrowse($cId, $eId, $cmd)
{
global $_PATHS, $_CONF;
$objTpl = new HTML_Template_IT($_PATHS['templates']);
$objTpl->loadTemplatefile("common.tpl.htm");
switch ($cId) {
case NAV_ACCOUNT:
$objAccounts = Account::select("SELECT * FROM punch_account ORDER BY name");
$arrDomain = explode('.', $_SERVER['HTTP_HOST']);
$strRootDomain = count($arrDomain) > 2 ? str_replace(array_shift($arrDomain) . ".", "", $_SERVER['HTTP_HOST']) : $_SERVER['HTTP_HOST'];
//*** Render list.
foreach ($objAccounts as $objTempAccount) {
$objTpl->setCurrentBlock("list-item");
$objTpl->setVariable('ITEM_LINK', "http://" . $objTempAccount->getUri() . "." . $strRootDomain);
$objTpl->setVariable('ITEM_LABEL', htmlentities($objTempAccount->getName()));
$objTpl->setVariable('ITEM_EXPORT', "?cid=" . NAV_ACCOUNT . "&cmd=" . CMD_EXPORT . "&eid=" . $objTempAccount->getId());
$objTpl->setVariable('ITEM_RESTORE', "?cid=" . NAV_ACCOUNT . "&cmd=" . CMD_RESTORE . "&eid=" . $objTempAccount->getId());
$objTpl->setVariable('ITEM_EDIT', "?cid=" . NAV_ACCOUNT . "&cmd=" . CMD_EDIT . "&eid=" . $objTempAccount->getId());
$objTpl->setVariable('ITEM_TYPE', "Account");
$objTpl->setVariable('ITEM_ID', $objTempAccount->getId());
$objTpl->parseCurrentBlock();
}
break;
case NAV_ADMIN:
break;
}
//*** Return the output.
return $objTpl->get();
}
示例3: address
function address()
{
$user_id = Account::getUserId();
$field = array('country', 'region', 'province', 'city', 'district', 'address', 'postcode', 'mobile', 'tel');
$m = new Account();
$m->clear();
$m->setField($field);
$m->setTable('vcb_user_address');
$m->setWhere('user_id', '=', $user_id);
$data = $m->select();
if (empty($data)) {
header("location:transfer");
}
$this->assign('data', $data);
}
示例4: explode
<?php
$arrDomain = explode('.', $_SERVER['HTTP_HOST']);
$intCatId = Request::get("cid");
if (isset($_CONF['app']['singleInstance']) && $_CONF['app']['singleInstance']) {
//*** Check if the account exists.
$objAccounts = Account::select();
if ($objAccounts->count() <= 0) {
//*** Account does not exist.
header("Location: " . Request::getURI("http") . "/?cid=" . NAV_MYPUNCH_NOACCOUNT);
exit;
} else {
$objAccount = $objAccounts->current();
}
//*** Set the PunchId.
$_CONF['app']['account'] = $objAccount;
$_CONF['app']['pageTitle'] = sprintf($objLang->get('pageTitle'), $_CONF['app']['account']->getName(), APP_NAME, APP_VERSION);
} else {
if ($intCatId != NAV_MYPUNCH_NOACCOUNT) {
if (count($arrDomain) > 2) {
$strDomain = $arrDomain[count($arrDomain) - 2] . "." . $arrDomain[count($arrDomain) - 1];
$strSubName = $arrDomain[0];
//*** Check if the account exists.
$objAccount = Account::getByUri($strSubName);
if (!is_object($objAccount)) {
//*** Account does not exist.
header("Location: " . Request::getURI("http") . "/?cid=" . NAV_MYPUNCH_NOACCOUNT);
exit;
}
//*** Set the PunchId.
$_CONF['app']['account'] = $objAccount;
示例5: testSelectWithNoParameters
public function testSelectWithNoParameters()
{
// our mock adapter
$adapter = $this->adapterMock;
// prepare the mock to expect the variables passed, and return a row
$adapter->expects($this->once())->method('select')->with('accounts', null, null, array());
$accountsTable = new Account($adapter);
// getInstance doesn't work well in testing
$result = $accountsTable->select();
}
示例6: array
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<?php
require 'autoloader.php';
Autoloader::register();
Config::load(array('dbconfig' => array('char' => array('user' => 'root', 'pass' => '', 'dsn' => 'mysql:host=127.0.0.1;dbname=characters'), 'auth' => array('user' => 'root', 'pass' => '', 'dsn' => 'mysql:host=127.0.0.1;dbname=auth'))));
$accounts = Account::select('id = 1');
foreach ($accounts as $account) {
$account->delete();
}
DatabaseManager::get('auth')->queue->execute();
DatabaseManager::get('char')->queue->execute();
?>
</body>
</html>