<?php
if($_SERVER['REQUEST_URI'] == "/"){
$basepath = "";
$index_path = '';
}else{
$basepath = "../";
$index_path = "../";
}

include_once($basepath."corebot/querycontrol.php");
include_once($basepath."corebot/_config_.php");

//$control = new queryinput();
class viewControlQuery extends queryinput
{

		const NETWORKTAB = "copn_netwrk";
		const CATETAB = "cop_categ";
		const STORETAB = "copn_storbnk";
		const COUPONTAB = "copn_cpnbnks";
		const ADMINSTAB = "cpn_admstrx";
		const UKEY = "_unk_ky";
		const FRNKEY = "_frgn_ky";
		const FEATURED_C = '_featr_cpon';
		const CODE_C = '_cpon_codchk';
		const DEALS_C = '_deal_cpon';
		const CHRISTMAS_C = '_cpon_discnt';
		const FREESHIP_C = '_freshp_cpon';
		const STORELINKNAME = '_cpon_stor ';
		const STOREFIELD = "_stor_nam";
		const TABCATEFIELD = "_cpon_categ";
		const TOTALSCATE = "to_tlct_listdt";
		const SORTFIELD = "_copn_stdat";
		const SUBCATETAB = "lstsub_catgry";
		const TOTALSUBCATE = "categ_ttlvlus";
		const TOPSTOREBN = "_top_sto";
		const VTAGCLOUD = "tag_clud_misl";
		const PAGXTAB = "jrnl_adpagx";
		const PAGXCATTAB = "blg_ctg_listdt";
		protected $_ukey = array("_unk_ky");
		protected $_ntValue = array("netwk_nam");
		protected $_colm  = '';
		protected $_stValue = array("_stor_nam");
		protected $_ctgValue = array("cate_nam");
		protected $_totalValue = array("*");
		protected $_populrPointer = "_stor_savng";
		protected $_item;
		protected $commonHeystack = array();
		protected $_shortText;
		protected $_imgPath = "../assets/shared/shops/"; // add ../
		protected $_vNeedle;
		protected $_viewTable;
		protected $_GTC = array();
		protected $_MetaId;
		protected $_storePath =  'coupons/'; //"view/?all="; //'coupons/'; //"view/?all=";
		protected $_blogPaths = ''; //"blog/page.php?blps="; // '';
		protected $_eventPaths = ''; //"event/page.php?blps="; // '';
		protected $_blogPagPath = '/'; //"&bttl="; //'/'; 
		protected $_pagePaths = ''; //"events/miscc.php?contn=";
		protected $_pagePathSec = '/'; //"&pgttl=";
		protected $_catePath = "for/"; //?view=


		// make conn	  
		private function connt(){
			$conf = new config();
			return $conf->_conni();
		}
		
public function dPath($id)
	{
		$path_d = '';
		if(is_string($id) && $id == "master")
		{	$path_d = "assets/shared/";
		}elseif(is_string($id) && $id == "inc"){
			$path_d = "assets/incl/";
			return $path_d;
		}elseif(is_string($id) && $id == "jav"){
			$path_d = "assets/js/";
		}elseif(is_string($id) && $id == "sty"){
			$path_d = "assets/css/";
		} // if
		return $path_d;
	}
	public function adminNum()
	{

	$number = mysqli_num_rows($this->queryBuilder($this->_totalValue, self::ADMINSTAB, $this->_colm));
	return $number;
	}
			
	public function networkNum()
	{

	$number = mysqli_num_rows($this->queryBuilder($this->_ntValue, self::NETWORKTAB, $this->_colm));
	return $number;
	}
	
	public function storeNum()
	{

	$number = mysqli_num_rows($this->queryBuilder($this->_stValue, self::STORETAB, $this->_colm));
	return $number;
	}
	
	public function categoryNum()
	{

	$number = mysqli_num_rows($this->queryBuilder($this->_ctgValue, self::CATETAB, $this->_colm));
	return $number;
	}
	
	public function couponNum()
	{

	$number = mysqli_num_rows($this->queryBuilder($this->_totalValue, self::COUPONTAB, $this->_colm));
	return $number;
	}
	
	private function sUrl($id)
	{
		$string = trim($id);
		$patterns = "/\s/";
		$replacements = "-";

		return preg_replace($patterns, $replacements, $string);
	}
	public function deUrl($id)
	{
		$string = trim($id);
		$patterns = "/-/";
		$replacements = " ";

		return preg_replace($patterns, $replacements, $string);
	}

	public function tagCloud($store)
	{
		$grab = $this->queryBuilder($this->_totalValue, self::VTAGCLOUD, array("tagd_stor" => $store));
		$tvw = '';
		if(mysqli_num_rows($grab) == 1) {
			$tvw .= "<div id='t_h'>Tag Cloud</div>";
			while($tagc = mysqli_fetch_array($grab, MYSQLI_NUM))
			{
				$tvw .= "<div id='tabblock'><h3>";
				$tvw .= $tagc[3];
				$tvw .= "</h3></div>";
			} // end while
			return $tvw;
		}else{
			return NULL;
		} // end if
			
	} // end method tag cloud

	public function storeView()
	{
		$initial = $this->queryBuilder($this->_totalValue, self::STORETAB, $this->_colm);
		$sView = "<table id='viewtab'>";
			$sView .= "<tr>";
			$sView .= "<th id='inhdrid'>ID</th>";
			$sView .= "<th id='inner_head'>Name</th>";
			$sView .= "<th id='inhdrid'>Disc.</th>";
			$sView .= "<th id='inner_head'>Meta Title</th>";
			$sView .= "<th id='inner_head'>Categories</th>";
			
			$sView .= "<th id='inner_head'>Enter By</th>";
			$sView .= "<th id='inhdrid'>Action</th>";
			$sView .= "</tr>";
		while($view = mysqli_fetch_array($initial, MYSQLI_NUM)) {
			
			$sView .= "<tr>";
			$sView .= "<td id='inrid'>".$view[1]."</td>";
			$sView .= "<td id='inner'>".$view[2]."</td>";
			$sView .= "<td id='inrid'>".$view[5]."</td>";
			$sView .= "<td id='inner'>".$view[9]."</td>";
			$sView .= "<td id='inner'>".$view[12]."</td>";
			
			$sView .= "<td id='inner'>".$view[16]."</td>";
			$sView .= "<td id='inrid'><a href='".$_SERVER['PHP_SELF']."?confirmdelete=".$this->encrypt($view[14]."::store")."' title='Delete Entry'><div id='delelte'></div></a>
			<a href='".$_SERVER['PHP_SELF']."?edtuk=".$view[14]."&rfk=".$view[15]."' title='Edit Entry'><div id='entedit'></div></a> </td>";
			$sView .= "</tr>";
		
		} // end while  
		$sView .= "</table>";
		return $sView;
		
	}
	
	public function couponsView()
	{
		$initial = $this->queryBuilder($this->_totalValue, self::COUPONTAB, $this->_colm);
		$sView = "<table id='viewtab'>";
			$sView .= "<tr>";
			$sView .= "<th id='inhdrid'>ID</th>";
			$sView .= "<th id='inner_head'>Name</th>";
			$sView .= "<th id='inner_head'>Code</th>";
			$sView .= "<th id='inhdrid'>Disc.</th>";
			$sView .= "<th id='inner_head'>Store</th>";
			
			$sView .= "<th id='inner_head'>Enter By</th>";
			$sView .= "<th id='inhdrid'>Action</th>";
			$sView .= "</tr>";
		while($view = mysqli_fetch_array($initial, MYSQLI_NUM)) {
			
			$sView .= "<tr>";
			$sView .= "<td id='inrid'>".$view[1]."</td>";
			$sView .= "<td id='inner'>".$view[2]."</td>";
			$sView .= "<td id='inner'>".$view[10]."</td>";
			$sView .= "<td id='inrid'>".$view[11]."</td>";
			$sView .= "<td id='inner'>".$view[17]."</td>";
			
			$sView .= "<td id='inner'>".$view[20]."</td>";
			$sView .= "<td id='inrid'><a href='".$_SERVER['PHP_SELF']."?confirmdelete=".$this->encrypt($view[18]."::coupons")."' title='Delete Entry'><div id='delelte'></div></a>
			<a href='".$_SERVER['PHP_SELF']."?cpnuk=".$this->encrypt($view[18])."&cpfk=".$this->encrypt($view[19])."' title='Edit Entry'><div id='entedit'></div></a> </td>";
			$sView .= "</tr>";
		
		} // end while  
		$sView .= "</table>";
		return $sView;
		
	}
	
	public function categoryView()
	{
		$initial = $this->queryBuilder($this->_totalValue, self::CATETAB, $this->_colm);
		$sView = "<table id='viewtab'>";
			$sView .= "<tr>";
			$sView .= "<th id='inhdrid'>ID</th>";
			$sView .= "<th id='inner_head'>Name</th>";
			$sView .= "<th id='inner_head'>Meta Title</th>";
			$sView .= "<th id='inner_head'>M-Keywords</th>";
			$sView .= "<th id='inner_head'>Meta Descp</th>";
			
			$sView .= "<th id='inner_head'>Enter By</th>";
			$sView .= "<th id='inhdrid'>Action</th>";
			$sView .= "</tr>";
		while($view = mysqli_fetch_array($initial, MYSQLI_NUM)) {
			
			$sView .= "<tr>";
			$sView .= "<td id='inrid'>".$view[1]."</td>";
			$sView .= "<td id='inner'>".$view[2]."</td>";
			$sView .= "<td id='inner'>".$view[4]."</td>";
			$sView .= "<td id='inrid'>".$view[5]."</td>";
			$sView .= "<td id='inner'>".$view[6]."</td>";
			
			$sView .= "<td id='inner'>".$view[9]."</td>";
			$sView .= "<td id='inrid'><a href='".$_SERVER['PHP_SELF']."?confirmdelete=".$this->encrypt($view[7]."::category")."' title='Delete Entry'><div id='delelte'></div></a>
			<a href='".$_SERVER['PHP_SELF']."?cteuk=".$this->encrypt($view[7])."&catefk=".$this->encrypt($view[8])."' title='Edit Entry'><div id='entedit'></div></a> </td>";
			$sView .= "</tr>";
		
		} // end while  
		$sView .= "</table>";
		return $sView;
	}
	
	public function networkView()
	{
		$initial = $this->queryBuilder($this->_totalValue, self::NETWORKTAB, $this->_colm);
		$sView = "<table id='viewtab'>";
			$sView .= "<tr>";
			$sView .= "<th id='inhdrid'>ID</th>";
			$sView .= "<th id='inner_head'>Name</th>";
			$sView .= "<th id='inner_head'>Enter By</th>";
			$sView .= "<th id='inhdrid'>Action</th>";
			$sView .= "</tr>";
		while($view = mysqli_fetch_array($initial, MYSQLI_NUM)) {
			
			$sView .= "<tr>";
			$sView .= "<td id='inrid'>".$view[1]."</td>";
			$sView .= "<td id='inner'>".$view[2]."</td>";
	
			$sView .= "<td id='inner'>".$view[6]."</td>";
			$sView .= "<td id='inrid'><a href='".$_SERVER['PHP_SELF']."?confirmdelete=".$this->encrypt($view[4]."::network")."' title='Delete Entry'><div id='delelte'></div></a>
			<a href='".$_SERVER['PHP_SELF']."?ntwuqk=".$this->encrypt($view[4])."&ntwrkfrk=".$this->encrypt($view[5])."' title='Edit Entry'><div id='entedit'></div></a> </td>";
			$sView .= "</tr>";
		
		} // end while  
		$sView .= "</table>";
		return $sView;
	}
	
	public function adminView()
	{
		$initial = $this->queryBuilder($this->_totalValue, self::ADMINSTAB, $this->_colm);
		$sView = "<table id='viewtab'>";
			$sView .= "<tr>";
			$sView .= "<th id='inhdrid'>ID</th>";
			$sView .= "<th id='inner_head'>User / ID</th>";
			$sView .= "<th id='inner_head'>Password</th>";
			$sView .= "<th id='inner_head'>IP</th>";
			$sView .= "<th id='inner_head'>Create By</th>";
			$sView .= "<th id='inhdrid'>Action</th>";
			$sView .= "</tr>";
		while($view = mysqli_fetch_array($initial, MYSQLI_NUM)) {
			
			$sView .= "<tr>";
			$sView .= "<td id='inrid'>".$view[1]."</td>";
			$sView .= "<td id='inner'>".$view[2]."</td>";
	
			$sView .= "<td id='inner'>".$view[3]."</td>";
			$sView .= "<td id='inner'>".$view[4]."</td>";
		
			$sView .= "<td id='inner'>".$view[8]."</td>";
			$sView .= "<td id='inrid'><a href='".$_SERVER['PHP_SELF']."?confirmdelete=".$this->encrypt($view[6]."::admin")."' title='Delete Entry'><div id='delelte'></div></a>
			<a href='".$_SERVER['PHP_SELF']."?ad_mnusuqk=".$this->encrypt($view[6])."&amnsfrk=".$this->encrypt($view[7])."' title='Edit Entry'><div id='entedit'></div></a> </td>";
			$sView .= "</tr>";
		
		} // end while  
		$sView .= "</table>";
		return $sView;
	}
	
	
		
	public function encrypt($code)
	{
		$code = base64_encode(base64_encode($code));
		return $code;
	} 
	public function decrypt($code)
	{
		$code = base64_decode(base64_decode($code));
		return $code;
	} 
	private function CommonHeyStack($heystack)
	{
		$this->commonHeystack = array("_unk_ky" => $heystack);
		return $this->commonHeystack;
	}
//$needle = array("netwk_nam", "_frgn_ky");
//$tb = "copn_netwrk";
//$heystack = ''; 

	
	public function process($item)
	{
		$this->_item = $this->decrypt($item);
		if(isset($this->_item) && $this->_item != '') {
			
			list($itemcode, $tablename) = explode("::", $this->_item);
			//check existance
			
			$num = $this->queryBuilder($this->_ukey, $this->gettab($tablename), $this->CommonHeyStack($itemcode));
				if(mysqli_num_rows($num) != 0) {
				
				$query = "DELETE FROM ".$this->gettab($tablename)." WHERE ".self::UKEY." = '".$itemcode."' LIMIT 1";
				$result = mysqli_query($this->connt(), $query) or die(mysqli_error($this->connt()));
				return "<ul><p style='color:#ff0000;'>Entry Deleted</p></ul>";
				}else{
				return "<ul><p style='color:#ff0000;'>Record Does Not Exist / Already Deleted</p></ul>";
				}
	
		}else{
			return "Error In Deletion ";
				//echo $this->get();
		}
		
	}
	
	public function gettab($name)
	{
		if(isset($name) && $name == "store"){
			$tab = self::STORETAB;
		}elseif(isset($name) && $name == "coupons") {
			$tab = self::COUPONTAB;
		}elseif(isset($name) && $name == "category") {
			$tab = self::CATETAB;
		}elseif(isset($name) && $name == "network") {
			$tab = self::NETWORKTAB;
		}elseif(isset($name) && $name == "admin") {
			$tab = self::ADMINSTAB;
		}
		return $tab;
	}
	
	/* front end */  
	public function viewNeedle($needle, $match)
	{
		//if($match == '') { $match = stripslashes($match); }
		//$col = array();
		if($needle != '' && is_string($needle) && $needle == "featured"){
			$col = array(self::FEATURED_C => $match);
			return $col;
			
		}elseif($needle != '' && is_string($needle) && $needle == "code"){
			$col = array(self::CODE_C => $match);
			return $col;
			
		}elseif($needle != '' && is_string($needle) && $needle == "deals"){
			$col = array(self::DEALS_C => $match);
			return $col;
		}elseif($needle != '' && is_string($needle) && $needle == "christmas"){
			$col = array(self::CHRISTMAS_C => $match);
			return $col;
		}elseif($needle != '' && is_string($needle) && $needle == "freeship"){
			$col = array(self::FREESHIP_C => $match);
			return $col;
		}elseif($needle != '' && is_string($needle) && $needle == "store"){
			$col = array(self::STORELINKNAME => $match);
			return $col;
		}elseif($needle != '' && is_string($needle) && $needle == "coupon_category"){
			$col = array(self::TABCATEFIELD => $match);
			return $col;
		}
		
	} 
	
