time = time(); $this->startSession(); //$_SESSION['expire'] = $_SESSION['start'] + (30 * 60) ; // ending a session in 30 minutes from the starting time } function startSession(){ global $database; //The database connection session_start(); //Tell PHP to start the session /* Set referrer page */ if(isset($_SESSION['url'])){ $this->referrer = $_SESSION['url']; }else{ $this->referrer = "/"; } /* Set current url */ $this->url = $_SESSION['url'] = $_SERVER['PHP_SELF']; } }; //----------------------------------------- // Start new wession //----------------------------------------- $session = new Session; ?> 1) ? 's':''; return count($items); } } //----------------------------------------- // Total items //----------------------------------------- function dmWListTotal() { if(!isset ( $_SESSION['dm_cart01'])){ $dm_cart01 = 0; }else{ $dm_cart01 = $_SESSION['dm_cart01']; } if (!$dm_cart01) { //echo "Your Wishlist is empty"; $dm_cart01 = 0; return ''; } else { //echo "Your Wishlist"; // Parse the cart session variable $items = explode(',',$dm_cart01); $s = (count($items) > 1) ? 's':''; // return '
You have '.count($items).' item'.$s.' in your wishlist
Back to catalogue'; }return '
You have '.count($items).' item'.$s.' in your wishlist
'; } //----------------------------------------- // Show List //----------------------------------------- function dmWListShow() { $dm_cart01 = $_SESSION['dm_cart01']; if ($dm_cart01) { $items = explode(',',$dm_cart01); $contents = array(); foreach ($items as $item) { $contents[$item] = (isset($contents[$item])) ? $contents[$item] + 1 : 1; } //$output[] = '
'; //$output[] = ''; $output[] = '
'; //$output[] = ''; $sn = 1; foreach ($contents as $id=>$qty) { $output[] = '
    '; // ul start1 $result = mysql_query("SELECT * FROM `products` where item_id ='".$id."LIMIT 1'"); while ($row = mysql_fetch_assoc($result)) { $output[] = '
  • '.$sn.'
  • '; $output[] = '
  • '; $output[] = '
  • Item Code: '.$row['item_code'].'
  • '; $output[] = '
  • '.$row['item_name'].'
  • '; $output[] = '
  •  
  • '; //$output[] = '
  • Qty
  • '; //$output[] = '
  • xYxRemove

  • '; $output[] = '
  • Remove

  • '; $sn++; } $output[] = '
'; } $output[] = ''; // key divs end $output[] = '
Clear Wishlist
'; //$output[] = '
'; //$output[] = 'Submit your wishlist'; $output[] = 'Submit your wishlist'; } else { $output[] = '
Your wish list is empty.
'; } return join('',$output); } function dmWList4Email(){ // server path for full image URL //$fullPath = "http://" . $_SERVER['HTTP_HOST'] . "/cmg/"; $fullPath = "http://" . $_SERVER['HTTP_HOST'].'/www-sat/images/items/hp/'; $dm_cart01 = $_SESSION['dm_cart01']; if ($dm_cart01) { $items = explode(',',$dm_cart01); $contents = array(); foreach ($items as $item) { $contents[$item] = (isset($contents[$item])) ? $contents[$item] + 1 : 1; } $sn = 1; $output[] = '
'; // ul start1 $output[] = ''; $output[] = ''; //$output[] = ''; $output[] = ''; //$output[] = ''; $output[] = ''; foreach ($contents as $id=>$qty) { $result = mysql_query("SELECT * FROM `products` where item_id ='".$id."LIMIT 1'"); while ($row = mysql_fetch_assoc($result)) { $output[] = ''; //$output[] = ''; $output[] = ''; //$output[] = ''; $output[] = ''; //$output[] = ''; $output[] = ''; $sn++; } } $output[] = '
S/N Item CodeItem Name
'.$sn.''.$row['item_code'].''.$row['item_name'].'
'; } else { $output[] = '
Your wish list is empty.
'; } return join('',$output); } ?> Silver Arcade Linen, Dubai, UAE