<?php echo $javascript->link('jquery.js'); ?>
<?php echo $javascript->link('home_tooltip.js'); ?>
<?php echo $html->css('tooltip.css'); ?>
<?php echo $javascript->link('hint.js'); ?> 

<section id="slider"><!--slider-->
        <div class="container">
            <div class="row">
                <div class="col-sm-12">
                    <div id="slider-carousel" class="carousel slide" data-ride="carousel">
                        <ol class="carousel-indicators">
                            <li data-target="#slider-carousel" data-slide-to="0" class="active"></li>
                            <li data-target="#slider-carousel" data-slide-to="1"></li>
                            <li data-target="#slider-carousel" data-slide-to="2"></li>
                        </ol>
                        
                        <div class="carousel-inner">
                            <div class="item active">
                                <div class="col-sm-6">
                                    <h1><span>E</span>-SHOPPER</h1>
                                    <h2>Free E-Commerce Template</h2>
                                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
                                    <button type="button" class="btn btn-default get">Get it now</button>
                                </div>
                                <div class="col-sm-6">
                                    <?php echo $html->image("/img/".  strtolower($style)."/girl1.jpg",array('class' => 'girl img-responsive'));?>
                                     <?php echo $html->image("/img/".  strtolower($style)."/pricing.png",array('class' => 'pricing'));?>
                                </div>
                            </div>
                            <div class="item">
                                <div class="col-sm-6">
                                    <h1><span>E</span>-SHOPPER</h1>
                                    <h2>100% Responsive Design</h2>
                                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
                                    <button type="button" class="btn btn-default get">Get it now</button>
                                </div>
                                <div class="col-sm-6">
                                  <?php echo $html->image("/img/".  strtolower($style)."/girl2.jpg",array('class' => 'girl img-responsive'));?>
                                     <?php echo $html->image("/img/".  strtolower($style)."/pricing.png",array('class' => 'pricing'));?>
                                  
                                </div>
                            </div>
                            
                            <div class="item">
                                <div class="col-sm-6">
                                    <h1><span>E</span>-SHOPPER</h1>
                                    <h2>Free Ecommerce Template</h2>
                                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
                                    <button type="button" class="btn btn-default get">Get it now</button>
                                </div>
                                <div class="col-sm-6">
                                    <?php echo $html->image("/img/".  strtolower($style)."/girl3.jpg",array('class' => 'girl img-responsive'));?>
                                    <?php echo $html->image("/img/".  strtolower($style)."/pricing.png",array('class' => 'pricing'));?>
                                   
                                </div>
                            </div>
                            
                        </div>
                        
                        <a href="#slider-carousel" class="left control-carousel hidden-xs" data-slide="prev">
                            <i class="fa fa-angle-left"></i>
                        </a>
                        <a href="#slider-carousel" class="right control-carousel hidden-xs" data-slide="next">
                            <i class="fa fa-angle-right"></i>
                        </a>
                    </div>
                    
                </div>
            </div>
        </div>
    </section><!--/slider-->

	<section>
		<div class="container">
			<div class="row">
				<div class="col-sm-3">
					<div class="left-sidebar">
						<h2>Category</h2>
						<div id="content" class="category-products">
						<div class="u-vmenu">
                                                    <?php
							function generate_menu($parent,$menu_array,$siteurl)
							{

									$has_childs = false;
									$pk	=	0;

									foreach($menu_array as $key => $value)
									{
										$parray[$pk]	=	$value['parent'];
										$pk++;
									}

									foreach($menu_array as $key => $value)
									{
                                                                            if ($value['parent'] == $parent)
                                                                            {
                                                                                    //if this is the first child print '<ul>'
                                                                                    if ($has_childs === false)
                                                                                    {

                                                                                                    $has_childs = true;
                                                                                                    echo '<ul>';
                                                                                    }

                                                                                    if(in_array($key,$parray)){
                                                                                            echo '<li><a href="javascript:void(0);" >' . $value['name'] . '</a>';
                                                                                    }
                                                                                    else
                                                                                    {
                                                                                            echo '<li><a href="'.$siteurl.'/categories/show_cat/'.cleancatnames($value['name'])."/".$key.'/">' . $value['name'] . '</a>';
                                                                                    }
                                                                                    generate_menu($key,$menu_array,$siteurl);
                                                                                    echo '</li>';
                                                                            }
									}

									if ($has_childs === true) echo '</ul>';
							}
							//generate menu starting with parent categories (that have a 0 parent)
							if(empty($menu_array)===false)
							generate_menu(1,$menu_array,$cnfg["sitebasefolder"]);
							?>
						</div>
					</div>
					<div class="clearfix"></div>







						<div align="left" id="" class="sidebarmenu">
						
					</div>
					<!--  Left Middle Block1 area start -->
					<?php if(isset($middle1) && !empty($middle1)) { ?>
					<div class="brands_products"><!--brands_products-->
							<h2><?php if(isset($middle1title)) echo $middle1title;?></h2>
							<ul class="brands-name">
                     <?php
					 $i = 0;
					 foreach($middle1 as $ft)
					 {
					  $i++;
                                         
                                          ?>
                                            <li>
							
							<div style="overflow: hidden;">
								<div class="prdct_img">

                 <div class="thump_size">
					<?php
						$pure_product_name = cleanspecialchars($ft["Product"]["pname"]);
					        //$url ='products/show/'.$pure_product_name.'/'.$ft["Product"]["id"];
                                                $url =$html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]);
                                                // Product Image
                                                $imgOrig = $imgUrl = $imgClass = NULL;
                                                $imgPath = '/img/noimagessmall.gif';
                                                if(isset($ft["Productimages"]) && $ft["Productimages"] <> '') {
                                                    $imgInfo = array();
                                                    $img = $ext = NULL;
                                                    $imgInfo = pathinfo($ft["Productimages"]);
                                                    $img=$imgInfo['filename'];
                                                    $ext='.'.$imgInfo['extension'];
                                                    if(is_file(WWW_ROOT.IMAGES_URL.'products/'.$img.'_thumb'.$ext)){
                                                        $imgOrig = $cnfg["sitebasefolder"].'/img/products/'.$img.$ext;
                                                        $imgPath = '/img/products/'.$img.'_thumb'.$ext;
                                                    }
                                                }

                                                $imgUrl =(empty($imgOrig)) ? 'javascript:void(0);' : $imgOrig;
                                                $imgClass = (empty($imgOrig)) ? '' : 'preview';

                                                // Product Image End
						?>
                                                        <a href='<?php echo $imgUrl; ?>' class="<?php echo $imgClass; ?>" onclick="return redirectPage('<?php echo $url;?>');">
							  <?php echo $html->image($imgPath,array('border' => '0','height' => '60', 'width' => '60')); ?>
							  </a>
							</div>
								</div>
								<div class="pr_details">
                                                                   
									<h4>
                                                                    <?php
								    $prodname=$pure_product_name;
									if(strlen($prodname)>18)
									 {
									   $prodname=substr($prodname, 0, 18)."..."; ?>
                                                                            <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>" class="tooltip" title="<?php echo stripslashes($ft["Product"]["pname"]); ?>"><?php echo stripslashes($prodname); ?></a>
                                                                      <?php
									    }
									 else
									 { ?>
								     <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>"><?php echo $prodname; ?></a>
									<?php } ?>

                                                                        </h4>
									<p>  <?php

                                                                      $pure_product_desc =  $ft["Product"]["descr"];
                                                                      
                                                                        if(strlen($pure_product_desc)>25)
									 {
                                                                             $pure_product_desc=substr($pure_product_desc, 0, 25)."...";
                                                                        }
                                                                        ?>
                                                                         <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>" class="tooltip" title="<?php echo stripslashes($ft["Product"]["descr"]); ?>"><?php echo stripslashes($pure_product_desc); ?></a>
                                                                        </p>
									<p class="Price">
									<?php
														//Setting the Prices & Discount for Wholesale/Retail Users
														$prod_price=0;
														$discnt_type='';
														$discnt_price=0;
														if($ft["Product"]["wholesale_price"] > 0 || $ft["Product"]["price"] > 0 )
														{
														if(isset($ft["Product"]["discount"]) && $ft["Product"]["discount"] > 0)
														{
														$discnt_type=$ft["Product"]["discount_type"];
														$discnt_price=$ft["Product"]["discount"];
														}
														}
														if(isset($sus) && empty($sus)===false)
														{
														if($sus["usertype"]=='wholesale')
														{
														if(isset($ft["Product"]["wholesale_price"]) && $ft["Product"]["wholesale_price"] > 0 )
														{
														$wholesale_price=$ft["Product"]["wholesale_price"];
														$utype='wholesale';
														display_price($utype,$wholesale_price,$discnt_type,$discnt_price,$curlogo);
														}
														else if(isset($ft["Product"]["price"]) && $ft["Product"]["price"] > 0 )
														{
														$retail_price=$ft["Product"]["price"];
														$utype='retail';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														else
														display_price('',0,'',0,$curlogo);
														}
														else if($sus["usertype"]=='retail')
														{
														if(isset($ft["Product"]["price"]) && $ft["Product"]["price"] > 0 )
														{
														$retail_price=$ft["Product"]["price"];
														$utype='retail';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														else
														display_price('',0,'',0,$curlogo);
														}
														}
														else
														{
														if(isset($ft["Product"]["price"]))
														$retail_price=$ft["Product"]["price"];
														$utype='normal';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														//Setting the Prices for Wholesale/Retail Users
														?>
									</p>
								</div>
                                                            <div class="clear"></div>
							</div>
							
							<div class="clear"></div>
						</li>
                                                 <?php
                    }
                    ?>
                                        </ul>

						<div class="clear"></div>
					</div>
					<?php
                    }
                    ?>
                    <!--  Left Middle Block1 area End -->
                    <!--  Left Middle Block2 area start -->
					<?php if(isset($middle2) && !empty($middle2)) { ?>
					<div class="brands_products"><!--brands_products-->
							<h2><?php if(isset($middle2title)) echo $middle2title;?></h2>
							<ul class="brands-name">
                     <?php
					 $i = 0;
					 foreach($middle2 as $ft)
					 {
					  $i++;
                                         
                                          ?>
                                            <li>
							
							<div style="overflow: hidden;">
								<div class="prdct_img">

                 <div class="thump_size">
					<?php
							$pure_product_name = cleanspecialchars($ft["Product"]["pname"]);
					        //$url ='products/show/'.$pure_product_name.'/'.$ft["Product"]["id"];
                                                $url =$html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]);
                                                 // Product Image
                                                $imgOrig = $imgUrl = $imgClass = NULL;
                                                $imgPath = '/img/noimagessmall.gif';
                                                if(isset($ft["Productimages"]) && $ft["Productimages"] <> '') {
                                                    $imgInfo = array();
                                                    $img = $ext = NULL;
                                                    $imgInfo = pathinfo($ft["Productimages"]);
                                                    $img=$imgInfo['filename'];
                                                    $ext='.'.$imgInfo['extension'];
                                                    if(is_file(WWW_ROOT.IMAGES_URL.'products/'.$img.'_thumb'.$ext)){
                                                        $imgOrig = $cnfg["sitebasefolder"].'/img/products/'.$img.$ext;
                                                        $imgPath = '/img/products/'.$img.'_thumb'.$ext;
                                                    }
                                                }

                                                $imgUrl =(empty($imgOrig)) ? 'javascript:void(0);' : $imgOrig;
                                                $imgClass = (empty($imgOrig)) ? '' : 'preview';

                                                // Product Image End
						?>
                                                        <a href='<?php echo $imgUrl; ?>' class="<?php echo $imgClass; ?>" onclick="return redirectPage('<?php echo $url;?>');">
							  <?php echo $html->image($imgPath,array('border' => '0','height' => '60', 'width' => '60')); ?>
							</a>							
							</div>
								</div>
								<div class="pr_details">

									<h2>
                                                                    <?php
								    $prodname=$pure_product_name;
									if(strlen($prodname)>18)
									 {
									   $prodname=substr($prodname, 0, 18)."..."; ?>
                                                                            <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>" class="tooltip" title="<?php echo addslashes($ft["Product"]["pname"]); ?>"><?php echo addslashes($prodname); ?></a>
                                                                      <?php
									    }
									 else
									 { ?>
								     <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>"><?php echo $prodname; ?></a>
									<?php } ?>

                                                                        </h2>
									<p>  <?php

                                                                      $pure_product_desc =  $ft["Product"]["descr"];
                                                                        if(strlen($pure_product_desc)>25)
									 {
                                                                             $pure_product_desc=substr($pure_product_desc, 0, 25)."...";
                                                                        }
                                                                        ?>
                                                                         <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>" class="tooltip" title="<?php echo addslashes($ft["Product"]["descr"]); ?>"><?php echo addslashes($pure_product_desc); ?></a>
                                                                        </p>
									<p class="Price">
									<?php
														//Setting the Prices & Discount for Wholesale/Retail Users
														$prod_price=0;
														$discnt_type='';
														$discnt_price=0;
														if($ft["Product"]["wholesale_price"] > 0 || $ft["Product"]["price"] > 0 )
														{
														if(isset($ft["Product"]["discount"]) && $ft["Product"]["discount"] > 0)
														{
														$discnt_type=$ft["Product"]["discount_type"];
														$discnt_price=$ft["Product"]["discount"];
														}
														}
														if(isset($sus) && empty($sus)===false)
														{
														if($sus["usertype"]=='wholesale')
														{
														if(isset($ft["Product"]["wholesale_price"]) && $ft["Product"]["wholesale_price"] > 0 )
														{
														$wholesale_price=$ft["Product"]["wholesale_price"];
														$utype='wholesale';
														display_price($utype,$wholesale_price,$discnt_type,$discnt_price,$curlogo);
														}
														else if(isset($ft["Product"]["price"]) && $ft["Product"]["price"] > 0 )
														{
														$retail_price=$ft["Product"]["price"];
														$utype='retail';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														else
														display_price('',0,'',0,$curlogo);
														}
														else if($sus["usertype"]=='retail')
														{
														if(isset($ft["Product"]["price"]) && $ft["Product"]["price"] > 0 )
														{
														$retail_price=$ft["Product"]["price"];
														$utype='retail';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														else
														display_price('',0,'',0,$curlogo);
														}
														}
														else
														{
														if(isset($ft["Product"]["price"]))
														$retail_price=$ft["Product"]["price"];
														$utype='normal';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														//Setting the Prices for Wholesale/Retail Users
														?>
									</p>
								</div>
                                                            <div class="clear"></div>
							</div>

							<div class="clear"></div>
						</li>
                                                 <?php
                    }
                    ?>
                                        </ul>

						<div class="clear"></div>
					</div>
					<?php
                    }
                    ?>
                    <!--  Left Middle Block2 area End -->
                    <!--  Left Middle Block3 area start -->
					<?php if(isset($middle3) && !empty($middle3)) { ?>
					<div class="brands_products"><!--brands_products-->
							<h2><?php if(isset($middle3title)) echo $middle3title;?></h2>
							<ul class="brands-name">
                     <?php
					 $i = 0;
					 foreach($middle3 as $ft)
					 {
					  $i++;
                                         
                                          ?>
                                            <li>
							
							<div style="overflow: hidden;">
								<div class="prdct_img">

                 <div class="thump_size">
					<?php
							$pure_product_name = cleanspecialchars($ft["Product"]["pname"]);
					        //$url ='products/show/'.$pure_product_name.'/'.$ft["Product"]["id"];
                                                $url =$html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]);
                                                 // Product Image
                                                $imgOrig = $imgUrl = $imgClass = NULL;
                                                $imgPath = '/img/noimagessmall.gif';
                                                if(isset($ft["Productimages"]) && $ft["Productimages"] <> '') {
                                                    $imgInfo = array();
                                                    $img = $ext = NULL;
                                                    $imgInfo = pathinfo($ft["Productimages"]);
                                                    $img=$imgInfo['filename'];
                                                    $ext='.'.$imgInfo['extension'];
                                                    if(is_file(WWW_ROOT.IMAGES_URL.'products/'.$img.'_thumb'.$ext)){
                                                        $imgOrig = $cnfg["sitebasefolder"].'/img/products/'.$img.$ext;
                                                        $imgPath = '/img/products/'.$img.'_thumb'.$ext;
                                                    }
                                                }

                                                $imgUrl =(empty($imgOrig)) ? 'javascript:void(0);' : $imgOrig;
                                                $imgClass = (empty($imgOrig)) ? '' : 'preview';

                                                // Product Image End
						?>
                                                        <a href='<?php echo $imgUrl; ?>' class="<?php echo $imgClass; ?>" onclick="return redirectPage('<?php echo $url;?>');">
							  <?php echo $html->image($imgPath,array('border' => '0','height' => '60', 'width' => '60')); ?>
							</a>
							</div>
								</div>
								<div class="pr_details">

									<h2>
                                                                    <?php
								    $prodname=$pure_product_name;
									if(strlen($prodname)>18)
									 {
									   $prodname=substr($prodname, 0, 18)."..."; ?>
                                                                            <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>" class="tooltip" title="<?php echo stripslashes($ft["Product"]["pname"]); ?>"><?php echo stripslashes($prodname); ?></a>
                                                                      <?php
									    }
									 else
									 { ?>
								     <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>"><?php echo $prodname; ?></a>
									<?php } ?>

                                                                        </h2>
									<p>  <?php

                                                                      $pure_product_desc =  $ft["Product"]["descr"];
                                                                        if(strlen($pure_product_desc)>25)
									 {
                                                                             $pure_product_desc=substr($pure_product_desc, 0, 25)."...";
                                                                        }
                                                                        ?>
                                                                         <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>" class="tooltip" title="<?php echo stripslashes($ft["Product"]["descr"]); ?>"><?php echo stripslashes($pure_product_desc); ?></a>
                                                                        </p>
									<p class="Price">
									<?php
														//Setting the Prices & Discount for Wholesale/Retail Users
														$prod_price=0;
														$discnt_type='';
														$discnt_price=0;
														if($ft["Product"]["wholesale_price"] > 0 || $ft["Product"]["price"] > 0 )
														{
														if(isset($ft["Product"]["discount"]) && $ft["Product"]["discount"] > 0)
														{
														$discnt_type=$ft["Product"]["discount_type"];
														$discnt_price=$ft["Product"]["discount"];
														}
														}
														if(isset($sus) && empty($sus)===false)
														{
														if($sus["usertype"]=='wholesale')
														{
														if(isset($ft["Product"]["wholesale_price"]) && $ft["Product"]["wholesale_price"] > 0 )
														{
														$wholesale_price=$ft["Product"]["wholesale_price"];
														$utype='wholesale';
														display_price($utype,$wholesale_price,$discnt_type,$discnt_price,$curlogo);
														}
														else if(isset($ft["Product"]["price"]) && $ft["Product"]["price"] > 0 )
														{
														$retail_price=$ft["Product"]["price"];
														$utype='retail';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														else
														display_price('',0,'',0,$curlogo);
														}
														else if($sus["usertype"]=='retail')
														{
														if(isset($ft["Product"]["price"]) && $ft["Product"]["price"] > 0 )
														{
														$retail_price=$ft["Product"]["price"];
														$utype='retail';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														else
														display_price('',0,'',0,$curlogo);
														}
														}
														else
														{
														if(isset($ft["Product"]["price"]))
														$retail_price=$ft["Product"]["price"];
														$utype='normal';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														//Setting the Prices for Wholesale/Retail Users
														?>
									</p>
								</div>
                                                            <div class="clear"></div>
							</div>

							<div class="clear"></div>
						</li>
                                                 <?php
                    }
                    ?>
                                        </ul>

						<div class="clear"></div>
					</div>
					<?php
                    }
                    ?>
                    <!--  Left Middle Block3 area End -->
                    <!--  Left Middle Block4 area start -->
					<?php if(isset($middle4) && !empty($middle4)) { ?>
					<div class="brands_products"><!--brands_products-->
							<h2><?php if(isset($middle4title)) echo $middle4title;?></h2>
							<ul class="brands-name">
                     <?php
					 $i = 0;
					 foreach($middle4 as $ft)
					 {
					  $i++;
                                         
                                          ?>
                                            <li>
							
							<div style="overflow: hidden;">
								<div class="prdct_img">

                 <div class="thump_size">
					<?php
							$pure_product_name = cleanspecialchars($ft["Product"]["pname"]);
					        //$url ='products/show/'.$pure_product_name.'/'.$ft["Product"]["id"];
                                                $url =$html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]);
                                                 // Product Image
                                                $imgOrig = $imgUrl = $imgClass = NULL;
                                                $imgPath = '/img/noimagessmall.gif';
                                                if(isset($ft["Productimages"]) && $ft["Productimages"] <> '') {
                                                    $imgInfo = array();
                                                    $img = $ext = NULL;
                                                    $imgInfo = pathinfo($ft["Productimages"]);
                                                    $img=$imgInfo['filename'];
                                                    $ext='.'.$imgInfo['extension'];
                                                    if(is_file(WWW_ROOT.IMAGES_URL.'products/'.$img.'_thumb'.$ext)){
                                                        $imgOrig = $cnfg["sitebasefolder"].'/img/products/'.$img.$ext;
                                                        $imgPath = '/img/products/'.$img.'_thumb'.$ext;
                                                    }
                                                }

                                                $imgUrl =(empty($imgOrig)) ? 'javascript:void(0);' : $imgOrig;
                                                $imgClass = (empty($imgOrig)) ? '' : 'preview';

                                                // Product Image End
						?>
                                                        <a href='<?php echo $imgUrl; ?>' class="<?php echo $imgClass; ?>" onclick="return redirectPage('<?php echo $url;?>');">
							  <?php echo $html->image($imgPath,array('border' => '0','height' => '60', 'width' => '60')); ?>
							</a>
							</div>
								</div>
								<div class="pr_details">

									<h2>
                                                                    <?php
								    $prodname=$pure_product_name;
									if(strlen($prodname)>18)
									 {
									   $prodname=substr($prodname, 0, 18)."..."; ?>
                                                                            <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>" class="tooltip" title="<?php echo addslashes($ft["Product"]["pname"]); ?>"><?php echo addslashes($prodname); ?></a>
                                                                      <?php
									    }
									 else
									 { ?>
								     <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>"><?php echo $prodname; ?></a>
									<?php } ?>

                                                                        </h2>
									<p>  <?php

                                                                      $pure_product_desc =  $ft["Product"]["descr"];
                                                                        if(strlen($pure_product_desc)>25)
									 {
                                                                             $pure_product_desc=substr($pure_product_desc, 0, 25)."...";
                                                                        }
                                                                        ?>
                                                                         <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>" class="tooltip" title="<?php echo addslashes($ft["Product"]["descr"]); ?>"><?php echo addslashes($pure_product_desc); ?></a>
                                                                        </p>
									<p class="Price">
									<?php
														//Setting the Prices & Discount for Wholesale/Retail Users
														$prod_price=0;
														$discnt_type='';
														$discnt_price=0;
														if($ft["Product"]["wholesale_price"] > 0 || $ft["Product"]["price"] > 0 )
														{
														if(isset($ft["Product"]["discount"]) && $ft["Product"]["discount"] > 0)
														{
														$discnt_type=$ft["Product"]["discount_type"];
														$discnt_price=$ft["Product"]["discount"];
														}
														}
														if(isset($sus) && empty($sus)===false)
														{
														if($sus["usertype"]=='wholesale')
														{
														if(isset($ft["Product"]["wholesale_price"]) && $ft["Product"]["wholesale_price"] > 0 )
														{
														$wholesale_price=$ft["Product"]["wholesale_price"];
														$utype='wholesale';
														display_price($utype,$wholesale_price,$discnt_type,$discnt_price,$curlogo);
														}
														else if(isset($ft["Product"]["price"]) && $ft["Product"]["price"] > 0 )
														{
														$retail_price=$ft["Product"]["price"];
														$utype='retail';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														else
														display_price('',0,'',0,$curlogo);
														}
														else if($sus["usertype"]=='retail')
														{
														if(isset($ft["Product"]["price"]) && $ft["Product"]["price"] > 0 )
														{
														$retail_price=$ft["Product"]["price"];
														$utype='retail';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														else
														display_price('',0,'',0,$curlogo);
														}
														}
														else
														{
														if(isset($ft["Product"]["price"]))
														$retail_price=$ft["Product"]["price"];
														$utype='normal';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														//Setting the Prices for Wholesale/Retail Users
														?>
									</p>
								</div>
                                                            <div class="clear"></div>
							</div>

							<div class="clear"></div>
						</li>
                                                 <?php
                    }
                    ?>
                                        </ul>

						<div class="clear"></div>
					</div>
					<?php
                    }
                    ?>
                    <!--  Left Middle Block4 area End -->
					</div>
				</div>
				<div class="col-sm-9 padding-right">
					<?php if($session->read('NewsLetter') != 'yes'){ if($session->check('Message.flash')) { ?><div id="okbox"><font color="#5cc477"><?php $session->flash(); ?></font></div><?php } } ?>
					<!--  Middle Block2 area starts -->
					<?php if(isset($right1)  && !empty($right1)) { ?>
					<div class="features_items">
						<h2 class="title text-center"><?php if(isset($right1title)) echo $right1title;?></h2>






               
                                             <?php
					 $i = 0;
					 foreach($right1 as $ft)
					 {
					  $i++;
							$pure_product_name = cleanspecialchars($ft["Product"]["pname"]);
                                                        $pure_product_desc = cleanspecialchars($ft["Product"]["descr"]);
                                                        //$url ='products/show/'.$pure_product_name.'/'.$ft["Product"]["id"];
                                                        $url =$html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]);
                                                         // Product Image
                                                        $imgOrig = $imgUrl = $imgClass = NULL;
                                                        $imgPath = '/img/noimages_disp.gif';
                                                        if(isset($ft["Productimages"]) && $ft["Productimages"] <> '') {
                                                            $imgInfo = array();
                                                            $img = $ext = NULL;
                                                            $imgInfo = pathinfo($ft["Productimages"]);
                                                            $img=$imgInfo['filename'];
                                                            $ext='.'.$imgInfo['extension'];
                                                            if(is_file(WWW_ROOT.IMAGES_URL.'products/'.$img.'_thumb'.$ext)){
                                                                $imgOrig = $cnfg["sitebasefolder"].'/img/products/'.$img.$ext;
                                                                $imgPath = '/img/products/'.$img.'_disp'.$ext;
                                                            }
                                                        }

                                                        $imgUrl =(empty($imgOrig)) ? 'javascript:void(0);' : $imgOrig;
                                                        $imgClass = (empty($imgOrig)) ? '' : 'preview';

                                                        // Product Image End
						?>
						<div class="col-sm-4">
							<div class="product-image-wrapper">
								<div class="single-products">
										<div class="productinfo text-center">
										<a href='<?php echo $imgUrl; ?>' class="shopboximg">
											<?php echo $html->image($imgPath,array('border' => '0')); ?>
											</a>
											<h2>
												<?php
														//Setting the Prices & Discount for Wholesale/Retail Users
														$prod_price=0;
														$discnt_type='';
														$discnt_price=0;
														if($ft["Product"]["wholesale_price"] > 0 || $ft["Product"]["price"] > 0 )
														{
														if(isset($ft["Product"]["discount"]) && $ft["Product"]["discount"] > 0)
														{
														$discnt_type=$ft["Product"]["discount_type"];
														$discnt_price=$ft["Product"]["discount"];
														}
														}
														if(isset($sus) && empty($sus)===false)
														{
														if($sus["usertype"]=='wholesale')
														{
														if(isset($ft["Product"]["wholesale_price"]) && $ft["Product"]["wholesale_price"] > 0 )
														{
														$wholesale_price=$ft["Product"]["wholesale_price"];
														$utype='wholesale';
														display_price($utype,$wholesale_price,$discnt_type,$discnt_price,$curlogo);
														}
														else if(isset($ft["Product"]["price"]) && $ft["Product"]["price"] > 0 )
														{
														$retail_price=$ft["Product"]["price"];
														$utype='retail';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														else
														display_price('',0,'',0,$curlogo);
														}
														else if($sus["usertype"]=='retail')
														{
														if(isset($ft["Product"]["price"]) && $ft["Product"]["price"] > 0 )
														{
														$retail_price=$ft["Product"]["price"];
														$utype='retail';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														else
														display_price('',0,'',0,$curlogo);
														}
														}
														else
														{
														if(isset($ft["Product"]["price"]))
														$retail_price=$ft["Product"]["price"];
														$utype='normal';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														//Setting the Prices for Wholesale/Retail Users
														?>
											</h2>
											<p><?php
								    $prodname=$pure_product_name;
									if(strlen($prodname)>20)
									 {
									   $prodname=substr($prodname, 0, 20)."..."; ?>
                                                                            <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>" class="tooltip" title="<?php echo stripslashes($ft["Product"]["pname"]); ?>"><?php echo stripslashes($prodname); ?></a>
                                     <?php
									    }
									 else
									 { ?>
								     <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>"><?php echo $prodname; ?></a>
									<?php } ?></p>
									<p>
                                                                         <?php
                                                                        if(strlen($pure_product_desc)>18)
									 {
                                                                             $pure_product_desc=substr($pure_product_desc, 0, 18)."...";
                                                                        }
                                                                        ?>
                                                                         <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>" class="tooltip" title="<?php echo stripslashes($ft["Product"]["descr"]); ?>"><?php echo stripslashes($pure_product_desc); ?></a>
                                                                        &nbsp;</p>
											<a href="<?php echo $html->url('/carts/add/'.$ft["Product"]["id"]."/".$ft["Product"]["id"]); ?>" class="btn btn-default add-to-cart"><i class="fa fa-shopping-cart"></i>Add to cart</a>
										</div>
										<div class="product-overlay">
											<div class="overlay-content">
												<h2>
												<?php
														//Setting the Prices & Discount for Wholesale/Retail Users
														$prod_price=0;
														$discnt_type='';
														$discnt_price=0;
														if($ft["Product"]["wholesale_price"] > 0 || $ft["Product"]["price"] > 0 )
														{
														if(isset($ft["Product"]["discount"]) && $ft["Product"]["discount"] > 0)
														{
														$discnt_type=$ft["Product"]["discount_type"];
														$discnt_price=$ft["Product"]["discount"];
														}
														}
														if(isset($sus) && empty($sus)===false)
														{
														if($sus["usertype"]=='wholesale')
														{
														if(isset($ft["Product"]["wholesale_price"]) && $ft["Product"]["wholesale_price"] > 0 )
														{
														$wholesale_price=$ft["Product"]["wholesale_price"];
														$utype='wholesale';
														display_price($utype,$wholesale_price,$discnt_type,$discnt_price,$curlogo);
														}
														else if(isset($ft["Product"]["price"]) && $ft["Product"]["price"] > 0 )
														{
														$retail_price=$ft["Product"]["price"];
														$utype='retail';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														else
														display_price('',0,'',0,$curlogo);
														}
														else if($sus["usertype"]=='retail')
														{
														if(isset($ft["Product"]["price"]) && $ft["Product"]["price"] > 0 )
														{
														$retail_price=$ft["Product"]["price"];
														$utype='retail';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														else
														display_price('',0,'',0,$curlogo);
														}
														}
														else
														{
														if(isset($ft["Product"]["price"]))
														$retail_price=$ft["Product"]["price"];
														$utype='normal';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														//Setting the Prices for Wholesale/Retail Users
														?>
											</h2>
											<p><?php
								    $prodname=$pure_product_name;
									if(strlen($prodname)>20)
									 {
									   $prodname=substr($prodname, 0, 20)."..."; ?>
                                                                            <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>" class="tooltip" title="<?php echo stripslashes($ft["Product"]["pname"]); ?>"><?php echo stripslashes($prodname); ?></a>
                                     <?php
									    }
									 else
									 { ?>
								     <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>"><?php echo $prodname; ?></a>
									<?php } ?></p>
									<p>
                                                                         <?php
                                                                        if(strlen($pure_product_desc)>18)
									 {
                                                                             $pure_product_desc=substr($pure_product_desc, 0, 18)."...";
                                                                        }
                                                                        ?>
                                                                         <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>" class="tooltip" title="<?php echo stripslashes($ft["Product"]["descr"]); ?>"><?php echo stripslashes($pure_product_desc); ?></a>
                                                                        &nbsp;</p>
											<a href="<?php echo $html->url('/carts/add/'.$ft["Product"]["id"]."/".$ft["Product"]["id"]); ?>" class="btn btn-default add-to-cart"><i class="fa fa-shopping-cart"></i>Add to cart</a>
											</div>
										</div>
								</div>
							</div>
						</div>

                        <?php 
                    	}
                        ?>
					</div>
					<?php
                    }
                    ?>
					<!--  Middle Block2 area end -->
					<!--  Middle Block3 area starts -->
					<?php if(isset($right2)  && !empty($right2)) {  ?>
					<div class="features_items">
						<h2 class="title text-center"><?php if(isset($right2title)) echo $right2title;?></h2>
                 <?php
					 $i = 0;
					 foreach($right2 as $ft)
					 {

					  $i++;
					  	$pure_product_name = cleanspecialchars($ft["Product"]["pname"]);
                                                        $pure_product_desc = cleanspecialchars($ft["Product"]["descr"]);
					                //$url ='products/show/'.$pure_product_name.'/'.$ft["Product"]["id"];
                                                        $url =$html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]);
                                                         // Product Image
                                                        $imgOrig = $imgUrl = $imgClass = NULL;
                                                        $imgPath = '/img/noimages_disp.gif';
                                                        if(isset($ft["Productimages"]) && $ft["Productimages"] <> '') {
                                                            $imgInfo = array();
                                                            $img = $ext = NULL;
                                                            $imgInfo = pathinfo($ft["Productimages"]);
                                                            $img=$imgInfo['filename'];
                                                            $ext='.'.$imgInfo['extension'];
                                                            if(is_file(WWW_ROOT.IMAGES_URL.'products/'.$img.'_thumb'.$ext)){
                                                                $imgOrig = $cnfg["sitebasefolder"].'/img/products/'.$img.$ext;
                                                                $imgPath = '/img/products/'.$img.'_disp'.$ext;
                                                            }
                                                        }

                                                        $imgUrl =(empty($imgOrig)) ? 'javascript:void(0);' : $imgOrig;
                                                        $imgClass = (empty($imgOrig)) ? '' : 'preview';

                                                        // Product Image End

					   ?>
						<div class="col-sm-4">
							<div class="product-image-wrapper">
								<div class="single-products">
										<div class="productinfo text-center">
										<a href='<?php echo $imgUrl; ?>' class="shopboximg">
											<?php echo $html->image($imgPath,array('border' => '0')); ?>
											</a>
											<h2>
												<?php
														//Setting the Prices & Discount for Wholesale/Retail Users
														$prod_price=0;
														$discnt_type='';
														$discnt_price=0;
														if($ft["Product"]["wholesale_price"] > 0 || $ft["Product"]["price"] > 0 )
														{
														if(isset($ft["Product"]["discount"]) && $ft["Product"]["discount"] > 0)
														{
														$discnt_type=$ft["Product"]["discount_type"];
														$discnt_price=$ft["Product"]["discount"];
														}
														}
														if(isset($sus) && empty($sus)===false)
														{
														if($sus["usertype"]=='wholesale')
														{
														if(isset($ft["Product"]["wholesale_price"]) && $ft["Product"]["wholesale_price"] > 0 )
														{
														$wholesale_price=$ft["Product"]["wholesale_price"];
														$utype='wholesale';
														display_price($utype,$wholesale_price,$discnt_type,$discnt_price,$curlogo);
														}
														else if(isset($ft["Product"]["price"]) && $ft["Product"]["price"] > 0 )
														{
														$retail_price=$ft["Product"]["price"];
														$utype='retail';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														else
														display_price('',0,'',0,$curlogo);
														}
														else if($sus["usertype"]=='retail')
														{
														if(isset($ft["Product"]["price"]) && $ft["Product"]["price"] > 0 )
														{
														$retail_price=$ft["Product"]["price"];
														$utype='retail';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														else
														display_price('',0,'',0,$curlogo);
														}
														}
														else
														{
														if(isset($ft["Product"]["price"]))
														$retail_price=$ft["Product"]["price"];
														$utype='normal';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														//Setting the Prices for Wholesale/Retail Users
														?>
											</h2>
											<p><?php
								    $prodname=$pure_product_name;
									if(strlen($prodname)>20)
									 {
									   $prodname=substr($prodname, 0, 20)."..."; ?>
                                                                            <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>" class="tooltip" title="<?php echo stripslashes($ft["Product"]["pname"]); ?>"><?php echo stripslashes($prodname); ?></a>
                                     <?php
									    }
									 else
									 { ?>
								     <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>"><?php echo $prodname; ?></a>
									<?php } ?></p>
									<p>
                                                                         <?php
                                                                        if(strlen($pure_product_desc)>18)
									 {
                                                                             $pure_product_desc=substr($pure_product_desc, 0, 18)."...";
                                                                        }
                                                                        ?>
                                                                         <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>" class="tooltip" title="<?php echo stripslashes($ft["Product"]["descr"]); ?>"><?php echo stripslashes($pure_product_desc); ?></a>
                                                                        &nbsp;</p>
											<a href="<?php echo $html->url('/carts/add/'.$ft["Product"]["id"]."/".$ft["Product"]["id"]); ?>" class="btn btn-default add-to-cart"><i class="fa fa-shopping-cart"></i>Add to cart</a>
										</div>
										<div class="product-overlay">
											<div class="overlay-content">
												<h2>
												<?php
														//Setting the Prices & Discount for Wholesale/Retail Users
														$prod_price=0;
														$discnt_type='';
														$discnt_price=0;
														if($ft["Product"]["wholesale_price"] > 0 || $ft["Product"]["price"] > 0 )
														{
														if(isset($ft["Product"]["discount"]) && $ft["Product"]["discount"] > 0)
														{
														$discnt_type=$ft["Product"]["discount_type"];
														$discnt_price=$ft["Product"]["discount"];
														}
														}
														if(isset($sus) && empty($sus)===false)
														{
														if($sus["usertype"]=='wholesale')
														{
														if(isset($ft["Product"]["wholesale_price"]) && $ft["Product"]["wholesale_price"] > 0 )
														{
														$wholesale_price=$ft["Product"]["wholesale_price"];
														$utype='wholesale';
														display_price($utype,$wholesale_price,$discnt_type,$discnt_price,$curlogo);
														}
														else if(isset($ft["Product"]["price"]) && $ft["Product"]["price"] > 0 )
														{
														$retail_price=$ft["Product"]["price"];
														$utype='retail';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														else
														display_price('',0,'',0,$curlogo);
														}
														else if($sus["usertype"]=='retail')
														{
														if(isset($ft["Product"]["price"]) && $ft["Product"]["price"] > 0 )
														{
														$retail_price=$ft["Product"]["price"];
														$utype='retail';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														else
														display_price('',0,'',0,$curlogo);
														}
														}
														else
														{
														if(isset($ft["Product"]["price"]))
														$retail_price=$ft["Product"]["price"];
														$utype='normal';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														//Setting the Prices for Wholesale/Retail Users
														?>
											</h2>
											<p><?php
								    $prodname=$pure_product_name;
									if(strlen($prodname)>20)
									 {
									   $prodname=substr($prodname, 0, 20)."..."; ?>
                                                                            <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>" class="tooltip" title="<?php echo stripslashes($ft["Product"]["pname"]); ?>"><?php echo stripslashes($prodname); ?></a>
                                     <?php
									    }
									 else
									 { ?>
								     <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>"><?php echo $prodname; ?></a>
									<?php } ?></p>
									<p>
                                                                         <?php
                                                                        if(strlen($pure_product_desc)>18)
									 {
                                                                             $pure_product_desc=substr($pure_product_desc, 0, 18)."...";
                                                                        }
                                                                        ?>
                                                                         <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>" class="tooltip" title="<?php echo stripslashes($ft["Product"]["descr"]); ?>"><?php echo stripslashes($pure_product_desc); ?></a>
                                                                        &nbsp;</p>
											<a href="<?php echo $html->url('/carts/add/'.$ft["Product"]["id"]."/".$ft["Product"]["id"]); ?>" class="btn btn-default add-to-cart"><i class="fa fa-shopping-cart"></i>Add to cart</a>
											</div>
										</div>
								</div>
							</div>
						</div>

                        <?php
                    	}
                        ?>
					</div>
					<?php
                    }
                    ?>
					<!--  Middle Block3 area end -->
					<!--  Middle Block4 area starts -->
					<?php if(isset($right3)  && !empty($right3)) {  ?>
					<div class="features_items">
						<h2 class="title text-center"><?php if(isset($right3title)) echo $right3title;?></h2>
                <?php
					 $i = 0;
					 foreach($right3 as $ft)
					 {

					  $i++;
					  	$pure_product_name = cleanspecialchars($ft["Product"]["pname"]);
                                                        $pure_product_desc = cleanspecialchars($ft["Product"]["descr"]);
					        //$url ='products/show/'.$pure_product_name.'/'.$ft["Product"]["id"];
                                                $url =$html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]);
                                                                // Product Image
                                                        $imgOrig = $imgUrl = $imgClass = NULL;
                                                        $imgPath = '/img/noimages_disp.gif';
                                                        if(isset($ft["Productimages"]) && $ft["Productimages"] <> '') {
                                                            $imgInfo = array();
                                                            $img = $ext = NULL;
                                                            $imgInfo = pathinfo($ft["Productimages"]);
                                                            $img=$imgInfo['filename'];
                                                            $ext='.'.$imgInfo['extension'];
                                                            if(is_file(WWW_ROOT.IMAGES_URL.'products/'.$img.'_thumb'.$ext)){
                                                                $imgOrig = $cnfg["sitebasefolder"].'/img/products/'.$img.$ext;
                                                                $imgPath = '/img/products/'.$img.'_disp'.$ext;
                                                            }
                                                        }

                                                        $imgUrl =(empty($imgOrig)) ? 'javascript:void(0);' : $imgOrig;
                                                        $imgClass = (empty($imgOrig)) ? '' : 'preview';

                                                        // Product Image End

					   ?>
						<div class="col-sm-4">
							<div class="product-image-wrapper">
								<div class="single-products">
										<div class="productinfo text-center">
										<a href='<?php echo $imgUrl; ?>' class="shopboximg">
											<?php echo $html->image($imgPath,array('border' => '0')); ?>
											</a>
											<h2>
												<?php
														//Setting the Prices & Discount for Wholesale/Retail Users
														$prod_price=0;
														$discnt_type='';
														$discnt_price=0;
														if($ft["Product"]["wholesale_price"] > 0 || $ft["Product"]["price"] > 0 )
														{
														if(isset($ft["Product"]["discount"]) && $ft["Product"]["discount"] > 0)
														{
														$discnt_type=$ft["Product"]["discount_type"];
														$discnt_price=$ft["Product"]["discount"];
														}
														}
														if(isset($sus) && empty($sus)===false)
														{
														if($sus["usertype"]=='wholesale')
														{
														if(isset($ft["Product"]["wholesale_price"]) && $ft["Product"]["wholesale_price"] > 0 )
														{
														$wholesale_price=$ft["Product"]["wholesale_price"];
														$utype='wholesale';
														display_price($utype,$wholesale_price,$discnt_type,$discnt_price,$curlogo);
														}
														else if(isset($ft["Product"]["price"]) && $ft["Product"]["price"] > 0 )
														{
														$retail_price=$ft["Product"]["price"];
														$utype='retail';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														else
														display_price('',0,'',0,$curlogo);
														}
														else if($sus["usertype"]=='retail')
														{
														if(isset($ft["Product"]["price"]) && $ft["Product"]["price"] > 0 )
														{
														$retail_price=$ft["Product"]["price"];
														$utype='retail';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														else
														display_price('',0,'',0,$curlogo);
														}
														}
														else
														{
														if(isset($ft["Product"]["price"]))
														$retail_price=$ft["Product"]["price"];
														$utype='normal';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														//Setting the Prices for Wholesale/Retail Users
														?>
											</h2>
											<p><?php
								    $prodname=$pure_product_name;
									if(strlen($prodname)>20)
									 {
									   $prodname=substr($prodname, 0, 20)."..."; ?>
                                                                            <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>" class="tooltip" title="<?php echo stripslashes($ft["Product"]["pname"]); ?>"><?php echo stripslashes($prodname); ?></a>
                                     <?php
									    }
									 else
									 { ?>
								     <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>"><?php echo $prodname; ?></a>
									<?php } ?></p>
									<p>
                                                                         <?php
                                                                        if(strlen($pure_product_desc)>18)
									 {
                                                                             $pure_product_desc=substr($pure_product_desc, 0, 18)."...";
                                                                        }
                                                                        ?>
                                                                         <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>" class="tooltip" title="<?php echo stripslashes($ft["Product"]["descr"]); ?>"><?php echo stripslashes($pure_product_desc); ?></a>
                                                                        &nbsp;</p>
											<a href="<?php echo $html->url('/carts/add/'.$ft["Product"]["id"]."/".$ft["Product"]["id"]); ?>" class="btn btn-default add-to-cart"><i class="fa fa-shopping-cart"></i>Add to cart</a>
										</div>
										<div class="product-overlay">
											<div class="overlay-content">
												<h2>
												<?php
														//Setting the Prices & Discount for Wholesale/Retail Users
														$prod_price=0;
														$discnt_type='';
														$discnt_price=0;
														if($ft["Product"]["wholesale_price"] > 0 || $ft["Product"]["price"] > 0 )
														{
														if(isset($ft["Product"]["discount"]) && $ft["Product"]["discount"] > 0)
														{
														$discnt_type=$ft["Product"]["discount_type"];
														$discnt_price=$ft["Product"]["discount"];
														}
														}
														if(isset($sus) && empty($sus)===false)
														{
														if($sus["usertype"]=='wholesale')
														{
														if(isset($ft["Product"]["wholesale_price"]) && $ft["Product"]["wholesale_price"] > 0 )
														{
														$wholesale_price=$ft["Product"]["wholesale_price"];
														$utype='wholesale';
														display_price($utype,$wholesale_price,$discnt_type,$discnt_price,$curlogo);
														}
														else if(isset($ft["Product"]["price"]) && $ft["Product"]["price"] > 0 )
														{
														$retail_price=$ft["Product"]["price"];
														$utype='retail';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														else
														display_price('',0,'',0,$curlogo);
														}
														else if($sus["usertype"]=='retail')
														{
														if(isset($ft["Product"]["price"]) && $ft["Product"]["price"] > 0 )
														{
														$retail_price=$ft["Product"]["price"];
														$utype='retail';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														else
														display_price('',0,'',0,$curlogo);
														}
														}
														else
														{
														if(isset($ft["Product"]["price"]))
														$retail_price=$ft["Product"]["price"];
														$utype='normal';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														//Setting the Prices for Wholesale/Retail Users
														?>
											</h2>
											<p><?php
								    $prodname=$pure_product_name;
									if(strlen($prodname)>20)
									 {
									   $prodname=substr($prodname, 0, 20)."..."; ?>
                                                                            <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>" class="tooltip" title="<?php echo stripslashes($ft["Product"]["pname"]); ?>"><?php echo stripslashes($prodname); ?></a>
                                     <?php
									    }
									 else
									 { ?>
								     <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>"><?php echo $prodname; ?></a>
									<?php } ?></p>
									<p>
                                                                         <?php
                                                                        if(strlen($pure_product_desc)>18)
									 {
                                                                             $pure_product_desc=substr($pure_product_desc, 0, 18)."...";
                                                                        }
                                                                        ?>
                                                                         <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>" class="tooltip" title="<?php echo stripslashes($ft["Product"]["descr"]); ?>"><?php echo stripslashes($pure_product_desc); ?></a>
                                                                        &nbsp;</p>
											<a href="<?php echo $html->url('/carts/add/'.$ft["Product"]["id"]."/".$ft["Product"]["id"]); ?>" class="btn btn-default add-to-cart"><i class="fa fa-shopping-cart"></i>Add to cart</a>
											</div>
										</div>
								</div>
							</div>
						</div>

                        <?php
                    	}
                        ?>
					</div>
					<?php
                    }
                    ?>
					<!--  Middle Block4 area end -->
					<!--  Middle Block5 area starts -->
					<?php if(isset($right4)  && !empty($right4)) { ?>
					<div class="features_items">
						<h2 class="title text-center"><?php if(isset($right4title)) echo $right4title;?></h2>
                <?php
					 $i = 0;
					 foreach($right4 as $ft)
					 {

					  $i++;
					  	$pure_product_name = cleanspecialchars($ft["Product"]["pname"]);
                                                        $pure_product_desc = cleanspecialchars($ft["Product"]["descr"]);
					        //$url ='products/show/'.$pure_product_name.'/'.$ft["Product"]["id"];
                                                        $url =$html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]);
                                                      // Product Image
                                                        $imgOrig = $imgUrl = $imgClass = NULL;
                                                        $imgPath = '/img/noimages_disp.gif';
                                                        if(isset($ft["Productimages"]) && $ft["Productimages"] <> '') {
                                                            $imgInfo = array();
                                                            $img = $ext = NULL;
                                                            $imgInfo = pathinfo($ft["Productimages"]);
                                                            $img=$imgInfo['filename'];
                                                            $ext='.'.$imgInfo['extension'];
                                                            if(is_file(WWW_ROOT.IMAGES_URL.'products/'.$img.'_thumb'.$ext)){
                                                                $imgOrig = $cnfg["sitebasefolder"].'/img/products/'.$img.$ext;
                                                                $imgPath = '/img/products/'.$img.'_disp'.$ext;
                                                            }
                                                        }

                                                        $imgUrl =(empty($imgOrig)) ? 'javascript:void(0);' : $imgOrig;
                                                        $imgClass = (empty($imgOrig)) ? '' : 'preview';

                                                        // Product Image End

					   ?>
						<div class="col-sm-4">
							<div class="product-image-wrapper">
								<div class="single-products">
										<div class="productinfo text-center">
										<a href='<?php echo $imgUrl; ?>' class="shopboximg">
											<?php echo $html->image($imgPath,array('border' => '0')); ?>
											</a>
											<h2>
												<?php
														//Setting the Prices & Discount for Wholesale/Retail Users
														$prod_price=0;
														$discnt_type='';
														$discnt_price=0;
														if($ft["Product"]["wholesale_price"] > 0 || $ft["Product"]["price"] > 0 )
														{
														if(isset($ft["Product"]["discount"]) && $ft["Product"]["discount"] > 0)
														{
														$discnt_type=$ft["Product"]["discount_type"];
														$discnt_price=$ft["Product"]["discount"];
														}
														}
														if(isset($sus) && empty($sus)===false)
														{
														if($sus["usertype"]=='wholesale')
														{
														if(isset($ft["Product"]["wholesale_price"]) && $ft["Product"]["wholesale_price"] > 0 )
														{
														$wholesale_price=$ft["Product"]["wholesale_price"];
														$utype='wholesale';
														display_price($utype,$wholesale_price,$discnt_type,$discnt_price,$curlogo);
														}
														else if(isset($ft["Product"]["price"]) && $ft["Product"]["price"] > 0 )
														{
														$retail_price=$ft["Product"]["price"];
														$utype='retail';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														else
														display_price('',0,'',0,$curlogo);
														}
														else if($sus["usertype"]=='retail')
														{
														if(isset($ft["Product"]["price"]) && $ft["Product"]["price"] > 0 )
														{
														$retail_price=$ft["Product"]["price"];
														$utype='retail';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														else
														display_price('',0,'',0,$curlogo);
														}
														}
														else
														{
														if(isset($ft["Product"]["price"]))
														$retail_price=$ft["Product"]["price"];
														$utype='normal';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														//Setting the Prices for Wholesale/Retail Users
														?>
											</h2>
											<p><?php
								    $prodname=$pure_product_name;
									if(strlen($prodname)>20)
									 {
									   $prodname=substr($prodname, 0, 20)."..."; ?>
                                                                            <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>" class="tooltip" title="<?php echo stripslashes($ft["Product"]["pname"]); ?>"><?php echo stripslashes($prodname); ?></a>
                                     <?php
									    }
									 else
									 { ?>
								     <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>"><?php echo $prodname; ?></a>
									<?php } ?></p>
									<p>
                                                                         <?php
                                                                        if(strlen($pure_product_desc)>18)
									 {
                                                                             $pure_product_desc=substr($pure_product_desc, 0, 18)."...";
                                                                        }
                                                                        ?>
                                                                         <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>" class="tooltip" title="<?php echo stripslashes($ft["Product"]["descr"]); ?>"><?php echo stripslashes($pure_product_desc); ?></a>
                                                                        &nbsp;</p>
											<a href="<?php echo $html->url('/carts/add/'.$ft["Product"]["id"]."/".$ft["Product"]["id"]); ?>" class="btn btn-default add-to-cart"><i class="fa fa-shopping-cart"></i>Add to cart</a>
										</div>
										<div class="product-overlay">
											<div class="overlay-content">
												<h2>
												<?php
														//Setting the Prices & Discount for Wholesale/Retail Users
														$prod_price=0;
														$discnt_type='';
														$discnt_price=0;
														if($ft["Product"]["wholesale_price"] > 0 || $ft["Product"]["price"] > 0 )
														{
														if(isset($ft["Product"]["discount"]) && $ft["Product"]["discount"] > 0)
														{
														$discnt_type=$ft["Product"]["discount_type"];
														$discnt_price=$ft["Product"]["discount"];
														}
														}
														if(isset($sus) && empty($sus)===false)
														{
														if($sus["usertype"]=='wholesale')
														{
														if(isset($ft["Product"]["wholesale_price"]) && $ft["Product"]["wholesale_price"] > 0 )
														{
														$wholesale_price=$ft["Product"]["wholesale_price"];
														$utype='wholesale';
														display_price($utype,$wholesale_price,$discnt_type,$discnt_price,$curlogo);
														}
														else if(isset($ft["Product"]["price"]) && $ft["Product"]["price"] > 0 )
														{
														$retail_price=$ft["Product"]["price"];
														$utype='retail';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														else
														display_price('',0,'',0,$curlogo);
														}
														else if($sus["usertype"]=='retail')
														{
														if(isset($ft["Product"]["price"]) && $ft["Product"]["price"] > 0 )
														{
														$retail_price=$ft["Product"]["price"];
														$utype='retail';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														else
														display_price('',0,'',0,$curlogo);
														}
														}
														else
														{
														if(isset($ft["Product"]["price"]))
														$retail_price=$ft["Product"]["price"];
														$utype='normal';
														display_price($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
														}
														//Setting the Prices for Wholesale/Retail Users
														?>
											</h2>
											<p><?php
								    $prodname=$pure_product_name;
									if(strlen($prodname)>20)
									 {
									   $prodname=substr($prodname, 0, 20)."..."; ?>
                                                                            <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>" class="tooltip" title="<?php echo stripslashes($ft["Product"]["pname"]); ?>"><?php echo stripslashes($prodname); ?></a>
                                     <?php
									    }
									 else
									 { ?>
								     <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>"><?php echo $prodname; ?></a>
									<?php } ?></p>
									<p>
                                                                         <?php
                                                                        if(strlen($pure_product_desc)>18)
									 {
                                                                             $pure_product_desc=substr($pure_product_desc, 0, 18)."...";
                                                                        }
                                                                        ?>
                                                                         <a href="<?php echo $html->url('/products/show/'.$pure_product_name.'/'.$ft["Product"]["id"]); ?>" class="tooltip" title="<?php echo stripslashes($ft["Product"]["descr"]); ?>"><?php echo stripslashes($pure_product_desc); ?></a>
                                                                        &nbsp;</p>
											<a href="<?php echo $html->url('/carts/add/'.$ft["Product"]["id"]."/".$ft["Product"]["id"]); ?>" class="btn btn-default add-to-cart"><i class="fa fa-shopping-cart"></i>Add to cart</a>
											</div>
										</div>
								</div>
							</div>
						</div>

                        <?php
                    	}
                        ?>
					</div>
					<?php
                    }
                    ?>
					<!--  Middle Block5 area end -->
					<!--  GiftCards area starts -->
					 <?php if($cnfg["allow_giftcard"] == 'Y') { ?>
			  <?php if(isset($giftcard) && !empty($giftcard)) { ?>
					<div class="features_items">
						<h2 class="title text-center">Gift Cards</h2>
                <?php
					 $i = 0;
					 foreach($giftcard as $gft)
					 {
					  $i++;
					  	 //$url ='/giftcards/showgiftcard/'.$gft["Giftcard"]["id"];
                                               $url =$html->url('/giftcards/showgiftcard/'.$gft["Giftcard"]["id"]);
                                                                                                // Product Image
                                                $imgOrig = $imgUrl = $imgClass = NULL;
                                                $imgPath = '/img/noimages_disp.gif';
                                               if(isset($gft["Giftcard"]["gift_img"]) && $gft["Giftcard"]["gift_img"] <> '') {
                                                    $imgInfo = array();
                                                    $img = $ext = NULL;
                                                    $imgInfo = pathinfo($gft["Giftcard"]["gift_img"]);
                                                    $img=$imgInfo['filename'];
                                                    $ext='.'.$imgInfo['extension'];
                                                    if(is_file(WWW_ROOT.IMAGES_URL.'products/'.$img.'_disp'.$ext)){
                                                        $imgOrig = $cnfg["sitebasefolder"].'/img/products/'.$img.$ext;
                                                        $imgPath = '/img/products/'.$img.'_disp'.$ext;
                                                    }
                                                }

                                                $imgUrl =(empty($imgOrig)) ? 'javascript:void(0);' : $imgOrig;
                                                $imgClass = (empty($imgOrig)) ? '' : 'preview';

                                                // Product Image End

					   ?>
						<div class="col-sm-4">
							<div class="product-image-wrapper">
								<div class="single-products">
										<div class="productinfo text-center">
										<a href='<?php echo $imgUrl; ?>' class="shopboximg">
											<?php echo $html->image($imgPath,array('border' => '0')); ?>
											</a>
											<h2>
												<?php echo $curlogo.$gft["Giftcard"]["gift_amnt"]; ?>
											</h2>
											<p>
												<?php
											    $descr=$gft["Giftcard"]["descr"];
												if(strlen($descr)>18)
												 {
												 $descr=substr($descr, 0, 18)."..."; ?>
												<a href="<?php echo $html->url('/giftcards/showgiftcard/'.$gft["Giftcard"]["id"]); ?>" class="tooltip" title="<?php echo stripslashes($gft["Giftcard"]["descr"]); ?>"><?php echo stripslashes($descr); ?></a>
												<?php  }
												 else
												 { ?>
												 <a href="<?php echo $html->url('/giftcards/showgiftcard/'.$gft["Giftcard"]["id"]); ?>"><?php echo $descr; ?></a>
												 <?php } ?>
											</p>
									
											<a href="<?php echo $html->url('/carts/giftcard/'.$gft["Giftcard"]["id"]); ?>" class="btn btn-default add-to-cart"><i class="fa fa-shopping-cart"></i>Add to cart</a>
										</div>
										<div class="product-overlay">
											<div class="overlay-content">
												<h2>
												<?php echo $curlogo.$gft["Giftcard"]["gift_amnt"]; ?>
											</h2>
											<p>
												<?php
											    $descr=$gft["Giftcard"]["descr"];
												if(strlen($descr)>18)
												 {
												 $descr=substr($descr, 0, 18)."..."; ?>
												<a href="<?php echo $html->url('/giftcards/showgiftcard/'.$gft["Giftcard"]["id"]); ?>" class="tooltip" title="<?php echo stripslashes($gft["Giftcard"]["descr"]); ?>"><?php echo stripslashes($descr); ?></a>
												<?php  }
												 else
												 { ?>
												 <a href="<?php echo $html->url('/giftcards/showgiftcard/'.$gft["Giftcard"]["id"]); ?>"><?php echo $descr; ?></a>
												 <?php } ?>
											</p>
									
											<a href="<?php echo $html->url('/carts/giftcard/'.$gft["Giftcard"]["id"]); ?>" class="btn btn-default add-to-cart"><i class="fa fa-shopping-cart"></i>Add to cart</a>
											</div>
										</div>
								</div>
							</div>
						</div>
						<?php
                          }
                          ?>
					</div>
					<?php }
                    	}
                        ?>
					<!--  GiftCards area end -->





				</div>
			</div>
		</div>
	</section><!--/ContentArea-->


















			


		
				
		<!--mainbody area end -->
		
		<?php
				//Function to display price for Wholesale and Retail Users
				function display_price($utype='',$prod_price='',$discnt_type='',$discnt_price='',$curlogo='')
				{										
					   /*if($utype=='wholesale')
					   echo "<b>Wholesale Price : </b>";
					   else if($utype=='retail')
					   echo "<b>Price : </b>";
					   else if($utype=='normal')
					   echo "<b>Price : </b>";*/
					   
					   if(isset($discnt_type) && $discnt_type <> '')
						{ 
						if($discnt_type=='per')
						{
						if(isset($discnt_price) && $discnt_price <> '' && $discnt_price > 0)
						{
						$discounted_price=($prod_price-(($prod_price * $discnt_price)/100));
						echo "<strike>".$curlogo.number_format($prod_price,2)."</strike>&nbsp;&nbsp;".$curlogo.number_format($discounted_price,2);								 
						}											 
						}
						else if($discnt_type=='amnt')
						{	 
						if(isset($discnt_price) && $discnt_price <> '' && $discnt_price > 0)
						{
						$discounted_price=($prod_price-$discnt_price);
						echo "<strike>".$curlogo.number_format($prod_price,2)."</strike>&nbsp;&nbsp;".$curlogo.number_format($discounted_price,2);								 
						}		
						}
						}
						else
						{
						echo $curlogo.number_format($prod_price,2);		
						}							
				}
				
				function cleanspecialchars($text)
				{
					$code_entities_match = array(' 
		','--','&quot;','!','@','#','$','%','^','&','*','(',')','_','+','{','}','|',':','"','<','>','?','[',']','\\',';',"'",',','.','/','*','+','~','`','=');
					$code_entities_replace =
					array('-','-','','','','','','','','','','','','','','','','','','','','','','','','');
					$text = str_replace($code_entities_match, $code_entities_replace, $text);
					return $text;
				}
		?>
</body>
</html>
<script>
function redirectPage(url)
{
  window.location.href=url;
  return false;
}
</script>
<?php
	function cleancatnames($text)
				{
					$code_entities_match = array('
		','--','&quot;','!','@','#','$','%','^','&','*','(',')','_','+','{','}','|',':','"','<','>','?','[',']','\\',';',"'",',','.','/','*','+','~','`','=');
					$code_entities_replace =
					array('-','-','','','','','','','','','','','','','','','','','','','','','','','','');
					$text = str_replace($code_entities_match, $code_entities_replace, $text);
					return $text;
				}
 ?>