	public function viewPath()
	{
			if($_SERVER['REQUEST_URI'] == "/"){
			$basepath = "";
			$index_path = '';
			return $basepath;
			}else{
			$basepath = "../";
			$index_path = "../";
			return $basepath;
			}
	}

	
	private function offerType($offer)
	{
			if($offer == 'ACTIVATE COUPON'){
			$ctyp = ""; //Deal
			}else{
			$ctyp = ""; //Code
			}
		return $ctyp;
	
	}
	
private function savingTypes($type, $offers)
	{
		$typearray = array("5%", "10%", "15%", "20%", "25%", "30%", "35%", "40%", "45%", "50%", "55%", "60%", "65%", "70%", "75%", "80%", "85%", "90%", "95%", 
						"$5", "$10", "$15", "$20", "$25", "$30", "$35", "$40", "$45", "$50", "$55", "$60", "$65",  "$65", "$70", "$75", "$80", "$85", "$90", "$95", "$100", "$150", "$200", "$250", "$300", "£5", "£10", "£15", "£20", "£25", "£30", "£35", "£40", "£45", "£50", "£55", "£60", "£65", "£70", "£75", "£80", "£85", "£90", "£95", "£100", "£200", "£300", "£400"); 
		$typeship = array("Free Shipping", "Sign up", "Special Offer", "Free Sample", "Free Gift");
		$typeoffers = array("Flat Rate-Shipping", "Buy one-Get 1 Free", "Buy one-Get 50%");
		if(in_array($type, $typeship)){
			list($first, $second) = explode(" ", $type);
					$logoView = "<div id='comn_text_freshp'>";
					$logoView .= "<div id='top_text_freshp'>";
					$logoView .= strtoupper($first)." <b>".strtoupper($second)."</b>";
						//$logoView .= "<div id='tt_inner'>";
						
						//$logoView .= "</div>";
					$logoView .= "</div>";
					
					$logoView .= "<div id='botom_text_freshp'>";
						$logoView .= $this->offerType($offers);
					$logoView .= "</div>";
				
					$logoView .= "</div>";
					
		}elseif(in_array($type, $typearray)){
		
				if($this->offerType($offers) == "Deal") 
				{
					$comn_text = "comn_text_block";
					$top_text = "top_text_block";
					$botom_text = "botom_text_block";
				}else{
					$comn_text = "comn_text_deal";
					$top_text = "top_text_deal";
					$botom_text = "botom_text_deal";
				}
					$logoView = "<div id='".$comn_text."'>";
					$logoView .= "<div id='".$top_text."'>";
					$logoView .= "<b> ".$type." Off</b>";
						//$logoView .= "<div id='tt_inner'>";
						
						//$logoView .= "</div>";
					$logoView .= "</div>";
					
					$logoView .= "<div id='".$botom_text."'>";
						$logoView .= $this->offerType($offers);
					$logoView .= "</div>";
				
					$logoView .= "</div>";
		}elseif(in_array($type, $typeoffers)){
		
				list($ftext, $stext) = explode("-", $type);
					$logoView = "<div id='comn_text_fltrshp'>";
					$logoView .= "<div id='top_text_fltrshp'>";
					$logoView .= strtoupper($ftext)." <b>".strtoupper($stext)."</b>";
						//$logoView .= "<div id='tt_inner'>";
						
						//$logoView .= "</div>";
					$logoView .= "</div>";
					
					$logoView .= "<div id='botom_text_fltrshp'>";
						$logoView .= $this->offerType($offers);
					$logoView .= "</div>";
				
					$logoView .= "</div>";
		
		}else{
				
			if($this->offerType($offers) == "Deal") 
				{
					$temp_promo = "Promo";
					$temp_code = ""; // Deal
					$comn_text = "comn_text_block";
					$top_text = "top_text_block";
					$botom_text = "botom_text_block";
				}else{
					$temp_promo = "Promo";
					$temp_code = ""; // Code
					$comn_text = "comn_text_deal";
					$top_text = "top_text_deal";
					$botom_text = "botom_text_deal";
				}
					$logoView = "<div id='".$comn_text."'>";
					$logoView .= "<div id='".$top_text."'>";
					$logoView .= $temp_promo." <b>".$temp_code."</b>";
						//$logoView .= "<div id='tt_inner'>";
						
						//$logoView .= "</div>";
					$logoView .= "</div>";
					
					$logoView .= "<div id='".$botom_text."'>";
						$logoView .= $this->offerType($offers);
					$logoView .= "</div>";
				
					$logoView .= "</div>";
			
				
		} // end if
				
		return $logoView;
	
	
	} // end method
public function heading($color, $text){
		$hds = '';
        	$hds .= "<div class='col-sm-12'>";
            $hds .= "<div class='row well ".$color." white text-left'>";
            $hds .= "<h3>";
       		$hds .= $text;
			$hds .= "</h3>";
        	$hds .= "</div>";
        	$hds .= "</div>";
		return $hds;
			
}

////#############################################--START--#################################################
////#######################################################################################################
////#######################################################################################################





////#######################################################################################################
////#######################################################################################################


public function viewCouponLoop($needle, $match)
	{
		$this->_vNeedle = $needle;
		$init= $this->queryBuilderBySort($this->_totalValue, self::COUPONTAB, $this->viewNeedle($this->_vNeedle, $match), self::SORTFIELD);
		$cpnView = '';
	 	//$cpnView .= "<div class='col-sm-12 white text-left' style='background:#cf0;'>";     			
	while($coupon = mysqli_fetch_array($init, MYSQLI_NUM))
	{
		
			
	if($coupon[14] == "Never Expire"){

			
	
		
						//$cpnView .= "<div id='exclus_cod'></div>"; 
				if($_SERVER['REQUEST_URI'] == "/".$this->_storePath.$this->sUrl($match)){
				// show nothing
				$logoView = $this->savingTypes($coupon[24], $coupon[10]);
				$nameView = '';
				}else{
			
	$logoView = "<a href='".$this->viewPath().$this->sUrl($coupon[17])."'><img src='".$this->_imgPath.$coupon[9]."' class='img-thumbnail norad' /></a>";
		
	$nameView = "<a href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'>".$coupon[17]." Coupons</a>";
				} // if
				
			$cpnView .= $logoView;
		
				// end 1st wrp
		// 2nd wrp
		$cpnView .= "<div class='col-sm-7'>";
		
				//$cpnView .= $nameView;
			//$cpnView .= "<div id='".$texttitleblock."'>";
			if($coupon[10] == 'ACTIVATE COUPON'){
			$ctyp = "Promotional";
			}else{
			$ctyp = "Coupon Code";
			}
			//$cpnView .= $ctyp;
			//$cpnView .= "Valid Till: ".$coupon[14];

			$cpnView .= "<span class='heading'>".$this->subText($coupon[2], 100)."</span>";
			
		
								
			$cpnView .= "<i style='color:#333;font-size:16px;'>".$this->subText($coupon[8], 150)."</i><br /><br />";
						//$cpnView .= "<div id='coupon_expirey'>";
							
							//$cpnView .= "<div id='edate_btm_inner'>";
							//$cpnView .= $coupon[14];
							//$cpnView .= "</div>";
						//$cpnView .= "</div>";
						$cpnView .= "<span style='color:#4caf50;'>Acceptable Till: ".$coupon[14]."</span>";
		$cpnView .= "</div>";
		//$cpnView .= "</div>";
		// 2nd wrp				
		// 3rd wrp
						
				
			
		
	
			if($coupon[10] == 'ACTIVATE COUPON'){
				//$cpnView .= "<a href='".$coupon[12]."' class='address' target='_blank' id='".$coupon[19]."'><div id='getcodetext' style='position:relative; margin-left:0px;'>Get Deal</div></a>";
			
			
			$cpnView .= "<a href='".$coupon[12]."' target='_blank' class='btn btn-info getcode noborder vclick' data-placement='top' title='Click To Copy or Open Site' data-toggle='modal' data-target='#".$coupon[19]."' id='".$coupon[19]."'>Get Deal & Visit Site</a><br><br>";
              		
					
			}else{
			//$cpnView .= "<div class='ss' id='getcodetext' style='position:absolute;'>Reveal Code</div>
		
			//<a href='".$coupon[12]."' class='address' target='_blank' id='".$coupon[19]."'><div class='getcodeblock' id='cc'>".$coupon[10]."</div></a>";
			
$cpnView .= "<a href='".$coupon[12]."' target='_blank' class='getcopcode btn btn-success getcode noborder vclick'  data-clipboard-action='copy' data-clipboard-target='#cdc".$coupon[19]."' id='".$coupon[19]."'>
    Get Code & Visit Site
</a>";
              $cpnView .= "<div class='code-back' style='background:#e5e5e5;' id='cdc".$coupon[19]."'>".$coupon[10]."</div><br><br>";
			} 
			
			
						
		
						$cpnView .= "<a href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'>".$coupon[17]." Coupons</a>";
						$cpnView .= "Used ".$coupon[23]." times";
						
						
			//$cpnView .= "</div>";
			
			/*
				$cpnView .= "<div id='cpn_rating'>";
					$net_vote = $coupon[21] - $coupon[22];
				$cpnView .= "<div class='thumb_text'><span class='vote_buttons' id='vote_buttons".$coupon[19]."'>";
				$cpnView .= "<a href='javascript:;' class='vote_up' id='".$coupon[19]."'></a>";
				$cpnView .= "<a href='javascript:;' class='vote_down' id='".$coupon[19]."'></a>";
				$cpnView .= "</span>";
				$cpnView .= "<span class='votes_count' id='votes_count".$coupon[19]."'><div style='font-size:15px; text-align:center; color:#00CCFF;'>".$net_vote."<br /><i style='font-size:13px; color:#E5E5E5; text-align:center;'>Rate It</i></div> </span></div>";
				$cpnView .= "</div>";
			*/
			//$cpnView .= "<div id='cpn_descp'>";
					//$cpnView .= "<div id='edate_head'>Clicked: ".$coupon[23]."</div>";
			//$cpnView .= "</div>";
			
		
					
 

	
	//
			//$cpnView .= $this->cDialog($coupon[19], $coupon[8], $coupon[9]);
##$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$////////////////////  
			}else{
	
		

	$cpnView .= "<div class='card mt-3'  >";
			
			
if($_SERVER['REQUEST_URI'] == "/".$this->_storePath.$this->sUrl($match)){
$logoView = "<div class='card'><div class='card-body'>";	
$logoView .= "<h2 class='card-title text-center text-info sh1'>".$this->savingTypes($coupon[24], $coupon[10])."</h2>";
$logoView .= "</div></div>";
	$browsall = '';
	$nameView = '';
	$col_sm = "col-sm-4";
}else{
		$logoView = '';
		$browsall = "<a class='card-link text-success' href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'>See All Offers</a>";
		$col_sm = "col-sm-8";
} // end if
			//$cpnView .= $logoView;
			
			
				// end 1st wrp
		// 2nd wrp
		
			
		if($coupon[10] == 'ACTIVATE COUPON'){
			$ctyp = "Deal";
		}else{
			$ctyp = "Code";
		}
		$cpnView .= "<div class='card-body'>";
			$cpnView .= "<div class='col-sm-2 text-left d-inline-block'><a href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'><img class='img-fluid' src='".$this->_imgPath.$coupon[9]."' width='165' height='125'/></a></div>";
			
		//$cpnView .= "<div class='text-left text-danger'>".$ctyp."</div>";
	//$cpnView .= "Valid Till: ".$coupon[14];
	$cpnView .= "<div class='".$col_sm." text-left d-inline-block'>";
	$cpnView .= "<h3 class='card-title text-left'>".$this->savingTypes($coupon[24], $coupon[10])."</h3>";
	$cpnView .= "<h4 class='coff text-danger'>".$this->subText($coupon[2], 100)."</h4>";
		$cpnView .= $browsall;
	$cpnView .= "<span class='glyphicon glyphicon-time'></span><span class='text-info'> ".$coupon[14]."</span>";
	$cpnView .= "<span class='fa fa-eye mlft'></span><span class='text-danger'> ".$coupon[23]."</span>";
	 // vote count
	$net_vote = $coupon[21] - $coupon[22];	
$cpnView .= "<span class='vote_buttons mlft' id='vote_buttons".$coupon[19]."'><a href='#' id='".$coupon[19]."' class='vote_up fa fa-check'></a></span>
		<span class='votes_count' id='votes_count".$coupon[19]."'> ".$net_vote."</span><br>";
		

	$cpnView .= "</div>"; // end sm-10
	
	$cpnView .= "<div class='col-sm-2 text-left d-inline-block'><br>";
	if($coupon[10] == 'ACTIVATE COUPON'){
				//$cpnView .= "<a href='".$coupon[12]."' class='address' target='_blank' id='".$coupon[19]."'><div id='getcodetext' style='position:relative; margin-left:0px;'>Activate Coupon</div></a>";
			
			$cpnView .= "<a href='".$coupon[12]."' target='_blank' class='btn btn-primary btn-lg rounded-0 noborder vclick' data-placement='top' title='Click To View Deal' id='".$coupon[19]."' data-toggle='tooltip'>View Deal</a>";
              		
					
			}else{
			//$cpnView .= "<div class='ss' id='getcodetext' style='position:absolute;'>Reveal Code</div>
		
			//<a href='".$coupon[12]."' class='address' target='_blank' id='".$coupon[19]."'><div class='getcodeblock' id='cc'>".$coupon[10]."</div></a>";
						$cpnView .= "<a href='' class='btn-light btn-lg' style=background:#d6d6d6;position:absolute;' id='doli".$coupon[19]."'>".$coupon[10]."</a>";
						
$cpnView .= "<a href='".$coupon[12]."'class='makcopoocodxis btn btn-primary btn-lg rounded-0 getcode vclick'  data-clipboard-action='copy' data-clipboard-target='#doli".$coupon[19]."' id='".$coupon[19]."' data-toggle='tooltip' title='Click To Copy Code' target='_blank' style='z-index:8759;position: relative;'>
  Copy Code
</a>";
		} 
			
		$cpnView .= "</div>";
				
	$cpnView .= "</div>";
	
		//$cpnView .= "</div>";
		// end 2nd wrp
		
		$net_vote = $coupon[21] - $coupon[22]; // vote count	
	//$cpnView .= "<div class='card-footer bg-light'>";
	//$cpnView .= "<details class='curs'><br><div class='text-dark'>".$this->subText($coupon[8], 450)."</div></details>";
	//$cpnView .= "</div>";

	
	
	$cpnView .= "</div>"; // outer col-4

	
				//}else{

				//}
	
					
			} // 1st f 
			//$cpnView .= $this->cDialog($coupon[19], $coupon[8], $coupon[9]);
		} // end whil
//$cpnView .= "</div>";
	return $cpnView;
	} // end class
////#######################################################################################################
////#######################################################################################################
////#######################################################################################################
////#######################################################################################################
////#######################################################################################################


	
////#######################################################################################################
////#######################################################################################################


public function viewCouponLoop3($needle, $match)
	{
	
		$this->_vNeedle = $needle;
		$init= $this->queryBuilderBySort($this->_totalValue, self::COUPONTAB, $this->viewNeedle($this->_vNeedle, $match), self::SORTFIELD);
		$cpnView = '';
	 	//$cpnView .= "<div class='col-sm-12 white text-left' style='background:#cf0;'>";     			
	while($coupon = mysqli_fetch_array($init, MYSQLI_NUM))
	{
		
			
	if($coupon[14] == "Never Expire"){

			
	
		
						//$cpnView .= "<div id='exclus_cod'></div>"; 
				if($_SERVER['REQUEST_URI'] == "/".$this->_storePath.$this->sUrl($match)){
				// show nothing
				$logoView = $this->savingTypes($coupon[24], $coupon[10]);
				$nameView = '';
				}else{
			
	$logoView = "<a href='".$this->viewPath().$this->sUrl($coupon[17])."'><img src='".$this->_imgPath.$coupon[9]."' class='img-thumbnail norad' /></a>";
		
	$nameView = "<a href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'>".$coupon[17]." Coupons</a>";
				} // if
				
			$cpnView .= $logoView;
		
				// end 1st wrp
		// 2nd wrp
		$cpnView .= "<div class='col-sm-7'>";
		
				//$cpnView .= $nameView;
			//$cpnView .= "<div id='".$texttitleblock."'>";
			if($coupon[10] == 'ACTIVATE COUPON'){
			$ctyp = "Promotional";
			}else{
			$ctyp = "Coupon Code";
			}
			//$cpnView .= $ctyp;
			//$cpnView .= "Valid Till: ".$coupon[14];

			$cpnView .= "<span class='heading'>".$this->subText($coupon[2], 100)."</span>";
			
		
								
			$cpnView .= "<i style='color:#333;font-size:16px;'>".$this->subText($coupon[8], 150)."</i><br /><br />";
						//$cpnView .= "<div id='coupon_expirey'>";
							
							//$cpnView .= "<div id='edate_btm_inner'>";
							//$cpnView .= $coupon[14];
							//$cpnView .= "</div>";
						//$cpnView .= "</div>";
						$cpnView .= "<span style='color:#4caf50;'>Acceptable Till: ".$coupon[14]."</span>";
		$cpnView .= "</div>";
		//$cpnView .= "</div>";
		// 2nd wrp				
		// 3rd wrp
						
				
			
		
	
			if($coupon[10] == 'ACTIVATE COUPON'){
				//$cpnView .= "<a href='".$coupon[12]."' class='address' target='_blank' id='".$coupon[19]."'><div id='getcodetext' style='position:relative; margin-left:0px;'>Get Deal</div></a>";
			
			
			$cpnView .= "<a href='".$coupon[12]."' target='_blank' class='btn btn-info getcode noborder vclick' data-placement='top' title='Click To Copy or Open Site' data-toggle='modal' data-target='#".$coupon[19]."' id='".$coupon[19]."'>Get Deal & Visit Site</a><br><br>";
              		
					
			}else{
			//$cpnView .= "<div class='ss' id='getcodetext' style='position:absolute;'>Reveal Code</div>
		
			//<a href='".$coupon[12]."' class='address' target='_blank' id='".$coupon[19]."'><div class='getcodeblock' id='cc'>".$coupon[10]."</div></a>";
			
$cpnView .= "<a href='".$coupon[12]."' target='_blank' class='getcopcode btn btn-success getcode noborder vclick'  data-clipboard-action='copy' data-clipboard-target='#cdc".$coupon[19]."' id='".$coupon[19]."'>
    Get Code & Visit Site
</a>";
              $cpnView .= "<div class='code-back' style='background:#e5e5e5;' id='cdc".$coupon[19]."'>".$coupon[10]."</div><br><br>";
			} 
			
			
						
		
						$cpnView .= "<a href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'>".$coupon[17]." Coupons</a>";
						$cpnView .= "Used ".$coupon[23]." times";
						
						
			//$cpnView .= "</div>";
			
			/*
				$cpnView .= "<div id='cpn_rating'>";
					$net_vote = $coupon[21] - $coupon[22];
				$cpnView .= "<div class='thumb_text'><span class='vote_buttons' id='vote_buttons".$coupon[19]."'>";
				$cpnView .= "<a href='javascript:;' class='vote_up' id='".$coupon[19]."'></a>";
				$cpnView .= "<a href='javascript:;' class='vote_down' id='".$coupon[19]."'></a>";
				$cpnView .= "</span>";
				$cpnView .= "<span class='votes_count' id='votes_count".$coupon[19]."'><div style='font-size:15px; text-align:center; color:#00CCFF;'>".$net_vote."<br /><i style='font-size:13px; color:#E5E5E5; text-align:center;'>Rate It</i></div> </span></div>";
				$cpnView .= "</div>";
			*/
			//$cpnView .= "<div id='cpn_descp'>";
					//$cpnView .= "<div id='edate_head'>Clicked: ".$coupon[23]."</div>";
			//$cpnView .= "</div>";
			
		
					
 

	
	//
			//$cpnView .= $this->cDialog($coupon[19], $coupon[8], $coupon[9]);
##$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$////////////////////  
			}else{
	
		

	$cpnView .= "<div class='card mt-4 col-sm-4 d-inline-block align-top' style='border: 1px solid #f8f7fa; background-color: #f8f7fa;'>";
			
			
if($_SERVER['REQUEST_URI'] == "/".$this->_storePath.$this->sUrl($match)){
$logoView = "<div class='card'><div class='card-body'>";	
$logoView .= "<h2 class='card-title text-center text-info sh1'>".$this->savingTypes($coupon[24], $coupon[10])."</h2>";
$logoView .= "</div></div>";
	$browsall = '';
	$nameView = '';
	$col_sm = "col-sm-4";
}else{
		$logoView = '';
		$browsall = "<a class='card-link text-success' href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'>View  Detial</a>";
		$col_sm = "col-sm-8";
} // end if
			//$cpnView .= $logoView;
			
			
				// end 1st wrp
		// 2nd wrp
		
			
		if($coupon[10] == 'ACTIVATE COUPON'){
			$ctyp = "Deal";
		}else{
			$ctyp = "Code";
		}
		$cpnView .= "<div class='card-body p-0 m-0 bg-white' style='border:1px solid #f8f7fa; border-radius: 25px; height: 320px;'>";
			//$cpnView .= "<div class='col-sm-12 text-center '><a href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'><img class='img-fluid' src='".$this->_imgPath.$coupon[9]."' width='165' height='125'/></a></div>";
			

			//$cpnView .= "<div class='col-sm-6 text-center text-white mb-3 ' style='padding: 0px; margin: 0px; background-color:#000;'>".$ctyp."</div>";
			//$cpnView .= "<div class='col-sm-5 m-auto bg-none text-center pt-3 pb-4' style='height:70px;'><a href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'><img class='img-fluid' src='".$this->_imgPath.$coupon[9]."' width='165' height='175' style='height: 100px; background-color: #f3f2f2; border-top-right-radius:95px; border-top-left-radius:95px;  border-bottom-right-radius:95px;  border-bottom-left-radius:95px; text-align:center; border:1px solid #f3f2f2;'/></a></div>";
			
	
	
	$cpnView .= "<div class='col-sm-12 text-left' style=''>";
	$cpnView .= "<div class='row'>";
	$cpnView .= "<div class='col-8 mt-4 p-0 bg-none'>";
	$cpnView .= "<h4 class='card-title text-center pt-4' style='font-size: 23px; color:#ff03b2;' ><font face='Abel'>".$this->savingTypes($coupon[24], $coupon[10])."</font></h4>";
	
	// $cpnView .= "<b class='text-left p-3' style='font-size: 25px; color:#ff03b2; '><font face='Abel'>";
	// $cpnView .= "Voucher";
//	$cpnView .= "</font></b>";
	$cpnView .= "</div>";//col-8 end
	
		$cpnView .= "<div class='col-3' style='height: 110px; background-color: #8855fa; 
     clip-path: polygon(0% 0%, 100% 0%, 100% 100%,50% 75%, 0% 100%);'>";
     	$cpnView .= "<div class='col-sm-12 text-left pt-4 mb-3 m-auto ' style='padding: 0px; margin: 0px; color: #fff; font-size: 18px;'><b>".$ctyp."</b></div>";
	  // $cpnView .= "<h4 class='card-title text-center pt-4 text-white' style='font-size: 23px;' ><font face='Abel'>".$this->savingTypes($coupon[24], $coupon[10])."</font></h4>";
	$cpnView .= "</div>";//col-4 end
	
    $cpnView .= "</div>";//row end
	//$cpnView .= "<h2 class='card-title text-center pt-1 text-dark' >".$this->savingTypes($coupon[24], $coupon[10])."</h2>";
	//$cpnView .= "<h3 class='card-title text-left'>".$this->savingTypes($coupon[24], $coupon[10])."</h3>";
	//$cpnView .= "<div class='col-sm-6 text-center  mb-3 m-auto ' style='padding: 0px; margin: 0px; color: #b5b5b5;'><b>".$ctyp."</b></div>";
//	$cpnView .= "<h3 class='col-sm-12 mt-4 text-dark text-left bg-none p-1' style=' font-size: 22px; line-height: 25px; 'href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."' style='color: #000;'><b><font face='Abel'>".ucwords($coupon[17])."</font></b></a>"."</h3>";
    $cpnView .="<div class='col-sm-12  mt-2'>";
	$cpnView .= "<a class=' p-0 m-0' style='font-size:20px; color: #000; text-decoration: none;' href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'><b><font face='Abel'>".ucwords($coupon[17])."</font></b></a></br>";
	$cpnView .= "</div>";
	$cpnView .= "<h3 class='col-sm-12 mt-2 text-dark text-left bg-none p-1' style=' font-size: 17px; line-height: 25px; height: 70px;'>".ucwords($this->subText($coupon[2], 100))."</h3>";
//	$cpnView .= "<div class='col-sm-12 text-left  mb-3 m-auto ' style='padding: 0px; margin: 0px; color: #b5b5b5;'><b>".$ctyp."</b></div>";
		// $cpnView .= "<a class='text-left p-3 mt-3' style='font-size:20px; color: #000;' href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'><b><font face='Abel'>".ucwords($coupon[17])."</font></b></a></br>";
	//$cpnView .= "<h4 class='card-title text-center pt-3 text-danger' >".$this->savingTypes($coupon[24], $coupon[10])."</h4>";
	//$cpnView .= "<p class='text-center' style='font-size:14px; color: #f7dd3b;'>"."Expire on: ".$coupon[14]."</p>";

	// $cpnView .= "<a class='text-left text-danger p-1' style='font-size:16px;' href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'><b>".$coupon[17]."</b></a>";
	//$cpnView .="<hr>";
	//$cpnView .= "<p class='coff text-dark' style='font-size:16px;'>".$this->subText($coupon[2], 100)."</p>";
	
	//$cpnView .= "<span class='glyphicon glyphicon-time'></span><span class='text-info'> ".$coupon[14]."</span>";
	//$cpnView .= "<span class='fa fa-eye mlft'></span><span class='text-danger'> ".$coupon[23]."</span>";
	 // vote count
//	$net_vote = $coupon[21] - $coupon[22];	
//$cpnView .= "<span class='vote_buttons mlft' id='vote_buttons".$coupon[19]."'><a href='#' id='".$coupon[19]."' class='vote_up fa fa-check'></a></span>
	//	<span class='votes_count' id='votes_count".$coupon[19]."'> ".$net_vote."</span><br>";
		

	$cpnView .= "</div>"; // end sm-10
	

	$cpnView .= "<div class='col-sm-12 text-center pb-3' style=''><br>";
	if($coupon[10] == 'ACTIVATE COUPON'){
				//$cpnView .= "<a href='".$coupon[12]."' class='address' target='_blank' id='".$coupon[19]."'><div id='getcodetext' style='position:relative; margin-left:0px;'>Activate Coupon</div></a>";
			
			$cpnView .= "<a href='".$coupon[12]."' target='_blank' class='btn btn-warning btn-lg col-sm-12   vclick' data-placement='top' title='Click To View Deal' id='".$coupon[19]."' data-toggle='tooltip' style='font-size:14px; border-radius: 30px; border:1px solid #9c27b0;  border: #9c27b0; color: #fff; background-image: linear-gradient(to right, #8855fa , #ff65c3);'>View Deal</a>";
              		
					
			}else{
			//$cpnView .= "<div class='ss' id='getcodetext' style='position:absolute;'>Reveal Code</div>
		
			//<a href='".$coupon[12]."' class='address' target='_blank' id='".$coupon[19]."'><div class='getcodeblock' id='cc'>".$coupon[10]."</div></a>";
						$cpnView .= "<a href='' class='btn-light btn-lg ' style=background:#fff;position:absolute;' id='doli".$coupon[19]."'>".$coupon[10]."</a>";
						
$cpnView .= "<a href='".$coupon[12]."'class='makcopoocodxis btn btn-warning btn-lg col-sm-12 getcode vclick'  data-clipboard-action='copy' data-clipboard-target='#doli".$coupon[19]."' id='".$coupon[19]."' data-toggle='tooltip' title='Click To Copy Code' target='_blank' style='z-index:8759;position: relative; border-radius: 30px; font-size:14px;  border:#9c27b0; color:#fff; background-image: linear-gradient(to right, #8855fa , #ff65c3);'>
  Copy Code
</a>";
		} 
			
		$cpnView .= "</div>";
				
	$cpnView .= "</div>";
	
		//$cpnView .= "</div>";
		// end 2nd wrp
		
		$net_vote = $coupon[21] - $coupon[22]; // vote count	
	//$cpnView .= "<div class='card-footer bg-light'>";
	//$cpnView .= "<details class='curs'><br><div class='text-dark'>".$this->subText($coupon[8], 450)."</div></details>";
	//$cpnView .= "</div>";

	
	
	$cpnView .= "</div>"; // outer col-4

	
				//}else{

				//}
	
					
			} // 1st f 
			//$cpnView .= $this->cDialog($coupon[19], $coupon[8], $coupon[9]);
		} // end whil
//$cpnView .= "</div>";
	return $cpnView;
	} // end class
////#######################################################################################################
////#######################################################################################################
////#######################################################################################################
////#######################################################################################################
////#######################################################################################################
////#######################################################################################################
	
	
public function getCouponView($needle, $match)
	{


		$this->_vNeedle = $needle;
		$init= $this->queryBuilderBySort($this->_totalValue, self::COUPONTAB, $this->viewNeedle($this->_vNeedle, $match), self::SORTFIELD);
		$cpnView = '';
	 	//$cpnView .= "<div class='col-sm-12 white text-left' style='background:#cf0;'>";     			
	while($coupon = mysqli_fetch_array($init, MYSQLI_NUM))
	{
		
			
	if($coupon[14] == "Never Expire"){
		$cpnView .= "<div class='col-sm-12 space white'>";
		
		  $cpnView .= "<div class='col-sm-2 text-center noboxshadow'>";
			
	
		
						//$cpnView .= "<div id='exclus_cod'></div>"; 
				if($_SERVER['REQUEST_URI'] == "/".$this->_storePath.$this->sUrl($match)){
				// show nothing
				$logoView = $this->savingTypes($coupon[24], $coupon[10]);
				$nameView = '';
				}else{
			
	$logoView = "<a href='".$this->viewPath().$this->sUrl($coupon[17])."'><img src='".$this->_imgPath.$coupon[9]."' class='img-thumbnail norad' /></a>";
		
	$nameView = "<a href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'>".$coupon[17]." Coupons</a>";
				} // if
				
			$cpnView .= $logoView;
				$cpnView .= "</div>";
				// end 1st wrp
		// 2nd wrp
		$cpnView .= "<div class='col-sm-7'>";
		
				//$cpnView .= $nameView;
			//$cpnView .= "<div id='".$texttitleblock."'>";
			if($coupon[10] == 'ACTIVATE COUPON'){
			$ctyp = "Promotional";
			}else{
			$ctyp = "Coupon Code";
			}
			//$cpnView .= $ctyp;
			//$cpnView .= "Valid Till: ".$coupon[14];

			$cpnView .= "<span class='heading'>".$this->subText($coupon[2], 100)."</span>";
			
		
								
			$cpnView .= "<i style='color:#333;font-size:16px;'>".$this->subText($coupon[8], 150)."</i><br /><br />";
						//$cpnView .= "<div id='coupon_expirey'>";
							
							//$cpnView .= "<div id='edate_btm_inner'>";
							//$cpnView .= $coupon[14];
							//$cpnView .= "</div>";
						//$cpnView .= "</div>";
						$cpnView .= "<span style='color:#4caf50;'>Acceptable Till: ".$coupon[14]."</span>";
		$cpnView .= "</div>";
		//$cpnView .= "</div>";
		// 2nd wrp				
		// 3rd wrp
		$cpnView .= "<div class='col-sm-3 well-lg text-center noboxshadow'>";						
				
			
		
	
			if($coupon[10] == 'ACTIVATE COUPON'){
				//$cpnView .= "<a href='".$coupon[12]."' class='address' target='_blank' id='".$coupon[19]."'><div id='getcodetext' style='position:relative; margin-left:0px;'>Get Deal</div></a>";
			
			
			$cpnView .= "<a href='".$coupon[12]."' target='_blank' class='btn btn-info getcode noborder vclick' data-placement='top' title='Click To Copy or Open Site' data-toggle='modal' data-target='#".$coupon[19]."' id='".$coupon[19]."'>Get Deal & Visit Site</a><br><br>";
              		
					
			}else{
			//$cpnView .= "<div class='ss' id='getcodetext' style='position:absolute;'>Reveal Code</div>
		
			//<a href='".$coupon[12]."' class='address' target='_blank' id='".$coupon[19]."'><div class='getcodeblock' id='cc'>".$coupon[10]."</div></a>";
			
$cpnView .= "<a href='".$coupon[12]."' target='_blank' class='getcopcode btn btn-success getcode noborder vclick'  data-clipboard-action='copy' data-clipboard-target='#cdc".$coupon[19]."' id='".$coupon[19]."'>
    Get Code & Visit Site
</a>";
              $cpnView .= "<div class='code-back' style='background:#e5e5e5;' id='cdc".$coupon[19]."'>".$coupon[10]."</div><br><br>";
			} 
			
			
						
		
						$cpnView .= "<a href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'>".$coupon[17]." Coupons</a>";
						$cpnView .= "Used ".$coupon[23]." times";
						
						
			//$cpnView .= "</div>";
			
			/*
				$cpnView .= "<div id='cpn_rating'>";
					$net_vote = $coupon[21] - $coupon[22];
				$cpnView .= "<div class='thumb_text'><span class='vote_buttons' id='vote_buttons".$coupon[19]."'>";
				$cpnView .= "<a href='javascript:;' class='vote_up' id='".$coupon[19]."'></a>";
				$cpnView .= "<a href='javascript:;' class='vote_down' id='".$coupon[19]."'></a>";
				$cpnView .= "</span>";
				$cpnView .= "<span class='votes_count' id='votes_count".$coupon[19]."'><div style='font-size:15px; text-align:center; color:#00CCFF;'>".$net_vote."<br /><i style='font-size:13px; color:#E5E5E5; text-align:center;'>Rate It</i></div> </span></div>";
				$cpnView .= "</div>";
			*/
			//$cpnView .= "<div id='cpn_descp'>";
					//$cpnView .= "<div id='edate_head'>Clicked: ".$coupon[23]."</div>";
			//$cpnView .= "</div>";
			
		
					

				//$cpnView .= "</div>"; // end flip  
			$cpnView .= "</div>"; // col-3 
			$cpnView .= "</div>"; // col-12
	
	
			//$cpnView .= $this->cDialog($coupon[19], $coupon[8], $coupon[9]);
##############/////////////////////////////////////////////////////////////////////////////////////  
			}else{
				list($m, $d, $y) = explode("-", $coupon[14]);
				@$dd = $y.'-'.$m.'-'.$d;
		

				
if(strtotime($dd) >= strtotime(date('Y-m-d'))){
$cpnView .= "<div class='col-sm-12 mkup space white'>";
				$cpnView .= "<div class='col-sm-2 text-center noboxshadow'>";
			
if($_SERVER['REQUEST_URI'] == "/".$this->_storePath.$this->sUrl($match)){
	$logoView = $this->savingTypes($coupon[24], $coupon[10]);
	$nameView = '';
}else{
			
	$logoView = "<a href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'><img src='".$this->_imgPath.$coupon[9]."' class='img-thumbnail norad' width='200' height='150'/></a>";
			
	$nameView = "<a href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'>".$coupon[17]." Coupons</a>";
} // end if
			$cpnView .= $logoView;
			
			$cpnView .= "</div>";
				// end 1st wrp
		// 2nd wrp
		$cpnView .= "<div class='col-sm-7'>";
			
		if($coupon[10] == 'ACTIVATE COUPON'){
			$ctyp = "Promotional";
		}else{
			$ctyp = "Coupon Code";
		}
	//$cpnView .= "Valid Till: ".$coupon[14];
	$cpnView .= "<span class='heading'>".$this->subText($coupon[2], 100)."</span></br>";
	$cpnView .= "<span style='color:#333;'>".$this->subText($coupon[8], 350)."</span><br /></br>";
			$cpnView .= "<span style='color:#4caf50;'>Acceptable Till: ".$coupon[14]."</span>";		
		$cpnView .= "</div>";
		// end 2nd wrp
		
		// 3rd wrp
		$cpnView .= "<div class='col-sm-3 text-center noboxshadow'>";
						
	
			if($coupon[10] == 'ACTIVATE COUPON'){
				//$cpnView .= "<a href='".$coupon[12]."' class='address' target='_blank' id='".$coupon[19]."'><div id='getcodetext' style='position:relative; margin-left:0px;'>Activate Coupon</div></a>";
			
			$cpnView .= "<a href='".$coupon[12]."' target='_blank' class='btn btn-info dlbtn noborder vclick' data-placement='top' title='Click To Get Deal' id='".$coupon[19]."' data-toggle='tooltip'>Get Deal</a><br><br>";
              		
					
			}else{
			//$cpnView .= "<div class='ss' id='getcodetext' style='position:absolute;'>Reveal Code</div>
		
			//<a href='".$coupon[12]."' class='address' target='_blank' id='".$coupon[19]."'><div class='getcodeblock' id='cc'>".$coupon[10]."</div></a>";
			
$cpnView .= "<a href='".$coupon[12]."' target='_blank' class='getcopcode btn btn-success getcode noborder vclick'  data-clipboard-action='copy' data-clipboard-target='#cdc".$coupon[19]."' id='".$coupon[19]."' data-toggle='tooltip' title='Click to copy and open site'>
    Get Code
</a>";
              $cpnView .= "<div class='code-back' style='background:#e5e5e5;' id='cdc".$coupon[19]."'>".$coupon[10]."</div><br><br>";
			} 
			
		
			
	$cpnView .= "<span class='glyphicon glyphicon-resize-vertical hazel'></span><br>";
$cpnView .= "<a href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'>Browse All</a>";

		//$cpnView .= "<div id='usd_cpn'>Used ".$coupon[23]." times</div>";
	
						

					//$net_vote = $coupon[21] - $coupon[22];
				//$cpnView .= "<div class='thumb_text'><span class='vote_buttons' id='vote_buttons".$coupon[19]."'>";
				//$cpnView .= "<a href='#' class='vote_up' id='".$coupon[19]."'></a>";
				//$cpnView .= "<a href='#' class='vote_down' id='".$coupon[19]."'></a>";
				//$cpnView .= "</span>";
				//$cpnView .= "<span class='votes_count' id='votes_count".$coupon[19]."'><div style='font-size:15px; text-align:center; color:#00CCFF;'>".$net_vote."<br /><i style='font-size:13px; color:#E5E5E5; text-align:center;'>Rate It</i></div> </span>";

				
		/* $cpnView .= "<div class='well well-sm nobg noboxshadow'>";
				$cpnView .= "<a href='#' type='button' class='btn btn-default green vote_up' id='".$coupon[19]."'><span class='glyphicon glyphicon-thumbs-up'></span></a>";
                $cpnView .= "<a href='#;' type='button' class='btn btn-default red flip vote_down' id='".$coupon[19]."'><span class='glyphicon glyphicon-thumbs-down'></span></a>";
				
				$cpnView .= "<span class='votes_count' id='votes_count".$coupon[19]."'><div style='font-size:15px; text-align:center; color:#00CCFF;'>".$net_vote."<br /><i style='font-size:13px; color:#E5E5E5; text-align:center;'>Rate It</i></div> </span>";
		$cpnView .= "</div>"; // well - sm */
				
				
			//$cpnView .= "<div id='cpn_descp'>";
					//$cpnView .= "<div id='edate_head'>Clicked: ".$coupon[23]."</div>";
			//$cpnView .= "</div>";
	
	
	
		$cpnView .= "</div>";
	 $cpnView .= "</div>"; // col-12
	
				}else{

				}
	
					
			} // 1st f 
			//$cpnView .= $this->cDialog($coupon[19], $coupon[8], $coupon[9]);
		} // end whil
//$cpnView .= "</div>";
	return $cpnView;
	} // end class
		
//###################################################################################################
		
