Reportagens

“;
}
$configura[ATIVADO] = true; // indica o estado da aplicação
$configura[MENSAGEM] = “Falha no acesso!!!”; //mensagem
$configura[HOSTDB] = “deborapadua.mysql.dbaas.com.br”;
$configura[NOMEDB] = “deborapadua”;
$configura[USERDB] = “deborapadua”;
$configura[PWDDB] = “SexoePonto13″;
$configura[PATH_RELATIVO]=”http://”.$_SERVER[“SERVER_NAME”].”/”;//caminho relativo
$configura[PATH_ABSOLUTE]=$_SERVER[“DOCUMENT_ROOT”].”/”;//caminho absolute
if(!$configura[ATIVADO]){
header(“Location:Manut.php?mens=$configura[MENSAGEM]”);
}

$con=mysql_connect($configura[HOSTDB], $configura[USERDB], $configura[PWDDB]) or die(“Não Conectou”); ;
mysql_select_db($configura[NOMEDB],$con);
mysql_query(“SET NAMES ‘utf8′”);
mysql_query(‘SET character_set_connection=utf8’);
mysql_query(‘SET character_set_client=utf8’);
mysql_query(‘SET character_set_results=utf8’);

$limite = 10;
/*$SQL_PEGA = mysql_query(“SELECT * FROM aconteceu WHERE midia = ‘link'”);

$SQL_COUNT = mysql_num_rows($SQL_PEGA);
$SQL_RESUL = ceil(mysql_result($SQL_COUNT, 0) / $limite);
var_dump($SQL_COUNT);*/
$sql_count = mysql_query(“SELECT COUNT(‘id’) FROM aconteceu WHERE midia = ‘link'”);
$sql_result = ceil(mysql_result($sql_count, 0) / $limite);
$pg = (isset($_GET[“pg”])) ? (int)$_GET[“pg”] : 1 ;
$start = ($pg – 1) * $limite;

$currentPage = (isset($_GET[“pg”])) ? (int)$_GET[“pg”] : 1 ;
$itemCount = ceil(mysql_result($sql_count, 0));
$itemsPerPage = 10;
$adjacentCount = 2;
$pageLinkTemplate = “?pg=$i”;
/**
* Displays pagination links based on given parameters
*
* @param int $currentPage – current page
* @param int $itemCount – number of items to paginate, used to calculate total number of pages
* @param int $itemsPerPage – number of items per page, used to calculate total number of pages
* @param int $adjacentCount – half the number of page links displayed adjacent to the current page
* @param (string|callable) $pageLinkTemplate – pagination URL string containing %d placeholder or a callable function that accepts page number and returns page URL
* @param boolean $showPrevNext – whether to show previous and next page links
* @return void
*/
function pagination($currentPage, $itemCount, $itemsPerPage, $adjacentCount, $pageLinkTemplate, $showPrevNext = true) {
$firstPage = 1;
$lastPage = ceil($itemCount / $itemsPerPage);
if ($lastPage == 1) {
return;
}
if ($currentPage <= $adjacentCount + $adjacentCount) { $firstAdjacentPage = $firstPage; $lastAdjacentPage = min($firstPage + $adjacentCount + $adjacentCount, $lastPage); } elseif ($currentPage > $lastPage – $adjacentCount – $adjacentCount) {
$lastAdjacentPage = $lastPage;
$firstAdjacentPage = $lastPage – $adjacentCount – $adjacentCount;
} else {
$firstAdjacentPage = $currentPage – $adjacentCount;
$lastAdjacentPage = $currentPage + $adjacentCount;
}
echo ‘

‘;
if ($showPrevNext) {
if ($currentPage == $firstPage) {
echo ”;
} else {
echo ‘‘;

}
}
if ($firstAdjacentPage > $firstPage) {
echo ‘‘ . $firstPage . ‘‘;
if ($firstAdjacentPage > $firstPage + 1) {
echo ‘‘;

}
}
for ($i = $firstAdjacentPage; $i <= $lastAdjacentPage; $i++) { if ($currentPage == $i) { echo '‘ . $i . ‘‘;

} else {
echo ‘‘ . $i . ‘‘;

}
}
if ($lastAdjacentPage < $lastPage) { if ($lastAdjacentPage < $lastPage - 1) { echo '‘;
}
echo ‘‘ . $lastPage . ‘‘;
}
if ($showPrevNext) {
if ($currentPage == $lastPage) {
echo ”;
} else {
echo ‘‘;

}
}
echo ‘

‘;
}

//ACESSO
$sql = “SELECT * FROM aconteceu WHERE midia = ‘link’ ORDER BY data DESC LIMIT $start, $limite “;
$query = mysql_query($sql);
$linhas = mysql_num_rows($query);
for($i=0; $i<$linhas; $i++) { $result = mysql_fetch_array($query); $descricao = $result[3]; $limite=115; //Edite aqui o numero de caracteres $result[3]= substr($descricao, 0,$limite); $conta = strlen($result[3]); // conta quantos caraceteres tem na variavel if($conta==$limite){ $pontinho = "..."; } else{ $pontinho = ""; } $result[3] = str_replace('ê', 'ê', $result[3]); //DATA $data = $result[2]; $nova_data = explode('-',$data); switch ($nova_data[1]) { case "01" : $mes = "JAN"; break; case "02" : $mes = "FEV"; break; case "03" : $mes = "MAR"; break; case "04" : $mes = "ABR"; break; case "05" : $mes = "MAI"; break; case "06" : $mes = "JUN"; break; case "07" : $mes = "JUL"; break; case "08" : $mes = "AGO"; break; case "09" : $mes = "SET"; break; case "10" : $mes = "OUT"; break; case "11" : $mes = "NOV"; break; case "12" : $mes = "DEZ"; break; } // FIM DATA if ($i % 2 == 1){ echo "

“;
echo “

“;
echo “

“;
echo “

$nova_data[2] $mes $nova_data[0]

“;
echo “

“;
echo “$result[3]$pontinho

“;
echo “

“;
echo “

  

“;

}
else{
if ($i == 0){
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

$nova_data[2] $mes $nova_data[0]

“;
echo “

“;
echo “$result[3]$pontinho

“;
echo “

“;
echo “

“;
}else{
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

$nova_data[2] $mes $nova_data[0]

“;
echo “

“;
echo “$result[3]$pontinho

“;
echo “

“;
echo “

“;

}

}

}
echo “

“;
echo “

“;
echo “

“;
echo “

“;

if($sql_result > 1 && $pg<=$sql_result){ for($i=1; $i<=$sql_result; $i++){ if($i == $pg){ }else{ } } pagination($currentPage, $itemCount, $itemsPerPage, 1, "?pg=%d"); } echo "

“;
echo “

“;

?>

Agendamento

Deixe seus dados e entraremos em contato







    Forma preferida de contato:

    Expediente:
    Seg a Qui: 8h às 22h
    Sex: 8h às 21h
    Sábado: 8h às 17h

    © 2021 Clínica Débora Pádua - Todos os Direitos Reservados. Site com SEO Criação