I'm getting these errror after I put "." ,Parse error: syntax error, unexpected ','
<?php
class Collection{
Private $m_next,$m_len;
Private $m_dic;
function Add($Item) {
$m_dic.Add."K".$m_next,$Item;
$m_next = $m_next+1;
$m_len = $m_len+1;
}
function Length {
return $m_len;
}
Public Default Function $Item[$Index];
//dim $tempItem,$i;
For Each $tempItem In $m_dic.$Items;
if ($i==$Index) {
Set $Item=$tempItem;
break;
}
$i=$i+1;
}
End Function;
function Class_Initialize {
$m_len=0;
Set $m_dic = Server.CreateObject("Scripting.Dictionary");
}
function Class_Terminate {
Set $m_dic = Nothing;
}
End Class;
Class $Node;
Public $Category_Desc;
Public $Target;
Public $iCategoryId;
Public $ChildNodes;
Public $ID;
function Init($strCategory_Desc,$strCategoryId) {
$Category_Desc = $strCategory_Desc;
$iCategoryId = $strCategoryId;
}
function Add($objNode) {
$ChildNodes.Add($objNode);
}
function Class_Initialize {
Set $ChildNodes = $New $Collection;
}
function Class_Terminate {
Set $ChildNodes = Nothing;
}
End Class;
Class $TreeView;
Private $m_folder;
Public $Color;
Public $Nodes;
Public $ID;
Public Property Let $ImagesFolder[$strFolder];
$m_folder=$strFolder;
End Property;
Public Property Get $ImagesFolder();
$ImagesFolder=$m_folder;
End Property;
function Class_Initialize {
Set $Nodes = $New $Collection;
$Color="Navy";
$m_folder="images";
}
function LoopThru($NodeList,$Parent) {
//dim $i,$j,$Node,$blnHasChild;
if ($Parent != "0") {
Out ('<ul class=tree id="N'.$Parent.'">');
} else {
Out ('<ul xstyle=\'margin-left:20px;\' id="N'.$Parent.'">');
}
for ($i=0; $i<=$NodeList.Length-1; $i++) {
Set $Node = $NodeList[$i];
if (($Node.$ChildNodes.Length>0)) {
$blnHasChild=True;
} else {
$blnHasChild=False;
}
if ($blnHasChild) {
Out('<li class=folder id="P'.$Parent.$i.'"><a class=treeview href="javascript:toggle'.$id."('N".$Parent."_".$i."','P".$Parent.$i.'\')"><font size=-1 color=navy>'.$Node.$Category_Desc."</font></a>");
} else {
?>
<li class="file"><input type="checkbox" name="txtIncident_1938" value="<?=$Node.$iCategoryId?>" class="treeview"><font size="-1" color="navy"><?=$Node.$Category_Desc?></font>
<?
//Out("<li class=file><input type=checkbox name=txtIncident value=" & Node.iCategoryId & " class=treeview><font size=-1 color=navy>" & Node.Category_Desc & "</font>")
}
if ($blnHasChild) {
Call LoopThru($Node.$ChildNodes,$Parent."_".$i);
}
Out ("</li>");
}
Out ("</ul>");
}
function Out($s) {
echo $s;
}
function Display {
Out("<script>function toggle".$id."(id,p){var myChild = document.getElementById(id);if(myChild.style.display!='block'){myChild.style.display='block';document.getElementById(p).className='folderOpen';}else{myChild.style.display='none';document.getElementById(p).className='folder';}}</script>");
Out("<style>ul.tree{display:none;margin-left:17px;}li.folder{list-style-image: url(".$ImagesFolder."/plus.gif);}li.folderOpen{list-style-image: url(".$ImagesFolder."/minus.gif);}li.file{list-style-image: url(".$ImagesFolder."/blank.gif);}a.treeview{color:".$Color.";font-family:verdana;font-size:8pt;}a.treeview:link {text-decoration:none;}a.treeview:visited{text-decoration:none;}a.treeview:hover {text-decoration:underline;}</style>");
Call LoopThru($Nodes,0);
}
function LoadFromDB {
//dim $connHelpdesk,$rsCategory,$strSQL;
Set $connHelpdesk = Server.CreateObject("ADODB.Connection");
$connHelpdesk.$Open "DSN=Helpdesk";
Set $rsCategory = Server.CreateObject("ADODB.Recordset");
// strSQL = "SELECT category_no, category_desc, iParentId FROM n_CATEGORIES WHERE igroupid = 69 AND iuserid = 54 AND tiactive = 1 ORDER BY iParentId"
$strSQL = "EXEC spClassificationTree";
$rsCategory.$Open $strSQL, $connHelpdesk;
//dim $node,$iParentId,$parentNode;
if (Not $rsCategory.$EOF) {
Do While Not $rsCategory.$EOF;
$iParentId = $rsCategory["iParentId"];
//dim $child;
Set $child = $new $Node;
Call $child.Init($rsCategory["category_desc"],$rsCategory["category_no"]);
$child.$ID =$rsCategory["category_no"];
if ($iParentId == 0) {
$Nodes.Add($child);
} else {
Set $parentNode = FindNode($Nodes,$iParentId);
if (Not ($parentNode $is Nothing)) {
$parentNode.Add($child);
}
}
$rsCategory.$MoveNext;
Loop;
$rsCategory.Close;
}
Set $rsCategory = Nothing;
$connHelpdesk.Close;
Set $connHelpdesk = Nothing;
}
function FindNode ($nodes,$ID) {
//dim $i,$tempNode;
for ($i=0; $i<=$nodes.Length-1; $i++) {
Set $tempNode = $nodes[$i];
if ($tempNode.$Id==$ID) {
Set return $tempNode;
break;
} else {
if ($tempNode.$ChildNodes.length>0) {
Set $tempNode = FindNode($tempNode.$ChildNodes,$ID);
if (Not ($tempNode $is Nothing)) {
Set return $tempNode;
break;
}
}
}
}
Set return Nothing;
}
}//End Class;
?>