		public function getExpCouponView($needle, $match)
		{
		$this->_vNeedle = $needle;
		//////////////////////////////////////////////////////////////////////////////////////////////
		$init_e = $this->queryBuilder($this->_totalValue, self::COUPONTAB, $this->viewNeedle($this->_vNeedle, $match));
		//$cpnView .= "<div id='t_h'>Expired Coupons</div>";
		//$cpnView = "<div id='innersub_block'>";
		$cpnView = '';
			
		while($coupon = mysqli_fetch_array($init_e, MYSQLI_NUM))
		{
		

				
			if($coupon[14] != "Never Expire"){ 
		
				list($m, $d, $y) = explode("-", $coupon[14]);
				$dd = $y.'-'.$m.'-'.$d;
				if(strtotime($dd) < strtotime(date('Y-m-d'))){
$cpnView .= "<div class='col-sm-12 white text-left'  style='margin-bottom:10px;'>";
	$cpnView .= "<div class='col-sm-3 well text-center noboxshadow' style='background:#fff;'>";
			//$cpnView .= "<div id='comn_logo_block'>";
			$cpnView .= "<a href='".$this->viewPath().$this->sUrl($coupon[17])."'><img src='".$this->_imgPath.$coupon[9]."' alt='".$coupon[17]."' class='img-thumbnail' width='275' height='175' /></a>";
		
		$cpnView .= "</div>";
		// 1st wrp	
// 2nd wrp			
$cpnView .= "<div class='col-sm-6 well noboxshadow'>";		

					
						$cpnView .= "<a href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'>".$coupon[17]." Coupons</a>";
					
			$cpnView .= "<h1 style='color:#337ab7; font-size:1.5em;'>".$this->subText($coupon[2], 100)."</h1>";
						
			$cpnView .= "<div id='cpn_detail'>".$this->subText($coupon[8], 150)."</div><br />";
						$cpnView .= "<div id='edate_head'>Expired: ".$coupon[14]."</div>";
$cpnView .= "</div>";
// end 2nd wrp						
						
// 3rd wrp
$cpnView .= "<div class='col-sm-3 text-center noboxshadow'>";			
						
			if($coupon[10] == 'ACTIVATE COUPON'){
				//$cpnView .= "<a href='".$coupon[12]."' class='address' target='_blank' id='".$coupon[19]."'><div id='getcodetext' style='position:relative; margin-left:0px;'>Get Deal</div></a>";
			
			$cpnView .= "<a class='btn btn-primary getcode noborder progress-bar-striped' data-placement='top' data-toggle='tooltip' title='Click To Get Deal' data-target='#".$coupon[19]."' id='ttpid'>Get Deal</a>
              		<a type='button' class='btn btn-default progress-bar-striped code-back' style='background:#e5e5e5;' >".$coupon[10]."</a><br><br>";
					
			}else{
			//$cpnView .= "<div class='ss' id='getcodetext' style='position:absolute;'>Reveal Code</div>
		
			//<a href='".$coupon[12]."' class='address' target='_blank' id='".$coupon[19]."'><div class='getcodeblock' id='cc'>".$coupon[10]."</div></a>";
			
			$cpnView .= "<a class='btn btn-primary getcode noborder progress-bar-striped' data-placement='top' title='Get Coupon Code' data-target='#".$coupon[19]."' id='ttpid' data-toggle='tooltip' title='Click to copy and open site'>Get Coupon Code</a>
              		<a type='button' class='btn btn-default progress-bar-striped code-back' style='background:#e5e5e5;' >".$coupon[10]."</a><br><br>";
			} 
			
	
			
			
			
			/*
				$cpnView .= "<div id='cpn_rating'>";
					$net_vote = $coupon[21] - $coupon[22];
				$cpnView .= "<div class='thumb_text'><span class='vote_buttons' id='vote_buttons".$coupon[19]."'>";
				$cpnView .= "<a href='javascript:;' class='vote_up' id='".$coupon[19]."'></a>";
				$cpnView .= "<a href='javascript:;' class='vote_down' id='".$coupon[19]."'></a>";
				$cpnView .= "</span>";
				$cpnView .= "<span class='votes_count' id='votes_count".$coupon[19]."'><div style='font-size:15px; text-align:center; color:#00CCFF;'>".$net_vote."<br /><i style='font-size:13px; color:#e5e5e5; text-align:center;'>Rate It</i></div> </span></div>";
				$cpnView .= "</div>";
			*/
			//$cpnView .= "<div id='cpn_descp'>";

					//$cpnView .= "<div id='edate_head'>Clicked:".$coupon[23]."</div>";
			//$cpnView .= "</div>";
			

			//$cpnView .= $this->viewLBox($coupon[18]);		 

$cpnView .= "</div>";
// end 3rd wrp
	 			// col-12
		$cpnView .= "</div>";
		$cpnView .= $this->cDialog($coupon[19], $coupon[8], $coupon[9]);	
				}else{
					
				}
			
		

			}else{
			}
		} // end whil

		//$cpnView .= "</div>";
		return $cpnView;
	} // end method

