|
|
|
|
if (strtoupper($lang)=='GR') { ?>
ΚΑΤΗΓΟΡΙΕΣ
} else { ?>
CATEGORIES
} ?>
|
|
if (strtoupper($lang)=='GR')
$tsel=printDataset($lang,'categories', 'subcategories', '*', 'cat_order', 'cat_name', 'cat_id', $cat_id, 'sca_id', $sca_id, 'sca_name', 'class=subcategory', 'category.php', ' where cat_visible=0 ');
else
$tsel=printDataset($lang,'categories', 'subcategories', '*', 'cat_order', 'cat_name_en', 'cat_id', $cat_id, 'sca_id', $sca_id, 'sca_name_en', 'class=subcategory', 'category.php', ' where cat_visible=0 ');
?>
|
$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 ($_REQUEST['tsel']!=null)
$tsel=$_REQUEST['tsel'];
?>
|
if (strtoupper($lang)=='GR') { ?>
|
} else { ?>
|
} ?>
if ($cat_id==$rs->fields['cat_id']) {
?>
|
if (strtoupper($lang)=='GR')
$tsel=$rs->fields['cat_name'].' :: '.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']);
else
$tsel=$rs->fields['cat_name_en'].' :: '.printDataset($lang,'subcategories', null, '*', 'sca_order', 'sca_name_en', 'sca_id', $rs->fields['cat_id'], 'cat_id', $sca_id, null, 'class=subcategory', 'category.php', ' where cat_id=' . $rs->fields['cat_id']);
if (substr(trim($tsel),strlen(trim($tsel))-2,2)=='::')
$tsel = substr(trim($tsel),0,strlen(trim($tsel))-2);
?>
|
}
$rs->MoveNext();
}
}
?>
|
if (strtoupper($lang)=='GR')
searchModule('ΑΝΑΖΗΤΗΣΗ ΚΩΔΙΚΟΥ','Αποδοχή');
else
searchModule('SEARCH BY CODE','Submit');
?>
|
|
|
|
if ($sca_id!=null)
$q="select p.*, c.cat_descr, c.cat_descr_en from products p inner join categories c on c.cat_id=p.cat_id where p.cat_id=".$cat_id." and sca_id=".$sca_id . ' order by prd_sca_ord';
else
$q="select p.*, c.cat_descr, c.cat_descr_en from products p inner join categories c on c.cat_id=p.cat_id where p.cat_id=".$cat_id." and ((p.sca_id=0) or (p.sca_id is null)) order by prd_sca_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 categories where cat_id=".$cat_id;
$rs = $DB->execute("$q");
if (strtoupper($lang)=='GR')
$catDescr=$rc->fields["cat_descr"];
else
$catDescr=$rc->fields["cat_descr_en"];
if ($catDescr!=null)
print '
' . $catDescr . ' ';
$q="select * from subcategories where cat_id=".$cat_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");
if ($rs->fields['photo_id_1']!=null) {
$obj = new lookupText('photos', 'photo_id', $rs->fields['photo_id_1'], 'photo_path', '', '');
$photoPath=$obj->getHtml();
} else $photoPath='images/noimg.jpg';
?>
if (strtoupper($lang)=='GR')
$catDescr=$rc->fields["cat_descr"];
else
$catDescr=$rc->fields["cat_descr_en"];
print '
' . $catDescr . ' ';
?> |
} else {
?>
for ($i=0;$i<$n;$i++) {
$obj = new lookupText('photos', 'photo_id', $rs->fields['photo_id'], 'photo_path', '', '');
$photoPath=$obj->getHtml();
?>
$rs->MoveNext();
}
}
?>
|
} else {
if (substr(trim($tsel),strlen(trim($tsel))-2,2)=='::')
$tsel = substr(trim($tsel),0,strlen(trim($tsel))-2);
print '
';
print '' . $tsel . '
';
$q="select * from categories where cat_id=".$cat_id;
$r = $DB->execute("$q");
if (strtoupper($lang)=='GR') {
if ($rs->fields['cat_descr']!=null) print $rs->fields['cat_descr'] . '
';
} else {
if ($rs->fields['cat_descr_en']!=null) print $rs->fields['cat_descr_en'] . '
';
}
for ($i=0;$i<$n;$i++) {
if ($rs->fields['photo_id']!=null) {
$obj = new lookupText('photos', 'photo_id', $rs->fields['photo_id'], 'photo_path', '', '');
$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;
else
$lwidth=$newwidth;
$width=$newwidth;
?>
} else {
if ($width<=85)
$lwidth=85;
?>
}
}
$rs->MoveNext();
}
if ($n>36) {
?>
}
}
?>
|
|