<?php 
global $database;
global $my;
global $agent2;
global $email2;

$this->execPieceByName('ff_InitLib');//This is important! - without this line, it doesn't work!

/*
  This php code is executed while the page is created.
  It queries the userlist by sql and creates options for the select list.
*/
$titles = ff_select("select * from agent where Acc = '$my->username' order by Name");

$email2 = '';

if ($titles)
    foreach ($titles as $title) 
        $email2 .= "0;$title->Name;$title->Email\n";
        
return "1;Select agency \r\n".$email2;

?>