	public function ExpHead($needle, $match)
	{
		$this->_vNeedle = $needle;
		
		$init_eh = $this->queryBuilder($this->_totalValue, self::COUPONTAB, $this->viewNeedle($this->_vNeedle, $match));
		while($coupon_e = mysqli_fetch_array($init_eh, MYSQLI_NUM))
		{
			if($coupon_e[14] != "Never Expire"){ 
				list($m, $d, $y) = explode("-", $coupon_e[14]);
				$dd = $y.'-'.$m.'-'.$d;
				if(strtotime($dd) < strtotime(date('Y-m-d'))){
					return 1;
				}else{
						
				}
			}else{
				//return false;
			}
		} // end whil
	return 0;
		
		} // end expHead method


// dialog
private function cDialog($id, $name, $imgs){
	
	$cpop = '';
	// wrp 1
$cpop .= "<div id='".$id."' class='modal fade' role='dialog'>";
	$cpop .= "<div class='modal-dialog'>";

    //<!-- content -->
		$cpop .= "<div class='modal-content'>";
		
      		$cpop .= "<div class='modal-header'>";
        		$cpop .= "<button type='button' class='close' data-dismiss='modal'>&times;</button>";
        		$cpop .= "<h4 class='modal-title'>".$name."</h4>";
      		$cpop .= "</div>";
     
		$cpop .= "<div class='modal-body'>";
    $cpop .= "<p><img src='".$this->_imgPath.$imgs."' class='img-thumbnail' height='125' width='125' alt='Avatar'></p>";
    	$cpop .= "</div>";
    
       	$cpop .= "<div class='modal-footer'>";
        	$cpop .= "<button type='button' class='btn btn-default' data-dismiss='modal'>Close</button>";
     	$cpop .= "</div>";
		
    $cpop .= "</div>";//<!-- content -->

	$cpop .= "</div>";
$cpop .= "</div>";
	return $cpop;
} // method

	public function viewLBox($key)
	{	
		$initLBQ = $this->queryBuilder($this->_totalValue, self::COUPONTAB, array(self::UKEY => $key));
		$LB = '';	
		while($LBView = mysqli_fetch_array($initLBQ, MYSQLI_NUM))
		{ 

			$LB .= "<div id='cs".md5(md5($LBView[18]))."' style='display:none;'>";
			$LB .= "<div id='osx-modal-title'>
				<div id='modal-img'>
				<a href='".$this->viewPath().$this->sUrl($LBView[17])."'><img src='".$this->_imgPath.$LBView[9]."' alt='".$LBView[17]."' /></a>
				</div><div id='modal-head'>".$LBView[17]."</div></div>";
			$LB .= "<div id='modal-descp'>".$LBView[2]."</div>";
			$LB .= $this->LBcodeBase($LBView[10], $LBView[12], $LBView[17]);
			$LB .= "<div id='modal_footer'></div>";
			$LB .= "</div>";
		
		
		} // end whil
		return $LB;		

	}// end method

	public function LBcodeBase($code, $url, $site)
	{
		if($code != '' && $code != "ACTIVATE COUPON" && $url != '' && $site != ''){
			$LBCB = "<table id='modal-mid'><tr>";
			$LBCB .= "<td id='modal-cblk'>".$code."</td>";
			$LBCB .= $this->btn($code);
			$LBCB .= "</tr></table>";
			$LBCB .= "<div id='text-mid'>
			<a href='".$url."' target='_blank'><b style='font-size:11px;'>Click To Open: </b> <b style='font-size:16px;'>".$site."</b></a><br />
			</div><br />";
			$LBCB .= "<div id='text-mid'>
			
			1- Copy The Code Above and Click To Open <i><a href='".$url."' target='_blank'>".$site."</a></i> website.<br /> 
			2- Write / Paste Above Code during checkout process.
			</div>";
		}else{
			$LBCB = "<table id='modal-mid'><tr>";
			$LBCB .= "<td id='modal-cblk'>No Code Required</td>";
			//$LBCB .= $this->btn($LBView[10]);
			$LBCB .= "</tr></table>";
			$LBCB .= "<div id='text-mid'>
			<a href='".$url."' target='_blank'><b style='font-size:11px;'>Click To Open:</b> <b style='font-size:16px;'>".$site."</b></a><br />
			</div><br />";
			$LBCB .= "<div id='text-mid'>
			
			1- No Need for Coupon Code Just Click To Open <i><a href='".$url."' target='_blank'>".$site."</a></i> website.<br /> 
			
			</div>";
		}
		return $LBCB;
	}
	
	public function codeBase($code)
	{
		if($code != '' && $code != "ACTIVATE COUPON"){
			$c = "<div class='getcodeblock'>Get Code</div> <span class='site-footer-map-marker site-footer-map-marker-staels'>
			 <span class='tooltip tooltip-right'>Click To Show Code</span>
            </span>";
		}else{
			$c = "<div class='getcodeblock'>Activate Offer</div> <span class='site-footer-map-marker site-footer-map-marker-staels'>
			 <span class='tooltip tooltip-right'>Click To Activate</span>
            </span>";
		
		}
		return $c;
	}
	
	public function btn($c)
	{
		$L = "<td id='modal-btn'>";
		$L .= "<script type='text/javascript'>ShowLMCButton('".$c."');</script>";
		$L .= "</td>";
		return $L;
	}	
	private function GTCHeyStack()
	{
		$this->_GTC = array('_tody_dls' => 1);
		return $this->_GTC;
	}

		public function getTopCoupon()
	{
			$init = $this->queryBuilder($this->_totalValue, self::COUPONTAB, $this->GTCHeyStack());
		$view = '';
		//$view .= "<div id='sequence'>";
				//$view .= "<img class='sequence-prev' src='".$this->_imgPath."imagex/bt-prev.png' alt='Previous Frame' />";
				//$view .= "<img class='sequence-next' src='".$this->_imgPath."imagex/bt-next.png' alt='Next Frame' />";
				
		

		while($r = mysqli_fetch_array($init, MYSQLI_NUM))
		{
	
		$view .= "<div class='row'>";

		
	
		//$view .= "<div id='slider_title'>".$r[17]."</div>";

			//$view .= "</div>";
$view .= "<a href='".$this->viewPath().$this->_storePath.$this->sUrl($r[17])."'><img src='".$this->_imgPath.$r[9]."' width='75' height='50'/>";
			//$view .= "<div id='leftcontainer'>";
			$view .= "<h4 class='list-group'>".$r[2]."</h4><hr></a>";
			//$view .= "<div id='slide_descrip'>".$r[8]."</div>";
		
			// <div id='viewmorelink'><a href='".$this->viewPath()."store/?si=".$this->sUrl($r[17])."'>More ".$r[17]." Coupons</a></div>
			
			

			$view .= "</div>";
				
					
		} // while
		


			
		//$view .= "</div>";
		return $view;
	}
	
		public function TotalStores()
	{
		$initStore = $this->queryBuilder($this->_totalValue, self::STORETAB, $this->_colm);
		$fStore = '';
		while($sView = mysqli_fetch_array($initStore, MYSQLI_NUM))
		{	
		$fStore .= "<div class='col-sm-3'>";
		//$fStore .= "<div id='leftviner'></div>"
		$fStore .= "<div class='well white'>
				<a href='".$this->viewPath().$this->_storePath.$this->sUrl($sView[2])."'><img src='".$this->_imgPath.$sView[8]."' alt='".$sView[2]."' class='img-thumbnail' width='200' height='150'/></a>
				</div>";
		//$fStore .= "<br /><b>SAVE ".$sView[5]."</b><br />";
		$fStore .= "<br />";
$fStore .= "<br />";		
		$fStore .= "</div>";
		} // end while
		return $fStore;
	}
	
	public function viewTopStore()
	{
		$initStore = $this->queryBuilder($this->_totalValue, self::STORETAB, array('_featr_sto' => 1));
		$fStore = '';
		while($sView = mysqli_fetch_array($initStore, MYSQLI_NUM))
		{	
		$fStore .= "<div class='col-sm-4'>";
		//$fStore .= "<div id='leftviner'></div>";
		$fStore .= "<a href='".$this->viewPath().$this->_storePath.$this->sUrl($sView[2])."'><img src='".$this->_imgPath.$sView[8]."' alt='".$sView[2]."' width='200' height='150' class='img-responsive img-thumbnail'/></a>";
		$fStore .= "<br /><b>SAVE ".$sView[5]."</b><br />";
		$fStore .= "<br />";
	
		$fStore .= "</div>"; // sm-2
		} // end while
		return $fStore;
	}
	
	public function viewPopularStore()
	{
		$initStore = $this->queryBuilder($this->_totalValue, self::STORETAB, array(self::TOPSTOREBN => 1));
		$fStore = '';
		while($sView = mysqli_fetch_array($initStore, MYSQLI_NUM))
		{	
		$fStore .= "<a href='".$this->viewPath().$this->_storePath.$this->sUrl($sView[2])."' style='color: #000; text-decoration: none;' class='p-2'><h6>".$sView[2]."</h6></a>";
		} // end while
		return $fStore;
	}

	public function viewCategory()
	{
		$initCate = $this->queryBuilder($this->_totalValue, self::CATETAB, array('_top_ctg' => 1));	
		$c = '';
		
		while($tpcate = mysqli_fetch_array($initCate, MYSQLI_NUM))
		{
			$c .= "<div id='cat_menu'>";	
			$c .= "<a href='".$this->viewPath()."categories/?view=".$this->sUrl($tpcate[2])."'>";
				
					$c .= $tpcate[2];
				
			$c .= "</a>";
			$c .= "</div>";
		}// end while
		
		return $c;
	}

	public function viewInlineCategory()
	{
		$initCate = $this->queryBuilder($this->_totalValue, self::CATETAB, array('_top_ctg' => 1));	
		$c = '';
		
		while($tpcate = mysqli_fetch_array($initCate, MYSQLI_NUM))
		{
			/* $c .= "<a href='categories/?view=".$tpcate[2]."'>";
			$c .= "<div class='col-sm-6'>";
			$c .= "<div class='well grnbg noborder11/14/2016 11:30:32 AM' style='text-decoration:none;'>";
			$c .= $tpcate[2];
	
			$c .= "</div>";
			$c .= "</div>";
			$c .= "</a>"; */
			
			
			$c .= "<div class='col-md-6'>";
            $c .= "<div class='icon-box'>";
             $c .= "<div class='icon'><i class='las la-basketball-ball' style='color: #ff689b;'></i></div>";
             $c .= "<h4 class='title'><a href='categories/?view=".$tpcate[2]."''>".$tpcate[2]."</a></h4>";
             $c .= "<p class='description'>".$tpcate[4]."</p>";
          	 $c .= "</div>";
			 	 $c .= "</div>";
			 
			 
	
		  

		}// end while
		
		return $c;
	}

public function masterCategory()
	{
		$initCate = $this->queryBuilder($this->_totalValue, self::CATETAB, $this->_colm);	
		$c = '';
		
		while($tpcate = mysqli_fetch_array($initCate, MYSQLI_NUM))
		{
			

			$c .= "<a href='".$this->viewPath().$this->_catePath.$this->sUrl($tpcate[2])."' style='color: #000; text-decoration: none;'>";
			$c .= "<div class='col-sm-12 p-0 m-0'>";
			$c .= "<div class='well white p-2 pt-0 pb-0 m-0 pr-0'>";
			$c .= ucwords($tpcate[2])."<hr class='mt-0 mb-0'>";
	      //   	$c .= $this->viewCouponLoop("coupon_category", $tpcate[2]);
			$c .= "</div>";
			$c .= "</div>";
			$c .= "</a>";
			
			
		}// end while
		
		return $c;
	}
	
	public function masterCategory2()
	{
		$initCate = $this->queryBuilder($this->_totalValue, self::CATETAB, $this->_colm);	
		$c = '';
		
		while($tpcate = mysqli_fetch_array($initCate, MYSQLI_NUM))
		{
			

			$c .= "<a href='".$this->viewPath().$this->_catePath.$this->sUrl($tpcate[2])."' style='color: #000; text-decoration: none;'>";
			$c .= "<div class='col-sm-12 p-0 m-0'>";
			$c .= "<div class='well white p-2 pt-0 pb-0 m-0 pr-0'>";
			$c .= ucwords($tpcate[2])."<hr class='mt-0 mb-0'>";
	      //   	$c .= $this->viewCouponLoop("coupon_category", $tpcate[2]);
			$c .= "</div>";
			$c .= "</div>";
			$c .= "</a>";
			
			
		}// end while
		
		return $c;
	}
	
	
	
	
	public function listCategory()
	{
		$initCate = $this->queryBuilder($this->_totalValue, self::CATETAB, $this->_colm);	
		$c = '';
		
		while($tpcate = mysqli_fetch_array($initCate, MYSQLI_NUM))
		{
			

			$c .= "<a href='".$this->viewPath().$this->_catePath.$this->sUrl($tpcate[2])."'>";
			$c .= "<div class='col-sm-3'>";
			$c .= "<div class='well white'>";
			$c .= $tpcate[2];
	
			$c .= "</div>";
			$c .= "</div>";
			$c .= "</a>";
			
			
		}// end while
		
		return $c;
	}

	/* public function subCategoryCouponKey($key)
	{
		$cCate = $this->queryBuilder($this->_totalValue, self::TOTALSUBCATE, array("cate_nam" => trim($key)));
		//$subCouponView =  '';
		$subcatlist = '';
		while($ckey = mysql_fetch_array($cCate)){
		
			$subcatlist .= $this->getCouponView("coupon_category", $ckey[7]);
			if($this->ExpHead("coupon_category", $ckey[7]) == 0){
				// show nothing 
			}else{
			$subcatlist .= "<div id='t_h'>Expired Coupons Deals</div>";
			} // end if
			$subcatlist .= $this->getExpCouponView("coupon_category", $ckey[7]);
		
		}
		return $subcatlist;
		
		
	} */
	
	
			public function CategoryCouponKey($key)
	{
		$key = mysqli_real_escape_string($this->connt(), addslashes($key));
		$cCate = $this->queryBuilder($this->_totalValue, self::TOTALSCATE, array("cate_nam" => trim($key)));
		//$subCouponView =  '';
		if(mysqli_num_rows($cCate) != 0){
		$subcatlist = '';
		while($ckey = mysqli_fetch_array($cCate, MYSQLI_NUM)){
		
			$subcatlist .= $this->viewCouponLoop3("coupon_category", $ckey[5]);
			//if($this->ExpHead("coupon_category", $ckey[7]) == 0){
				// show nothing 
			//}else{
			//$subcatlist .= "<div id='t_h'>Expired Coupons Deals</div>";
			//} // end if
			//$subcatlist .= "<div style='margin-top:0px; display:inline-block; vertical-align:top;'>".$this->getExpCouponView("coupon_category", $ckey[5])."</div>";
		
		}
		return $subcatlist;
		}else{
		$subcatlist = "<i class='text-danger'>Sorry. Currently there is no discount offer available at this time</i></br></br>";
		$subcatlist .= "<b style='color:#000; text-decoration: none;'>You can find other categories</b></br>";
		$subcatlist .=  $this->masterCategory();
		return $subcatlist;
		}
		
	}

	public function topstorebanner()
	{
		$initStore = $this->queryBuilder($this->_totalValue, self::STORETAB, array(self::TOPSTOREBN => 1));	
		$c = '';
		//$c .= "<div id='rttop_storebanner'>";
		while($storeL = mysqli_fetch_array($initStore, MYSQLI_NUM))
		{
			
			$c .= "<div class='card col-sm-2 ml-2 mt-2'><div class='card-body text-center'><a href='".$this->viewPath().$this->sUrl($storeL[2])."'>";
			$c .= "<img src='".$this->_imgPath.$storeL[8]."' width='140' height='85' border='' class='img-fluid' title='".$storeL[2]."' />";
			$c .= "</a></div></div>";
			//$c .= "<div id='top_store_text'>";
				//$c .=	"<h2>".$storeL[2]."</h2><br />";
				//$c .=	$storeL[9];
			//$c .= "</div>";

		}// end while  
		//$c .= "</div>";

		return $c;
	}
/*
	public function SML()
	{
		$c = '';
		$c = "<div id='t_h'>Follow Us</div>";
		$c .= "<div id='sml_wrapper'>";
			$c .= "<a href='http://www.pinterest.com/ ' target='_blank' id='pnt'></a>";
			$c .= "<a href='#' id='ggl'></a>";
			$c .= "<a href='https://twitter.com/' target='_blank' id='twt'></a>";
			$c .= "<a href='https://www.facebook.com/' target='_blank' id='fcb'></a>";
		$c .= "</div>";
		return $c;
	} // end method
*/
	public function storeList()
	{
		$initStore = $this->queryBuilder($this->_totalValue, self::STORETAB, array($this->_populrPointer => 1));	
		$c = '';
		$c .= "<div id='verticalright'>";
		while($storeL = mysqli_fetch_array($initStore, MYSQLI_NUM))
		{
			$c .= "<li>";
			$c .= "<a href='".$this->viewPath().$this->sUrl($storeL[2])."'>".stripslashes($storeL[2])."</a><br />";
			$c .= "</li>";

		}// end while
		$c .= "</div>";
		return $c;
	}

	public function viewTotalStore($alpha)
	{
		if(strlen($alpha) == 1){
		//$initStore = $this->queryBuilder($this->_totalValue, self::STORETAB, $this->_colm);
		$initStore = mysqli_query($this->connt(), "select * from ".self::STORETAB." where _stor_nam like '".$alpha."%'");
		if(mysqli_num_rows($initStore) != 0) {
		$fStore = '';

		$fStore .= "<div class='col-sm-12 border border-light mt-4 p-3 bg-light'>";
		while($sView = mysqli_fetch_array($initStore, MYSQLI_NUM))
		{	
	
		//$fStore .= "<div class='storder'>".$sView[2]."</div>";
		$fStore .= "<a class='text-default ml-4 text-left' href='".$this->viewPath().$this->_storePath.$this->sUrl($sView[2])."'><span class='fa fa-dot text-dark'></span> ".stripslashes($sView[2])."</a>";
		//$fStore .= "<br /><b>SAVE ".$sView[5]."</b><br />";
		// <img src='".$this->_imgPath.$sView[8]."' width='75' height='50'/>
		

		} // end while
		$fStore .= "</div>";
		return $fStore;
		}else{
		//return "<p><ul style='color:#FF0000;'><h4>No Store Available( ".$alpha." )</h4></ul></p>";
		}
		}else{
		//return "<p><ul style='color:#FF0000;'><h3>!Error OR use Signle Character</h3></ul></p>";
		}
	} // end method

	private function subText($text, $needle)
	{
		$this->_shortText = $text;
		$countstring = strlen($this->_shortText);
		if($countstring > $needle){
		$less = $countstring - $needle;
		$h = substr($this->_shortText, 0, -$less);
			return $h ." ....";
		}else{
			return $this->_shortText;
		}
	}

// define store header text
	public function StoreHeaderText($sName)
	{
		if($sName != '' && is_string($sName))
		{
			$initSHead = $this->queryBuilder($this->_totalValue, self::STORETAB, array(self::STOREFIELD => $sName));
			$sheadView = '';
			while($head = mysqli_fetch_array($initSHead, MYSQLI_NUM))
			{
			//location
			//if($head[12] == 1){ $loct = "Voucher Codes and Discounts ".date("F, Y"); }else{ $loct = "Coupon Codes and Promo Codes ".date("F, Y"); }
				$sheadView .= "<div class='text-center'><img src='".$this->_imgPath.$head[8]."' alt='".$head[2]."' class='img-responsive img-rounded' width='100%'/></div>";
				
				

			} // end while
			return $sheadView;
		}
	
	} // end method
	
// define store header view
	public function viewStoreHeader($sName)
	{
		if($sName != '' && is_string($sName))
		{
			$initSHead = $this->queryBuilder($this->_totalValue, self::STORETAB, array(self::STOREFIELD => $sName));
			$sheadView = '';
			while($head = mysqli_fetch_array($initSHead, MYSQLI_NUM))
			{
			
				//$sheadView .= "<img src='".$this->_imgPath.$head[8]."' alt='".$head[2]."' width='400' height='250'  class='img-responsive' />";
					//$sheadView .= "<div class='well'>";
				//	$sheadView .= $head[17];
					$sheadView .= $head[10];
					//$sheadView .= "</div>";

			} // end while
			return $sheadView;
		}
	
	} // end method
	
