本文整理汇总了PHP中Read::Query方法的典型用法代码示例。如果您正苦于以下问题:PHP Read::Query方法的具体用法?PHP Read::Query怎么用?PHP Read::Query使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Read
的用法示例。
在下文中一共展示了Read::Query方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Read
?>
</select>
</label>
<label class="label_small">
<span class="field">Cidade:</span>
<select class="j_loadcity" name="empresa_cidade">
<?php
if (!isset($data['empresa_cidade'])) {
?>
<option value="" selected disabled> Selecione antes um estado </option>
<?php
} else {
$City = new Read("app_cidades");
$City->Query("WHERE estado_id = :uf ORDER BY cidade_nome ASC", "uf={$data['empresa_uf']}");
if ($City->getRowCount()) {
foreach ($City->getResult() as $cidade) {
extract((array) $cidade);
echo "<option value=\"{$cidade_id}\" ";
if (isset($data['empresa_cidade']) && $data['empresa_cidade'] == $cidade_id) {
echo "selected";
}
echo "> {$cidade_nome} </option>";
}
}
}
?>
</select>
</label>
示例2: getRow
private function getRow()
{
$Read = new Read($this->Tabela);
if (!empty($this->Places)) {
$Read->Query($this->Termos, $this->Places);
} else {
$Read->findAll();
}
return $Read->getRowCount();
}
示例3: SUM
?>
</span> empresas</li>
<!-- <li class="comm"><span>38</span> comentários</li> -->
</ul>
<div class="clear"></div>
</article>
<article class="useragent boxaside">
<h1 class="boxsubtitle">Navegador:</h1>
<?php
//LE O TOTAL DE VISITAS DOS NAVEGADORES
$read->FullRead(null, "SELECT SUM(agent_views) AS TotalViews FROM ws_siteviews_agent");
$TotalViews = $read->getResult()[0]->TotalViews;
$read->setTable('ws_siteviews_agent');
$read->Query("ORDER BY agent_views DESC LIMIT 3", null);
if (!$read->getResult()) {
WSErro("Oppsss, Ainda não existem estatísticas de navegadores!", WS_INFOR);
} else {
echo "<ul>";
foreach ($read->getResult() as $nav) {
extract((array) $nav);
//REALIZA PORCENTAGEM DE VISITAS POR NAVEGADOR!
$percent = substr($agent_views / $TotalViews * 100, 0, 5);
?>
<li>
<p><strong><?php
echo $agent_name;
?>
:</strong> <?php
echo $percent;
示例4: Read
<?php
require_once '../../_app/Config.inc.php';
$estado = filter_input(INPUT_POST, 'estado', FILTER_VALIDATE_INT);
$readCityes = new Read('app_cidades');
$readCityes->Query("WHERE estado_id = :uf", "uf={$estado}");
sleep(1);
echo "<option value=\"\" disabled selected> Selecione a cidade </option>";
foreach ($readCityes->getResult() as $cidades) {
extract((array) $cidades);
echo "<option value=\"{$cidade_id}\" ";
/*
if($cidade_id == $_SESSION['city']):
echo ' selected="seleted" ';
endif;
*/
echo "> {$cidade_nome} </option>";
}
示例5: Pager
$empi = 0;
$getPage = filter_input(INPUT_GET, 'page', FILTER_VALIDATE_INT);
$Pager = new Pager('painel.php?exe=empresas/index&page=');
$Pager->ExePager($getPage, 10);
$readEmp = new Read('app_empresas');
$readEmp->Query("ORDER BY empresa_status ASC, empresa_title ASC LIMIT :limit OFFSET :offset", "limit={$Pager->getLimit()}&offset={$Pager->getOffset()}");
if ($readEmp->getResult()) {
foreach ($readEmp->getResult() as $emp) {
$empi++;
extract((array) $emp);
$status = !$empresa_status ? 'style="background: #fffed8"' : '';
$stateObj = new Read('app_estados');
$stateObj->Query("WHERE estado_id = :est", "est={$empresa_uf}");
$state = $stateObj->getResult() ? $stateObj->getResult()[0]->estado_uf : 'NULL';
$cityObj = new Read('app_cidades');
$cityObj->Query("WHERE cidade_id = :city", "city={$empresa_cidade}");
$city = $cityObj->getResult() ? $cityObj->getResult()[0]->cidade_nome : 'NULL';
?>
<article<?php
if ($empi % 2 == 0) {
echo ' class="right"';
}
?>
<?php
echo $status;
?>
>
<header>
<div class="img thumb_small">
<?php
示例6: UsuariosUpdate
private function UsuariosUpdate()
{
$this->Usuario = new WsSiteviewsOnline();
$this->Usuario->setOnline_endview($_SESSION['useronline']['online_endview']);
$this->Usuario->setOnline_url($_SESSION['useronline']['online_url']);
$this->Usuario->setOnline_session($_SESSION['useronline']['online_session']);
$this->Usuario->update();
if (!$this->Usuario->getRowCount()) {
$Read = new Read('ws_siteviews_online');
$query = $Read->Query("WHERE #online_session#", "online_session={$_SESSION['useronline']['online_session']}");
if (!$query) {
$this->setUsuarios();
}
}
var_dump($this->Usuario);
}
示例7: WSErro
break;
case 'delete':
$postUpdate->ExeDelete($postAction);
WSErro($postUpdate->getError()[0], $postUpdate->getError()[1]);
break;
default:
WSErro("Ação não foi identificada pelo sistema, favor utilize os botões", WS_ERROR);
break;
}
}
$posti = 0;
$getPage = filter_input(INPUT_GET, 'page', FILTER_VALIDATE_INT);
$Pager = new Pager("painel.php?exe=posts/index&page=");
$Pager->ExePager($getPage, 5);
$Read = new Read("ws_posts");
$Read->Query("ORDER by post_status ASC, post_date DESC LIMIT :limit OFFSET :offset", "limit={$Pager->getLimit()}&offset={$Pager->getOffset()}");
if ($Read->getResult()) {
foreach ($Read->getResult() as $post) {
$posti++;
extract((array) $post);
$status = !$post_status ? 'style="background: #fffed8"' : '';
?>
<article<?php
if ($posti % 2 == 0) {
echo ' class="right" ';
}
?>
<?php
echo $status;
?>
>
示例8: Read
<nav class="guia_comercial">
<h1>Guia de Empresas:</h1>
<ul class="navitem">
<li id="comer" class="azul tabactive">Onde Comer</li>
<li id="ficar">Onde Ficar</li>
<li id="comprar" class="verde">Onde Comprar</li>
<li id="divertir" class="roxo">Onde se Divertir</li>
</ul>
<div class="tab comer">
<?php
$empcat = 'onde-comer';
$empresa = new Read('app_empresas');
$empresa->Query("WHERE empresa_status = 1 AND #empresa_categoria# ORDER BY rand() LIMIT 4", "empresa_categoria={$empcat}");
if (!$empresa->getResult()) {
WSErro("Desculpe, não existem empresas cadastradas na categoria ONDE COMER. Favor, volte depois!", WS_INFOR);
} else {
foreach ($empresa->getResult() as $emp) {
$View->Show((array) $emp, $tpl_empresa);
}
}
?>
</div>
<div class="tab ficar none">
<?php
$empcat = 'onde-ficar';
$empresa->newDados("empresa_categoria={$empcat}");
if (!$empresa->getResult()) {
示例9: Read
<?php
}
?>
</ul>
<div class="clear"></div>
</section>
<?php
}
?>
</div>
<!--RELACIONADOS-->
<?php
$readMode = new Read();
$readMode->setTable("ws_posts");
$readMode->Query("WHERE post_status = 1 AND post_id != :post_id AND #post_category# ORDER BY rand() LIMIT 2", "post_id={$post_id}&post_category={$post_category}");
if ($readMode->getResult()) {
$View = new View();
$tpl_m = $View->Load('article_m');
?>
<footer>
<nav>
<h3>Veja também:</h3>
<?php
foreach ($readMode->getResult() as $more) {
$more->datetime = date('Y-m-d', strtotime($more->post_date));
$more->pubdate = date('d/m/Y H:i', strtotime($more->post_date));
$more->post_content = Check::Words($more->post_content, 20);
$View->Show((array) $more, $tpl_m);
}
?>
示例10: Query
public function Query($Termos)
{
return $this->Read->Query($Termos, $this->Dados);
}
示例11: foreach
<header>
<h1>Anúncio Patrocinado:</h1>
<a href="http://www.upinside.com.br/campus" title="Campus UpInside - Treinamentos em TI 100% em Vídeo aulas">
<img src="<?php
echo INCLUDE_PATH;
?>
/_tmp/banner_large.png" alt="UPINSIDE TEINAMENTOS" title="UPINSIDE TEINAMENTOS" />
</a>
</header>
</article>
<section class="widget art-list last-publish">
<h2 class="line_title"><span class="oliva">Últimas Atualizações:</span></h2>
<?php
$side->setTable('ws_posts');
$side->Query("WHERE post_status = 1 AND post_id != :side ORDER BY post_date DESC LIMIT 3", "side={$post_id}");
if ($side->getResult()) {
foreach ($side->getResult() as $last) {
$last->datetime = date('Y-m-d', strtotime($last->post_date));
$last->pubdate = date('d/m/Y H:i', strtotime($last->post_date));
$View->Show((array) $last, $tpl_p);
}
}
?>
</section>
<section class="widget art-list most-view">
<h2 class="line_title"><span class="vermelho">Destaques:</span></h2>
<?php
$side->setTable('ws_posts');
$side->Query("WHERE post_status = 1 AND post_id != :side ORDER BY post_views DESC LIMIT 3", "side={$post_id}");