<?php require_once 'protect.php'; 
$count++;
$id=$row['insert_id'];
$category_id=$row['category_id'];
$section_id=$row['section_id'];
$pageid=$row['page_id'];
$pageitem=$row['page'];
if ($itempage==1) { $siteitem=$pageitem; }
$pagesiteitem=$siteitem.".".$pageid;
$name=$row['name'];
$description=$row['description'];
$details=$row['details'];
$text=$row['text'];
$extra=$row['extra'];
$code=$row['code'];
$url=$row['url'];
$itemail=$row['email'];
$script=$row['script'];
$price=$row['price'];
$price1=$row['price'];
$offerprice=$row['offerprice'];
$weight=$row['weight'];
$unit=$row['unit'];
$image=$row['image'];
$file=$row['file'];
$typei=$row['type'];
$new=$row['new'];
$available=$row['available'];
$size=$row['size'];
$color=$row['color'];
$showpage=$row['showpage'];
$priority=$row['priority'];
$itemdate=$row['date'];

$resultc = $mysqli->query("SELECT name, page, discount, type FROM categories WHERE insert_id=$category_id AND lang_id=$lang");
$row = $resultc->fetch_array();
$category=$row['name'];
$page=$row['page'];
$discount=$row['discount'];
$typec=$row['type'];

if ($type==4) {
$resultsc = $mysqli->query("SELECT name, page, parent FROM sections WHERE insert_id=$section_id AND lang_id=$lang");
$row = $resultsc->fetch_array();
$secategory2=$row['name'];
$sepage2=$row['page'];
$secpar=$row['parent'];
$resultsc1 = $mysqli->query("SELECT name, page FROM sections WHERE insert_id='$secpar' AND lang_id=$lang");
$row = $resultsc1->fetch_array();
$secategory=$row['name'];
$sepage=$row['page'];
}

$result1s = $mysqli->query("SELECT id FROM extras WHERE type=1 AND lang_id=$lang AND item_id=$id AND publish='yes' AND category_id=ANY (SELECT insert_id FROM categories WHERE type=3 AND lang_id=$lang AND publish='yes')");
$nrrows1s = mysqli_num_rows($result1s);
$result1p = $mysqli->query("SELECT id FROM extras WHERE type=0 AND item_id=$id");
$nrrows1p = mysqli_num_rows($result1p);
?>