	private function totalStoreCoupon($store)
	{
		$number = mysqli_num_rows($this->queryBuilder(array(self::STORELINKNAME), self::COUPONTAB, array(self::STORELINKNAME => $store)));
		return $number;
	
	} // end

	private function totalStoreCouponCode($store)
	{
		$number = mysqli_num_rows($this->queryBuilder(array(self::STORELINKNAME), self::COUPONTAB, array(self::STORELINKNAME => $store, self::CODE_C => 1)));
		return $number;
	
	} // end
	
	private function totalStoreCouponDeal($store)
	{
		$number = mysqli_num_rows($this->queryBuilder(array(self::STORELINKNAME), self::COUPONTAB, array(self::STORELINKNAME => $store, self::DEALS_C => 1)));
		return $number;
	
	} // end

	// fetch meta
	
	public function fixMeta()
	{
		$meta = '';
		$meta .= "<meta name='description' content='DealOffs make it possible to discover new deals across the online shopping market and deliver you thousands of updated, easy to use deals and one-click copy coupon codes.'/>\n";
		$meta .= "<meta name='keywords' content='promo codes, deals, coupon codes, discounts, offers, savings, sales reviews, promotional codes'/>\n";
		$meta .= "<meta name='abstract' content='Deal Offs Discover Discount For All' />\n";
		$meta .= "<meta name='robots' content='index,follow'/>\n";
				
		
		return $meta;
	} // end meta method

	public function storeMeta($id)
	{
		$this->_MetaId = $id;
		$mdata = '';
		$initStoreMeta = $this->queryBuilder($this->_totalValue, self::STORETAB, array(self::STOREFIELD => $this->_MetaId));
		$sMeta = mysqli_fetch_row($initStoreMeta, MYSQLI_NUM);
			$mdata .= "<title>".$sMeta[2]." ".$sMeta[9]."</title>\n";
			$mdata .= "<meta name='keywords' content='".$sMeta[11]."'/>\n";
			$mdata .= "<meta name='description' content='".$sMeta[10]."'/>\n";
			$mdata .= "<meta name='abstract' content='".$sMeta[2]."' />\n";
			$mdata .= "<meta name='robots' content='index,follow'/>\n";
			
		

		return $mdata;
	
	} // method store meta
	
	public function socialMedia(){
		$sm = '';
		$sm .= "<div class='addthis_inline_follow_toolbox'></div>";
		return $sm;	
	}
	
	// header menu page list 
	public function pagList($pagetitl)
	{
		 $initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("_mt_ttl" =>$pagetitl, "hadr_mntib" => 1));
		 $b_cont = '';
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		//$b_cont .= "<div class='col-sm-12' style='margin-top:0px;'>";
		//$b_cont .= "<div class='row'>";
		//$b_cont .= "<ul class='nav navbar-nav'>";
		
		$b_cont .= "<li class='nav-link'><a class='text-success' href='".$this->viewPath().$this->_pagePaths.$this->sUrl($blv[4]).$this->_pagePathSec.$this->sUrl($blv[2])."' style='text-decoration:none;'>".ucwords($blv[2])."</a></li>";
			
		//$b_cont .= "</div>"; // sm-12
				//$b_cont .= "</ul>";
			//$b_cont .= "</div>";
			
		} // while   glyphicon  
		
		return  $b_cont;
	} // page list method

// footer menu page list 
	public function FMpagList($pagetitl)
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("_mt_ttl" =>$pagetitl, "ftro_mnwtb" => 1));
		 $b_cont = '';
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		//$b_cont .= "<div class='col-sm-12' style='margin-top:0px;'>";
		//$b_cont .= "<div class='row'>";
		//$b_cont .= "<ul class='nav navbar-nav'>";
		
		$b_cont .= "<li class='nav-link p-0'><a class='text-white' href='".$this->viewPath().$this->_pagePaths.$this->sUrl($blv[4]).$this->_pagePathSec.$this->sUrl($blv[2])."' style='text-decoration:none;'>".ucwords($blv[2])."</a></li>";
			
		//$b_cont .= "</div>"; // sm-12
				//$b_cont .= "</ul>";
			//$b_cont .= "</div>";
			
		} // while   glyphicon  
		
		return  $b_cont;
	} // page list method

	// blog list  
	public function IblogListView()
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("_mt_ttl" =>"blog", "_top_ctg" => 1));
		 $b_cont = '';
		$b_cont .= "<div class='card-deck'>";
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		
		$b_cont .= "<div class='card'>";
			$b_cont .= "<div class='thumbnail img-responsive'>";
				$b_cont .= stripslashes($blv[10]);
			$b_cont .= "</div>"; // sm-4
				    
				$b_cont .= "<div class='card-body'>";
					$b_cont .= "<h2 class='card-title text-success' style='font-size:22px;'><b>".ucwords($blv[2])."</b></h2>";
				//$b_cont .= "<p>".$this->subText($blv[6], 100)."</p>";
				
		$b_cont .= "<br>";
		$b_cont .= "<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."' class='btn btn-success btn-md mt-2'>Learn More</a>";
			$b_cont .= "</div>"; // sm-8	
		$b_cont .= "</div>"; // card

		
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>";
		} // while  
		$b_cont .= "</div>"; // deck
		
		return  $b_cont;
	}// method for index
	
	
		// blog list   "ftro_mnwtb" => 1
	public function NewblogListView()
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("_mt_ttl" =>"blog", "_top_ctg" => 1));
		 $b_cont = '';
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		
		     $b_cont .= "<div class='col-lg-4  col-md-6 d-flex align-items-stretch'>";
            $b_cont .= "<article class='entry'>";

              $b_cont .= "<div class='entry-img'>";
                //$b_cont .= "<img src='assets/img/blog-1.jpg' alt='' class='img-fluid'>";
				$b_cont .= stripslashes($blv[10]);
              $b_cont .= "</div>";

              $b_cont .= "<h2 class='entry-title'>";
                $b_cont .= "<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."'>".$blv[2]."</a>";
              $b_cont .= "</h2>";

              $b_cont .= "<div class='entry-meta'>";
                $b_cont .= "<ul>";
                  $b_cont .= "<li class='d-flex align-items-center'><i class='icofont-user'></i> <a href='blog-single.html'>Marry. S</a></li>";
                  $b_cont .= "<li class='d-flex align-items-center'><i class='icofont-wall-clock'></i> <a href='blog-single.html'><time datetime='2020-01-01'>Jan 1, 2020</time></a></li>";
                $b_cont .= "</ul>";
              $b_cont .= "</div>";

              $b_cont .= "<div class='entry-content'>";
                $b_cont .= "<p>".$this->subText($blv[6], 380)." </p>";
                //$b_cont .= "<div class='read-more'>";
                  //$b_cont .= "<a href='blog-single.html'>Read More</a>";
               // $b_cont .= "</div>";
              $b_cont .= "</div>";

            $b_cont .= "</article>"; //<!-- End blog entry -->
          $b_cont .= "</div>";
		  
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>";
		} // while  
		
		return  $b_cont;
	}// method end new blogs post entry
	
		// blog list  
	public function IndexblogListView()
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("_mt_ttl" =>"blog", "_top_ctg" => 1));
		 $b_cont = '';
		$b_cont .= "<div class='card-deck'>";
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		
		$b_cont .= "<div class='card'>";
			$b_cont .= "<div class='thumbnail img-responsive'>";
				$b_cont .= stripslashes($blv[10]);
			$b_cont .= "</div>"; // sm-4
				    
				$b_cont .= "<div class='card-body'>";
					$b_cont .= "<h2 class='card-title text-success' style='font-size:22px;'><b>".ucwords($blv[2])."</b></h2>";
				//$b_cont .= "<p>".$this->subText($blv[6], 100)."</p>";
				
		$b_cont .= "<br>";
		$b_cont .= "<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."' class='btn btn-success btn-md mt-2'>Learn More</a>";
			$b_cont .= "</div>"; // sm-8	
		$b_cont .= "</div>"; // card

		
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>";
		} // while  
		$b_cont .= "</div>"; // deck
		
		return  $b_cont;
	}// method for index
	
	
		// blog list   "ftro_mnwtb" => 1
	public function CBlogpostList()
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("_mt_ttl" =>"blog", "ftro_mnwtb" => 1));
		 $b_cont = '';
		 $b_cont .= "<div class='row'>";
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{


      $b_cont .= "<div class='col-md-6 d-flex' >";
            $b_cont .= "<div class='card'>";
			$b_cont .= stripslashes($blv[10]);
              $b_cont .= "<div class='card-body'>";
                $b_cont .= "<h5 class='card-title'><a href='' class='text-info'>".$blv[2]."</a></h5>";
                $b_cont .= "<p class='card-text'>".$this->subText($blv[6], 380)."</p>";
                $b_cont .= "<div class='read-more'><a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."'><i class='text-info icofont-arrow-right'></i> Learn More</a></div>";
              $b_cont .= "</div>";
            $b_cont .= "</div>";
          $b_cont .= "</div>";


		} // while  
		  $b_cont .= "</div>";
		return  $b_cont;
	}// method end for bottom blog list

		// blog list  
	public function blogListView()
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("_mt_ttl" =>"blog"));
		 $b_cont = '';
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		
			 $b_cont .="<div class='col-sm-4 mt-3 bg-none'>";
	     $b_cont .="<div class='card bg-white' style='border:none;'>";
	     $b_cont .="<img src='../assets/shared/$blv[10]' class='img-fluid' style='border-radius: 20px; height: 300px;'/>";
	     	$b_cont .= "<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."' class='card-title text-dark pt-3' style='font-size: 20px; text-decoration: none;'>"."<font face='Poppins'>".ucwords($blv[2])."</font></a>";
		 
		 //	$b_cont .= stripslashes($blv[10]);
			$b_cont .="</div>"; //<!--card-->
	   	$b_cont .="</div>"; //<!--col-4 ednd-->		
		   
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>";
		} // while  
		
		return  $b_cont;
	}// method end blog list view total
	
		// blog list  
	public function eventListView()
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("_mt_ttl" =>"events"));
		 $b_cont = '';
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		
		     $b_cont .= "<div class='col-lg-4  col-md-6 d-flex align-items-stretch'>";
            $b_cont .= "<article class='entry'>";

              $b_cont .= "<div class='entry-img'>";
                //$b_cont .= "<img src='assets/img/blog-1.jpg' alt='' class='img-fluid'>";
				$b_cont .= stripslashes($blv[10]);
              $b_cont .= "</div>";

              $b_cont .= "<h2 class='entry-title'>";
                $b_cont .= "<a href='".$this->viewPath().$this->_eventPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."'>".$blv[2]."</a>";
              $b_cont .= "</h2>";

              $b_cont .= "<div class='entry-meta'>";
                $b_cont .= "<ul>";
                  $b_cont .= "<li class='d-flex align-items-center'><i class='icofont-user'></i> <a href='blog-single.html'>Marry. S</a></li>";
                  $b_cont .= "<li class='d-flex align-items-center'><i class='icofont-wall-clock'></i> <a href='blog-single.html'><time datetime='2020-01-01'>Jan 1, 2020</time></a></li>";
                $b_cont .= "</ul>";
              $b_cont .= "</div>";

              $b_cont .= "<div class='entry-content'>";
                $b_cont .= "<p>".$this->subText($blv[6], 380)." </p>";
                //$b_cont .= "<div class='read-more'>";
                  //$b_cont .= "<a href='blog-single.html'>Read More</a>";
               // $b_cont .= "</div>";
              $b_cont .= "</div>";

            $b_cont .= "</article>"; //<!-- End blog entry -->
          $b_cont .= "</div>";
		  
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>";
		} // while  
		
		return  $b_cont;
	}// method end event list view total
	
	// single blog
	public function singleBlogView($pagedir, $pagetitl)
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("cate_nam" => $pagedir, "_mt_ttl" => $pagetitl ));
		 $pConent = '';
		$post_by = '';

		while($pagedetails = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
					if(!preg_match("/events/", $_SERVER['REQUEST_URI'])) {
				$post_by = "";
			}else{  $post_by = '';  }
			
			

$pConent .="<div class='container-fluid '>";
  $pConent .="<div class='col-12 bg-white pt-4 m-auto pb-5'>";
    $pConent .="<div class='row mt-2 mb-5'>";
	   $pConent .="<div class='col-sm-12' style='font-size: 16px;'>"."<font face='Poppins'>";
     	//$pConent .= stripslashes($pagedetails[10]);
     	  
     	// $pConent .="<img src='../assets/shared/$blv[10]' class='img-fluid' style='width: 100%; border-top-left-radius: 20px;  border-top-right-radius: 20px;'/>";
	
	  $pConent .= stripslashes(utf8_encode($pagedetails[6]));
		
	    $pConent .="</font></div>"; //<!--col-8 end--->
	 $pConent .="</div>"; //<!--row end-->
   $pConent .="</div>"; //<!--col-11 end-->
 $pConent .="</div>"; //<!--container-fluid--->


			
		} // end while
		
		return $pConent;
		
			
	} // end method
	
			// single blog
	public function sglBlogimg($pagedir, $pagetitl)
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("cate_nam" => $pagedir, "_mt_ttl" => $pagetitl));
		 $pConent = '';
		$post_by = '';

		while($pagedetails = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
					if(!preg_match("/events/", $_SERVER['REQUEST_URI'])) {
				$post_by = "";
			}else{  $post_by = '';  }
			
			

   $pConent .= "https://homeofretailer.com/assets/shared/$pagedetails[10]";


		} // end while  $basepath
		
		return $pConent;
		
			
	} // end method
	
	
			// single blog
	public function singleBlogimg($pagedir, $pagetitl)
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("cate_nam" => $pagedir, "_mt_ttl" => $pagetitl ));
		 $pConent = '';
		$post_by = '';

		while($pagedetails = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
					if(!preg_match("/events/", $_SERVER['REQUEST_URI'])) {
				$post_by = "";
			}else{  $post_by = '';  }
			

    $pConent .="<div class='container-fluid p-0 m-0'>";

		$pConent .="<div class='col-12'>";
		 $pConent .="<div class='row'>";
		$pConent .="<div class='col-sm-6  m-0 p-0'>";
		$pConent .="<img src='../assets/shared/$pagedetails[10]' class='img-fluid m-0 p-0' style='width:100%; height: 530px;'/>";
		   
		$pConent .="</div>"; //<!--col-6 end-->
		
		$pConent .="<div class='col-sm-6' style='background-color: #8a50ff;'>";
		$pConent .="<div class='col-11 mt-5 ml-4 mr-4 pt-5 text-white' style='font-size:20px;'>";
		$pConent  .="<font face='Poppins'>"."<span class='badge badge-outline-secondary mt-1' style='font-size: 14px; background-color: #ff3ab2;'>"."Accessories"."</span>"."</font>";
//	$pConent .="<p class='text-white'>"."Looking Amazing Deals"."</p>";
	$pConent .="<h5 class='card-title mt-1' style='color:#fff; font-size:45px;'>"."<b>".ucfirst($pagedetails[2])."</b></h5>";
	$pConent .="<p class='text-white'>"."The Great Thing Which You Wants With The Simple Labor Of Trouble Seems To Be With No Haters"."</p>";
	$pConent .="<p class='text-white pt-2' style='font-size:18px;'>"."Published By Amilya"."</p>";
		 $pConent .="<span class='fa fa-star checked'></span>";
		   $pConent .="<span class='fa fa-star checked'></span>";
		    $pConent .="<span class='fa fa-star checked'></span>";
			 $pConent .="<span class='fa fa-star checked'></span>";
			  $pConent .="<span class='fa fa-star checked'></span>";
		

		$pConent .="</div>";
		$pConent .="</div>"; //<!--col-6 end-->
		
		
		$pConent .="</div>"; //<!--row end-->
			
		$pConent .="</div>"; //<!--col-12 end-->
	$pConent .="</div>"; //<!--col-12 end-->
     
     	  
   

			
		} // end while
		
		return $pConent;
		
			
	} // end method

	
	
		public function pageView($pageid)
	{
		//$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array('cate_nam' => $this->deUrl($pageid)));
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array('_unk_ky' => $pageid));
		 
		while($pagedetails = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
			$pConent = " <div class='j_innerheading'>".$pagedetails[5]."</div>";
			$pConent .= " <div id='mrs_comn_midblkr' class='clearfix'>".stripslashes($pagedetails[6])."</div>";
		
		} // end while
			return $pConent;
	} // end method
	
	public function pageTitle($pageid)
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array('cate_nam' => $this->deUrl($pageid)));
		while($pagedetails = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
			$ptitle = $pagedetails[2];
		} // end while
			return $ptitle;
	} // end method
		public function pageDescp($pageid)
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array('cate_nam' => $this->deUrl($pageid)));
		while($pagedetails = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
			$ptitle = $pagedetails[2];
		} // end while
			return $ptitle;
	} // end method
	
	// 404
	public function reject(){
		
	 	$rej = header("HTTP/1.0 404 Not Found");
  		$rej .= header("Location: ".$this->viewPath());
  return $rej;
	} // method
	
	
		// blog list  
	public function fistbgListView($blog)
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("blg_catgy" => $blog ));
		 $b_cont = '';
		$b_cont .= "<div class='card-deck'>";
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		

		$b_cont .="<div class='col-sm-5 m-auto text-center p-0'>";
		$b_cont .="<li class='list-group-item mt-2' style='border-color: #fff; background-color: #f8f8f8;'>"."<font face='Poppins'>"."<span class='badge badge-secondary mt-1' style='font-size: 12px; background-color: #ff3ab2;'>"."Travelling"."</span>"."</font></li>";
	   $b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."' class='col-12 mt-2 p-0 text-center d-none d-lg-block' style='font-size:22px; color: #000; font-weight: 500; text-decoration: none;'>"."<font face='Poppins'>".$blv[2]."</font> </a>";
	     $b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."' class='col-12 mt-2 p-0 text-center d-lg-none ' style='font-size:22px; color: #000; font-weight: 500; text-decoration: none;'>"."<font face='Poppins'>".$blv[2]."</font> </a>";
	    $b_cont .= "<p class='p-2 text-center'>".$this->subText($blv[6], 380)."</p>";
	     $b_cont .="</div>";
		   $b_cont .="<div class='card col-sm-7 p-4 border border-light bg-light' style='border-radius: 25px;'>";
		    $b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."'>";
		       $b_cont .="<img src='assets/shared/$blv[10]' class='img-fluid' style='border-radius: 20px;'/>";
		        $b_cont .="</a>";
		       // $b_cont .="<img class='card-img-top' src='../assets/img/ddd.jpg' alt='Card image cap' style='border-radius: 25px;'> ";
		   $b_cont .="</div>"; //<!--card end-->
	    

		
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>";
		} // while  
		$b_cont .= "</div>"; // deck
		
		return  $b_cont;
	}// method for index
	
	
		// blog list  
	public function secbgListView($blog)
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("blg_catgy" => $blog )) ;
		 $b_cont = '';
		
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		
		
	
	
		$b_cont .="<div class='col-sm-4 mt-3'>";
		   $b_cont .="<div class='card' style='border-color: #fff; background-color: #f8f8f8;'>";
		    $b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."'>";
		       $b_cont .="<img src='assets/shared/$blv[10]' class='img-fluid' style='border-radius: 20px; height: 300px;'/>";
		        $b_cont .="</a>";
		     //$b_cont .="<img src='../assets/shared/$blv[10]' class='img-fluid' style='width: 100%; border-top-left-radius: 20px;  border-top-right-radius: 20px;'/>";
				//$b_cont .="<img class='card-img-top' src='assets/img/bb1.jpg' style='border-top-left-radius: 20px; border-top-right-radius: 20px;' alt='Card image cap'>";
				  $b_cont .="<div class='card-body ' style='text-decoration: none; background-color: #f8f9fa; height: 120px;'>";
				  $b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."' style='text-decoration: none;'>";
					$b_cont .="<h5 class='card-title' style='color: #000;'>"."<font face='Poppins'>".ucwords($blv[2])."</font></h5>";
					$b_cont .="</a>";
				  $b_cont .="</div>";
				   $b_cont .="<ul class='list-group list-group-flush' style='border-color: #fff; background-color: #f8f8f8;'>";
					$b_cont .="<li class='list-group-item' style='border-color: #fff; background-color: #f8f8f8;'>"."<font face='Poppins'>"."<span class='badge badge-secondary mt-1' style='font-size: 12px; background-color: #ff3ab2;'>"."BY Ammay Aarob"."</span>"."</font></li>";
				 $b_cont .="</ul>";
				    $b_cont .="<div class='card-body  pt-2 pb-2'>";
					$b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."' class='card-link pr-5 pl-1 mr-5' style='color:#8d51ff; text-decoration: none;'>"."<font face='Poppins'>"."Read Now"."</font></a>";
					//$b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."' class='card-link pl-5 ml-3' style='color:#8d51ff; font-size:34px; font-weight:bold; text-decoration: none;'>"."<font face='Poppins'>"."&rarr;"."</font></a>";
				  $b_cont .="</div>";
				$b_cont .="</div>"; //<!--card -end-->
		 $b_cont .="</div>"; //<!--col-4 end--->
		 
		 
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>";
		} // while  
	
		
		return  $b_cont;
	}// method for index
	
	
		
		// blog list  
	public function thidbgListView($blog)
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("blg_catgy" => $blog ));
		 $b_cont = '';
		
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		
		  $b_cont .="<div class='col-sm-6 mt-3'>";
		  $b_cont .="<div class='card p-3' style='border-color: #fff; background-color:#f5f5f5; border-radius: 20px;'>";
		  $b_cont .="<div class='col-12 p-0 mt-3'>";
		  $b_cont .="<div class='col-3 d-inline-block text-center' style='font-size: 75px; color: #000;'>"."&darr;"."</div>";
			$b_cont .="<div class='col-8 d-inline-block  m-0 p-0'>";
			 $b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."'>";
			  $b_cont .="<img src='assets/shared/$blv[10]' class='img-fluid' style='width: 100%; height: 300px; border-top-left-radius: 20px;  border-top-right-radius: 20px;'/>";
			   $b_cont .="</a>";
				//$b_cont .="<img class='card-img-top' src='assets/img/bb1.jpg' style='border-radius: 20px;' alt='Card image cap'>";
				  $b_cont .="</div>";
				 $b_cont .="</div>";
				  $b_cont .="<div class='card-body'>";
				    $b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."' style='text-decoration: none;'>";
				$b_cont .="<h4 class='card-title' style='color: #000; height: 70px;'>"."<font face='Poppins'>".$blv[2]."</font></h4>";
				 $b_cont .="</a>";
				 	$b_cont .="<font face='Poppins'>"."<span class='badge badge-secondary mt-1' style='font-size: 12px; background-color: #ff3ab2;'>"."BY Ammay Aarob"."</span>"."</font>";
				 $b_cont .="</div>";
		
				    $b_cont .="<div class='card-body pt-3 pb-2'>";
					$b_cont .="<a href='#' class='card-link pr-5 pl-1 mr-5' style='color:#000; text-decoration: none;'>"."<font face='Poppins'>"." Category from Fashion | Review More"."</font></a>";
					$b_cont .="<a href='#' class='card-link pl-4 ml-2 align-left text-left  text-dark' style='font-size:20px; text-decoration: none; font-weight:bold;'>";
					$b_cont .="<span class='fa fa-star checked' style='color: #fdb816;'></span>";
					$b_cont .="<span class='fa fa-star checked' style='color: #fdb816;'></span>";
					$b_cont .="<span class='fa fa-star checked' style='color: #fdb816;'></span>";
					$b_cont .="<span class='fa fa-star checked' style='color: #fdb816;'></span>";
					$b_cont .="<span class='fa fa-star checked' style='color: #fdb816;'></span>";

					$b_cont .="</a>";
				  $b_cont .="</div>";
				$b_cont .="</div>"; //<!--card -end-->
		$b_cont .="</div>"; //<!--col-6 end-->
		
		 
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>";
		} // while  
	
		
		return  $b_cont;
	}// method for index
	
	
	
		// blog list  
	public function forthbgListView()
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("_mt_ttl" =>"blog", "hadr_mntib" => 1));
		 $b_cont = '';
		
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		
		    $b_cont .="<div class='col-sm-2 p-2'>";
		       $b_cont .="<div class='card' style='border: 1px solid #f5f5f5; border-radius: 10px;'>";
		        $b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."'>";
			     $b_cont .="<img src='assets/shared/$blv[10]' class='img-fluid' style='width: 100%; height:150px; border-top-left-radius: 20px;  border-top-right-radius: 20px;'/>";
			      $b_cont .="</a>";
				  //$b_cont .="<img class='card-img-top' src='assets/img/d1.jpg' alt='Card image cap' style='border-top-left-radius: 10px; border-top-right-radius: 10px;'>";
				  $b_cont .="<div class='card-body p-1 m-0' style='height: 150px;'>";
				    $b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."' style='text-decoration: none; color: #000;'>";
				$b_cont .="<p class='card-text p-3' style='font-size:16px;'>"."<font face='Poppins'>"."<b>".ucwords($blv[2])."</b></font></p>";
				 $b_cont .="</a>";
			   $b_cont .="</div>";
		    $b_cont .="</div>"; //<!--card-->
	     $b_cont .="</div>"; //<!--col-2 end-->
		 
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>";
		} // while  
	
		
		return  $b_cont;
	}// method for index
	
	
		// blog list  
	public function fifthbgListView()
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("_mt_ttl" =>"blog", "ftro_mnwtb" => 8));
		 $b_cont = '';
		
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		
			$b_cont .="<div class='col-sm-6 mt-3'>";
			  $b_cont .="<div class='card border border-light'>";
			   $b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."'>";
				 $b_cont .="<img src='assets/shared/$blv[10]' class='card-img-top img-fluid p-3' style='border-radius: 20px;' alt='...'>";
				  $b_cont .="</a>";
					$b_cont .="<div class='card-body'>";
						$b_cont .="<div class='col-sm-10 m-auto'>";
						//  $b_cont .="<img src='assets/img/c1.png' class='img-fluid' style='width: 100%; border-top-left-radius: 20px;  border-top-right-radius: 20px;'/>";
						//	$b_cont .="<img src='assets/img/c1.png' class='card-img-top img-fluid' alt=''>";
							$b_cont .="</div>";
							$b_cont .="<p class='card-text text-center' style='font-size:12px; color: #ff3ab2'>"."<font face='Poppins'>"."Fashion"."</font></p>";
							 $b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."' style='text-decoration: none; color: #000;'>";
							$b_cont .="<p class='card-text text-center' style='font-size:22px; height: 80px;'>"."<font face='Poppins'>".$blv[2]."</font></p>";
							$b_cont .="</a>";
							$b_cont .="</br>";
							//$b_cont .="<p class='card-text text-center' style='font-size:12px;'>"."<font face='Poppins'>"."<b>"."Check Now"."</b></font></p>";
						  $b_cont .="</div>";
						$b_cont .="</div>";
					$b_cont .="</div>"; //<!--col-3 end-->
			   
		   
		  
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>";
		} // while  
	
		
		return  $b_cont;
	}// method for index
	
	
		// blog list  
	public function sixbgListView($blog)
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("blg_catgy" => $blog ));
		 $b_cont = '';
		
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		
	
       $b_cont .="<div class='col-sm-4 mt-4'>";
		  $b_cont .="<div class='card' style='border-color: #fff; background-color: #fff;'>";
		   $b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."'>";
		  $b_cont .="<img src='assets/shared/$blv[10]' class='img-fluid' style='width: 100%; height: 300px; border-top-left-radius: 20px;  border-top-right-radius: 20px;'/>";
		   $b_cont .="</a>";
			//$b_cont .="<img class='card-img-top' src='assets/img/bb1.jpg' style='border-top-left-radius: 20px; border-top-right-radius: 20px;' alt='Card image cap'>";
			$b_cont .="<div class='card-body' style='background-color:#f5f5f5;'>";
			 $b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."' style='text-decoration: none;  color: #000;'>";
			$b_cont .="<h4 class='card-title' style='color: #000; height: 90px;'>"."<font face='Poppins'>".$blv[2]."</font></h4>";
			  $b_cont .="</a>";
			  
			  	$b_cont .="<font face='Poppins'>"."<span class='badge badge-secondary mt-1' style='font-size: 12px; background-color: #ff3ab2;'>"."BY Ammay Aarob"."</span>"."</font>";
				  $b_cont .="</div>";
			
			
				    $b_cont .="<div class='card-body  pt-2 pb-3' style='background-color:#f5f5f5;'>";
					$b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."' class='card-link pr-5 pl-1 mr-5' style='color:#000; text-decoration: none;'>"."<font face='Poppins'>"."Learn More"."</font></a>";
				//	$b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."' class='card-link pl-5 ml-3' style='color:#000; font-size:34px; font-weight:bold; text-decoration: none;'>"."<font face='Poppins'>"."&rarr;"."</font></a>
				  $b_cont .="</div>";
				$b_cont .="</div>"; //<!--card -end-->
		 $b_cont .="</div>"; //<!--col-4 end--->
		   
		  
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>";
		} // while  
	
		
		return  $b_cont;
	}// method for index
	
	
	////#######################################################################################################
