<?php require_once('Connections/connMontessori.php'); ?>
<?php
//initialize the session
if (!isset($_SESSION)) {
  session_start();
}
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_rsDataMenu = "-1";
if (isset($_GET['type'])) {
  $colname_rsDataMenu = $_GET['type'];
}
mysql_select_db($database_connMontessori, $connMontessori);
$query_rsDataMenu = sprintf("SELECT * FROM contents WHERE type_contents = %s ORDER BY ordenar ASC", GetSQLValueString($colname_rsDataMenu, "text"));
$rsDataMenu = mysql_query($query_rsDataMenu, $connMontessori) or die(mysql_error());
$row_rsDataMenu = mysql_fetch_assoc($rsDataMenu);
$totalRows_rsDataMenu = mysql_num_rows($rsDataMenu);

$colname_rsDataData = "-1";
if (isset($_GET['qry'])) {
  $colname_rsDataData = $_GET['qry'];
}
mysql_select_db($database_connMontessori, $connMontessori);
$query_rsDataData = sprintf("SELECT * FROM contents WHERE namemenu_contents = %s", GetSQLValueString($colname_rsDataData, "text"));
$rsDataData = mysql_query($query_rsDataData, $connMontessori) or die(mysql_error());
$row_rsDataData = mysql_fetch_assoc($rsDataData);
$totalRows_rsDataData = mysql_num_rows($rsDataData);

$colname_rsUserStarted = "-1";
if (isset($_SESSION['MM_Username'])) {
  $colname_rsUserStarted = $_SESSION['MM_Username'];
}
mysql_select_db($database_connMontessori, $connMontessori);
$query_rsUserStarted = sprintf("SELECT * FROM usuarios WHERE username_usuario = %s", GetSQLValueString($colname_rsUserStarted, "text"));
$rsUserStarted = mysql_query($query_rsUserStarted, $connMontessori) or die(mysql_error());
$row_rsUserStarted = mysql_fetch_assoc($rsUserStarted);
$totalRows_rsUserStarted = mysql_num_rows($rsUserStarted);
?>
<!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>Programa Educativo | Instituto Montessori Sabinas</title>
<link rel="stylesheet" type="text/css" href="files/Montessori_main.css" />
<!--[if IE ]><link rel="stylesheet" type="text/css" href="files/IE.css" media="screen"><![endif]--><!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="prebuilt/css/IE6.css" />
<![endif]-->
<script type="text/javascript" src="files/prototype-1.6.0.2.js"></script>
<script type="text/javascript" src="files/site.js"></script>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<div id="wrapper">
  <div id="container">
    <? include('phps/header.php'); ?>
      <script type="text/javascript">
	function beforeSubmit(form){ 
		document.location.href = 'http://instituto-montessori.edu.mx/buscar.php?q=' + form.q.value; 
	}
	</script>
      <form style="z-index: 0;" id="seek" onsubmit="beforeSubmit(this);return false;" method="get" name="search" action="http://instituto-montessori.edu.mx/buscar.php">
        <p>
          <input id="searchfield" title="Buscar" onclick="if (this.value='Buscar') this.value='';" name="q" alt="search_for" maxlength="2047" value="Buscar" type="text" />
        </p>
        <div id="search-go">
          <input onsubmit="beforeSubmit(this);return false;" name="submit" alt="submit" value="Search Montessori" src="files/button_go.gif" type="image" />
        </div>
      </form>
      <dl id="quicklinks" class="off quicklinks">
        <? include('phps/quicks.php'); ?>
      </dl>
    </div>
    <ul id="breadcrumbs">
      <li><a href="">Inicio</a> »</li>
      <li><a href="programa-educativo.php">OFERTA EDUCATIVA</a> »</li>
      <li><?php 
		  if ($row_rsDataData['type_contents']=='comunidad-infantil'){ echo "Comunidad Infantil";}else
		  if ($row_rsDataData['type_contents']=='casa-de-ninios'){ echo "Casa de Ni&Ntilde;os";}else
		  if ($row_rsDataData['type_contents']=='taller1y2'){ echo "Taller I y II";}else
		  if ($row_rsDataData['type_contents']=='taller3'){ echo "Taller III";}else
		  if ($row_rsDataData['type_contents']=='taller4'){ echo "Taller IV";}
		   ; ?> »</li>
      <li><?php echo $row_rsDataData['title_contents']; ?></li>
    </ul>
    <div id="content" class="inside">
      <div id="main_content" class="wide">
        <?php if ($totalRows_rsDataData > 0) { // Show if recordset not empty ?>
            <h1><?php echo $row_rsDataData['title_contents']; ?></h1>
            <?php if ($row_rsDataData['imgheader_contents'] != NULL) { // Show if recordset empty ?>
            <p><img src="img_secciones/<?php echo $row_rsDataData['imgheader_contents']; ?>" class="<?php echo $row_rsDataData['classe_contents']; ?>" /></p>
            <?php } // Show if recordset not empty ?>
            <p><?php echo $row_rsDataData['descripcion_contents']; ?></p>
            <?php } // Show if recordset not empty ?>
      </div>
      <div id="nav_column">
        <ul id="insidenav">
        <ul><li>
          <h3>M&Aacute;S de <?php 
		  if ($row_rsDataData['type_contents']=='comunidad-infantil'){ echo "Comunidad Infantil";}else
		  if ($row_rsDataData['type_contents']=='casa-de-ninios'){ echo "Casa de Ni&Ntilde;os";}else
		  if ($row_rsDataData['type_contents']=='taller1y2'){ echo "Taller I y II";}else
		  if ($row_rsDataData['type_contents']=='taller3'){ echo "Taller III";}else
		  if ($row_rsDataData['type_contents']=='taller4'){ echo "Taller IV";}
		   ; ?></h3></li></ul>
          <?php do { ?>
            <li> <a href="programa-educativo2.php?qry=<?php echo $row_rsDataMenu['namemenu_contents']; ?>&amp;type=<?php echo $row_rsDataData['type_contents']; ?>"><?php echo $row_rsDataMenu['title_contents']; ?></a> </li>
            <?php } while ($row_rsDataMenu = mysql_fetch_assoc($rsDataMenu)); ?>
        </ul> 
        
        <ul>
        <ul><li>
          <h3>OFERTA  EDUCATIVA</h3></li></ul>
            <li> <a href="http://instituto-montessori.edu.mx/programa-educativo2.php?qry=informacion-general-ci&amp;type=comunidad-infantil">COMUNIDAD INFANTIL (maternal)</a></li>
            <li> <a href="http://instituto-montessori.edu.mx/programa-educativo2.php?qry=informacion-general-cn&amp;type=casa-de-ninios">CASA DE NIÑOS (preescolar)</a></li>
            <li> <a href="http://instituto-montessori.edu.mx/programa-educativo2.php?qry=informacion-general-t1y2&amp;type=taller1y2">TALLERES I y II (primaria)</a></li>
            <li> <a href="http://instituto-montessori.edu.mx/programa-educativo2.php?qry=informacion-general-t3&amp;type=taller3">TALLERES III (secundaria)</a></li>
            <li> <a href="http://instituto-montessori.edu.mx/programa-educativo2.php?qry=informacion-general-t4&amp;type=taller4">TALLERES IV (preparatoria)</a></li>
        </ul> 
