include "mysql.php";
include "templates/head.php";
?>
include "templates/menu.php";
include "templates/left.php"
?>
//faz páginas em numeros
if(!empty($_GET[Start]))
{
$Start = $_GET[Start];
}
else
{
$Start = '0';
}
$ByPage = 8;
$rows = "SELECT * FROM curso ORDER BY cursoid DESC LIMIT $Start, $ByPage";
$extrai_rows= mysql_query($rows, $connection);
if($lrows = mysql_num_rows($extrai_rows) > 0){
//extrai dados
if($_GET['id'] == ""){
$extrai_dados = "SELECT * FROM curso ORDER BY cursoid DESC LIMIT $Start, 1;";
}else{
$id_news = $_GET['id'];
$extrai_dados = "SELECT * FROM curso WHERE cursoid = '$id_news';";
}
$extrai_informativo= mysql_query($extrai_dados, $connection);
while($inf = mysql_fetch_array($extrai_informativo)){
if($inf['imagem'] == ""){
}else{
$fig .= " ";
}
?>
| echo $inf['titulo']?> |
| =$fig?> echo $fgkdjhfjg = str_replace("
"," ", $inf['mensagem']); ?> |
}
}else{
echo "";
}
?>
|
| Cursos |
//extrai dados
$extrai_dados_link = "SELECT * FROM curso ORDER BY cursoid DESC LIMIT $Start, $ByPage;";
$extrai_informativo_link= mysql_query($extrai_dados_link, $connection);
while($inf_link = mysql_fetch_array($extrai_informativo_link)){
?>
', '_parent')">"> echo $inf_link['titulo']; ?> echo $inf_link['data']; ?> |
}
echo " ";
$qnav = "SELECT * FROM curso";
$rnav = mysql_query($qnav, $connection);
$rows = mysql_num_rows($rnav);
if($rows > $ByPage){
$ListingTable .= "
";
$ListingTable .= "| ";
$pages = ceil($rows/$ByPage);
for($i = 0; $i <= ($pages); $i++)
{
$PageStart = $ByPage*$i;
$i2 = $i + 1;
if($PageStart == $Start)
{
$links[] = " $i2\n\t ";
}
elseif($PageStart < $rows)
{
$links[] = " $i2\n\t ";
}
}
$links2 = implode(" | ", $links);
$ListingTable .= $links2;
$ListingTable .= " | ";
$ListingTable .= " \n";
}
echo $ListingTable;
?>
|
|
|
|
include "templates/foot.php";
?>