<?php
// technocurve arc 3 php bv block1/3 start
$color1 = "#CCFFFF";
$color2 = "#FFFFFF";
$color = $color1;
// technocurve arc 3 php bv block1/3 end
?>
<?php require_once('../Connections/receitas.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$maxRows_legumes = 10;
$pageNum_legumes = 0;
if (isset($_GET['pageNum_legumes'])) {
  $pageNum_legumes = $_GET['pageNum_legumes'];
}
$startRow_legumes = $pageNum_legumes * $maxRows_legumes;

mysql_select_db($database_receitas, $receitas);
$query_legumes = "SELECT * FROM receitas WHERE categoria = 'LEGUMES' ORDER BY titulo ASC";
$query_limit_legumes = sprintf("%s LIMIT %d, %d", $query_legumes, $startRow_legumes, $maxRows_legumes);
$legumes = mysql_query($query_limit_legumes, $receitas) or die(mysql_error());
$row_legumes = mysql_fetch_assoc($legumes);

if (isset($_GET['totalRows_legumes'])) {
  $totalRows_legumes = $_GET['totalRows_legumes'];
} else {
  $all_legumes = mysql_query($query_legumes);
  $totalRows_legumes = mysql_num_rows($all_legumes);
}
$totalPages_legumes = ceil($totalRows_legumes/$maxRows_legumes)-1;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>RECEITAS = LEGUMES</title>
<link href="../cssfluida/boilerplate.css" rel="stylesheet" type="text/css">
<link href="../cssfluida/css_fluida.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div class="receitaspri">
<div class="titulo">LEGUMES</div>
<div class="divisao"></div>
<div class="descricao">
  <?php do { ?>
    <table width="100%" border="0" align="center" cellpadding="10" cellspacing="10">
      <tr>
        <td><a href="receita.php?id=<?php echo $row_legumes['id']; ?>"><?php echo $row_legumes['titulo']; ?>***<?php echo $row_legumes['autor']; ?></a></td>
        </tr>
    </table>
    <?php } while ($row_legumes = mysql_fetch_assoc($legumes)); ?>
</div>
<div class="divisao"></div>
<div class="voltar"><a href="../inicio.php">VOLTAR</a></div>
<div class="divisao"></div>
</div>
</body>
</html>
<?php
mysql_free_result($legumes);
?>
