LN: ".__line__." / FILE: ".__file__." / Q: ".$query." / ERR: ".mysql_error()); $cinfo = mysql_fetch_array($result); $id = $cinfo['vegid']; $vegid = $cinfo['vegid']; } if(isset($_GET['admin'])){ echo "
  • ID: ".$id; if(isset($_POST['combine'])){ $parentid = $_POST['combineid']; $query = "update tblVeggiesSources set vegid=".$parentid." where vegid=".$id; mysql_query($query) or die("\n
  • LN: ".__line__." / FILE: ".__file__." / Q: ".$query." / ERR: ".mysql_error()); $query = "update tblVeggiesPictures set vegid=".$parentid." where vegid=".$id; mysql_query($query) or die("\n
  • LN: ".__line__." / FILE: ".__file__." / Q: ".$query." / ERR: ".mysql_error()); $query = "delete from tblVeggies where vegid=".$id; mysql_query($query) or die("\n
  • LN: ".__line__." / FILE: ".__file__." / Q: ".$query." / ERR: ".mysql_error()); $query = "delete from tblVeggiesPictures where vegid=".$id; mysql_query($query) or die("\n
  • LN: ".__line__." / FILE: ".__file__." / Q: ".$query." / ERR: ".mysql_error()); $query = "delete from tblVeggiesFeaturesRelate where vegid=".$id; mysql_query($query) or die("\n
  • LN: ".__line__." / FILE: ".__file__." / Q: ".$query." / ERR: ".mysql_error()); } ?>
    0){ $referer = $_SERVER['HTTP_REFERER']; $query = "select S.sourceid,S.name,S.url from tblSources S order by S.name"; $result = mysql_query($query) or die("\n
  • LN: ".__line__." / FILE: ".__file__." / Q: ".$query." / ERR: ".mysql_error()); while($dinfo = mysql_fetch_array($result)){ $data['sources'][$dinfo['sourceid']] = array('id' => $dinfo['sourceid'], 'name' => stripslashes($dinfo['name']), 'url' => $dinfo['url']); } $query = "select V.vegid,V.categoryid,V.name,V.permalink,C.name as category,C.permalink as categorylink from tblVeggies V,tblCategories C where V.categoryid=C.categoryid and vegid=".$id; $result = mysql_query($query) or die("\n
  • LN: ".__line__." / FILE: ".__file__." / Q: ".$query." / ERR: ".mysql_error()); $info = mysql_fetch_array($result); $data['breadcrumbs'] = array(array('name' => 'Home', 'link' => $data['domain']), array('name' => "Vegetables & Herbs", 'link' => $data['domain'].'plants-seeds'), array('name' => $info['category'], 'link' => $data['domain'].$info['categorylink']), array('name' => $info['name'], 'link' => $data['domain'].$info['categorylink']."/".$info['permalink'])); if(eregi('/search',$referer)){ $p = explode("?",$referer); $p2 = explode("&",$p[1]); $q = ""; while(list($k,$var) = each($p2)){ if(eregi("q=",$var)){ $e = explode("=",$var); $q = urldecode($e[1]); break; } } unset($data['breadcrumbs'][1]); $data['breadcrumbs'][2] = array('name' => "Search: ".stripslashes($q), 'link' => $data['domain'].'search?q='.urlencode($q)); } $data['features'] = array(); $query = "select featureid,name,options,label from tblFeatures where featureid != 20 order by name"; $query = "select F.featureid,F.name,F.label,F.options,F.filteredname,F.options from tblFeatures F,tblCategoriesFeatures C where F.featureid=C.featureid and C.categoryid=".$info['categoryid']." and F.featureid NOT IN (20,27) order by name"; $result = mysql_query($query) or die("\n
  • LN: ".__line__." / FILE: ".__file__." / Q: ".$query." / ERR: ".mysql_error()); while($finfo = mysql_fetch_array($result)){ $options = array(); $a = explode("|",$finfo['options']); while(list($k,$o) = each($a)){ $b = explode(":",$o); $options[$b[0]] = $b[1]; } $data['features'][$finfo['featureid']] = array('id' => $finfo['featureid'], 'name' => ucwords($finfo['label']), 'options' => $options); } $vfeatures = array(); $query = "select featureid,val,valid from tblVeggiesFeaturesRelate where vegid=".$id; $result = mysql_query($query) or die("\n
  • LN: ".__line__." / FILE: ".__file__." / Q: ".$query." / ERR: ".mysql_error()); while($finfo = mysql_fetch_array($result)){ $ct = (isset($vfeatures[$finfo['featureid']])) ? count($vfeatures[$finfo['featureid']]) : 0; $vfeatures[$finfo['featureid']][$ct] = array('val' => $finfo['val'], 'valid' => $finfo['valid']); } $description = ""; $prices = array(); $vs = array(); $query = "select S.vegsourceid,P.id,P.qty,P.price,C.name,C.sourceid,S.link,S.description,S.organic,S.seed from tblVeggiesSourcesPrices P,tblVeggiesSources S,tblSources C where S.vegsourceid=P.vegsourceid and S.sourceid=C.sourceid and S.vegid=".$info['vegid']." order by P.price"; $result = mysql_query($query) or die("\n
  • LN: ".__line__." / FILE: ".__file__." / Q: ".$query." / ERR: ".mysql_error()); while($pinfo = mysql_fetch_array($result)){ $description = $pinfo['description']; $vs[$pinfo['vegsourceid']] = array('sourceid' => $pinfo['sourceid'], 'organic' => $pinfo['organic']); $link = "http://www.abcgrow.com/click/click.php?id=".$pinfo['vegsourceid']; if(strlen($pinfo['qty']) && strlen($pinfo['price'])){ $prices[$pinfo['vegsourceid']][] = array('id' => $pinfo['id'], 'label' => $pinfo['qty'], 'sourceid' => $pinfo['sourceid'], 'organic' => $pinfo['organic'], 'price' => $pinfo['price'], 'seed' => $pinfo['seed'], 'name' => stripslashes($pinfo['name']), 'link' => $link); } } $images = array(); $query = "select imageid,pictureurl,description from tblVeggiesPictures P where P.vegid=".$info['vegid']; $result = mysql_query($query) or die("\n
  • LN: ".__line__." / FILE: ".__file__." / Q: ".$query." / ERR: ".mysql_error()); while($pinfo = mysql_fetch_array($result)){ $images[] = array('id' => $pinfo['id'], 'image' => $data['domain']."images/plants/vegetables/".$pinfo['pictureurl']); } $url = $data['domain'].$info['permalink']; $url = $data['domain']."product.php?id=".$info['vegid']; $url = $data['domain'].$info['categorylink']."/".$info['permalink']; //"product.php?id=".$info['vegid']; $data['plant'] = array('id' => $info['vegid'], 'categoryid' => $info['categoryid'], 'category' => $info['category'], 'name' => $info['name'], 'permalink' => $url, 'description' => $description, 'prices' => $prices, 'features' => $vfeatures, 'images' => $images); } //season - 16 //uses - 12 $data['related'] = array(); $att1 = $att2 = 0; $queryTables = $queryJoins = $queryEnds = $queryPass = ""; if(count($data['plant']['features'][12])){ $table = "R2"; $queryTables .= ",tblVeggiesFeaturesRelate ".$table; $queryJoins .= " and V.vegid=".$table.".vegid"; $queryEnds .= " and ".$table.".featureid=12 and ".$table.".val=\"".mysql_escape_string($data['plant']['features'][12][0]['val'])."\""; } if(count($data['plant']['features'][16])){ $query = "select V.vegid,V.name,V.permalink from tblVeggies V,tblVeggiesFeaturesRelate R1".$queryTables." where V.vegid=R1.vegid".$queryJoins." and R1.val='".$data['plant']['features'][16][0]['val']."' and V.vegid != ".$id." and V.categoryid=".$data['plant']['categoryid']." ".$queryEnds." order by rand() limit 8"; }else{ $query = "select V.vegid,V.name,V.permalink from tblVeggies V where V.vegid != ".$id." and V.categoryid=".$data['plant']['categoryid']." order by rand() limit 8"; } $resultRelated = mysql_query($query) or die("\n
  • LN: ".__line__." / FILE: ".__file__." / Q: ".$query." / ERR: ".mysql_error()); if(!mysql_num_rows($resultRelated)){ $query = "select V.vegid,V.name,V.permalink from tblVeggies V where V.vegid != ".$id." and V.categoryid=".$data['plant']['categoryid']." order by rand() limit 8"; //echo "
  • Q: ".$query; $resultRelated = mysql_query($query) or die("\n
  • LN: ".__line__." / FILE: ".__file__." / Q: ".$query." / ERR: ".mysql_error()); } while($rinfo = mysql_fetch_array($resultRelated)){ $images = $vfeatures = $prices = array(); $query = "select imageid,pictureurl,description from tblVeggiesPictures P where P.vegid=".$rinfo['vegid']; $result = mysql_query($query) or die("\n
  • LN: ".__line__." / FILE: ".__file__." / Q: ".$query." / ERR: ".mysql_error()); if(mysql_num_rows($result)){ while($pinfo = mysql_fetch_array($result)){ $images[] = $data['domain']."images/plants/vegetables/".$pinfo['pictureurl']; } $vfeatures = array(); $query = "select featureid,val,valid from tblVeggiesFeaturesRelate where vegid=".$rinfo['vegid']; $result = mysql_query($query) or die("\n
  • LN: ".__line__." / FILE: ".__file__." / Q: ".$query." / ERR: ".mysql_error()); while($finfo = mysql_fetch_array($result)){ $ct = (isset($vfeatures[$finfo['featureid']])) ? count($vfeatures[$finfo['featureid']]) : 0; $vfeatures[$finfo['featureid']][$ct] = array('val' => $finfo['val'], 'valid' => $finfo['valid']); } $description = ""; $url = $data['domain'].$info['permalink']; $url = $data['domain']."product.php?id=".$rinfo['vegid']; $url = $data['domain'].$info['categorylink']."/".$rinfo['permalink']; $data['related'][] = array('id' => $rinfo['vegid'], 'categoryid' => $rinfo['categoryid'], 'name' => $rinfo['name'], 'permalink' => $url, 'description' => $description, 'prices' => $prices, 'features' => $vfeatures, 'images' => $images); if(count($data['related']) == 5) break; } } $temp = $data['plant']['name']; $exp = $cinfo['category']; if(@eregi($cinfo['category'],$temp)){ //name contains category }else{ $temp .= " ".$cinfo['category']; } $data['meta']['title'] = $temp." Seeds & Starter Plants"; $data['meta']['description'] = $temp." Seeds & Starter Plants"; $data['templates']['background'] = "bg3"; include("templates/body.tmpl.php"); ?>