<div id="wrapper">
  <div class="header">
    <div class="col-sm-6 col-md-5 nopadding logo"><img src="<?php print $logo ?>" usemap="#logos" class="img-responsive"></div>
		<map name="logos">
			<area shape="rect" coords="0,0,190,100" href="http://www.i2r.a-star.edu.sg/" target="_blank" />
			<area shape="rect" coords="190,0,420,100" href="<?php print base_path(); ?>"  />
		</map>
    <div class="col-sm-6 col-md-7 nopadding">
      <div class="col-sm-4 search-bar pull-right">
		 <?php print render($page['search']); ?>
      </div>
      <div class="col-sm-12 news"><?php print render($page['newsfeed']); ?></div>
    </div>
  </div>
  <div class="clearfix"></div>
  <div class="mainmenu">
    <nav class="navbar navbar-default" role="navigation">
      <div class="navbar-header"> <a class="navbar-brand visible-md-block" href="#">Main Menu</a>
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
      </div>
      <div id="navbar" class="navbar-collapse collapse">
       <?php 
	   $top_menu = menu_tree_output(menu_tree_all_data('main-menu'));
	   print drupal_render($top_menu); ?>
	  </div>
    </nav>
  </div>
  <div class="clearfix"></div>
  <div class="content-part">
   <?php 
/*$type = 'robots';
$query = db_select('node', 'n')
  ->fields('n', array('nid', 'field_year_of_invention_value'))
  ->condition('type', $type);
  $query->join('field_data_field_year_of_invention', 'field1', 'n.nid = field1.entity_id');
  $query->condition('status', 1);
  $query->orderBy('title', 'DESC');
  $nids = $query->execute()->fetchCol();

	$nodes = node_load_multiple($nids);
print_r($nodes);exit;*/
 
 /*$query1 = db_query("SELECT nid, field_year_of_invention_value from node 
			LEFT JOIN field_data_field_year_of_invention ON entity_id = nid
			LEFT JOIN field_revision_field_achievement_year AS achievement ON achievement.field_achievement_year_value = field_year_of_invention_value
			where type = 'robots'  ORDER BY field_year_of_invention_value DESC LIMIT 0,3")->fetchAll();
  foreach($query1 as $query) {
		echo $query->nid;
  }exit;*/
  
  
   if($title == 'Publicity') {?>
	 <h1><span class="glyphicon glyphicon-bullhorn"></span> <?php echo $title; ?></h1>
   <?php }
   if($title == 'News') 
   {?>
    <h1><span class="glyphicon glyphicon-volume-up"></span> <?php echo $title; ?></h1>
   <?php }
   if($title == 'About Us') 
   {?>
    <h1><span class="glyphicon glyphicon-folder-open"></span> <?php echo $title; ?></h1>
   <?php }
   if($title=='Robot Overview') {
	echo '<h1><span class="glyphicon glyphicon-eye-open"></span> Robots Timeline</h1>';
   }
   if($title=='Photo Gallery') {
	echo '<h1><span class="glyphicon glyphicon-camera"></span> Photos</h1>';
   }
    if($title=='Site map') {
	echo '<h1><span class="glyphicon glyphicon-globe"></span> Site map</h1>';
   }
   if($title=='ourpeople') {
	echo '<h1><span class="glyphicon glyphicon-user"></span><small style="color:#C44343"><span class="glyphicon glyphicon-user"></span></small> The Robotics Team</h1>';
   }
   if($title=='News Overview') {
	echo '<h1>News</h1>';
   }
   print render($page['content']); ?>
   </div>
  <div class="clearfix"></div>
</div>
<div class="sub">
  
	<div id="moredetail" class="collapse moredetail">
      <div class="row nopadding">
       <?php print render($page['footerblocks']); ?>
      </div>
    </div>
    
  		 <div class="more-detail">
     <p  class="collapsed" data-toggle="collapse" data-target="#moredetail">Click Here for More Details  </p>

    </div>
    
  <div class="clearfix"></div>
  <div class="footer">
    <div class="col-md-8 col-sm-6  col-xs-12 footer-menu">
      <?php
		$bottom_menu = menu_tree('menu-footer-menu');
		print drupal_render($bottom_menu); 
	?>
    </div>
    <div class="col-md-4 col-sm-6 col-xs-12 pull-right copyright">
      <?php print render($page['footeraddress']); ?>
    </div>
  </div>
</div>
<?php
	drupal_add_js('jQuery(document).ready(function () {       		
		jQuery("#edit-submit--3").click(function()
		{
			var val_search = jQuery("#edit-search-block-form--2").val();
			jQuery("#search-block-form").attr("action","/robotics/search/node/"+val_search);
		}
		);
     });', 'inline');
?>