<br /><br />
        <iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fpages%2FInstituto-Montessori-Sabinas%2F270980319644036&amp;width=180&amp;height=150&amp;colorscheme=light&amp;show_faces=false&amp;border_color=%23FFFFFF&amp;stream=false&amp;header=false" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:180px; height:158px;" allowTransparency="true"></iframe>
        
        </div>
    </div>
  <div id="crosslinks" style="margin-top:-50px; padding:0px;">
    <?php /*?>
      <div id="whatsnext">
        <h2><img alt="Quien eres?" src="files/crosslink_whatsnext.gif" /></h2>
        <ul>
          <li><a href="contacto.php">Cont&aacute;ctanos</a></li>
          <li><a href="#">Conoce Montessori</a></li>
          <li><a href="#">Información relevante</a></li>
          <li><a href="contents.php?type=redes-sociales">Redes Sociales</a></li>
        </ul>
      </div>
      <div id="anotherdimension">
        <h2><img alt="images" src="files/crosslink_dimension.gif" /></h2>
        <h3>Conoce nuestro método</h3>
        <p>El <strong>método Montessori</strong> esta inspirado en el humanismo integral, que postula la formación de los seres humanos como personas únicas y plenamente capacitadas para actuar con libertad, inteligencia y dignidad.</p>
        <a href="#"> <img id="Image40" border="0" name="Image40" alt="Learn More" src="files/button_learnmore.gif" width="71" height="10" /></a> <a class="entirediv" href="#" target=""></a></div>
      <div id="profiles">
        <h2><img alt="Profiles" src="files/crosslink_profiles.gif" /></h2>
        <img title="imagen" alt="imagen" src="files/profile_thumb_jim_ellfson.jpg" />
        <blockquote>
          <p>La meta de la Educación Montessori debe ser cultivar el deseo natural de aprender.<br />
            <br />
          </p>
        </blockquote>
        <em>María Montessori</em></div>
      <div id="studentwork">
        <h2><img title="imagen" alt="imagen" src="files/crosslink_studentwork.gif" /></h2>
        <h3>DE CALIDAD</h3>
        <p><img title="imagen" alt="imagen" src="files/JosephDionisio_thumb.jpg" />Nuestros alumnos tienen la posibilidad de desarrollarse a nivel personal, a la sociedad y al medio ambiente.</p>
        <a href="#"><em>Conoce nuestras instalaciones</em></a> </div>
    <?php */?>
    </div>
  </div>
</div>
<? include('phps/footer.php'); ?>
</body>
</html>
<?php
mysql_free_result($rsDataMenu);

mysql_free_result($rsDataData);

mysql_free_result($rsUserStarted);
?>
