"; } if ($currentPage > 1) { echo " "; } if ($currentPage-$nrToShow > 1) echo "... "; } function scrieSufix($basePath, $totalPagini, $currentPage, $nrToShow=5, $clasaLink, $arataFastForward) { global $ABS_PATH; if ($currentPage+$nrToShow < $totalPagini) echo "... "; if ($currentPage < $totalPagini) { echo " "; } if ($arataFastForward) { echo " "; } } function scrieLinkPagini($idx, $currentPage, $basePath, $clasaLink, $totalPagini) { if ($idx == $currentPage) { ?> ".$idx." "; } } function paginare($basePath, $totalPagini, $currentPage, $nrToShow=5, $clasaLink) { if ($totalPagini > ($nrToShow*2)-1) { if ($currentPage <= $nrToShow) { //echo "cazI"; scriePrefix($basePath, $totalPagini, $currentPage, $nrToShow, $clasaLink, false); for ($i=1; $i<=$currentPage+$nrToShow; $i++) { scrieLinkPagini($i, $currentPage, $basePath, $clasaLink, $totalPagini); } scrieSufix($basePath, $totalPagini, $currentPage, $nrToShow, $clasaLink, true); } elseif ($currentPage >= $totalPagini-$nrToShow) { //echo "cazII"; scriePrefix($basePath, $totalPagini, $currentPage, $nrToShow, $clasaLink, true); for ($i=$currentPage-$nrToShow; $i<=$totalPagini; $i++) { scrieLinkPagini($i, $currentPage, $basePath, $clasaLink, $totalPagini); } scrieSufix($basePath, $totalPagini, $currentPage, $nrToShow, $clasaLink, false); } else { //echo "cazIII"; scriePrefix($basePath, $totalPagini, $currentPage, $nrToShow, $clasaLink, true); for ($i=$currentPage-$nrToShow; $i<=$currentPage+$nrToShow; $i++) { scrieLinkPagini($i, $currentPage, $basePath, $clasaLink, $totalPagini); } scrieSufix($basePath, $totalPagini, $currentPage, $nrToShow, $clasaLink, true); } } else { for ($i=1; $i<=$totalPagini; $i++) { scrieLinkPagini($i, $currentPage, $basePath, $clasaLink, $modRewrite); } } } function areCopii($mId) { $sql="SELECT m_id FROM t_meniu WHERE m_parent_id='".$mId."'"; $res=query($sql); return (num($res)>0)?true:false; } function areCopii_catalog($mId) { $sql="SELECT cc_id FROM t_catalog_categorii WHERE cc_parent_id='".$mId."'"; $res=query($sql); return (num($res)>0)?true:false; } function __areCopii($tabela, $prefix, $mId) { $sql="SELECT ".$prefix."_id FROM ".$tabela." WHERE ".$prefix."_parent_id='".$mId."'"; $res=query($sql); return (num($res)>0)?true:false; } function scrieMeniu($pId=0) { if($pId!=0) echo ""; } function scrieMeniu_check($pId=0, $aidi="") { global $set; $index=1; if($pId!=0) echo ""; } function __scrieMeniu($tabela, $prefix, $pId=0, $completareSQL="", $aidi="1") { $index=1; if($pId!=0) echo "\n"; } function stergeArticol($mId) { $sql="SELECT m_id FROM t_meniu WHERE m_parent_id='".$mId."'"; $res=query($sql); if(num($res)>0) { while($row=fetch($res)) { stergeArticol($row['m_id']); } } query("DELETE FROM t_meniu WHERE m_id='".$mId."'"); } function __stergeCategorie($tabela, $prefix, $ccId) { $sql="SELECT ".$prefix."_id FROM ".$tabela." WHERE ".$prefix."_parent_id='".$ccId."'"; $res=query($sql); if(num($res)>0) { while($row=fetch($res)) { __stergeCategorie($tabela, $prefix, $row[$prefix.'_id']); } } query("DELETE FROM ".$tabela." WHERE ".$prefix."_id='".$ccId."'"); } function categorii_tree($id, $tab="") { global $tree; if($id==0) $tree=array(); $res=query("SELECT m_id, m_denumire FROM t_meniu WHERE m_parent_id = '".$id."' ORDER BY m_ordine, m_denumire"); if(num($res)>0) { while($row=fetch($res)) { $tree[]=array($row['m_id'], $tab.$row['m_denumire']); categorii_tree($row['m_id'], $tab." --- " ); } } return $tree; } function categorii_tree_catalog($catalog, $id, $tab="") { global $tree; if($id==0) $tree=array(); if($catalog!=0) $completare="AND cc_catalog='".$catalog."'"; $res=query("SELECT cc_id, cc_denumire FROM t_catalog_categorii WHERE cc_parent_id = '".$id."' AND cc_lb='".LIMBA_DEFAULT."' $completare ORDER BY cc_ordine, cc_denumire"); if(num($res)>0) { while($row=fetch($res)) { $tree[]=array($row['cc_id'], $tab.$row['cc_denumire']); categorii_tree_catalog($catalog, $row['cc_id'], $tab." --- " ); } } return $tree; } function getParinti($id, $index=1) { global $xxx; if($index==1) $xxx=array(); $sql="SELECT * FROM t_meniu WHERE m_id='".$id."'"; $res=query($sql); $row=fetch($res); $xxx[]=$row['m_id']; if($row['m_parent_id']!=0) { getParinti($row['m_parent_id'], ++$index); } return $xxx; } function __getParinti($tabel, $prefix, $id, $index=1) { global $xxx; if($index==1) $xxx=array(); $sql="SELECT * FROM ".$tabel." WHERE ".$prefix."_id='".$id."'"; $res=query($sql); $row=fetch($res); $xxx[]=$row[$prefix.'_id']; if($row[$prefix.'_parent_id']!=0) { __getParinti($tabel, $prefix, $row[$prefix.'_parent_id'], ++$index); } return $xxx; } function scrie_cale($arrayCale) { $arrayCale=array_reverse($arrayCale); $arrayDenumiri=array(); foreach($arrayCale as $idM) { $sql="SELECT m_denumire FROM t_meniu WHERE m_id='".$idM."'"; $res=query($sql); $row=fetch($res); $arrayDenumiri[]=$row['m_denumire']; } return implode(" » ", $arrayDenumiri); } function __scrieCale($tabel, $prefix, $arrayCale) { $arrayCale=array_reverse($arrayCale); $arrayDenumiri=array(); foreach($arrayCale as $idM) { $sql="SELECT ".$prefix."_denumire FROM ".$tabel." WHERE ".$prefix."_id='".$idM."'"; $res=query($sql); $row=fetch($res); $arrayDenumiri[]=$row[$prefix.'_denumire']; } return implode(" » ", $arrayDenumiri); } function areAtribute($mId) { $are=false; $sql="SELECT as_meniu FROM t_atribute_set"; $res=query($sql); while($row=fetch($res)) { $temp=explode(",", $row['as_meniu']); if(in_array($mId, $temp)) { $are=true; break; } } return $are; } function afiseazaTabelArticole($idCat) // parametru = categorie id { $sql_main="SELECT * FROM t_articole AS art INNER JOIN t_catalog_categorii AS cat ON art.art_categorie=cat.cc_id WHERE art_categorie='".$idCat."' AND art_catalog='".CATALOG."'"; $res_main=query($sql_main); $row_main=fetch($res_main); ?>

$row['atr_denumire'], "tip"=>$row['at_denumire'], "camp"=>$row['atr_camp'], "um"=>$row['atr_um']); $arrayAtribute[$row['atr_id']]=$temp; } } /* latime TD */ $nrCelule=count($arrayAtribute); $width=floor(600/($nrCelule+1)); ?> $atribut) { ?> "> $atribut) { $sql_val="SELECT artv_valoare FROM t_articole AS art INNER JOIN t_articole_valori AS artv ON artv.artv_articol=art.art_id WHERE artv_articol='".$row['art_id']."' AND artv_atribut='".$id."'"; $res_val=query($sql_val); $row_val=fetch($res_val); $valoare=$row_val['artv_valoare']; ?>
Denumire
>
", $text); ?>
>
".$row['tur_denumire'].""):("".trans("tur_virtual_no_continut").""); } ?>