private function process()
 {
     $this->commonProcess();
     $config = services::getService('config');
     $lang = services::getService('lang');
     $params = services::getService('pageParams');
     // the table with users pools is generated
     // fetch "Pool"
     $pools_pool = new pools();
     $pools_pool->id = 1;
     $pools_pool->find(true);
     if ($pools_pool->isAdmin($this->user->id)) {
         $this->mypoolstable_thirdcol = true;
         $this->mypoolstable[] = array("id" => $pools_pool->id, "name" => $pools_pool->name, "area" => $pools_pool->area, "links" => '<a href="./index.php?page=pooldata&pool_id=' . $pools->id . '">' . $lang->getMsg('mysite_poolsadmintable_changedatalink') . '</a> | <a href="./index.php?page=pooladmin&pool_id=' . $pools->id . '">' . $lang->getMsg('mysite_poolsadmintable_adminlink') . '</a>');
     } else {
         $this->mypoolstable[] = array("id" => $pools_pool->id, "name" => $pools_pool->name, "area" => $pools_pool->area);
     }
     // fetch all other pools
     $pools = new poolsFetcher();
     $pools->_user = $this->user->id;
     $pools->_order = "name";
     $pools->search();
     while ($pools->fetch()) {
         if ($pools->id != 1) {
             if ($pools->isAdmin($this->user->id)) {
                 $this->mypoolstable_thirdcol = true;
                 $this->mypoolstable[] = array("id" => $pools->id, "name" => $pools->name, "area" => $pools->area, "links" => '<a href="./index.php?page=pooldata&pool_id=' . $pools->id . '">' . $lang->getMsg('mysite_poolsadmintable_changedatalink') . '</a> | <a href="./index.php?page=pooladmin&pool_id=' . $pools->id . '">' . $lang->getMsg('mysite_poolsadmintable_adminlink') . '</a>');
             } else {
                 $this->mypoolstable[] = array("id" => $pools->id, "name" => $pools->name, "area" => $pools->area);
             }
         }
     }
 }
 private function process()
 {
     $this->commonProcess();
     $config = services::getService('config');
     $lang = services::getService('lang');
     $params = services::getService('pageParams');
     // function is set
     if ($params->getParam('function')) {
         $this->function = $params->getParam('function');
     } else {
         $this->function = 'public';
     }
     $table = new tablePools();
     if ($this->function == 'public') {
         // fetch "Pool"
         $pools_pool = new pools();
         $pools_pool->id = 1;
         $pools_pool->find(true);
         $main_res = new resFetcher();
         $main_res->_pools = array(1);
         $table->addRow(array('<a href="./index.php?page=showpool&pool_id=' . $pools_pool->id . '&cat=0&type=0">' . $pools_pool->name . '</a>', $pools_pool->area, " ", $main_res->count()), array("class" => "pools3"));
     }
     // other pools
     $pools = new poolsFetcher();
     if ($this->function == 'public') {
         $pools->_is_public = 1;
     } else {
         $pools->_is_public = 0;
     }
     $order = "country,plz";
     $pools->_order = $order;
     $pools->search();
     $act_country = 'none';
     while ($pools->fetch()) {
         if (!($pools->id == 1)) {
             // country headlines
             if ($pools->country != $act_country) {
                 if ($pools->country == '0') {
                     $table->addRow(array('&nbsp;'), array("color" => "white"));
                     $table->addRow(array('<b>' . $lang->getMsg('showpool_nocountry_header') . '</b>'), array("class" => "poolsblank"));
                 } else {
                     $table->addRow(array('&nbsp;'), array("color" => "white"));
                     $table->addRow(array('<b>' . $lang->getMsg('country_' . $pools->country) . '</b>'), array("class" => "poolsblank"));
                 }
                 $lastplz = true;
                 $act_country = $pools->country;
             }
             if ($pools->plz && !$lastplz) {
                 $table->addRow(array('&nbsp;'), array("color" => "white"));
             }
             if ($pools->plz) {
                 $plz = $pools->plz;
             } else {
                 $plz = false;
             }
             $rescount = new resFetcher();
             $rescount->_pools = array($pools->id);
             $table->addRow(array('<a href="./index.php?page=showpool&pool_id=' . $pools->id . '">' . $pools->name . '</a>', $pools->area, $plz . ' ' . $pools->city, $rescount->count()), array("class" => "pools3"));
             $lastplz = $pools->plz;
         }
     }
     $this->table = $table;
     $this->header = $lang->getMsg('poolbrowser_all_header');
 }
 private function process()
 {
     $this->commonProcess();
     $config = services::getService('config');
     $lang = services::getService('lang');
     $params = services::getService('pageParams');
     // release resources
     if ($this->user->hasResources()) {
         // release no resources-function
         if ($params->getParam('function') == "freenone") {
             $relnone = new poolsUser();
             $relnone->pool_id = $params->getParam('freenone_pool_id');
             $relnone->user_id = $this->user->id;
             $relnone->find(true);
             $relnone->res_to_free = 0;
             $relnone->update();
         }
         $newpools = new poolsUser();
         $newpools->res_to_free = 1;
         $newpools->user_id = $this->user->id;
         if ($params->getParam('new_pool')) {
             $newpool = new pools();
             $newpool->id = $params->getParam('new_pool');
             $newpool->find(true);
             $this->new_pool = clone $newpool;
         } else {
             if ($newpools->find(true)) {
                 $newpools->fetchPool();
                 $this->new_pool = clone $newpools->pool;
             }
         }
     }
     $this->user->fetchPreferences();
     // registered msg
     if ($params->getParam('function') == "noregistered") {
         $this->user->preferences->delete();
         $this->user->preferences->registered_message = "2";
         $this->user->preferences->insert();
     }
     if ($this->user->preferences->registered_message === "1") {
         $this->registered_msg = true;
     }
     // welcome msg
     if ($params->getParam('function') == "nowelcome") {
         $this->user->preferences->delete();
         $this->user->preferences->welcome_message = "2";
         $this->user->preferences->insert();
     }
     if ($this->user->preferences->welcome_message === "2") {
         $this->welcome_msg = false;
     }
     // the table with users pools is generated
     // fetch "Pool"
     $pools_pool = new pools();
     $pools_pool->id = 1;
     $pools_pool->find(true);
     if ($pools_pool->isAdmin($this->user->id)) {
         $this->mypoolstable_thirdcol = true;
         $this->mypoolstable[] = array("id" => $pools_pool->id, "name" => $pools_pool->name, "area" => $pools_pool->area, "links" => '<a href="./index.php?page=pooldata&pool_id=' . $pools->id . '">' . $lang->getMsg('mysite_poolsadmintable_changedatalink') . '</a> | <a href="./index.php?page=pooladmin&pool_id=' . $pools->id . '">' . $lang->getMsg('mysite_poolsadmintable_adminlink') . '</a>');
     } else {
         $this->mypoolstable[] = array("id" => $pools_pool->id, "name" => $pools_pool->name, "area" => $pools_pool->area);
     }
     // fetch all other pools
     $pools = new poolsFetcher();
     $pools->_user = $this->user->id;
     $pools->_order = "name";
     $pools->search();
     while ($pools->fetch()) {
         if ($pools->id != 1) {
             if ($pools->isAdmin($this->user->id)) {
                 $this->mypoolstable_thirdcol = true;
                 $this->mypoolstable[] = array("id" => $pools->id, "name" => $pools->name, "area" => $pools->area, "links" => '<a href="./index.php?page=pooldata&pool_id=' . $pools->id . '">' . $lang->getMsg('mysite_poolsadmintable_changedatalink') . '</a> | <a href="./index.php?page=pooladmin&pool_id=' . $pools->id . '">' . $lang->getMsg('mysite_poolsadmintable_adminlink') . '</a>');
             } else {
                 $this->mypoolstable[] = array("id" => $pools->id, "name" => $pools->name, "area" => $pools->area);
             }
         }
     }
     // fetch all borrowed resources
     $borrowed = new resBorrowed();
     $borrowed->user_id = $this->user->id;
     if ($borrowed->find()) {
         $this->borrowed = array();
         while ($borrowed->fetch()) {
             $borrowed->fetchRes();
             $borrowed->res->fetchUser();
             $this->borrowed[] = clone $borrowed->res;
         }
     }
 }