////#######################################################################################################


public function viewCouponLoop6($needle, $match)
	{
	
		$this->_vNeedle = $needle;
		$init= $this->queryBuilderBySort($this->_totalValue, self::COUPONTAB, $this->viewNeedle($this->_vNeedle, $match), self::SORTFIELD);
		$cpnView = '';
	 	//$cpnView .= "<div class='col-sm-12 white text-left' style='background:#cf0;'>";     			
	while($coupon = mysqli_fetch_array($init, MYSQLI_NUM))
	{
		
			
	if($coupon[14] == "Never Expire"){

			
	
		
						//$cpnView .= "<div id='exclus_cod'></div>"; 
				if($_SERVER['REQUEST_URI'] == "/".$this->_storePath.$this->sUrl($match)){
				// show nothing
				$logoView = $this->savingTypes($coupon[24], $coupon[10]);
				$nameView = '';
				}else{
			
	$logoView = "<a href='".$this->viewPath().$this->sUrl($coupon[17])."'><img src='".$this->_imgPath.$coupon[9]."' class='img-thumbnail norad' /></a>";
		
	$nameView = "<a href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'>".$coupon[17]." Coupons</a>";
				} // if
				
			$cpnView .= $logoView;
		
				// end 1st wrp
		// 2nd wrp
		$cpnView .= "<div class='col-sm-7'>";
		
				//$cpnView .= $nameView;
			//$cpnView .= "<div id='".$texttitleblock."'>";
			if($coupon[10] == 'ACTIVATE COUPON'){
			$ctyp = "Promotional";
			}else{
			$ctyp = "Coupon Code";
			}
			//$cpnView .= $ctyp;
			//$cpnView .= "Valid Till: ".$coupon[14];

			$cpnView .= "<span class='heading'>".$this->subText($coupon[2], 100)."</span>";
			
		
								
			$cpnView .= "<i style='color:#333;font-size:16px;'>".$this->subText($coupon[8], 150)."</i><br /><br />";
						//$cpnView .= "<div id='coupon_expirey'>";
							
							//$cpnView .= "<div id='edate_btm_inner'>";
							//$cpnView .= $coupon[14];
							//$cpnView .= "</div>";
						//$cpnView .= "</div>";
						$cpnView .= "<span style='color:#4caf50;'>Acceptable Till: ".$coupon[14]."</span>";
		$cpnView .= "</div>";
		//$cpnView .= "</div>";
		// 2nd wrp				
		// 3rd wrp
						
				
			
		
	
			if($coupon[10] == 'ACTIVATE COUPON'){
				//$cpnView .= "<a href='".$coupon[12]."' class='address' target='_blank' id='".$coupon[19]."'><div id='getcodetext' style='position:relative; margin-left:0px;'>Get Deal</div></a>";
			
			
			$cpnView .= "<a href='".$coupon[12]."' target='_blank' class='btn btn-info getcode noborder vclick' data-placement='top' title='Click To Copy or Open Site' data-toggle='modal' data-target='#".$coupon[19]."' id='".$coupon[19]."'>Get Deal & Visit Site</a><br><br>";
              		
					
			}else{
			//$cpnView .= "<div class='ss' id='getcodetext' style='position:absolute;'>Reveal Code</div>
		
			//<a href='".$coupon[12]."' class='address' target='_blank' id='".$coupon[19]."'><div class='getcodeblock' id='cc'>".$coupon[10]."</div></a>";
			
$cpnView .= "<a href='".$coupon[12]."' target='_blank' class='getcopcode btn btn-success getcode noborder vclick'  data-clipboard-action='copy' data-clipboard-target='#cdc".$coupon[19]."' id='".$coupon[19]."'>
    Get Code & Visit Site
</a>";
              $cpnView .= "<div class='code-back' style='background:#e5e5e5;' id='cdc".$coupon[19]."'>".$coupon[10]."</div><br><br>";
			} 
			
			
						
		
						$cpnView .= "<a href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'>".$coupon[17]." Coupons</a>";
						$cpnView .= "Used ".$coupon[23]." times";
						
						
			//$cpnView .= "</div>";
			
			/*
				$cpnView .= "<div id='cpn_rating'>";
					$net_vote = $coupon[21] - $coupon[22];
				$cpnView .= "<div class='thumb_text'><span class='vote_buttons' id='vote_buttons".$coupon[19]."'>";
				$cpnView .= "<a href='javascript:;' class='vote_up' id='".$coupon[19]."'></a>";
				$cpnView .= "<a href='javascript:;' class='vote_down' id='".$coupon[19]."'></a>";
				$cpnView .= "</span>";
				$cpnView .= "<span class='votes_count' id='votes_count".$coupon[19]."'><div style='font-size:15px; text-align:center; color:#00CCFF;'>".$net_vote."<br /><i style='font-size:13px; color:#E5E5E5; text-align:center;'>Rate It</i></div> </span></div>";
				$cpnView .= "</div>";
			*/
			//$cpnView .= "<div id='cpn_descp'>";
					//$cpnView .= "<div id='edate_head'>Clicked: ".$coupon[23]."</div>";
			//$cpnView .= "</div>";
			
		
					
 

	
	//
			//$cpnView .= $this->cDialog($coupon[19], $coupon[8], $coupon[9]);
##$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$////////////////////  
			}else{
	
		

	$cpnView .= "<div class='card mt-1 col-sm-4 p-3 d-inline-block align-top' style='background-color:#f8f7fa; border:1px solid #f8f7fa;'>";
			
			
if($_SERVER['REQUEST_URI'] == "/".$this->_storePath.$this->sUrl($match)){
$logoView = "<div class='card'><div class='card-body'>";	
$logoView .= "<h2 class='card-title text-center text-info sh1'>".$this->savingTypes($coupon[24], $coupon[10])."</h2>";
$logoView .= "</div></div>";
	$browsall = '';
	$nameView = '';
	$col_sm = "col-sm-4";
}else{
		$logoView = '';
		$browsall = "<a class='card-link text-success' href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'>View  Detial</a>";
		$col_sm = "col-sm-8";
} // end if
			//$cpnView .= $logoView;
			
			
				// end 1st wrp
		// 2nd wrp
		
			
		if($coupon[10] == 'ACTIVATE COUPON'){
			$ctyp = "Deal";
		}else{
			$ctyp = "Code";
		}
		$cpnView .= "<div class='card-body mt-2' style='background-color: #ff7455; border-radius: 25px; background:
        radial-gradient(40px at 0    0   ,#f8f7fa 98%,#fff  ) 0     0   /100% 51% no-repeat,
    radial-gradient(0px at 0    100%,#f8f7fa 98%,#fff) 0     100%/51%  51% no-repeat,
    radial-gradient(40px at 100% 100%,#f8f7fa 98%,#fff) 100% 100%/51%  51% no-repeat;
}
	'>";
			//$cpnView .= "<div class='col-sm-12 text-center '><a href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'><img class='img-fluid' src='".$this->_imgPath.$coupon[9]."' width='165' height='125'/></a></div>";
			

			//$cpnView .= "<div class='col-sm-6 text-center text-white mb-3 ' style='padding: 0px; margin: 0px; background-color:#000;'>".$ctyp."</div>";
			//$cpnView .= "<div class='col-sm-6 m-auto bg-none text-center ' style='height:70px;'><a href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'><img class='img-fluid' src='".$this->_imgPath.$coupon[9]."' width='165' height='175' style='height: 120px; background-color: #f3f2f2; border-top-right-radius:95px; border-top-left-radius:95px;  border-bottom-right-radius:95px;  border-bottom-left-radius:95px; text-align:center; border:1px solid #f3f2f2;'/></a></div>";
			
	
	
	$cpnView .= "<div class='col-sm-12 pt-1 '>";
	//	 $cpnView .= "<a class='text-center text-white col-12 p-1' style='font-size:16px; color: #aba6a7; text-align: center;' href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'><b>".$coupon[17]."</b></a>";
	$cpnView .= "<h4 class='col-sm-12 mt-4  mb-2 text-center bg-none p-2' style='color: #4c4949; font-size: 18px; line-height: 25px; height: 110px;'><b>".ucwords($this->subText($coupon[2], 100))."</b></h4>";

	$cpnView .= "<h5 class='col-sm-8 m-auto card-title text-center' style='height: 90px; background-color: #fff; border-radius: 25px; color: #adacac; border:2px dashed #adacac;'>";
		$cpnView .="<i class='fa fa-scissors' style='font-size:40px;color:#adacac; margin-top: -45px; margin-left: -200px;'></i>";
		$cpnView .= "<b class='pb-3 mt-3 pt-5' style='color: #adacac;'>".$this->savingTypes($coupon[24], $coupon[10])."</b>";
		$cpnView .="</h5>";
		 $cpnView .= "<div class='text-center col-12 p-1' style='font-size:16px; color: #4c4949; text-align: center;' class='text-center'><a href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."' style='color: #4c4949; text-decoration: none;'><b>".$coupon[17]."</b></a></div>";
	//$cpnView .= "<p class='text-center' style='font-size:14px; color: #f7dd3b;'>"."Expire on: ".$coupon[14]."</p>";

	//$cpnView .="<hr>";
	//$cpnView .= "<p class='coff text-dark' style='font-size:16px;'>".$this->subText($coupon[2], 100)."</p>";
	
	//$cpnView .= "<span class='glyphicon glyphicon-time'></span><span class='text-info'> ".$coupon[14]."</span>";
	//$cpnView .= "<span class='fa fa-eye mlft'></span><span class='text-danger'> ".$coupon[23]."</span>";
	 // vote count
//	$net_vote = $coupon[21] - $coupon[22];	
//$cpnView .= "<span class='vote_buttons mlft' id='vote_buttons".$coupon[19]."'><a href='#' id='".$coupon[19]."' class='vote_up fa fa-check'></a></span>
	//	<span class='votes_count' id='votes_count".$coupon[19]."'> ".$net_vote."</span><br>";
		

	$cpnView .= "</div>"; // end sm-10
	

	$cpnView .= "<div class='col-sm-12 text-center pb-5' style=''><br>";
	if($coupon[10] == 'ACTIVATE COUPON'){
				//$cpnView .= "<a href='".$coupon[12]."' class='address' target='_blank' id='".$coupon[19]."'><div id='getcodetext' style='position:relative; margin-left:0px;'>Activate Coupon</div></a>";
			
			$cpnView .= "<a href='".$coupon[12]."' target='_blank' class='btn btn-primary btn-lg col-sm-8  vclick' data-placement='top' title='Click To View Deal' id='".$coupon[19]."' data-toggle='tooltip' style='font-size:14px; border-radius: 30px; background-color:#ff7455; border:1px solid #fff; color: #fff; '>View Deal</a>";
              		
					
			}else{
			//$cpnView .= "<div class='ss' id='getcodetext' style='position:absolute;'>Reveal Code</div>
		
			//<a href='".$coupon[12]."' class='address' target='_blank' id='".$coupon[19]."'><div class='getcodeblock' id='cc'>".$coupon[10]."</div></a>";
						$cpnView .= "<a href='' class='btn-light btn-lg ' style=background:#fff;position:absolute;' id='doli".$coupon[19]."'>".$coupon[10]."</a>";
						
$cpnView .= "<a href='".$coupon[12]."'class='makcopoocodxis btn btn-primary btn-lg col-sm-8  getcode vclick'  data-clipboard-action='copy' data-clipboard-target='#doli".$coupon[19]."' id='".$coupon[19]."' data-toggle='tooltip' title='Click To Copy Code' target='_blank' style=' border-radius: 30px; z-index:8759;position: relative; font-size:14px; background-color:#ff7455; border:1px solid #fff; color: #fff;'>
  Copy Code
</a>";
		} 
			
		$cpnView .= "</div>";
				
	$cpnView .= "</div>";
	
		//$cpnView .= "</div>";
		// end 2nd wrp
		
		$net_vote = $coupon[21] - $coupon[22]; // vote count	
	//$cpnView .= "<div class='card-footer bg-light'>";
	//$cpnView .= "<details class='curs'><br><div class='text-dark'>".$this->subText($coupon[8], 450)."</div></details>";
	//$cpnView .= "</div>";

	
	
	$cpnView .= "</div>"; // outer col-4

	
				//}else{

				//}
	
					
			} // 1st f 
			//$cpnView .= $this->cDialog($coupon[19], $coupon[8], $coupon[9]);
		} // end whil
//$cpnView .= "</div>";
	return $cpnView;
	} // end class
////#######################################################################################################
////#######################################################################################################
////#######################################################################################################
////#######################################################################################################
////#######################################################################################################
////#######################################################################################################


////#######################################################################################################
////#######################################################################################################


public function viewCouponLoop7($needle, $match)
	{
	
		$this->_vNeedle = $needle;
		$init= $this->queryBuilderBySort($this->_totalValue, self::COUPONTAB, $this->viewNeedle($this->_vNeedle, $match), self::SORTFIELD);
		$cpnView = '';
	 	//$cpnView .= "<div class='col-sm-12 white text-left' style='background:#cf0;'>";     			
	while($coupon = mysqli_fetch_array($init, MYSQLI_NUM))
	{
		
			
	if($coupon[14] == "Never Expire"){

			
	
		
						//$cpnView .= "<div id='exclus_cod'></div>"; 
				if($_SERVER['REQUEST_URI'] == "/".$this->_storePath.$this->sUrl($match)){
				// show nothing
				$logoView = $this->savingTypes($coupon[24], $coupon[10]);
				$nameView = '';
				}else{
			
	$logoView = "<a href='".$this->viewPath().$this->sUrl($coupon[17])."'><img src='".$this->_imgPath.$coupon[9]."' class='img-thumbnail norad' /></a>";
		
	$nameView = "<a href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'>".$coupon[17]." Coupons</a>";
				} // if
				
			$cpnView .= $logoView;
		
				// end 1st wrp
		// 2nd wrp
		$cpnView .= "<div class='col-sm-7'>";
		
				//$cpnView .= $nameView;
			//$cpnView .= "<div id='".$texttitleblock."'>";
			if($coupon[10] == 'ACTIVATE COUPON'){
			$ctyp = "Promotional";
			}else{
			$ctyp = "Coupon Code";
			}
			//$cpnView .= $ctyp;
			//$cpnView .= "Valid Till: ".$coupon[14];

			$cpnView .= "<span class='heading'>".$this->subText($coupon[2], 100)."</span>";
			
		
								
			$cpnView .= "<i style='color:#333;font-size:16px;'>".$this->subText($coupon[8], 150)."</i><br /><br />";
						//$cpnView .= "<div id='coupon_expirey'>";
							
							//$cpnView .= "<div id='edate_btm_inner'>";
							//$cpnView .= $coupon[14];
							//$cpnView .= "</div>";
						//$cpnView .= "</div>";
						$cpnView .= "<span style='color:#4caf50;'>Acceptable Till: ".$coupon[14]."</span>";
		$cpnView .= "</div>";
		//$cpnView .= "</div>";
		// 2nd wrp				
		// 3rd wrp
						
				
			
		
	
			if($coupon[10] == 'ACTIVATE COUPON'){
				//$cpnView .= "<a href='".$coupon[12]."' class='address' target='_blank' id='".$coupon[19]."'><div id='getcodetext' style='position:relative; margin-left:0px;'>Get Deal</div></a>";
			
			
			$cpnView .= "<a href='".$coupon[12]."' target='_blank' class='btn btn-info getcode noborder vclick' data-placement='top' title='Click To Copy or Open Site' data-toggle='modal' data-target='#".$coupon[19]."' id='".$coupon[19]."'>Get Deal & Visit Site</a><br><br>";
              		
					
			}else{
			//$cpnView .= "<div class='ss' id='getcodetext' style='position:absolute;'>Reveal Code</div>
		
			//<a href='".$coupon[12]."' class='address' target='_blank' id='".$coupon[19]."'><div class='getcodeblock' id='cc'>".$coupon[10]."</div></a>";
			
$cpnView .= "<a href='".$coupon[12]."' target='_blank' class='getcopcode btn btn-success getcode noborder vclick'  data-clipboard-action='copy' data-clipboard-target='#cdc".$coupon[19]."' id='".$coupon[19]."'>
    Get Code & Visit Site
</a>";
              $cpnView .= "<div class='code-back' style='background:#e5e5e5;' id='cdc".$coupon[19]."'>".$coupon[10]."</div><br><br>";
			} 
			
			
						
		
						$cpnView .= "<a href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'>".$coupon[17]." Coupons</a>";
						$cpnView .= "Used ".$coupon[23]." times";
						
						
			//$cpnView .= "</div>";
			
			/*
				$cpnView .= "<div id='cpn_rating'>";
					$net_vote = $coupon[21] - $coupon[22];
				$cpnView .= "<div class='thumb_text'><span class='vote_buttons' id='vote_buttons".$coupon[19]."'>";
				$cpnView .= "<a href='javascript:;' class='vote_up' id='".$coupon[19]."'></a>";
				$cpnView .= "<a href='javascript:;' class='vote_down' id='".$coupon[19]."'></a>";
				$cpnView .= "</span>";
				$cpnView .= "<span class='votes_count' id='votes_count".$coupon[19]."'><div style='font-size:15px; text-align:center; color:#00CCFF;'>".$net_vote."<br /><i style='font-size:13px; color:#E5E5E5; text-align:center;'>Rate It</i></div> </span></div>";
				$cpnView .= "</div>";
			*/
			//$cpnView .= "<div id='cpn_descp'>";
					//$cpnView .= "<div id='edate_head'>Clicked: ".$coupon[23]."</div>";
			//$cpnView .= "</div>";
			
		
					
 

	
	//
			//$cpnView .= $this->cDialog($coupon[19], $coupon[8], $coupon[9]);
##$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$////////////////////  
			}else{
	
		

	$cpnView .= "<div class='card mt-2 col-sm-4 p-2 d-inline-block align-top' style='background-color:#f8f7fa; border:1px solid #f8f7fa;'>";
			
			
if($_SERVER['REQUEST_URI'] == "/".$this->_storePath.$this->sUrl($match)){
$logoView = "<div class='card'><div class='card-body'>";	
$logoView .= "<h2 class='card-title text-center text-info sh1'>".$this->savingTypes($coupon[24], $coupon[10])."</h2>";
$logoView .= "</div></div>";
	$browsall = '';
	$nameView = '';
	$col_sm = "col-sm-4";
}else{
		$logoView = '';
		$browsall = "<a class='card-link text-success' href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'>View  Detial</a>";
		$col_sm = "col-sm-8";
} // end if
			//$cpnView .= $logoView;
			
			
				// end 1st wrp
		// 2nd wrp
		
			
		if($coupon[10] == 'ACTIVATE COUPON'){
			$ctyp = "Deal";
		}else{
			$ctyp = "Code";
		}
			$cpnView .= "<div class='card-body m-0 pt-1 ' style='background-color: #ff7455; border-radius: 25px; background:
        radial-gradient(40px at 0    0   ,#f8f7fa 98%,#fff  ) 0     0   /100% 51% no-repeat,
    radial-gradient(0px at 0    100%,#f8f7fa 98%,#fff) 0     100%/51%  51% no-repeat,
    radial-gradient(40px at 100% 100%,#f8f7fa 98%,#fff) 100% 100%/51%  51% no-repeat;
}
	'>";
			//$cpnView .= "<div class='col-sm-12 text-center '><a href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'><img class='img-fluid' src='".$this->_imgPath.$coupon[9]."' width='165' height='125'/></a></div>";
			

			//$cpnView .= "<div class='col-sm-6 text-center text-white mb-3 ' style='padding: 0px; margin: 0px; background-color:#000;'>".$ctyp."</div>";
			//$cpnView .= "<div class='col-sm-6 m-auto bg-none text-center ' style='height:70px;'><a href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'><img class='img-fluid' src='".$this->_imgPath.$coupon[9]."' width='165' height='175' style='height: 120px; background-color: #f3f2f2; border-top-right-radius:95px; border-top-left-radius:95px;  border-bottom-right-radius:95px;  border-bottom-left-radius:95px; text-align:center; border:1px solid #f3f2f2;'/></a></div>";
			
	
	
	$cpnView .= "<div class='col-sm-12 pt-1 '>";
	//	 $cpnView .= "<a class='text-center text-white col-12 p-1' style='font-size:16px; color: #aba6a7; text-align: center;' href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."'><b>".$coupon[17]."</b></a>";
	$cpnView .= "<h5 class='col-sm-12 mt-4  mb-2 text-center bg-none' style='padding: 3px; color: #000; font-size: 16px; line-height: 25px; height: 110px;'>".ucwords($this->subText($coupon[2], 100))."</h5>";

	$cpnView .= "<h5 class='col-sm-8 m-auto card-title text-center bg-white' style='height: 100px; border-radius: 25px; color: #adacac; border:2px dashed #adacac;'>";
		$cpnView .="<i class='fa fa-scissors' style='font-size:40px;color:#adacac; margin-top: -15px; margin-left: -150px;'></i>";
		$cpnView .= "<b class='pb-3 ' style=''>".$this->savingTypes($coupon[24], $coupon[10])."</b>";
		$cpnView .="</h5>";
		 $cpnView .= "<div class='text-centercol-12 p-1' style='font-size:16px; color: #000; text-align: center;' class='text-center'><a href='".$this->viewPath().$this->_storePath.$this->sUrl($coupon[17])."' style='color:#000; text-decoration: none;'><b>".$coupon[17]."</b></a></div>";
	//$cpnView .= "<p class='text-center' style='font-size:14px; color: #f7dd3b;'>"."Expire on: ".$coupon[14]."</p>";

	//$cpnView .="<hr>";
	//$cpnView .= "<p class='coff text-dark' style='font-size:16px;'>".$this->subText($coupon[2], 100)."</p>";
	
	//$cpnView .= "<span class='glyphicon glyphicon-time'></span><span class='text-info'> ".$coupon[14]."</span>";
	//$cpnView .= "<span class='fa fa-eye mlft'></span><span class='text-danger'> ".$coupon[23]."</span>";
	 // vote count
//	$net_vote = $coupon[21] - $coupon[22];	
//$cpnView .= "<span class='vote_buttons mlft' id='vote_buttons".$coupon[19]."'><a href='#' id='".$coupon[19]."' class='vote_up fa fa-check'></a></span>
	//	<span class='votes_count' id='votes_count".$coupon[19]."'> ".$net_vote."</span><br>";
		

	$cpnView .= "</div>"; // end sm-10
	

	$cpnView .= "<div class='col-sm-12 text-center pb-5' style=''><br>";
	if($coupon[10] == 'ACTIVATE COUPON'){
				//$cpnView .= "<a href='".$coupon[12]."' class='address' target='_blank' id='".$coupon[19]."'><div id='getcodetext' style='position:relative; margin-left:0px;'>Activate Coupon</div></a>";
			
			$cpnView .= "<a href='".$coupon[12]."' target='_blank' class='btn btn-primary btn-lg col-sm-8  vclick' data-placement='top' title='Click To View Deal' id='".$coupon[19]."' data-toggle='tooltip' style='font-size:14px; border-radius: 30px; background-color:#ff7455; border:1px solid #fff; color: #fff; '>View Deal</a>";
              		
					
			}else{
			//$cpnView .= "<div class='ss' id='getcodetext' style='position:absolute;'>Reveal Code</div>
		
			//<a href='".$coupon[12]."' class='address' target='_blank' id='".$coupon[19]."'><div class='getcodeblock' id='cc'>".$coupon[10]."</div></a>";
						$cpnView .= "<a href='' class='btn-light btn-lg ' style=background:#fff;position:absolute;' id='doli".$coupon[19]."'>".$coupon[10]."</a>";
						
$cpnView .= "<a href='".$coupon[12]."'class='makcopoocodxis btn btn-primary btn-lg col-sm-8  getcode vclick'  data-clipboard-action='copy' data-clipboard-target='#doli".$coupon[19]."' id='".$coupon[19]."' data-toggle='tooltip' title='Click To Copy Code' target='_blank' style=' border-radius: 30px; z-index:8759;position: relative; font-size:14px; background-color:#ff7455; border:1px solid #fff; color: #fff;'>
  Copy Code
</a>";
		} 
			
		$cpnView .= "</div>";
				
	$cpnView .= "</div>";
	
		//$cpnView .= "</div>";
		// end 2nd wrp
		
		$net_vote = $coupon[21] - $coupon[22]; // vote count	
	//$cpnView .= "<div class='card-footer bg-light'>";
	//$cpnView .= "<details class='curs'><br><div class='text-dark'>".$this->subText($coupon[8], 450)."</div></details>";
	//$cpnView .= "</div>";

	
	
	$cpnView .= "</div>"; // outer col-4

	
				//}else{

				//}
	
					
			} // 1st f 
			//$cpnView .= $this->cDialog($coupon[19], $coupon[8], $coupon[9]);
		} // end whil
//$cpnView .= "</div>";
	return $cpnView;
	} // end class
////#######################################################################################################
////#######################################################################################################
////#######################################################################################################
////#######################################################################################################
////#######################################################################################################
////#######################################################################################################


		public function sidestoresname()
	{
		$initStore = $this->queryBuilder($this->_totalValue, self::STORETAB, array('_top_sto' => 1));
		$fStore = '';
		while($sView = mysqli_fetch_array($initStore, MYSQLI_NUM))
		{	
	//	$fStore .= "<div class='col-sm-3'>";
		//$fStore .= "<div id='leftviner'></div>"
		//$fStore .= "<div class='well white'>
			//	<a href='".$this->viewPath().$this->_storePath.$this->sUrl($sView[2])."'><img src='".$this->_imgPath.$sView[8]."' alt='".$sView[2]."' class='img-thumbnail' width='200' height='150'/></a>
				//</div>";
		//$fStore .= "<br /><b>SAVE ".$sView[2]."</b><br />";
	//	$fStore .= "<br />";
//$fStore .= "<br />";		
	//	$fStore .= "</div>";
		
			//$fStore .="<li class='col-3 d-inline-block'>";
          	//$fStore .="<div class='w-deal-in d-inline-block'>"."<a href='".$this->viewPath().$this->_storePath.$this->sUrl($sView[2])."'>"."<img class='img-responsive' src='".$this->_imgPath.$sView[8]."' alt='".$sView[2]."' alt='' >"."</a>";
            $fStore .="<a href='".$this->viewPath().$this->_storePath.$this->sUrl($sView[2])."' style='color:#010101;'>"."<p>".$sView[2]."</p></a>";
            $fStore .="</hr>";
          // $fStore .="</div>";
         //$fStore .="</li>";
	
		
		} // end while
		return $fStore;
	}

  	public function topstorename()
	{
		$initStore = $this->queryBuilder($this->_totalValue, self::STORETAB, array('_top_sto' => 1));
		$fStore = '';
		while($sView = mysqli_fetch_array($initStore, MYSQLI_NUM))
		{	
		
		$fStore .="<div class='col-sm-3 mt-3'>";
			$fStore .="<div class='col-12' style='border: 1px solid #bdbbbb;'>";
			$fStore .="<div class='row'>";
			$fStore .="<div class='col-sm-6 p-3'>"."<img src='assets/shared/shops/$sView[8]' class='img-fluid pt-4'/>"."</div>";
			$fStore .="<div class='col-sm-6 p-3' style='border-left: 1px solid #bdbbbb;'>"."<b>"."<font face='Poppins'>"."<a href='".$this->viewPath().$this->_storePath.$this->sUrl($sView[2])."' style='color: #000; text-decoration: none;'>".$sView[2]."</a></font></b>";
			$fStore .="</br>";
			$fStore .="</br>";
			$fStore .="<p class='' style='color: #9B9B9B;'>"."<font face='Poppins'>"."<a href='".$this->viewPath().$this->_storePath.$this->sUrl($sView[2])."' style='color: #000; text-decoration: none;'>"."Check Brand"."</a></font></p>";
			$fStore .="</div>";
			$fStore .="</div>";
			$fStore .="</div>";
		$fStore .="</div>"; //<!--col-3 end-->  
	//	$fStore .= "<div class='col-sm-3'>";
		//$fStore .= "<div id='leftviner'></div>"
		//$fStore .= "<div class='well white'>
			//	<a href='".$this->viewPath().$this->_storePath.$this->sUrl($sView[2])."'><img src='".$this->_imgPath.$sView[8]."' alt='".$sView[2]."' class='img-thumbnail' width='200' height='150'/></a>
				//</div>";
		//$fStore .= "<br /><b>SAVE ".$sView[2]."</b><br />";
	//	$fStore .= "<br />";
//$fStore .= "<br />";		
	//	$fStore .= "</div>";
		
			//$fStore .="<li class='col-3 d-inline-block'>";
          	//$fStore .="<div class='w-deal-in d-inline-block'>"."<a href='".$this->viewPath().$this->_storePath.$this->sUrl($sView[2])."'>"."<img class='img-responsive' src='".$this->_imgPath.$sView[8]."' alt='".$sView[2]."' alt='' >"."</a>";
           // $fStore .="<a href='".$this->viewPath().$this->_storePath.$this->sUrl($sView[2])."' style='color:#010101;'>"."<p>".$sView[2]."</p></a>";
           // $fStore .="</hr>";
          // $fStore .="</div>";
         //$fStore .="</li>";
	
		
		} // end while
		return $fStore;
	}
	
	
		public function topstorename2()
	{
		$initStore = $this->queryBuilder($this->_totalValue, self::STORETAB, array('_top_sto' => 1));
		$fStore = '';
		while($sView = mysqli_fetch_array($initStore, MYSQLI_NUM))
		{	
		
		$fStore .="<div class='col-sm-12 mt-3'>";
			$fStore .="<div class='col-12' style='border: 1px solid #bdbbbb;'>";
			$fStore .="<div class='row'>";
			$fStore .="<div class='col-sm-6 p-3'>"."<img src='../assets/shared/shops/$sView[8]' class='img-fluid pt-4'/>"."</div>";
			$fStore .="<div class='col-sm-6 p-3' style='border-left: 1px solid #bdbbbb;'>"."<b>"."<font face='Poppins'>"."<a href='".$this->viewPath().$this->_storePath.$this->sUrl($sView[2])."' style='color: #000; text-decoration: none;'>".$sView[2]."</a></font></b>";
			$fStore .="</br>";
			$fStore .="</br>";
			$fStore .="<p class='' style='color: #9B9B9B;'>"."<font face='Poppins'>"."<a href='".$this->viewPath().$this->_storePath.$this->sUrl($sView[2])."' style='color: #000; text-decoration: none;'>"."Check Brand"."</a></font></p>";
			$fStore .="</div>";
			$fStore .="</div>";
			$fStore .="</div>";
		$fStore .="</div>"; //<!--col-3 end-->  
	//	$fStore .= "<div class='col-sm-3'>";
		//$fStore .= "<div id='leftviner'></div>"
		//$fStore .= "<div class='well white'>
			//	<a href='".$this->viewPath().$this->_storePath.$this->sUrl($sView[2])."'><img src='".$this->_imgPath.$sView[8]."' alt='".$sView[2]."' class='img-thumbnail' width='200' height='150'/></a>
				//</div>";
		//$fStore .= "<br /><b>SAVE ".$sView[2]."</b><br />";
	//	$fStore .= "<br />";
//$fStore .= "<br />";		
	//	$fStore .= "</div>";
		
			//$fStore .="<li class='col-3 d-inline-block'>";
          	//$fStore .="<div class='w-deal-in d-inline-block'>"."<a href='".$this->viewPath().$this->_storePath.$this->sUrl($sView[2])."'>"."<img class='img-responsive' src='".$this->_imgPath.$sView[8]."' alt='".$sView[2]."' alt='' >"."</a>";
           // $fStore .="<a href='".$this->viewPath().$this->_storePath.$this->sUrl($sView[2])."' style='color:#010101;'>"."<p>".$sView[2]."</p></a>";
           // $fStore .="</hr>";
          // $fStore .="</div>";
         //$fStore .="</li>";
	
		
		} // end while
		return $fStore;
	}
	
		
		// blog list  
	public function eightListView($blog)
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("blg_catgy" => $blog ));
		 $b_cont = '';
		
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		
	
       $b_cont .="<div class='col-sm-6 bg-none mt-3'>";
		 $b_cont .="<div class='col-12'>";
		  $b_cont .="<div class='row'>";
		  $b_cont .="<div class='col-sm-5 bg-none p-0 m-0'>";
		   $b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."'>";
		   $b_cont .="<img src='assets/shared/$blv[10]' class='img-fluid' style='width: 100%; height: 200px; border-radius: 20px; '/>";
		    $b_cont .="</a>";
		  //$b_cont .="<img src='assets/img/new1.png' class='img-fluid m-0 p-0'/>";
		  $b_cont .="</div>"; //<!--col-5 inner end-->
		  $b_cont .="<div class='col-sm-7 bg-none text-dark' style=''>";
		  $b_cont .="<div class='box arrow-left mt-2 ' style='height: 120px;'>";
			$b_cont .="<font face='Poppins'>"."<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."' style='text-decoration: none; color: #080808; font-size:20px;'>".$blv[2]."</a></font>";
			$b_cont .="</div>"; //<!--aroow box end-->
			$b_cont .="<p class='text-left pt-1 m-0' style='color: #ff3ab2;'>"."<font face='Poppins'>"."<b>"."John Hndsome"."</b></font></p>";
				$b_cont .="<font face='Poppins'>"."<span class='badge badge-outline-secondary mt-1' style='font-size: 12px; background-color: #ff3ab2;'>"."Accessories"."</span>"."</font>";
		  $b_cont .="</div>"; //<!---col7 end-->
		  $b_cont .="</div>"; //<!--inner row--->
		   $b_cont .="</div>"; //<!---inner col12 --->
	  $b_cont .="</div>"; //<!---col-4 end-->
		   
		  
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>";
		} // while  
	
		
		return  $b_cont;
	}// method for index
	
	
	
		
		// blog list  
	public function eightListView2($blog)
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("blg_catgy" => $blog ));
		 $b_cont = '';
		
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		
	
       $b_cont .="<div class='col-sm-6 bg-none mt-3'>";
		 $b_cont .="<div class='col-12'>";
		  $b_cont .="<div class='row'>";
		  $b_cont .="<div class='col-sm-5 bg-none p-0 m-0'>";
		   $b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."'>";
		   $b_cont .="<img src='../assets/shared/$blv[10]' class='img-fluid' style='width: 100%; height: 200px; border-radius: 20px; '/>";
		    $b_cont .="</a>";
		  //$b_cont .="<img src='assets/img/new1.png' class='img-fluid m-0 p-0'/>";
		  $b_cont .="</div>"; //<!--col-5 inner end-->
		  $b_cont .="<div class='col-sm-7 bg-none text-dark' style=''>";
		  $b_cont .="<div class='box arrow-left mt-2 ' style='height: 120px;'>";
			$b_cont .="<font face='Poppins'>"."<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."' style='text-decoration: none; color: #080808; font-size:20px;'>".$blv[2]."</a></font>";
			$b_cont .="</div>"; //<!--aroow box end-->
			$b_cont .="<p class='text-left pt-1 m-0' style='color: #ff3ab2;'>"."<font face='Poppins'>"."<b>"."John Hndsome"."</b></font></p>";
				$b_cont .="<font face='Poppins'>"."<span class='badge badge-outline-secondary mt-1' style='font-size: 12px; background-color: #ff3ab2;'>"."Accessories"."</span>"."</font>";
		  $b_cont .="</div>"; //<!---col7 end-->
		  $b_cont .="</div>"; //<!--inner row--->
		   $b_cont .="</div>"; //<!---inner col12 --->
	  $b_cont .="</div>"; //<!---col-4 end-->
		   
		  
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>";
		} // while  
	
		
		return  $b_cont;
	}// method for index
	
	
	
	
		// blog listt 
	public function blogctgList($blog, $blgkey)
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("_mt_ttl" => $blog , "blg_catgy" => $blgkey ));
		 $b_cont = '';
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		
			 $b_cont .="<div class='col-sm-4 mt-3 bg-none'>";
	     $b_cont .="<div class='card bg-light' style='border:none;'>";
	      $b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."'>";
	     $b_cont .="<img src='../assets/shared/$blv[10]' class='img-fluid' style='border-radius: 20px;'/>";
	      $b_cont .="</a>";
	     	$b_cont .= "<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."' class='card-title text-dark p-3' style='font-size: 20px; text-decoration: none;'>"."<font face='Poppins'>".ucwords($blv[2])."</font></a>";
		 
		 //	$b_cont .= stripslashes($blv[10]);
			$b_cont .="</div>"; //<!--card-->
	   	$b_cont .="</div>"; //<!--col-4 ednd-->		
		   
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>";
		} // while  
		
		return  $b_cont;
	}// method end blog list view total
	
	
		// blog list  
	public function bgsideList()
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("_mt_ttl" =>"blog", "sdbir_ctg" => 2));
		 $b_cont = '';
		
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		

	
  
		  $b_cont .="<div class=' mt-2 p-2' style='border-bottom: 1px solid #000;'>";
			$b_cont .="<font face='Poppins'>"."<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."' style='text-decoration: none; color: #080808; font-size:16px; '>".$blv[2]."</a></font>";
			$b_cont .="</div>"; //<!--aroow box end-->

		  
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>";
		} // while  
	
		
		return  $b_cont;
	}// method for index
	
	
			// blog list  
	public function sidtwListView()
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("_mt_ttl" =>"blog", "ftro_mnwtb" => 5));
		 $b_cont = '';
		
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		
		$b_cont .="<div class='col-sm-12 mt-3'>";
		   $b_cont .="<div class='card' style='border-color: #fff; background-color: #f8f8f8;'>";
		    $b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."'>";
		       $b_cont .="<img src='../assets/shared/$blv[10]' class='img-fluid' style='border-radius: 20px;'/>";
		        $b_cont .="</a>";
		     //$b_cont .="<img src='../assets/shared/$blv[10]' class='img-fluid' style='width: 100%; border-top-left-radius: 20px;  border-top-right-radius: 20px;'/>";
				//$b_cont .="<img class='card-img-top' src='assets/img/bb1.jpg' style='border-top-left-radius: 20px; border-top-right-radius: 20px;' alt='Card image cap'>";
				  $b_cont .="<div class='card-body' style='text-decoration: none; background-color: #f8f9fa;'>";
				  $b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."' style='text-decoration: none;'>";
					$b_cont .="<h5 class='card-title' style='color: #000;'>"."<font face='Poppins'>"."Unleashing Your Best: How to achieve your goals without sacrificing your life"."</font></h5>";
					$b_cont .="</a>";
				  $b_cont .="</div>";
				   $b_cont .="<ul class='list-group list-group-flush' style='border-color: #fff; background-color: #f8f8f8;'>";
					$b_cont .="<li class='list-group-item' style='border-color: #fff; background-color: #f8f8f8;'>"."<font face='Poppins'>"."<span class='badge badge-secondary mt-1' style='font-size: 12px; background-color: #ff3ab2;'>"."BY Ammay Aarob"."</span>"."</font></li>";
				 $b_cont .="</ul>";
				    $b_cont .="<div class='card-body  pt-2 pb-2'>";
					$b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."' class='card-link pr-5 pl-1 mr-5' style='color:#8d51ff; text-decoration: none;'>"."<font face='Poppins'>"."Read Now"."</font></a>";
					//$b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."' class='card-link pl-5 ml-3' style='color:#8d51ff; font-size:34px; font-weight:bold; text-decoration: none;'>"."<font face='Poppins'>"."&rarr;"."</font></a>";
				  $b_cont .="</div>";
				$b_cont .="</div>"; //<!--card -end-->
		 $b_cont .="</div>"; //<!--col-4 end--->
		 
		 
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>";
		} // while  
	
		
		return  $b_cont;
	}// method for index
	
		// blog list  
	public function ftbgListView()
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("_mt_ttl" =>"blog", "sdbir_ctg" => 2));
		 $b_cont = '';
		
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		
	
       $b_cont .="<div class='col-sm-6 bg-none mt-3'>";
		 $b_cont .="<div class='col-12'>";
		  $b_cont .="<div class='row'>";
		  $b_cont .="<div class='col-sm-5 bg-none p-0 m-0'>";
		   $b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."'>";
		   $b_cont .="<img src='../assets/shared/$blv[10]' class='img-fluid' style='width: 100%; border-radius: 20px; '/>";
		    $b_cont .="</a>";
		  //$b_cont .="<img src='assets/img/new1.png' class='img-fluid m-0 p-0'/>";
		  $b_cont .="</div>"; //<!--col-5 inner end-->
		  $b_cont .="<div class='col-sm-7 bg-none text-dark' style=''>";
		  $b_cont .="<div class='box arrow-left mt-2 ' style='height: 120px;'>";
			$b_cont .="<font face='Poppins'>"."<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."' style='text-decoration: none; color: #080808; font-size:20px;'>".$blv[2]."</a></font>";
			$b_cont .="</div>"; //<!--aroow box end-->
			$b_cont .="<p class='text-left pt-1 m-0' style='color: #ff3ab2;'>"."<font face='Poppins'>"."<b>"."John Hndsome"."</b></font></p>";
				$b_cont .="<font face='Poppins'>"."<span class='badge badge-outline-secondary mt-1' style='font-size: 12px; background-color: #ff3ab2;'>"."Accessories"."</span>"."</font>";
		  $b_cont .="</div>"; //<!---col7 end-->
		  $b_cont .="</div>"; //<!--inner row--->
		   $b_cont .="</div>"; //<!---inner col12 --->
	  $b_cont .="</div>"; //<!---col-4 end-->
		   
		  
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>";
		} // while  
	
		
		return  $b_cont;
	}// method for index
	
	
		// blog list  
	public function topfstView()
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("_mt_ttl" =>"blog", "sdbir_ctg" => 11));
		 $b_cont = '';
		
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		
	
          $b_cont .="<div class='col-sm-6'>";
        $b_cont .="<div class='card bg-white mt-3 text-white border border-white' style='border-radius: 15px;'>";
         $b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."'>";
         
         $b_cont .="<img src='../assets/shared/$blv[10]' class='img-fluid'  alt='Card image' style=' border-radius: 15px; '/>";
           $b_cont .="</a>";
          $b_cont .="<div class='card-img-overlay' style='height: 110px; bottom:0;  position: absolute; background-color: #5d29c166; border-top-left-radius: 15px; border-top-right-radius: 15px;'>";
             $b_cont .="<div class='col-12'>";
            $b_cont .="<span class='badge badge-secondary mt-1' style='font-size: 12px; background-color: #ff3ab2;'>"."Fashion"."</span>";
              $b_cont .="</div>";
            	$b_cont .="<font face='Poppins'>"."<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."' class='col-12 text-left p-0 m-0' style='text-decoration: none; color: #fff; font-size:20px;'>".$blv[2]."</a></font>";
               $b_cont .="</div>";
             $b_cont .="</div>";
              $b_cont .="</div>";
      
      
		  
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>";
		} // while  
	
		
		return  $b_cont;
	}// method for index
	
	
		// blog list  
	public function topsecView()
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("_mt_ttl" =>"blog", "sdbir_ctg" => 12));
		 $b_cont = '';
		
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		
	
          $b_cont .="<div class='col-sm-6'>";
        $b_cont .="<div class='card bg-white mt-3 text-white border border-white' style='border-radius: 15px;'>";
         $b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."'>";
         $b_cont .="<img src='../assets/shared/$blv[10]' class='img-fluid'  alt='Card image' style=' border-radius: 15px; '/>";  
          $b_cont .="</a>";
          $b_cont .="<div class='card-img-overlay' style='height: 110px; bottom:0;  position: absolute; background-color: #5d29c166; border-top-left-radius: 15px; border-top-right-radius: 15px;'>";
             $b_cont .="<div class='col-12'>";
            $b_cont .="<span class='badge badge-secondary mt-1' style='font-size: 12px; background-color: #ff3ab2;'>"."Fashion"."</span>";
              $b_cont .="</div>";
            	$b_cont .="<font face='Poppins'>"."<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."' class='col-12 text-left p-0 m-0' style='text-decoration: none; color: #fff; font-size:20px;'>".$blv[2]."</a></font>";
               $b_cont .="</div>";
             $b_cont .="</div>";
              $b_cont .="</div>";
      
      
		  
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>";
		} // while  
	
		
		return  $b_cont;
	}// method for index
	
	
		// blog list  
	public function topthirdView()
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("_mt_ttl" =>"blog", "sdbir_ctg" => 13));
		 $b_cont = '';
		
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		
		
		
		 $b_cont .="<div class='col-sm-5 pt-3'>";
		  $b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."'>";
          $b_cont .="<img src='../assets/shared/$blv[10]' class='bg-light img-fluid m-auto text-center align-center' style='border-radius:15px;'/>";
           $b_cont .="</a>";
           $b_cont .="<span class='badge badge-secondary mt-3' style='font-size: 12px; background-color: #ff3ab2;'>"."Fashion"."</span>";
            $b_cont .="<h5 class='card-title mt-3 p-0'>"."<font face='Poppins'>"."<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."' class='col-12 text-left p-0 m-0' style='text-decoration: none; color: #000; font-size:20px;'>".$blv[2]."</a></font>"."</h5>";
    $b_cont .="<p class='card-text'>"."Shop the most sought after designer clothes at Farfetch and give your wardrobe a fresh new look for the season ahead."."</p>";
              $b_cont .="</div>"; //<!--col-6 end--->
              
	
         
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>";
		} // while  
	
		
		return  $b_cont;
	}// method for index
	
	
			// blog list  
	public function categryblogView()
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("_mt_ttl" =>"blog", "sdbir_ctg" => 13));
		 $b_cont = '';
		
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		
		
		
		 $b_cont .="<div class='col-sm-5 pt-3'>";
		  $b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."'>";
          $b_cont .="<img src='../assets/shared/$blv[10]' class='bg-light img-fluid m-auto text-center align-center' style='border-radius:15px;'/>";
           $b_cont .="</a>";
           $b_cont .="<span class='badge badge-secondary mt-3' style='font-size: 12px; background-color: #ff3ab2;'>"."Fashion"."</span>";
            $b_cont .="<h5 class='card-title mt-3 p-0'>"."<font face='Poppins'>"."<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."' class='col-12 text-left p-0 m-0' style='text-decoration: none; color: #000; font-size:20px;'>".$blv[2]."</a></font>"."</h5>";
    $b_cont .="<p class='card-text'>"."Shop the most sought after designer clothes at Farfetch and give your wardrobe a fresh new look for the season ahead."."</p>";
              $b_cont .="</div>"; //<!--col-6 end--->
              
	
         
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>";
		} // while  
	
		
		return  $b_cont;
	}// method for index
	
	
		// blog list  
	public function ft2bgListView()
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXTAB, array("_mt_ttl" =>"blog", "sdbir_ctg" => 2));
		 $b_cont = '';
		
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		
	
       $b_cont .="<div class='col-sm-6 bg-none mt-3'>";
		 $b_cont .="<div class='col-12'>";
		  $b_cont .="<div class='row'>";
		  $b_cont .="<div class='col-sm-5 bg-none p-0 m-0'>";
		   $b_cont .="<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."'>";
		   $b_cont .="<img src='../assets/shared/$blv[10]' class='img-fluid' style='width: 100%; border-radius: 20px; '/>";
		    $b_cont .="</a>";
		  //$b_cont .="<img src='assets/img/new1.png' class='img-fluid m-0 p-0'/>";
		  $b_cont .="</div>"; //<!--col-5 inner end-->
		  $b_cont .="<div class='col-sm-7 bg-none text-dark' style=''>";
		  $b_cont .="<div class='box arrow-left mt-2 ' style='height: 120px;'>";
			$b_cont .="<font face='Poppins'>"."<a href='".$this->viewPath().$this->_blogPaths.$this->sUrl($blv[4]).$this->_blogPagPath.$this->sUrl($blv[2])."' style='text-decoration: none; color: #080808; font-size:20px;'>".$blv[2]."</a></font>";
			$b_cont .="</div>"; //<!--aroow box end-->
			$b_cont .="<p class='text-left pt-1 m-0' style='color: #ff3ab2;'>"."<font face='Poppins'>"."<b>"."John Hndsome"."</b></font></p>";
				$b_cont .="<font face='Poppins'>"."<span class='badge badge-outline-secondary mt-1' style='font-size: 12px; background-color: #ff3ab2;'>"."Accessories"."</span>"."</font>";
		  $b_cont .="</div>"; //<!---col7 end-->
		  $b_cont .="</div>"; //<!--inner row--->
		   $b_cont .="</div>"; //<!---inner col12 --->
	  $b_cont .="</div>"; //<!---col-4 end-->
		   
		  
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>";
		} // while  
	
		
		return  $b_cont;
	}// method for index
	
	
	
	
			public function blgCouponKey($key)
	{
		$key = mysqli_real_escape_string($this->connt(), addslashes($key));
		$cCate = $this->queryBuilder($this->_totalValue, self::PAGXCATTAB, array("cate_nam" => trim($key)));
		//$subCouponView =  '';
		if(mysqli_num_rows($cCate) != 0){
		$subcatlist = '';
		while($ckey = mysqli_fetch_array($cCate, MYSQLI_NUM)){
		

		//	$subcatlist .= $ckey;
			$subcatlist .= $this->blogctgList("blog", $ckey[5]);
	
		}
	return $subcatlist;	
		}else{
		echo "<div class='ml-4' style='font-size: 25px; color: #8c52ff; height: 250px;'>"."<i>"."Sorry Currently There Is No Blog Available At This Time"."</i>"."</div>";
		//$subcatlist .= "<b style='color:#000; text-decoration: none;'>You can find other categories</b></br>";
	//	$subcatlist .=  "ok";
	//	return $subcatlist;
		}
	  	
	}





	
		// blog list  
	public function blgfshlist($keyf)
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXCATTAB, array("cate_nam" => $keyf));
		 $b_cont = '';
		
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		
       $b_cont.= $this->secbgListView($blv[5]);
       
       
		  
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>";
		} // while  
	
		
		return  $b_cont;
	}// method for index
	
	
   		// blog list  
	public function blgtrvllist($keyf)
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXCATTAB, array("cate_nam" => $keyf));
		 $b_cont = '';
		
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		
       $b_cont.= $this->fistbgListView($blv[5]);
       
       
		  
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>"; 
		} // while  
	
		
		return  $b_cont;
	}// method for index
	
	
   		// blog list  
	public function blgbeautylist($keyf)
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXCATTAB, array("cate_nam" => $keyf));
		 $b_cont = '';
		
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		
       $b_cont.= $this->eightListView($blv[5]);
       
       
		  
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>";  thidbgListView
		} // while  
	
		
		return  $b_cont;
	}// method for index
	
	
			// blog list  
	public function blgbeautylist2($keyf)
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXCATTAB, array("cate_nam" => $keyf));
		 $b_cont = '';
		
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		
       $b_cont.= $this->eightListView2($blv[5]);
       
       
		  
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>";  thidbgListView
		} // while  
	
		
		return  $b_cont;
	}// method for index
	
	

   
   		// blog list  
	public function blgpetlist($keyf)
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXCATTAB, array("cate_nam" => $keyf));
		 $b_cont = '';
		
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		
       $b_cont.= $this->thidbgListView($blv[5]);
       
       
		  
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>";
		} // while  
	
		
		return  $b_cont;
	}// method for index
	
	
	// blog list  
	public function blgacesslist($keyf)
	{
		$initial = $this->queryBuilder($this->_totalValue, self::PAGXCATTAB, array("cate_nam" => $keyf));
		 $b_cont = '';
		
		 while($blv = mysqli_fetch_array($initial, MYSQLI_NUM))
		{
		
       $b_cont.= $this->sixbgListView($blv[5]);
       
       
		  
		//$b_cony .= "<div class='col-sm-12'>".$this->_pagePaths()."</div>";
		} // while  
	
		
		return  $b_cont;
	}// method for index
	



} // end class 

?>
