function IsAnagram($subject, $seek) { SortTable($subject); SortTable($seek); if ($subject == $seek) { return true; } else { return false; } }
$Get = "CampId={$CampId}&"; if (isset($_GET['SortId'])) { $SortId = $_GET['SortId']; } if (isset($_GET['SortTo'])) { $SortTo = $_GET['SortTo']; } if (isset($_GET['DeleteId'])) { $DeleteId = $_GET['DeleteId']; } UserColumns(); ///////////////////////////////////////////// ///////// call any process functions if (!$nsUser->DEMO) { if (ValidId($SortId) && isset($SortTo)) { SortTable(PFX . "_tracker_camp_piece", false, $SortId, $SortTo, "CAMPAIGN_ID={$CampId}"); } } $PathArr = false; $PathArr = GrpListPath($CampId); if (count($PathArr) > 1) { $PathArr = array_reverse($PathArr); } else { $PathArr = false; } ///////////////////////////////////////////// ///////// display section here $SubMenu[0]['Name'] = $Lang['BackToCamp']; $SubMenu[0]['Link'] = getURL("campaign"); $SubMenu[1]['Name'] = $Lang['AddNewCamp']; $SubMenu[1]['Link'] = getURL("sub_camp", "EditId=new&GrpId={$CampId}");
///////// call any process functions if (!$nsUser->DEMO) { if (ValidId($EditId) && isset($EditArr) && is_array($EditArr)) { UpdateCampaign($EditId, $EditArr); } if (isset($EditId) && $EditId == "new" && isset($EditArr) && is_array($EditArr)) { CreateCampaign($EditArr, $ParentId); } if (ValidId($DeleteId)) { DeleteCampaign($CpId, $DeleteId); } if (ValidId($MoveId) && ValidId($MoveTo)) { MoveCampaign($MoveId, $MoveTo); } if (ValidId($SortId) && isset($SortTo) && ValidId($ParentId)) { SortTable(PFX . "_tracker_campaign", false, $SortId, $SortTo, "PARENT_ID={$ParentId}"); } } ///////////////////////////////////////////// ///////// display section here //// campaigns tree if (!isset($EditId) || !ValidId($EditId) && $EditId != "new") { UserColumns(); $SubMenu[0]['Name'] = $Lang['AddGroup']; $SubMenu[0]['Link'] = getURL("campaign", "EditId=new"); $SubMenu[1]['Name'] = $Lang['AddCampNoGrp']; $SubMenu[1]['Link'] = getURL("sub_camp", "EditId=new&GrpId=0"); include $nsTemplate->Inc("inc/header"); include $nsTemplate->Inc("inc/submenu"); $FirstIter = true; $JavaArrCounter = 1;
function GetGroupDataFromDB($targetUser, $targetRole, &$targetTable) { global $site; global $groupSortColumn; global $groupSortDirection; // Call server to get comprehensive list of users. $groups = $site->EnumerateGroups($targetUser, $targetRole); $buffer = ""; $chunk = ""; do { $chunkSize = $groups->Read($chunk, 4096); $buffer = $buffer . $chunk; } while ($chunkSize != 0); // Parse XML in $buffer parseUnicodeData($buffer, $targetTable, 'Group', 'groupRecParser'); SortTable($targetTable, $groupSortColumn, $groupSortDirection); }