<?php
// RCI code start
echo $cre_RCI->get('global', 'top');
echo $cre_RCI->get('articlesearch', 'top');
// RCI code eof
?>

<div class="col-lg-12"><h1><?php echo HEADING_TITLE_2; ?></h1></div>
<div class="col-lg-9" style="float:left;">




<?php
// BOF: Lango Added for template MOD
/*if (MAIN_TABLE_BORDER == 'yes'){
table_image_border_top(false, false, $header_text);
}*/
// EOF: Lango Added for template MOD
?>
<?php
  if ($akeywords == ""){
?>
      <div class="main"><?php echo ERROR_INPUT; ?></div>
<?php
    } else {

  $group_access_search_articles = $obj_catalog->b2b_filter_sql('a.products_group_access');
  if (isset($_GET['description'])) {
    $search_query = tep_db_query("select ad.articles_name, a.articles_id,a.articles_image,a.articles_date_added,a.authors_id,ad.articles_head_desc_tag, ad.articles_description from " . TABLE_ARTICLES_DESCRIPTION . " ad inner join " . TABLE_ARTICLES . " a on ad.articles_id = a.articles_id where a.articles_status = '1' and ad.language_id = '" . (int)$languages_id . "' and (ad.articles_name like '%" . tep_db_input($akeywords) . "%' or ad.articles_description like '%" . tep_db_input($akeywords) . "%' or ad.articles_head_desc_tag like '%" . tep_db_input($akeywords) . "%' or ad.articles_head_keywords_tag like '%" . tep_db_input($akeywords) . "%' or ad.articles_head_title_tag like '%" . tep_db_input($akeywords) . "%') ". $group_access_search_articles ." order by ad.articles_name ASC");
  }  else {
    $search_query = tep_db_query("select ad.articles_name, a.articles_id,a.articles_image,a.articles_date_added,a.authors_id,ad.articles_head_desc_tag, ad.articles_description from " . TABLE_ARTICLES_DESCRIPTION . " ad inner join " . TABLE_ARTICLES . " a on ad.articles_id = a.articles_id where a.articles_status='1' and ad.language_id = '" . (int)$languages_id . "' and (ad.articles_name like '%" . tep_db_input($akeywords) . "%' or ad.articles_head_desc_tag like '%" . tep_db_input($akeywords) . "%' or ad.articles_head_keywords_tag like '%" . tep_db_input($akeywords) . "%' or ad.articles_head_title_tag like '%" . tep_db_input($akeywords) . "%') ". $group_access_search_articles ." order by ad.articles_name ASC");
  }
    $count=0;
?>

<?php
    while($articles_all = tep_db_fetch_array($search_query)){
    $authors_data = tep_db_fetch_array(tep_db_query("select authors_name from authors where authors_id='".$results['authors_id']."'"));

	   include(DIR_WS_MODULES.'article_listing_view.php');

    $count++;
  }
  if ($count == 0){
?>
<div class="col-lg-9 main"><?php echo TEXT_NO_ARTICLES ?></div>
<?php
  }
?>
<?php
  }
?>
<?php
// RCI code start
echo $cre_RCI->get('articlesearch', 'menu');
// RCI code eof
// BOF: Lango Added for template MOD
/*if (MAIN_TABLE_BORDER == 'yes'){
table_image_border_bottom();
}*/
// EOF: Lango Added for template MOD
?>
       </div>
       <div class="col-lg-3" style="float:left">
      <?php include('templates/default/boxes/asearch.php');
      include('templates/default/boxes/articles.php');
      include('templates/default/boxes/article_archive.php');
      ?>


       </div>

<?php
// RCI code start
echo $cre_RCI->get('articlesearch', 'bottom');
echo $cre_RCI->get('global', 'bottom');
// RCI code eof
?>
