<?php

function printSideLinks($current, $permission) {
$linkNames = [
  "index.php" => "HOME",
  "changeCnam.php" => "Change Cnam",
  "enum.php" => "Enum Lookup"
  ];
        //current page
        //$current = substr($_SERVER['PHP_SELF'], 1);

//creates side links dynamically, but skips current page
foreach($linkNames as $x => $x_value) {
  //error_log("DEBUG: x '$x' / x_value '$x_value'");
	if($x == $current)  {
		continue;
	} elseif ($current == 'index.php') {
            echo "<li><label><a href=" . $x .  ">" . $x_value . "</a></label></li>";

        }  else {
	
            echo "<a href=" . $x . ">" . $x_value . "</a></br>";
        
        }
}
}

?>
