<?php session_start() ;  
//$_SESSION['language']="fa";
include("include/config.php");
include("include/db.class.php");
include("include/functions.php");
include_once("adminspkm/include/jdf.php");

if(isset($_GET['lang'])){
			$t=$_GET['lang'];
		if($t=="en"){
$_SESSION['language']="en";

}
else{
	$_SESSION['language']="pr";

}}elseif(!isset($_SESSION['language'])){$_SESSION['language']="pr";}
$db=new DB($globalConfig['dbase'], $globalConfig['dbhost'],$globalConfig['dbuser'], $globalConfig['dbpass']);?>
<?php
$sql_portal=$db->query("select * from chitaportal where portalID=1");
$res_portal=$db->fetchNextArray($sql_portal);
?><!DOCTYPE html>
<html>
	<head>
		<title><?php if($_SESSION['language']=="pr"){echo $res_portal['title'];}else{echo $res_portal['titleen'];}?> | </title>
		
		<!-- metas -->
		<meta charset="utf-8">
		<meta name="keywords" content="">
        
		<meta name="description" content="">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
		<!--/ metas -->
		
		<!-- styles -->
		<?php 
if(isset($_SESSION['language'])){
	$temp=$_SESSION['language'];
	if($temp=="en"){
		include("include/spkm/headeren.php");
		 }elseif($temp=="pr"){
			 include("include/spkm/headerfa.php");
			  } } ?>
		
		<!--/ styles -->
		
		<!--[if lt IE 9]><script src="js/html5.js"></script><![endif]-->
	</head>
	
	<body>
		<div class="page">

			<!-- page header -->
			<?php	include("include/spkm/menu.php");?>
			<!--/ page header -->
			
			<!-- quick search -->
			<?php	include("include/spkm/search.php");?>
			<!--/ quick search -->

			<!-- page title -->
			<section class="page-title">
				<div class="grid-row clearfix">
					<h1><?php if($_SESSION['language']=="pr"){echo 'نتایج جستجو';}else{echo 'Search Results';}?></h1>
					
					<nav class="bread-crumbs">
						<a href="index.php"><?php if($_SESSION['language']=="pr"){echo 'صفحه اصلی';}else{echo 'Home';}?></a>&nbsp;&nbsp;<i class="fa fa-angle-left"></i>&nbsp;
						<a><?php if($_SESSION['language']=="pr"){echo 'جستجو';}else{echo 'Search';}?></a>&nbsp;&nbsp;<i class="fa fa-angle-left"></i>&nbsp;
					</nav>
				</div>
			</section>
			<!--/ page title -->
			
			<!-- page content -->
			<main class="page-content">
				<div class="grid-row">
					<!-- photo tour -->
					<section id="photo-tour" class="widget photo-tour photo-tour-4">
						<div class="widget-title"><?php if($_SESSION['language']=="pr"){echo 'نتایج جستجو';}else{echo 'Search Results';}?></div>
						
						
						
						<div class="grid">
            
 <?php
		 
		   if(isset($_POST['quick-search']) && $_POST['quick-search']!=""){ 
		   $s_Text=trim($_POST['quick-search']);
           $result=$db->query("select * from parts where name like '%".$s_Text."%' or nameen like '%".$s_Text."%' or des like '%".$s_Text."%' or desen like '%".$s_Text."%'");
           $count = mysql_num_rows($result);
		   
		   if($count>0)
		   {
			   while($newsItem=$db->fetchNextArray($result))
			   {
		 ?>
							<div class="item item2">
								<div class="pic">
                                <?  $eimage=$db->query("SELECT * FROM picturespart where adid='".$newsItem['id']."' and profile=1");
			 $image=$db->fetchNextArray($eimage); ?>
									<img src="<?php echo $image['file'];?>" width="270" height="142" alt="Nullam euismod commodo">
									<div class="links">
										<ul>
											<li><a href="<?php echo seourl('post',$newsItem['post_id']);?>" class="fa fa-link"></a></li>										
										</ul>
									</div>
								</div>
								<h3><?php if($_SESSION['language']=='pr'){ echo ($newsItem['name']);}
               else if($_SESSION['language']=='en'){echo ($newsItem['nameen']);}?></h3>
								<p></p>
							</div>	
                       <?php
			   }
		   }else echo "موردی پیدا نشد";
		   
		   }
		 ?>
                             <div class="col-md-12" style="margin-bottom:40px !important;">
      <!-- content parent -->
      
    </div>																																																																																																																																																								
						</div>
						
						
					</section>
					<!--/ photo tour -->
				</div>
			</main>
			<!--/ page content -->

			<!-- copyrights -->
			<?php	include("include/spkm/footer.php");?>
			<!--/ copyrights -->

		</div>
		
		<!-- scripts -->
		<script type="text/javascript" src="js/jquery.min.js"></script>
		<script type="text/javascript" src="js/jquery-ui.min.js"></script>
		<script type="text/javascript" src="js/jquery.migrate.min.js"></script>
		<script type="text/javascript" src="js/owl.carousel.min.js"></script>
		<script type="text/javascript" src="js/jquery.isotope.min.js"></script>
		<script type="text/javascript" src="js/jquery.fancybox.pack.js"></script>
		<script type="text/javascript" src="js/jquery.fancybox-media.js"></script>
		<script type="text/javascript" src="js/jquery.flot.js"></script>
		<script type="text/javascript" src="js/jquery.flot.pie.js"></script>
		<script type="text/javascript" src="js/jquery.flot.categories.js"></script>
		<script type="text/javascript" src="js/greensock.js"></script>
		<script type="text/javascript" src="js/layerslider.transitions.js"></script>
		<script type="text/javascript" src="js/layerslider.kreaturamedia.jquery.js"></script>

	<!-- Superscrollorama -->		
		<script type="text/javascript" src="js/jquery.superscrollorama.js"></script>
		<script type="text/javascript" src="js/TweenMax.min.js"></script>
		<script type="text/javascript" src="js/TimelineMax.min.js"></script>
	<!--/ Superscrollorama -->
	
		<script type="text/javascript" src="js/jquery.ui.core.min.js"></script>
		<script type="text/javascript" src="js/jquery.ui.widget.min.js"></script>
		<script type="text/javascript" src="js/jquery.ui.tabs.min.js"></script>
		<script type="text/javascript" src="js/jquery-ui-tabs-rotate.js"></script>
		<script type="text/javascript" src="js/jquery.ui.accordion.min.js"></script>
		<script type="text/javascript" src="js/jquery.tweet.js"></script>
	<!-- EASYPIECHART -->
		<script type="text/javascript" src="js/jquery.easypiechart.js"></script>
	<!--/ EASYPIECHART -->
		<script type="text/javascript" src="js/jquery.autocomplete.min.js"></script>
		<script type="text/javascript" src="js/scripts.js"></script>
		<!--/ scripts -->
		
	</body>
</html>