$counter = 0;
$members = array_reverse($members);
foreach ($members as $nikolas) {
    $address = $CONFIG->API_URL . "eidsearch?id=http://metamorphosis.med.duth.gr/uid%23" . $nikolas->guid;
    $rdf_info = connectToSesame($address);
    $medParser = new MeducatorParser($rdf_info, true);
    if (count($medParser->results) > 0) {
        foreach ($medParser->results as $key => $value) {
            $resourceSesameID = $key;
            $resourceData = $value;
        }
    } else {
        $resourceData = array();
        $resourceSesameID = "";
    }
    $mM = new MeducatorMetadata($resourceSesameID, $resourceData);
    if ($mM->getID() != NULL && $mM->getID() != "") {
        $stats_single .= $nikolas->guid . "|";
        $stats_single .= $mM->getData("ID") . "|";
        $creaguid = $nikolas->creatorg;
        $crea = get_entity($creaguid);
        $stats_single .= $crea->name . "|" . $crea->Affiliation . "|" . $mM->getData("title") . "|";
        $stats_single .= $mM->getData("language") . "|";
        $stats_single .= $mM->getData("metadataLanguage") . "|";
        $stats_single .= $mM->getData("created") . "|";
        $stats_single .= $mM->getData("citation") != "" ? "YES" . "|" : "|";
        $stats_single .= $mM->getData("description") != "" ? "YES" . "|" : "|";
        $stats_single .= $mM->getData("technicalDescription") != "" ? "YES" . "|" : "|";
        $stats_single .= $mM->getData("educationalContext") != "" ? "YES" . "|" : "|";
        $stats_single .= $mM->getData("teachingLearningInstructions") != "" ? "YES" . "|" : "|";
        $stats_single .= $mM->getData("educationalObjectives") != "" ? "YES" . "|" : "|";
 * @link http://www.coldtrick.com/
 * 
 * @uses $vars['entity'] The user entity
 * @uses $vars['profile'] Profile items from $CONFIG->profile, defined in profile/start.php for now 
 */
require_once dirname(dirname(dirname(dirname(dirname(__FILE__))))) . "/mmsearch/custom/MeducatorMetadata.php";
include dirname(dirname(dirname(dirname(dirname(__FILE__))))) . "/mmsearch/views/default/resources/properties_list.php";
$ts = time();
//	$token = generate_action_token($ts);
$editAction = false;
$resourceData = array();
if (is_array($vars["data"]) && $vars["sesame_id"] != "") {
    $editAction = true;
    $resourceData = $vars["data"];
}
$mM = new MeducatorMetadata($vars["sesame_id"], $vars["data"]);
//print_r($mM);
if ($editAction) {
    $auxResTitle = $mM->getData("title");
} else {
    $auxResTitle = page_owner_entity()->meducator3;
}
//echo "here1";
?>

<style type="text/css">
select {
    -moz-border-radius: 5px 5px 5px 5px;
    border: 1px solid #CCCCCC;
    color: #666666;
    font: 120% Arial,Helvetica,sans-serif;
 * @copyright Coldtrick IT Solutions 2009
 * @link http://www.coldtrick.com/
 * 
 * @uses $vars['entity'] The user entity
 * @uses $vars['profile'] Profile items from $CONFIG->profile, defined in profile/start.php for now 
 */
require_once dirname(dirname(dirname(dirname(dirname(__FILE__))))) . "/mmsearch/custom/MeducatorMetadata.php";
$ts = time();
//	$token = generate_action_token($ts);
$editAction = false;
$resourceData = array();
if (is_array($vars["data"]) && $vars["sesame_id"] != "") {
    $editAction = true;
    $resourceData = $vars["data"];
}
$mM = new MeducatorMetadata($vars["sesame_id"], $vars["data"]);
//print_r($mM);
?>

<script type="text/javascript" language="javascript">
    function submitForm()
    {
        var typesList = "";
        //save the settings for the current selectedParent
        if(previousParent != null)
        {
            $('#repurpose_desc_' + previousParent).val($('#meducator27').val());
            $('#meducator265 option:selected').each(function(i, element){
               typesList += (typesList == "") ? $(element).text() : ";" + $(element).text();
             });
             $('#repurpose_types_' + previousParent).val(typesList);
$members = get_entities_from_metadata('issimpleuser', 'no', 'user', '', '', 10000);
fwrite($ourFileHandle, "GUID|CREATOR|AFFILIATION|TITLE|URL|IPR_CC|IPR_OTHER|QUALITY STAMP|RESOURCE LANGUAGE|METADATA LANGUAGE|AUTHOR|DATE|CITATION|KEYWORDS|EDUCATIONAL DESCRIPTION|TECHNICAL DESCRIPTION|RESOURCE TYPE|MEDIA TYPE|DISCIPLINE|SPECIALTY|EDUCATIONAL LEVEL|EDUCATIONAL CONTEXT|EDUCATIONAL INSTRUCTIONS|EDUCATIONAL OBJECTIVES|LEARNING OUTCOMES|ASSESSMENT METHODS|EDUCATIONAL PREREQUISITES|IDS OF PARENTS|COMPANION\r");
foreach ($members as $nikolas) {
    $address = $CONFIG->API_URL . "eidsearch?id=" . $nikolas->guid;
    $rdf_info = connectToSesame($address);
    $medParser = new MeducatorParser($rdf_info, true);
    if (count($medParser->results) > 0) {
        foreach ($medParser->results as $key => $value) {
            $resourceSesameID = $key;
            $resourceData = $value;
        }
    } else {
        $resourceData = array();
        $resourceSesameID = "";
    }
    $mM = new MeducatorMetadata($resourceSesameID, $resourceData);
    $stats = $nikolas->guid . "|";
    $creaguid = $nikolas->creatorg;
    $crea = get_entity($creaguid);
    $stats .= $crea->name . "|" . $crea->Affiliation . "|" . $mM->getData("title");
    //       fwrite($ourFileHandle,$crea->name);
    //      fwrite($ourFileHandle,"|".$crea->Affiliation);
    //      fwrite($ourFileHandle,"|".$mM->getData("title"));
    $uris = $mM->getData("identifier");
    if ($uris) {
        foreach ($uris as $uri) {
            $statsiden = $uri[description];
        }
    }
}
// layout the page
     $rdf_info = connectToSesame($address);
     require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/mod/mmsearch/custom/MeducatorParser.php";
     require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/mod/mmsearch/custom/MeducatorMetadata.php";
     $medParser = new MeducatorParser($rdf_info, true);
     $b = print_r($medParser, true);
     file_put_contents("bbb", $b);
     if (count($medParser->results) > 0) {
         foreach ($medParser->results as $key => $value) {
             $resourceSesameID = $key;
             $resourceData = $value;
         }
     } else {
         $resourceData = array();
         $resourceSesameID = "";
     }
     $mM = new MeducatorMetadata($resourceSesameID, $resourceData);
     if (issuperadminloggedin()) {
         //TEODOR print_r($mM);
     }
     //			echo "<br />";
     //			foreach($mM->getData("creator") as $niks)
     //			echo $niks;
     //	exit();
 }
 $delid = substr($mM->ID, 36);
 /*		if ($vars['entity']->issimpleuser!='yes'){
 											echo elgg_view(
 						"profile/icon", array(
 												'entity' => $vars['entity'],
 												//'align' => "left",
 												'size' => "large",