<?php require_once('../../Connections/conreceitas.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;
}
}

$colname_Rsprocura = "-1";
if (isset($_POST['buscar'])) {
  $colname_Rsprocura = $_POST['buscar'];
}
mysql_select_db($database_conreceitas, $conreceitas);
$query_Rsprocura = sprintf("SELECT * FROM receitas WHERE titulo LIKE %s ORDER BY id ASC", GetSQLValueString("%" . $colname_Rsprocura . "%", "text"));
$Rsprocura = mysql_query($query_Rsprocura, $conreceitas) or die(mysql_error());
$row_Rsprocura = mysql_fetch_assoc($Rsprocura);
$totalRows_Rsprocura = mysql_num_rows($Rsprocura);
?>
<!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>Documento sem título</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>

        <script type="text/javascript">

				// navigateTo
                $(document).delegate('*[data-gallery="navigateTo"]', 'click', function(event) {
                    event.preventDefault();

                    var lb;
                    return $(this).ekkoLightbox({
                        onShown: function() {

                            lb = this;

							$(lb.modal_content).on('click', '.modal-footer a', function(e) {

								e.preventDefault();
								lb.navigateTo(2);

							});

                        }
                    });
                });


        </script>
       

<link href="lightbox/dist/ekko-lightbox.css" rel="stylesheet" type="text/css">
<link href="css_procura.css" rel="stylesheet" type="text/css" />
<link href="bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
</head>

<body class="glyphicon-thumbs-down">
<div class="result">

<div class="resultform">
  <table width="100%" cellspacing="15">
    <tr>
      <td align="center" bgcolor="#E5E5E5" ><h4>RESULTADOS</h4></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
    </tr>
    <?php do { ?>
      <tr>
        <td bgcolor="#E5E5E5"><h5><a href="receita_detalhes.php?id=<?php echo $row_Rsprocura['id']; ?>"data-toggle="lightbox"data-gallery="navigateTo"><?php echo $row_Rsprocura['titulo']; ?></a></h5></td>
      </tr>
      <?php } while ($row_Rsprocura = mysql_fetch_assoc($Rsprocura)); ?>
    
  </table>

  </div>
</div>
<script src="bootstrap/js/bootstrap.js"></script>
<script src="lightbox/dist/ekko-lightbox.js"></script>
<script src="../js/respond.min.js"></script>
</body>
</html>
<?php
mysql_free_result($Rsprocura);
?>
