本文整理汇总了PHP中Read类的典型用法代码示例。如果您正苦于以下问题:PHP Read类的具体用法?PHP Read怎么用?PHP Read使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Read类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCategory
/**
* Busca a categoria a partir do id
* @param INT $Category - ID do usuário cadastrado no banco
* @return STRING - retorna o nome da categoria
*/
public function getCategory($Category)
{
$this->CatId = $Category;
$read = new Read();
$read->FullRead("SELECT cat_name FROM " . DB_PRODUTOS_CATEGORIAS . " WHERE cat_id = :id", "id={$this->CatId}");
return $read->getResult()[0]['cat_name'];
}
示例2: getSyntax
private function getSyntax()
{
$read = new Read();
$read->ExeRead($this->Tabela, $this->Termos, $this->Places);
$this->Rows = $read->getRowCount();
if ($this->Rows > $this->Limite) {
$Paginas = ceil($this->Rows / $this->Limite);
$MaxLinks = $this->MaxLinks;
$this->Paginator = "<ul class=\"paginator\">";
$this->Paginator .= "<li><a title=\"{$this->First}\" href=\"{$this->Link}1\">{$this->First}</a></li>";
for ($iPag = $this->Page - $MaxLinks; $iPag <= $this->Page - 1; $iPag++) {
if ($iPag >= 1) {
$this->Paginator .= "<li><a title=\"Página {$iPag}\" href=\"{$this->Link}{$iPag}\">{$iPag}</a></li>";
}
}
$this->Paginator .= "<li><span class=\"active\">{$this->Page}</span></li>";
for ($dPag = $this->Page + 1; $dPag <= $this->Page + $MaxLinks; $dPag++) {
if ($dPag <= $Paginas) {
$this->Paginator .= "<li><a title=\"Página {$dPag}\" href=\"{$this->Link}{$dPag}\">{$dPag}</a></li>";
}
}
$this->Paginator .= "<li><a title=\"{$this->Last}\" href=\"{$this->Link}{$Paginas}\">{$this->Last}</a></li>";
$this->Paginator .= "</ul>";
}
}
示例3: getUserName
/**
* Busca o login do usuário a partir do user_id
* @param INT $userid - ID do usuário cadastrado no banco
* @return STRING - retorna o login do usuário
*/
public function getUserName($UserId)
{
$this->UserId = $UserId;
$read = new Read();
$read->FullRead("SELECT user_login FROM " . DB_USERS . " WHERE user_id = :id", "id={$this->UserId}");
return $read->getResult()[0]['user_login'];
}
示例4: getSyntax
private function getSyntax()
{
$read = new Read();
$read->ExeRead($this->Table, $this->Terms, $this->Places);
$this->Rows = $read->getRowCount();
// Verifica se tem resultados para que se faça a paginação
if ($this->Rows > $this->Limit) {
// Divide a quantidade de resultados (Rows) pelo limite para obter a quantidade de páginas
$Paginas = ceil($this->Rows / $this->Limit);
$MaxLinks = $this->MaxLinks;
$this->Paginator = "<ul class=\"paginator\">";
$this->Paginator .= "<li><a title=\"{$this->First}\" href=\"{$this->Link}1\">{$this->First}</a></li>";
for ($iPag = $this->Page - $MaxLinks; $iPag <= $this->Page - 1; $iPag++) {
if ($iPag >= 1) {
$this->Paginator .= "<li><a title=\"Página {$iPag}\" href=\"{$this->Link}{$iPag}\">{$iPag}</a></li>";
}
}
$this->Paginator .= "<li><span class=\"active\">{$this->Page}</span></li>";
for ($dPag = $this->Page + 1; $dPag <= $this->Page + $MaxLinks; $dPag++) {
if ($dPag <= $Paginas) {
$this->Paginator .= "<li><a title=\"Página {$dPag}\" href=\"{$this->Link}{$dPag}\">{$dPag}</a></li>";
}
}
$this->Paginator .= "<li><a title=\"{$this->Last}\" href=\"{$this->Link}{$Paginas}\">{$this->Last}</a></li>";
$this->Paginator .= "</ul>";
}
}
示例5: getSyntax
private function getSyntax()
{
$read = new Read();
$read->ExeRead($this->tabela, $this->termos, $this->places);
$this->rows = $read->getRowCount();
if ($this->rows > $this->limit) {
$paginas = ceil($this->rows / $this->limit);
$maxLinks = $this->maxLinks;
$this->paginator = "<ul class=\"paginator\">";
$this->paginator .= "<li><a title=\"{$this->first}\" href=\"{$this->link}1\">{$this->first}</a></li>";
for ($iPag = $this->page - $maxLinks; $iPag <= $this->page - 1; $iPag++) {
if ($iPag >= 1) {
$this->paginator .= "<li><a title=\"Página {$iPag}\" href=\"{$this->link}{$iPag}\">{$iPag}</a></li>";
}
}
$this->paginator .= "<li><span=\"active\">{$this->page}</li>";
for ($dPag = $this->page + 1; $dPag <= $this->page + $maxLinks; $dPag++) {
if ($dPag <= $paginas) {
$this->paginator .= "<li><a title=\"Página {$dPag}\" href=\"{$this->link}{$dPag}\">{$dPag}</a></li>";
}
}
$this->paginator .= "<li><a title=\"{$this->last}\" href=\"{$this->link}{$paginas}\">{$this->last}</a></li>";
$this->paginator .= "</ul>";
}
}
示例6: ExeStatus
public function ExeStatus($PostId, $PostStatus)
{
$this->Post = (int) $PostId;
$this->Data['post_status'] = (string) $PostStatus;
$Read = new Read('ws_posts');
$this->Data['post_id'] = $this->Post;
$Read->update($this->Data);
}
示例7: setName
private function setName()
{
$Where = isset($this->Post) ? "post_id != {$this->Post} and" : '';
$readName = new Read();
$readName->ExeRead(self::Entity, "where {$Where} post_title = :t", "t={$this->Data['post_title']}");
if ($readName->getResult()) {
$this->Data['post_name'] = $this->Data['post_name'] . '-' . $readName->getRowCount();
}
}
示例8: Trabalho
public function Trabalho($parametro)
{
include_once 'app/View/header.php';
$tipoAtividade = new Read();
$tipoAtividade->ExeRead('tipo_atividades');
include_once 'app/View/form-trabalho.php';
$parametro = $parametro;
include_once 'app/View/footer.php';
}
示例9: UserOnline
public static function UserOnline()
{
$now = Date('Y-m-d H:i:s');
$deleteUserOnline = new Delete();
$deleteUserOnline->ExeDelete('ws_siteviews_online', "WHERE online_endview < :now", "now={$now}");
$readUserOnline = new Read();
$readUserOnline->ExeRead('ws_siteviews_online');
return $readUserOnline->getRowCount();
}
示例10: select
private function select()
{
$ReadBanco = new Read();
$ReadBanco->ExeRead(self::entidade, ($this->id != 0 ? 'WHERE id = :id' : null) . ' ORDER BY sigla', $this->id != 0 ? "id={$this->id}" : null);
if ($ReadBanco->getRowCount() > 0) {
$this->result = $ReadBanco->getResult();
} else {
$this->result = null;
}
}
示例11: select
private function select()
{
$read = new Read();
$read->ExeRead(self::entidade, ($this->id != 0 ? 'WHERE id = :id' : '') . ' ORDER BY nome', $this->id != 0 ? "id={$this->id}" : null);
if ($read->getRowCount() > 0) {
$this->result = $read->getResult();
} else {
$this->result = null;
}
}
示例12: getNames
private function getNames($nutri)
{
$read = new Read();
$read->FullRead("SELECT nutri_name FROM " . DB_NUTRICAO . " WHERE nutri_id = :id", "id={$nutri}");
if ($read->getResult()) {
return $read->getResult()[0]['nutri_name'];
} else {
return null;
}
}
示例13: setName
private function setName()
{
$email = $this->Data['email'];
$readName = new Read();
$readName->ExeRead(self::Entity, "WHERE cpf = {$this->Data['cpf']} or email = '{$email}'");
if ($readName->getResult()) {
$this->Msg = "<script>alert('Ja possui Cadastrado em Nosso Sitema!');</script>";
} else {
$this->Create();
}
}
示例14: GetAccountId
/**
* Obtem o player com o id tal
* @return $Array [] de player
*/
public static function GetAccountId($id)
{
$Read = new Read();
$Read->ExeRead('players', "WHERE id = :id", "id={$id}");
$Result = $Read->getResult();
if ($Result) {
return $Result;
} else {
return false;
}
}
示例15: getUser
private function getUser()
{
$read = new Read();
$read->ExeRead('pessoas', "WHERE email = :e AND senha = :p", "e={$this->Email}&p={$this->Senha}");
if ($read->getResult()) {
$this->Result = $read->getResult()[0];
return true;
} else {
return false;
}
}