You have a function called fetchdir()
but it resides within a class, therefore you cannot call the function directly without first instantiating this class, and then calling the function as a method of the class its self.
$directories = new directories;
<a href="<?php $directories->fetchdir($views); ?>">TEST</a>