本文整理汇总了PHP中BD::Next方法的典型用法代码示例。如果您正苦于以下问题:PHP BD::Next方法的具体用法?PHP BD::Next怎么用?PHP BD::Next使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BD
的用法示例。
在下文中一共展示了BD::Next方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: RodadaCopa
/**
* Construtor
* @param int $userid
* @return void
*/
function RodadaCopa($camp, $rod)
{
$db = new BD();
$sql = sprintf("select distinct \n\t\t\t campeonato,\n\t\t\t rodada,\n\t\t\t jogo\n\t\t\t from\n cad_rodada_copa\n where campeonato = %d\n\t\t\t and rodada = %d", $camp, $rod);
$db->Query($sql);
$this->Campeonato = $camp;
$this->Rodada = $rod;
while ($db->Next()) {
array_push($this->Jogos, $db->getValue('jogo'));
}
$db->Close();
}
示例2: getFim
function getFim()
{
//Retorna o numero da ultima rodada
$datafim = 0;
$db = new BD();
$sql = sprintf("select\n\t\t\t\t\t max(addtime(data,hora)) datafim\n\t\t\t\t\t from\n\t\t\t\t\t cad_rodada\n\t\t\t\t\t where \n\t\t\t\t\t campeonato= %d \n\t\t\t\t\t and rodada = %d", $this->getCampeonato(), $this->getRodada());
$db->Query($sql);
$db->Next();
$datafim = $db->getValue('datafim');
$db->Close();
return $datafim;
}
示例3: JogoCopa
/**
* Construtor
* @param int $userid
* @return void
*/
function JogoCopa($camp, $rod, $jg)
{
$db = new BD();
$sql = sprintf("select \n\t\t\t campeonato,\n\t\t\t rodada,\n\t\t\t jogo,\n\t\t\t tipo,\n\t\t\t userid,\n\t\t\t golsp,\n\t\t\t pontos,\n\t\t\t grupo\n\t\t\t from\n cad_rodada_copa\n where campeonato = %d\n\t\t\t and rodada = %d\n\t\t\t and jogo = %d", $camp, $rod, $jg);
$db->Query($sql);
$this->Campeonato = $camp;
$this->Rodada = $rod;
$this->Jogo = $jg;
while ($db->Next()) {
if ($db->getValue('tipo') == 'M') {
$this->Mandante = $db->getValue('userid');
$this->GolsMa = $db->getValue('golsp');
$this->PontosMa = $db->getValue('pontos');
} else {
$this->Visitante = $db->getValue('userid');
$this->GolsVi = $db->getValue('golsp');
$this->PontosVi = $db->getValue('pontos');
}
$this->Grupo = $db->getValue('grupo');
}
$db->Close();
}
示例4: getVotos
function getVotos($op)
{
// Retorna os votos de cada opção
$res = array();
$Votos = 0;
$db = new BD();
if (strtoupper($op) == "TOTAL") {
$sql = sprintf("select\n\t\t\t\t\t count(*) votos\n\t\t\t\t\t from\n\t\t\t\t\t cad_enquete_votos where\n\t\t\t\t\t numero = %d", $this->getCodigo());
} else {
$sql = sprintf("select\n\t\t\t\t\t count(*) votos\n\t\t\t\t\t from\n\t\t\t\t\t cad_enquete_votos where\n\t\t\t\t\t numero = %d and opcao = %d", $this->getCodigo(), $op);
}
$db->Query($sql);
$db->Next();
$Votos = $db->getValue('votos');
$db->Close();
return $Votos;
}
示例5: BD
<?php
require_once $_SESSION['DOCROOT'] . "/classes/class.bd.php";
require_once $_SESSION['DOCROOT'] . "/classes/class.usuario.php";
require_once $_SESSION['DOCROOT'] . "/classes/class.campeonato.php";
require_once $_SESSION['DOCROOT'] . "/classes/class.inscricao.php";
$db = new BD();
$sql = sprintf("select i.campeonato,i.userid " . "from " . "cad_inscricao i, " . "cad_usuario u, " . "cad_campeonato c " . "where " . "i.campeonato = c.codigo " . "and i.userid = u.userid " . "and c.flandamento = 'S' and c.codigo = 4 " . "order by " . "c.ano desc," . "i.campeonato," . "i.posefetiva," . "u.username");
$db->Query($sql);
$camp = 0;
$posant = 0;
$pos = 0;
if ($db->NumRows() == 0) {
echo ' <tr> <td>Não existe campeonatos cadastrados ou em andamento no momento.<br></td> </tr>' . "\n";
} else {
while ($db->Next()) {
if ($camp != $db->getValue('campeonato')) {
if ($camp != 0) {
echo "<tr><td colspan=4><br></td></tr>\n";
}
$pos = 0;
$cmp = new Campeonato($db->getValue('campeonato'));
echo "<tr style='background:rgb(250, 252, 188);color:rgb(0, 102, 0);'><td colspan=10 align=center><b>" . $cmp->getDescricaoAno() . "</td></tr>\n";
echo "<tr style='background:rgb(250, 252, 188);color:rgb(0, 102, 0);'><td colspan=3 align=center><b>Classificação do Bolão</td>\n\t\t\t\t\t\t\t</tr>\n";
$camp = $cmp->getCodigo();
echo "<tr class='cabec'><td align=center>Pos</td><td>Participante</td><td align=center>Pontos</td></tr>\n";
}
$usr = new Usuario($db->getValue('userid'));
$ins = new Inscricao($cmp->getCodigo(), $usr->getUserid());
if ($posant != $ins->getPosicao()) {
$pos = $ins->getPosefetiva();
示例6: getHistorico
function getHistorico()
{
//Retorna uma matriz com o historico de confrontos do time
$Hst = array();
$db = new BD();
$sql = sprintf("select\n\t\t\t\t\t campeonato,\n\t\t\t\t\t rodada,\n\t\t\t\t\t manda,\n\t\t\t\t\t vi.nome visitante,\n\t\t\t\t\t ma.nome mandante,\n\t\t\t\t\t visita,\n\t\t\t\t\t golsma,\n\t\t\t\t\t golsvi,\n\t\t\t\t\t addtime(data,hora) datahora\n\t\t\t\t\t from\n\t\t\t\t\t cad_rodada,\n\t\t\t\t\t cad_times ma,\n\t\t\t\t\t cad_times vi\n\t\t\t\t\t where \n\t\t\t\t\t (manda = %d\n\t\t\t\t\t or visita = %d)\n\t\t\t\t\t and ma.codigo = manda\n\t\t\t\t\t and vi.codigo = visita\n \t\t\t\t\t order by campeonato desc,rodada desc,data desc,hora desc", $this->getCodigo(), $this->getCodigo());
$db->Query($sql);
while ($db->Next()) {
array_push($Hst, $db->Row);
}
$db->Close();
return $Hst;
}
示例7: LogUsuario
function LogUsuario($pUserid, $pOrigem, $pLogado)
{
$gi = geoip_open($_SERVER['DOCUMENT_ROOT'] . "/geoip/GeoLiteCity.dat", GEOIP_STANDARD);
$geoip = geoip_record_by_addr($gi, $_SERVER['REMOTE_ADDR']);
$db = new BD();
$sql = sprintf("select count(*) qtde from log_usuario\n where\n ip = '%s'\n and sessionid = '%s'", $_SERVER['REMOTE_ADDR'], session_id());
$db->Query($sql);
$db->Next();
if ($db->getValue("qtde") == 0) {
$sql = sprintf("insert into log_usuario\n\t\t\t\t\t(userid,datahora,origem,logado,ip,sessionid,cidade,estado,pais)\n\t\t\t\t\tvalues (%d,now(),'%s','%s','%s','%s','%s','%s','%s')", $pUserid, $pOrigem, $pLogado, $_SERVER['REMOTE_ADDR'], session_id(), $geoip->city, RetornaEstado($geoip->country_code, $geoip->region), $geoip->country_name);
} else {
$sql = sprintf("update log_usuario\n\t\t\t\t\t\t\tset userid = %d,\n\t\t\t\t\t\t\t\torigem = '%s',\n\t\t\t\t\t\t\t\tlogado = '%s',\n\t\t\t\t\t\t\t\tqtde = qtde + 1\n\t\t\t\t\t\t\t\twhere\n\t\t\t\t\t\t\t\tip = '%s'\n\t\t\t\t\t\t\t\tand sessionid = '%s'", $pUserid, $pOrigem, $pLogado, $_SERVER['REMOTE_ADDR'], session_id());
}
$db->Exec($sql);
$db->Close();
geoip_close($gi);
}
示例8: getJogosCopa
function getJogosCopa($rodada)
{
$Adv = array();
$db = new BD();
$sql = sprintf("select jogo\n\t\t\t\t\t\t from cad_rodada_copa\n\t\t\t\t\t\t where campeonato = %d\n\t\t\t\t\t\t and rodada = %d\n\t\t\t\t\t\t and userid = %d", $this->getCampeonato(), $rodada, $this->getUserid());
$db->Query($sql);
while ($db->Next()) {
array_push($Adv, $db->getValue('jogo'));
}
$db->Close();
return $Adv;
}
示例9: getReunioes
function getReunioes($filtro)
{
// Retorna as reuniões cadastradas
$reunioes = array();
$db = new BD();
if ($filtro == 'T') {
$sql = sprintf("select\n\t\t\t\t\t\t id,\n\t\t\t\t\t\t local,\n\t\t\t\t\t\t data,\n\t\t\t\t\t\t hora\n\t\t\t\t\t\t from\n\t\t\t\t\t\t cad_reuniao\n\t\t\t\t\t\t order by data desc");
} else {
if ($filtro == 'P') {
$sql = sprintf("select\n\t\t\t\t\t\t\t min(id) id\n\t\t\t\t\t\t\t from\n\t\t\t\t\t\t\t cad_reuniao\n\t\t\t\t\t\t\t where\n\t\t\t\t\t\t\t data >= curdate()\n\t\t\t\t\t\t\t order by data desc");
}
}
$db->Query($sql);
while ($db->Next()) {
array_push($reunioes, $db->Row);
}
$db->Close();
return $reunioes;
}
示例10: getEventos
function getEventos()
{
// Retorna os eventos cadastrados
$eventos = array();
$db = new BD();
$sql = sprintf("select\n\t\t\t\t\t id,\n\t\t\t\t\t local,\n\t\t\t\t\t data,\n\t\t\t\t\t descricao\n\t\t\t\t\t from\n\t\t\t\t\t cad_eventos\n\t\t\t\t\t order by data desc");
$db->Query($sql);
while ($db->Next()) {
array_push($eventos, $db->Row);
}
$db->Close();
return $eventos;
}
示例11: getProximaRodada
function getProximaRodada()
{
//Retorna o numero da rodada atual
$Rodada = 0;
$db = new BD();
$sql = sprintf("select ifnull(min(rodada),0) rodada\n\t\t\t\t\t\t\tfrom cad_rodada\n\t\t\t\t\t\t\twhere campeonato = %d\n\t\t\t\t\t\t\tand rodada > %d", $this->Codigo, $this->getRodadaAtual());
$db->Query($sql);
$db->Next();
$Rodada = $db->getValue('rodada');
$db->Close();
return $Rodada;
}
示例12: BD
$msg = "";
$username = "";
$linkexc = "";
$db = new BD();
$db2 = new BD();
$sql = sprintf("select m.codigo,u.userid,email,mensagem,m.userid useridrec from\n\t\t\t\t\t\t\t\tcad_mural m,\n\t\t\t\t\t\t\t\tcad_usuario u\n\t\t\t\t\t\t\t\twhere\n\t\t\t\t\t\t\t\tu.recmail = 'S'\n\t\t\t\t\t\t\t\tand u.aprovado = 'S'\n\t\t\t\t\t\t\t\tand (m.codigo,u.userid)\n\t\t\t\t\t\t\t\tnot in\n\t\t\t\t\t\t\t\t(select codigo,userid from log_mural)\n\t\t\t\t\t\t\t\tlimit 45");
$db->Query($sql);
while ($db->Next()) {
$codigo = $db->getValue('codigo');
$user = $db->getValue('userid');
$userrec = $db->getValue('useridrec');
$email = $db->getValue('email');
$msg = $db->getValue('mensagem');
$sql = sprintf("select username from cad_usuario where userid = %d", $userrec);
$db2->Query($sql);
$db2->Next();
$username = $db2->getValue('username');
$msg .= "<br><br><br>" . "Mensagem enviada por: <b>" . $username;
$msg .= "<br>" . "Opala Clube Franca.";
$msg .= "<br><br><br>" . "Se não deseja receber as mensagens por e-mail clique no link abaixo.";
$linkexc = sprintf("<a href=http://" . $_SERVER['HTTP_HOST'] . "/prc_excmail.php?usr=" . trim($user) . "&id=" . md5(trim(trim($username) . 'lstmailexc' . trim($email))) . ">Clique aquí p/ não receber mais os recados por e-mail</a>");
$msg .= "<br>" . $linkexc;
$ln = sprintf("Codigo:%d - User:%d - Username:%s - Email:%s<br>", $codigo, $user, $username, $email);
// echo ($ln)."\n";
$st = envmail($email, "Recado Opala Clube Franca", $msg, "admin@opalaclubefranca.com.br");
$sql = sprintf("insert into log_mural (codigo,userid,dataenvio,status)\n\t\t\t\t\t\tvalues (%d,%d,now(),'%s')", $codigo, $user, $st);
$db2->Exec($sql);
}
$db->Close();
$db2->Close();
foreach (glob("/home/opalaclu/prc_envrecado.php.*") as $filename) {
示例13: getEventos
function getEventos($filtro)
{
// Retorna as reuniões cadastradas
$calendario = array();
$db = new BD();
if ($filtro == 'T') {
$sql = sprintf("select\n\t\t\t\t\t\t idcalendario,\n\t\t\t\t\t\t titulo,\n\t\t\t\t\t\t dataevento,\n\t\t\t\t\t\t descricao,\n\t\t\t\t\t\t local,\n\t\t\t\t\t\t realizacao\n\t\t\t\t\t\t from\n\t\t\t\t\t\t tb_calendario\n\t\t\t\t\t\t order by dataevento desc");
} else {
if ($filtro == 'P') {
$sql = sprintf("select\n\t\t\t\t\t\t\t\t idcalendario,\n\t\t\t\t\t\t\t\t titulo,\n\t\t\t\t\t\t\t\t dataevento,\n\t\t\t\t\t\t\t\t descricao,\n\t\t\t\t\t\t\t\t local,\n\t\t\t\t\t\t\t\t realizacao\n\t\t\t\t\t\t\t\t from\n\t\t\t\t\t\t\t\t tb_calendario\n\t\t\t\t\t\t\t\t where\n\t\t\t\t\t\t\t\t dataevento >= DATE_SUB(CURDATE(), INTERVAL 10 DAY)\n\t\t\t\t\t\t\t\t and dataevento <= DATE_ADD(CURDATE(), INTERVAL 30 DAY)\n\t\t\t\t\t\t\t\t order by dataevento");
} else {
if ($filtro == 'X') {
$sql = sprintf("select\n\t\t\t\t\t\t\t\t idcalendario,\n\t\t\t\t\t\t\t\t titulo,\n\t\t\t\t\t\t\t\t dataevento,\n\t\t\t\t\t\t\t\t descricao,\n\t\t\t\t\t\t\t\t local,\n\t\t\t\t\t\t\t\t realizacao\n\t\t\t\t\t\t\t\t from\n\t\t\t\t\t\t\t\t tb_calendario\n\t\t\t\t\t\t\t\t where\n\t\t\t\t\t\t\t\t dataevento >= DATE_SUB(CURDATE(), INTERVAL 10 DAY)\n\t\t\t\t\t\t\t\t order by dataevento");
}
}
}
$db->Query($sql);
while ($db->Next()) {
array_push($calendario, $db->Row);
}
$db->Close();
return $calendario;
}