|
|
|
|
FURNITURE style |
if ($c!=null) {
?>
|
$tsel=printDataset($lang,'collections', 'subcategories', '*', 'col_order,sca_order_col', 'col_name', 'col_id', $col_id, 'sca_id', $sca_id, 'sca_name', 'class=subcategory', 'collection.php');
?>
|
}
?>
|
ΚΑΤΗΓΟΡΙΕΣ |
if ($sc!=null) {
?>
|
$tsel=printDataset($lang,'categories', null, '*', 'cat_order', 'cat_name', 'cat_id', null, null, null, null, 'class=subcategory', 'category.php');
?>
|
}
?>
$q="select * from categories where cat_visible=1";
$rs = $DB->execute("$q");
$n=$rs->RecordCount();
//echo '->' . $n . '';
if ($n>0) {
for ($i=0;$i<$n;$i++) {
if ($cat_id==$rs->fields['cat_id'])
$sel='_sel';
else $sel='';
?>
|
|
if ($cat_id==$rs->fields['cat_id']) {
?>
|
$tsel=printDataset($lang,'subcategories', null, '*', 'sca_order', 'sca_name', 'sca_id', $rs->fields['cat_id'], 'cat_id', $sca_id, null, 'class=subcategory', 'category.php', ' where cat_id=' . $rs->fields['cat_id']);
?>
|
}
$rs->MoveNext();
}
}
?>
|
if (strtoupper($lang)=='GR')
searchModule('ΑΝΑΖΗΤΗΣΗ ΚΩΔΙΚΟΥ','Αποδοχή');
else
searchModule('SEARCH BY CODE','Submit');
?>
|
|
|
|
//$DB->debug=true;
if ($sca_id!=null)
$q="select * from products where col_id=".$col_id." and sca_id=".$sca_id . ' order by prd_col_ord';
else
$q="select * from products where col_id=".$col_id." and ((sca_id=0) or (sca_id is null)) order by prd_col_ord";
$rs = $DB->execute("$q");
$n=$rs->RecordCount();
$col=0;
if (($n==0) && ($sca_id==null)) { // no products, yes subcategories
print '
' . $tsel . ' ';
$q="select * from collections where col_id=".$col_id;
$rs = $DB->execute("$q");
if (strtoupper($lang)=='GR')
$colDescr=$rc->fields["col_descr"];
else
$colDescr=$rc->fields["col_descr_en"];
print '
' . $colDescr . ' ';
//$DB->debug=true;
$q="select distinct a.*, scc.photo_id phid from subcategories a left join scacolphotos scc on (scc.col_id=".$col_id." and scc.sca_id=a.sca_id), products b where a.sca_id=b.sca_id and b.col_id=".$col_id." order by sca_order";
$rs = $DB->execute("$q");
$n=$rs->RecordCount();
if ($n==0) { // no products, no subcategories
$q="select * from categories where cat_id=".$cat_id;
$rs = $DB->execute("$q");
$obj = new lookupText('photos', 'photo_id', $rs->fields['photo_id_1'], 'photo_path', '', '');
$photoPath=$obj->getHtml();
?>
if (strtoupper($lang)=='GR')
$colDescr=$rc->fields["col_descr"];
else
$colDescr=$rc->fields["col_descr_en"];
print '
' . $catDescr . ' ';
?> |
} else {
?>
for ($i=0;$i<$n;$i++) {
if ($rs->fields['phid']!=null)
$obj = new lookupText('photos', 'photo_id', $rs->fields['phid'], 'photo_path', '', '');
else
$obj = new lookupText('photos', 'photo_id', $rs->fields['photo_id'], 'photo_path', '', '');
$photoPath=$obj->getHtml();
?>
$rs->MoveNext();
}
}
?>
|
} else {
print '
';
print ' ' . $tsel . ' ';
$qc="select * from collections where col_id=".$col_id;
$rc=$DB->execute($qc);
if (strtoupper($lang)=='GR')
$colDescr=$rc->fields["col_descr"];
else
$colDescr=$rc->fields["col_descr_en"];
print '
' . $colDescr . ' ';
for ($i=0;$i<$n;$i++) {
if ($rs->fields['photo_id']!=null) {
$obj = new lookupText('photos', 'photo_id', $rs->fields['photo_id'], 'photo_tpath', '', '');
$photoPath=$obj->getHtml();
} else $photoPath='images/noimg_100.jpg';
if (($photoPath!=null) && ($photoPath!='-') && ($photoPath!='')) {
list($width, $height) = getimagesize("$photoPath");
if ($height>85) {
$newheight=85;
$percent=$newheight/$height;
$newwidth = $width * $percent;
$height=85;
if ($newwidth<=85)
$lwidth=85;
$width=$newwidth;
?>
} else {
if ($width<=85)
$lwidth=85;
else $lwidth=$width;
?>
}
}
$rs->MoveNext();
}
if ($n>36) {
?>
}
}
?>
|
|