<?php require_once('../Connections/conreceitas.php'); ?>
<?php
if (!isset($_SESSION)) {
  session_start();
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";

// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) { 
  // For security, start by assuming the visitor is NOT authorized. 
  $isValid = False; 

  // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. 
  // Therefore, we know that a user is NOT logged in if that Session variable is blank. 
  if (!empty($UserName)) { 
    // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. 
    // Parse the strings into arrays. 
    $arrUsers = Explode(",", $strUsers); 
    $arrGroups = Explode(",", $strGroups); 
    if (in_array($UserName, $arrUsers)) { 
      $isValid = true; 
    } 
    // Or, you may restrict access to only certain users based on their username. 
    if (in_array($UserGroup, $arrGroups)) { 
      $isValid = true; 
    } 
    if (($strUsers == "") && true) { 
      $isValid = true; 
    } 
  } 
  return $isValid; 
}

$MM_restrictGoTo = "login/login_admin.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {   
  $MM_qsChar = "?";
  $MM_referrer = $_SERVER['PHP_SELF'];
  if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
  if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0) 
  $MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
  $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
  header("Location: ". $MM_restrictGoTo); 
  exit;
}
?>
<?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;
}
}

mysql_select_db($database_conreceitas, $conreceitas);
$query_receitas = "SELECT * FROM receitas ORDER BY id ASC";
$receitas = mysql_query($query_receitas, $conreceitas) or die(mysql_error());
$row_receitas = mysql_fetch_assoc($receitas);
$totalRows_receitas = mysql_num_rows($receitas);
?>
<!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</title>
<link href="style.css" rel="stylesheet" type="text/css" />

<style type="text/css">
<!--
body {
	background-image: url(../imagens/nosss.jpg);
	background-repeat: repeat-x;
}
-->
</style></head>

<body>
<table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><form action="receitas_busca.php" method="post" name="busca" target="_blank" id="busca">
      <table width="700" border="0" align="center" cellpadding="0" cellspacing="15">
        <tr>
          <td colspan="2" align="center" class="stilo24">UM COZINHEIRO E QUATRO ESFOMEADOS</td>
        </tr>
        <tr>
          <td colspan="2" align="center" class="stilo2">RECEITAS</td>
        </tr>
        <tr>
          <td colspan="2" align="center" class="stilo3">&nbsp;</td>
        </tr>
        <tr>
          <td colspan="2" align="center" class="stilo3">CATEGORIAS</td>
        </tr>
        <tr>
          <td align="center" class="stilo1"><a href="categorias/aves.php">AVES</a></td>
          <td align="center" class="stilo1"><a href="categorias/bebidas.php">BEBIDAS</a></td>
        </tr>
        <tr>
          <td align="center" class="stilo1"><a href="categorias/bolinhos.php">BOLINHOS</a></td>
          <td align="center" class="stilo1"><a href="categorias/carnes.php">CARNES</a></td>
        </tr>
        <tr>
          <td align="center" class="stilo1"><a href="categorias/doces.php">DOCES</a></td>
          <td align="center" class="stilo1"><a href="categorias/legumes.php">LEGUMES</td>
        </tr>
        <tr>
          <td align="center" class="stilo1"><a href="categorias/massas.php">MASSAS</a></td>
          <td align="center" class="stilo1"><a href="categorias/molhos.php">MOLHOS</a></td>
        </tr>
        <tr>
          <td align="center" class="stilo1"><a href="categorias/paes.php">PÃES</a></td>
          <td align="center" class="stilo1"><a href="categorias/pasteis.php">PASTÉIS</a></td>
        </tr>
        <tr>
          <td width="360" align="center" class="stilo1"><a href="categorias/pates.php" class="stilo1">PATÊS</a></td>
          <td width="310" align="center" class="stilo1"><a href="categorias/peixes.php">PEIXES E FRUTOS DO MAR</a></td>
        </tr>
        <tr>
          <td align="center" class="stilo1"><a href="categorias/salgados.php" target="_parent">SALGADOS</a></td>
          <td align="center" class="stilo1"><a href="categorias/sopas.php" target="_parent">SOPAS</a></td>
        </tr>
        <tr>
          <td align="center"><a href="../../paginasReceitas/temperos.php" target="_parent" class="stilo1">TEMPEROS</a></td>
          <td align="center"><a href="categorias/tortas.php" target="_parent" class="stilo1">TORTAS</a></td>
        </tr>
        <tr>
          <td align="center"><a href="categorias/diversos.php" target="_parent" class="stilo1">DIVERSOS</a></td>
          <td align="center"></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="center" class="stilo1"><a href="inserir.php" target="_parent">INSERIR</a></td>
          <td align="center" class="stilo1"><a href="lista_receitas_admin.php" target="_parent">LISTA RECEITAS</a></td>
        </tr>
        <tr>
          <td colspan="2" align="center" class="stilo1"><a href="lista_receitas_admin.php" target="_parent"></a></td>
        </tr>
      </table>
    </form></td>
  </tr>
</table>
</body>
</html>
<?php
mysql_free_result($receitas);
?>
