Пример #1
0
 function loadMoreComments($paramOne = null, $paramTwo = null)
 {
     $maximumQuantity = FormElements::filterInteger($paramTwo, true) + 1;
     $this->sqlDataArray = array('pirnaCode' => FormElements::filterString($paramOne, true), 'initialItem' => 0, 'maximumQuantity' => $maximumQuantity);
     $this->principalData = $this->model->loadMoreComments($this->sqlDataArray);
     View::render('information/morecomments', $this->principalData);
 }
Пример #2
0
 function update($paramOne = 1)
 {
     $this->model->checkLogged();
     $this->actualPage = FormElements::filterInteger($paramOne);
     $this->initialResult = ($this->actualPage - 1) * $this->resultsPerPage;
     $this->sqlDataArray = array('initialItem' => $this->initialResult, 'maximumQuantity' => $this->resultsPerPage);
     $this->tempQueryData = $this->model->getListUpdate($this->sqlDataArray);
     if (FlashMessages::hasFlashMessage()) {
         $this->principalData['allResults'] = 0;
         $this->principalData['FlashMessage'] = FlashMessages::displayFlashMessage();
     } else {
         $this->principalData['updateList'] = $this->tempQueryData['updateList'];
         $this->principalData['urlQuery'] = $this->tempQueryData['urlQuery'];
         $this->principalData['allResults'] = $this->tempQueryData['allResults'];
         $this->principalData['totalPages'] = $this->tempQueryData['totalPages'];
         $this->temporaryPagination = $this->model->pagination($this->actualPage, $this->tempQueryData['totalPages']);
         $this->principalData['pagination'] = $this->temporaryPagination[0];
         $this->principalData['activePagination'] = $this->temporaryPagination[1];
     }
     View::render('sidebar-admin');
     View::render('administration/update', $this->principalData);
 }
Пример #3
0
    function searchCluster($sqlDataArray = array())
    {
        if (isset($_POST['search'])) {
            $this->dataArray = array('cluster_chromosome' => FormElements::getPostInteger('inputSearchChromosome', true), 'cluster_start' => FormElements::getPostInteger('inputSearchStart', true), 'cluster_end' => FormElements::getPostInteger('inputSearchEnd', true));
            $this->formToken = FormElements::getPostString('token', true);
            parent::checkFormRequired($this->dataArray);
            parent::checkFormToken($this->formToken, 'search/cluster');
        } elseif (isset($_GET['cluster_chromosome']) && isset($_GET['cluster_start']) && isset($_GET['cluster_end'])) {
            $this->dataArray = array('cluster_chromosome' => FormElements::filterInteger($_GET['cluster_chromosome'], true), 'cluster_start' => FormElements::filterInteger($_GET['cluster_start'], true), 'cluster_end' => FormElements::filterInteger($_GET['cluster_end'], true));
        }
        if (!in_array('errorRequiredField', $this->dataArray) && (isset($_GET['cluster_chromosome']) || $this->formToken === Session::getSession('formToken')) && !FlashMessages::hasFlashMessage()) {
            $cookieData = date('Y-m-d') . '|cluster|' . 'cluster_chromosome|' . $this->dataArray['cluster_chromosome'] . '|cluster_start|' . $this->dataArray['cluster_start'] . '|cluster_end|' . $this->dataArray['cluster_end'];
            if (isset($_COOKIE['pirna_db_cache_search'])) {
                $newData = $_COOKIE['pirna_db_cache_search'] . '@' . $cookieData;
            } else {
                $newData = $cookieData;
            }
            setcookie('pirna_db_cache_search', $newData, time() + 86400 * 30 * 30, '/');
            Session::unsetSession('formToken');
            $this->sqlAllResults = 'SELECT cluster_code,
																		 cluster_chromosome,
																		 cluster_start,
																		 cluster_end  
															FROM cluster 
															WHERE cluster_chromosome = ' . $this->dataArray['cluster_chromosome'] . ' AND 
																		cluster_start >= ' . $this->dataArray['cluster_start'] . ' AND 
																		cluster_end <= ' . $this->dataArray['cluster_end'];
            $this->allResults = $this->db->select($this->sqlAllResults);
            $this->results[0] = count($this->allResults);
            $this->results[1] = ceil($this->results[0] / $sqlDataArray['maximumQuantity']);
            $this->sql = 'SELECT cluster_code,
													 cluster_chromosome,
													 cluster_start,
													 cluster_end  
										FROM cluster 
										WHERE cluster_chromosome = ' . $this->dataArray['cluster_chromosome'] . ' AND 
													cluster_start >= ' . $this->dataArray['cluster_start'] . ' AND 
													cluster_end <= ' . $this->dataArray['cluster_end'] . '
										LIMIT :initialItem, :maximumQuantity';
            $this->results[2] = $this->db->select($this->sql, $sqlDataArray);
            $this->results[3] = '?cluster_chromosome=' . $this->dataArray['cluster_chromosome'] . '&' . 'cluster_start=' . $this->dataArray['cluster_start'] . '&' . 'cluster_end=' . $this->dataArray['cluster_end'];
            if ($this->results[0] > 0) {
                return $this->results;
            } else {
                FlashMessages::setFlashMessage('noresult', '<b>Not Found!</b><br />None cluster was found using your query..');
            }
        }
    }
Пример #4
0
 function cluster($paramOne = 1)
 {
     $this->model->quantityCacheSearch();
     $this->model->breadCumbs();
     $this->actualPage = FormElements::filterInteger($paramOne);
     $this->initialResult = ($this->actualPage - 1) * $this->resultsPerPage;
     $this->sqlDataArray = array('initialItem' => $this->initialResult, 'maximumQuantity' => 5);
     $this->browseData = $this->model->getBrowseCluster($this->sqlDataArray);
     if (FlashMessages::hasFlashMessage()) {
         $this->principalData['FlashMessage'] = FlashMessages::displayFlashMessage();
     } else {
         $this->principalData['countResults'] = $this->browseData['quantityAllCluster'];
         $this->principalData['browseData'] = $this->browseData['clusterList'];
         $this->principalData['totalPages'] = $this->browseData['totalPages'];
         $this->temporaryPagination = $this->model->pagination($this->actualPage, $this->browseData['totalPages']);
         $this->principalData['pagination'] = $this->temporaryPagination[0];
         $this->principalData['activePagination'] = $this->temporaryPagination[1];
     }
     if ($this->actualPage === 1) {
         $this->cannonicalUrl = URL . 'browse/cluster';
     } else {
         $this->cannonicalUrl = '';
     }
     $this->principalData['qttResultPage'] = $this->resultsPerPage;
     $this->principalData['activeBrowsePirna'] = '';
     $this->principalData['activeBrowseDataset'] = '';
     $this->principalData['activeBrowseCluster'] = 'class="active"';
     View::setHeaderVars('title', 'Browse piRNA Clusters');
     View::setHeaderVars('specificKeywords', DEFAULT_KEYWORDS . ', piRNA cluster List, piRNA cluster, browse piRNA cluster');
     View::setHeaderVars('description', 'Browse all the piRNA clusters in the database');
     View::setHeaderVars('cannonicalUrl', $this->cannonicalUrl);
     View::setHeaderVars('robots', 'index, follow');
     View::render('header');
     View::render('browse/cluster', $this->principalData);
     View::render('footer-clean');
 }