Na samym końcu kodu czyli w 117 lini wyskakuje mi błąd:
syntax error, unexpected $end in C:\WebSerwer\Apache2\Apache2\htdocs\drzewo_kat_alss\class\Tree_class.php on line 117
Przepatrzyłem kod i nie znalazłem żadnego błędu związaego ze złym zamknięciem.
Z góry dziękuje za pomoc
<? /** * @package class * @author abstract : Laurent Moutard, Arnaud Beauvain, Aurore Moutte, Stéphane Bernhardt * @version 1.0 */ require("Category_class.php"); class Tree{ /** @var integer root's id in db*/ var $idRoot = 1; /** @var string product's table*/ var $productTable = "product"; /** @var string category's table*/ var $categoryTable = "category"; /** @var integer category's id choosen*/ var $idCategoryChoosen = ""; /** @var string for Listing displayable categories (all those having associated articles and their fathers)*/ var $categoryList = ""; /** @var int[] for Listing fathers of the clicked category*/ /** @var integer Size of the fathers list of the selected category*/ var $parentsListSize = 0; /** @var mixed[] containing the tree structure with the requested branch*/ /** @var Builder which creates a character string containing all of the displayable categories, separated by commas example : "1,2,15,4,11" */ function Tree($idCategoryChoosen=null){ if($idCategoryChoosen == null){ $idCategoryChoosen = $this->idRoot; } $this->idCategoryChoosen = $idCategoryChoosen; $categoryChoosen = new category($idCategoryChoosen); /** We select categories associated with suitable articles*/ $query1 = "SELECT ".$this->productTable.".id_category,".$this->categoryTable.".parents_list FROM ".$this->productTable.",".$this->categoryTable." WHERE ".$this->productTable.".id_category=".$this->categoryTable.".id GROUP BY ".$this->productTable.".id_category"; } } $this->createTree(); } /** Recursive method which creates the array which will contain the tree It doesn't need any parameter when it's called. Those are only used for the recursivity @param $index integer index used in the recursivity @param $deep integer contain the node's deep */ function createTree($index=0,$deep=0){ if($index<$this->parentsListSize){ $idCategory = $this->parentsList[$index]; $query2 = "SELECT id,name FROM ".$this->categoryTable." WHERE id_father='".$idCategory."' AND id In (".$this->categoryList.") ORDER BY name"; $index++; $this->createTree($index,$deep+1); } } } } } /** return the tree in an array @return mixed[] $tabResult */ function &getTree(){ $this->createArbre(); return($this->tabResult); } /** show the tree in html*/ function show(){ ?> <TABLE border="0" cellspacing="0" cellpadding="2" style="font-size:12px;FONT-FAMILY: Verdana;background-color:#0000BB;"> <TR> <TD bgcolor="#8888BB"> <a href="<?=$_SERVER['SCRIPT_NAME']?>?idcat=<?=$this->idRoot?>"><font color="#FFFFFF">ROOT</font></a> </TD> </TR> <? ?> <TR> <TD> <? for($i=0;$i<$values['deep'];$i++){ ?> <? } ?> <a href="<?=$_SERVER['SCRIPT_NAME']?>?idcat=<?=$id?>"><font color="#FFFFFF"><?=$values['name']?></font></a> </TD> </TR> <? } ?></TABLE><? } } } ?>