function information($paramOne = null) { $this->updateItem = FormElements::filterString($paramOne); $this->model->quantityCacheSearch(); $this->model->breadCumbs(); $this->model->footerFaq(); $this->model->footerSystemUpdate(); if ($this->updateItem != null) { $this->sqlDataArray = array('info_update_id' => $this->updateItem); $this->updateData = $this->model->getUpdate($this->sqlDataArray); if (FlashMessages::hasFlashMessage()) { $this->principalData['FlashMessage'] = FlashMessages::displayFlashMessage(); } else { $this->principalData['updateData'] = $this->updateData[0]; $this->principalData['updateItem'] = true; } } else { $this->updateData = $this->model->getUpdate(); if (FlashMessages::hasFlashMessage()) { $this->principalData['FlashMessage'] = FlashMessages::displayFlashMessage(); } else { $this->principalData['updateData'] = $this->updateData; $this->principalData['updateItem'] = false; } } View::setHeaderVars('title', 'Update Information'); View::setHeaderVars('specificKeywords', ''); View::setHeaderVars('description', ''); View::setHeaderVars('cannonicalUrl', ''); View::setHeaderVars('robots', 'noindex, nofollow'); View::render('header'); View::render('update/index', $this->principalData); View::render('footer'); }
function archive($paramOne = 'pirna', $paramTwo = null, $paramThree = null) { $this->actualPage = FormElements::filterString($paramOne); $this->dataType = FormElements::filterString($paramTwo); $this->archiveExtension = FormElements::filterString($paramThree); $this->model->quantityCacheSearch(); $this->model->BreadCumbs(); $this->model->footerFaq(); $this->model->footerSystemUpdate(); $this->principalData['downloadPage'] = false; if (!empty($this->dataType) && !empty($this->archiveExtension)) { $this->principalData['downloadPage'] = true; } $this->principalData['activeDownloadPirna'] = ''; $this->principalData['activeDownloadDataset'] = ''; $this->principalData['activeDownloadAlignament'] = ''; $this->principalData['activeDownloadCluster'] = ''; if ($this->actualPage === 'pirna') { $this->model->generateLog('download pirna', 'download', '400'); $this->principalData['activeDownloadPirna'] = 'class="active"'; $this->temporaryTitle = 'piRNA'; $this->principalData['sizeHsaFile'] = Files::getFileSize('downloads/pirna/hsa-pirna-list.txt'); $this->principalData['downloadType'] = 'pirna/hsa-pirna-list'; $this->cannonicalUrl = URL . 'download/archive/pirna'; } elseif ($this->actualPage === 'dataset') { $this->model->generateLog('download dataset', 'download', '420'); $this->principalData['activeDownloadDataset'] = 'class="active"'; $this->temporaryTitle = 'Dataset'; $this->principalData['sizeHsaFile'] = Files::getFileSize('downloads/dataset/hsa-dataset-list.txt'); $this->principalData['downloadType'] = 'dataset/hsa-dataset-list'; $this->cannonicalUrl = ''; } elseif ($this->actualPage === 'alignament') { $this->model->generateLog('download alignament', 'download', '440'); $this->principalData['activeDownloadAlignament'] = 'class="active"'; $this->temporaryTitle = 'Alignament'; $this->principalData['sizeHsaFile'] = Files::getFileSize('downloads/alignament/hsa-alignament-list.txt'); $this->principalData['downloadType'] = 'alignament/hsa-alignament-list'; $this->cannonicalUrl = ''; } elseif ($this->actualPage === 'cluster') { $this->model->generateLog('download cluster', 'download', '430'); $this->principalData['activeDownloadCluster'] = 'class="active"'; $this->temporaryTitle = 'Cluster'; $this->principalData['sizeHsaFile'] = Files::getFileSize('downloads/cluster/hsa-cluster-list.txt'); $this->principalData['downloadType'] = 'cluster/hsa-cluster-list'; $this->cannonicalUrl = ''; } $this->principalData['downloadTitle'] = $this->temporaryTitle; View::setHeaderVars('title', 'Download ' . $this->temporaryTitle); View::setHeaderVars('specificKeywords', DEFAULT_KEYWORDS . ', piRNA download, dataset download, alignament download'); View::setHeaderVars('description', 'Download piRNA sequences, alignaments or full datasets'); View::setHeaderVars('cannonicalUrl', $this->cannonicalUrl); View::setHeaderVars('robots', 'index, follow'); View::render('header'); View::render('download/index', $this->principalData); View::render('footer'); }
function searchCache($sqlDataArray = array()) { if (isset($_COOKIE['pirna_db_cache_search'])) { $this->rawData = explode('@', FormElements::filterString($_COOKIE['pirna_db_cache_search'])); $quantity = count($this->rawData); for ($num = 0; $num < $quantity; ++$num) { $this->temporaryData[$num] = explode('|', $this->rawData[$num]); } if ($sqlDataArray['cache_type'] === 'pirna') { $tempNumber = 0; for ($num = 0; $num < $quantity; ++$num) { if ($this->temporaryData[$num][1] === 'pirna') { $this->results[$tempNumber]['cacheDate'] = Dates::convertDate($this->temporaryData[$num][0]); $this->results[$tempNumber]['cacheUrl'] = 'pirna/1?pirna_code=' . $this->temporaryData[$num][3]; $this->results[$tempNumber]['cacheUrl'] .= '&pirna_organism=' . $this->temporaryData[$num][5]; $this->results[$tempNumber]['cacheQuery'] = 'piRNA Code = ' . $this->temporaryData[$num][3]; $this->results[$tempNumber]['cacheQuery'] .= ' & piRNA Organism = ' . $this->temporaryData[$num][5]; ++$tempNumber; } } } elseif ($sqlDataArray['cache_type'] === 'alignament') { $tempNumber = 0; for ($num = 0; $num < $quantity; ++$num) { if ($this->temporaryData[$num][1] === 'alignament') { $this->results[$tempNumber]['cacheDate'] = Dates::convertDate($this->temporaryData[$num][0]); $this->results[$tempNumber]['cacheUrl'] = 'alignament/1?alignament_chromosome=' . $this->temporaryData[$num][3]; $this->results[$tempNumber]['cacheUrl'] .= '&alignament_start=' . $this->temporaryData[$num][5]; $this->results[$tempNumber]['cacheUrl'] .= '&alignament_end=' . $this->temporaryData[$num][7]; $this->results[$tempNumber]['cacheQuery'] = 'Chromosome = ' . $this->temporaryData[$num][3]; $this->results[$tempNumber]['cacheQuery'] .= ' & Start = ' . $this->temporaryData[$num][5]; $this->results[$tempNumber]['cacheQuery'] .= ' & End = ' . $this->temporaryData[$num][7]; ++$tempNumber; } } } elseif ($sqlDataArray['cache_type'] === 'cluster') { $tempNumber = 0; for ($num = 0; $num < $quantity; ++$num) { if ($this->temporaryData[$num][1] === 'cluster') { $this->results[$tempNumber]['cacheDate'] = Dates::convertDate($this->temporaryData[$num][0]); $this->results[$tempNumber]['cacheUrl'] = 'cluster/1?cluster_chromosome=' . $this->temporaryData[$num][3] . '&cluster_start=' . $this->temporaryData[$num][5] . '&cluster_end=' . $this->temporaryData[$num][7]; $this->results[$tempNumber]['cacheQuery'] = 'Chromosome = ' . $this->temporaryData[$num][3] . ' & Start = ' . $this->temporaryData[$num][5] . ' & End = ' . $this->temporaryData[$num][7]; ++$tempNumber; } } } } $this->quantityResults = count($this->results); if ($this->quantityResults > 0) { return $this->results; } else { FlashMessages::setFlashMessage('noresult', '<b>Zero Results!</b><br />None of your cache search results was found.'); } }
function informations($paramOne = 'pirna') { $this->actualPage = FormElements::filterString($paramOne); $this->model->quantityCacheSearch(); $this->model->breadCumbs(); $this->model->footerFaq(); $this->model->footerSystemUpdate(); $this->principalData['activeAboutPirna'] = ''; $this->principalData['activeAboutDatabase'] = ''; $this->principalData['activeAboutDataset'] = ''; $this->principalData['activeAboutReference'] = ''; $this->principalData['activeAboutStatistics'] = ''; if ($this->actualPage === 'database') { $this->sqlDataArray = array('text_type' => 'database'); $this->temporaryTitle = 'Database'; $this->principalData['activeAboutDatabase'] = 'class="active"'; } elseif ($this->actualPage === 'dataset') { $this->sqlDataArray = array('text_type' => 'dataset'); $this->temporaryTitle = 'Dataset'; $this->principalData['activeAboutDataset'] = 'class="active"'; } elseif ($this->actualPage === 'reference') { $this->sqlDataArray = array('text_type' => 'reference'); $this->temporaryTitle = 'Reference'; $this->principalData['activeAboutReference'] = 'class="active"'; } elseif ($this->actualPage === 'statistics') { $this->temporaryTitle = 'Statistics'; $this->principalData['activeAboutStatistics'] = 'class="active"'; } else { $this->sqlDataArray = array('text_type' => 'pirna'); $this->temporaryTitle = 'piRNA'; $this->principalData['activeAboutPirna'] = 'class="active"'; } if ($this->actualPage === 'statistics') { $this->aboutData = $this->model->getAboutStatistics(); $this->principalData['aboutDataTitle'] = $this->temporaryTitle; $this->principalData['aboutData'] = $this->aboutData; } else { $this->aboutData = $this->model->getAboutInformation($this->sqlDataArray); $this->principalData['aboutDataTitle'] = $this->temporaryTitle; $this->principalData['aboutData'] = $this->aboutData['text_content']; } View::setHeaderVars('title', 'About ' . $this->temporaryTitle); View::setHeaderVars('specificKeywords', DEFAULT_KEYWORDS . ' ,about pirna, about database, about dataset, about'); View::setHeaderVars('description', 'Informations about piRNAs, origin, functions, database and datasets'); View::setHeaderVars('cannonicalUrl', ''); View::setHeaderVars('robots', 'noindex, nofollow'); View::render('header'); View::render('about/index', $this->principalData); View::render('footer'); }
function informations($paramOne = 'pirna') { $this->actualPage = FormElements::filterString($paramOne); $this->model->quantityCacheSearch(); $this->model->BreadCumbs(); $this->model->footerFaq(); $this->model->footerSystemUpdate(); $this->principalData['activeFaqPirna'] = ''; $this->principalData['activeFaqDatabase'] = ''; $this->principalData['activeFaqDataset'] = ''; $this->principalData['activeFaqLogs'] = ''; if ($this->actualPage === 'pirna') { $this->principalData['activeFaqPirna'] = 'class="active"'; $this->sqlDataArray = array('faq_type' => '1'); $this->temporaryTitle = 'piRNA'; $this->cannonicalUrl = URL . 'faq/informations/pirna'; } elseif ($this->actualPage === 'database') { $this->principalData['activeFaqDatabase'] = 'class="active"'; $this->sqlDataArray = array('faq_type' => '2'); $this->temporaryTitle = 'Database'; $this->cannonicalUrl = ''; } elseif ($this->actualPage === 'dataset') { $this->principalData['activeFaqDataset'] = 'class="active"'; $this->sqlDataArray = array('faq_type' => '3'); $this->temporaryTitle = 'Dataset'; $this->cannonicalUrl = ''; } elseif ($this->actualPage === 'logs') { $this->principalData['activeFaqLogs'] = 'class="active"'; $this->sqlDataArray = array('faq_type' => '4'); $this->temporaryTitle = 'Logs'; $this->cannonicalUrl = ''; } $this->faqData = $this->model->getFaqData($this->sqlDataArray); $this->principalData['faqTitle'] = $this->temporaryTitle; $this->principalData['faqData'] = $this->faqData; $this->principalData['faqType'] = $this->actualPage; View::setHeaderVars('title', 'FAQ/Help ' . $this->temporaryTitle); View::setHeaderVars('specificKeywords', DEFAULT_KEYWORDS . ', faq pirna, help pirna, faq, help'); View::setHeaderVars('description', 'Questions and step-by-step about functions of database'); View::setHeaderVars('cannonicalUrl', $this->cannonicalUrl); View::setHeaderVars('robots', 'index, follow'); View::render('header'); View::render('faq/index', $this->principalData); View::render('footer'); }
function searchList($paramOne = null) { $this->actualPage = FormElements::filterString($paramOne); $this->model->quantityCacheSearch(); $this->model->breadCumbs(); $this->model->footerFaq(); $this->model->footerSystemUpdate(); $this->principalData['activeCachePirna'] = ''; $this->principalData['activeCacheAlignament'] = ''; $this->principalData['activeCacheCluster'] = ''; if ($this->actualPage === 'pirna') { $this->sqlDataArray = array('cache_type' => 'pirna'); $this->principalData['activeCachePirna'] = 'class="active"'; $this->temporaryTitle = 'piRNA'; } elseif ($this->actualPage === 'alignament') { $this->sqlDataArray = array('cache_type' => 'alignament'); $this->principalData['activeCacheAlignament'] = 'class="active"'; $this->temporaryTitle = 'Alignament'; } elseif ($this->actualPage === 'cluster') { $this->sqlDataArray = array('cache_type' => 'cluster'); $this->principalData['activeCacheCluster'] = 'class="active"'; $this->temporaryTitle = 'Cluster'; } $this->cacheData = $this->model->searchCache($this->sqlDataArray); if (FlashMessages::hasFlashMessage()) { $this->principalData['FlashMessage'] = FlashMessages::displayFlashMessage(); } else { $this->principalData['cacheData'] = $this->cacheData; } View::setHeaderVars('title', $this->temporaryTitle . ' Results Cache'); View::setHeaderVars('specificKeywords', DEFAULT_KEYWORDS . ', cache results, search pirna cache'); View::setHeaderVars('description', 'Stored piRNA search'); View::setHeaderVars('cannonicalUrl', ''); View::setHeaderVars('robots', 'noindex, nofollow'); View::render('header'); View::render('cache/index', $this->principalData); View::render('footer'); }
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); }
function cluster($paramOne = 1) { $this->model->quantityCacheSearch(); $this->model->BreadCumbs(); $this->actualPage = FormElements::filterString($paramOne); $this->principalData['resultPage'] = false; if (isset($_POST['search']) || isset($_GET['cluster_chromosome']) && isset($_GET['cluster_start']) && isset($_GET['cluster_end'])) { $this->principalData['resultPage'] = true; $this->initialResult = ($this->actualPage - 1) * $this->resultsPerPage; $this->sqlDataArray = array('initialItem' => $this->initialResult, 'maximumQuantity' => $this->resultsPerPage); $this->searchResults = $this->model->searchCluster($this->sqlDataArray); if (FlashMessages::hasFlashMessage()) { $this->principalData['FlashMessage'] = FlashMessages::displayFlashMessage(); } else { $this->principalData['resultCount'] = $this->searchResults[0]; $this->principalData['totalPages'] = $this->searchResults[1]; $this->principalData['resultSearch'] = $this->searchResults[2]; $this->principalData['resultQuery'] = $this->searchResults[3]; $this->temporaryPagination = $this->model->pagination($this->actualPage, $this->searchResults[1]); $this->principalData['pagination'] = $this->temporaryPagination[0]; $this->principalData['activePagination'] = $this->temporaryPagination[1]; } } else { $this->principalData['formToken'] = FormElements::formToken(); } $this->principalData['qttResultPage'] = $this->resultsPerPage; $this->cannonicalUrl = URL . 'search/cluster'; $this->principalData['activeSearchPirna'] = ''; $this->principalData['activeSearchAlignament'] = ''; $this->principalData['activeSearchCluster'] = 'class="active"'; View::setHeaderVars('title', 'Search Cluster'); View::setHeaderVars('specificKeywords', ''); View::setHeaderVars('description', ''); View::setHeaderVars('cannonicalUrl', $this->cannonicalUrl); View::setHeaderVars('robots', 'noindex, nofollow'); View::render('header'); View::render('search/cluster', $this->principalData); View::render('footer-clean'); }
function searchAlignament($sqlDataArray = array()) { if (isset($_POST['search'])) { $this->dataArray = array('alignament_chromosome' => FormElements::getPostInteger('inputSearchChromosome', true), 'alignament_start' => FormElements::getPostInteger('inputSearchStart', true), 'alignament_end' => FormElements::getPostInteger('inputSearchEnd', true), 'build_code' => FormElements::getPostString('inputSearchBuild', true)); $this->formToken = FormElements::getPostString('token', true); parent::checkFormRequired($this->dataArray); parent::checkFormToken($this->formToken, 'search/alignament'); } elseif (isset($_GET['alignament_chromosome']) && isset($_GET['alignament_start']) && isset($_GET['alignament_end'])) { $this->dataArray = array('alignament_chromosome' => FormElements::filterInteger($_GET['alignament_chromosome'], true), 'alignament_start' => FormElements::filterInteger($_GET['alignament_start'], true), 'alignament_end' => FormElements::filterInteger($_GET['alignament_end'], true), 'build_code' => FormElements::filterString($_GET['build_code'], true)); } if (!in_array('errorRequiredField', $this->dataArray) && (isset($_GET['alignament_chromosome']) || $this->formToken === Session::getSession('formToken')) && !FlashMessages::hasFlashMessage()) { $cookieData = date('Y-m-d') . '|alignament|' . 'alignament_chromosome|' . $this->dataArray['alignament_chromosome'] . '|alignament_start|' . $this->dataArray['alignament_start'] . '|alignament_end|' . $this->dataArray['alignament_end'] . '|build_code|' . $this->dataArray['build_code']; 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 alignament.alignament_id, alignament.alignament_chromosome, alignament.alignament_start, alignament.alignament_end, alignament.alignament_strand FROM alignament INNER JOIN rel_alignament_build ON rel_alignament_build.alignament_id = alignament.alignament_id AND rel_alignament_build.build_code = :build_code AND alignament.alignament_chromosome = :alignament_chromosome AND alignament.alignament_start >= :alignament_start AND alignament.alignament_end <= :alignament_end'; $this->allResults = $this->db->select($this->sqlAllResults, $this->dataArray); $this->results[0] = count($this->allResults); $this->results[1] = ceil($this->results[0] / $sqlDataArray['maximumQuantity']); $this->sql = 'SELECT alignament.alignament_id, alignament.alignament_chromosome, alignament.alignament_start, alignament.alignament_end, alignament.alignament_strand FROM rel_alignament_build INNER JOIN alignament ON rel_alignament_build.alignament_id = alignament.alignament_id AND rel_alignament_build.build_code = :build_code AND alignament.alignament_chromosome = :alignament_chromosome AND alignament.alignament_start >= :alignament_start AND alignament.alignament_end <= :alignament_end LIMIT ' . $sqlDataArray['initialItem'] . ', ' . $sqlDataArray['maximumQuantity']; $this->results[2] = $this->db->select($this->sql, $this->dataArray); $this->results[3] = '?alignament_chromosome=' . $this->dataArray['alignament_chromosome'] . '&' . 'alignament_start=' . $this->dataArray['alignament_start'] . '&' . 'alignament_end=' . $this->dataArray['alignament_end'] . '&' . 'build_code=' . $this->dataArray['build_code']; if ($this->results[0] > 0) { return $this->results; } else { FlashMessages::setFlashMessage('noresult', '<b>Not Found!</b><br />None alignament was found using your query..'); } } }
function deleteInfo($paramOne = null, $paramTwo = null) { $this->model->checkLogged(); if ($paramOne === 'pirna' && isset($_POST['submit'])) { $this->model->sendDeleteInfo('pirna', FormElements::filterString($paramTwo, true)); } elseif ($paramOne === 'dataset' && isset($_POST['submit'])) { $this->model->sendDeleteInfo('dataset', FormElements::filterString($paramTwo, true)); } elseif ($paramOne === 'cluster' && isset($_POST['submit'])) { $this->model->sendDeleteInfo('cluster', FormElements::filterString($paramTwo, true)); } elseif ($paramOne === 'reference' && isset($_POST['submit'])) { $this->model->sendDeleteInfo('reference', FormElements::filterString($paramTwo, true)); } elseif ($paramOne === 'target' && isset($_POST['submit'])) { $this->model->sendDeleteInfo('target', FormElements::filterString($paramTwo, true)); } elseif ($paramOne === 'faq' && isset($_POST['submit'])) { $this->model->sendDeleteInfo('faq', FormElements::filterString($paramTwo, true)); } elseif ($paramOne === 'article' && isset($_POST['submit'])) { $this->model->sendDeleteInfo('article', FormElements::filterString($paramTwo, true)); } elseif ($paramOne === 'informations' && isset($_POST['submit'])) { $this->model->sendDeleteInfo('informations', FormElements::filterString($paramTwo, true)); } elseif ($paramOne === 'contact' && isset($_POST['submit'])) { $this->model->sendDeleteInfo('contact', FormElements::filterString($paramTwo, true)); } elseif ($paramOne === 'update' && isset($_POST['submit'])) { $this->model->sendDeleteInfo('update', FormElements::filterString($paramTwo, true)); } elseif ($paramOne === 'pirnacomment' && isset($_POST['submit'])) { $this->model->sendDeleteInfo('pirnacomment', FormElements::filterString($paramTwo, true)); } $this->principalData['formToken'] = FormElements::formToken(); if (FlashMessages::hasFlashMessage()) { $this->principalData['FlashMessage'] = FlashMessages::displayFlashMessage(); } $this->principalData['typeItem'] = $paramOne; $this->principalData['idItem'] = $paramTwo; View::setHeaderVars('title', 'Admin'); View::render('sidebar-admin'); View::render('administration/deleteinfo', $this->principalData); }
function getInfo($sqlDataArray = array(), $type = null) { if ($type === 'pirna') { $this->sql = 'SELECT pirna_code, pirna_access, pirna_sequence, pirna_organism, pirna_feedback_agree, pirna_feedback_disagree FROM pirna WHERE pirna_code = :searchQuery'; $this->results['pirnaInfo'] = $this->db->select($this->sql, $sqlDataArray); if (count($this->results['pirnaInfo']) > 0) { $this->sql = 'SELECT alignament_id FROM rel_alignament_pirna WHERE pirna_code = :searchQuery'; $this->results['alignamentInfo'] = $this->db->select($this->sql, $sqlDataArray); $quantity = count($this->results['alignamentInfo']); for ($num = 0; $num < $quantity; ++$num) { $this->sql = 'SELECT alignament_chromosome, alignament_start, alignament_end, alignament_strand FROM alignament WHERE alignament_id = ' . $this->results['alignamentInfo'][$num]['alignament_id']; $this->results['allAlignamentInfo'][] = $this->db->select($this->sql, $sqlDataArray); } $this->sql = 'SELECT reference_id FROM rel_pirna_reference WHERE pirna_code = :searchQuery'; $this->results['referenceInfo'] = $this->db->select($this->sql, $sqlDataArray); $quantity = count($this->results['referenceInfo']); for ($num = 0; $num < $quantity; ++$num) { $this->sql = 'SELECT reference_id, reference_code FROM reference WHERE reference_id = ' . $this->results['referenceInfo'][$num]['reference_id']; $this->results['allReferenceInfo'][] = $this->db->select($this->sql, $sqlDataArray); } $this->sql = 'SELECT dataset_id FROM rel_dataset_pirna WHERE pirna_code = :searchQuery'; $this->results['datasetInfo'] = $this->db->select($this->sql, $sqlDataArray); $quantity = count($this->results['datasetInfo']); for ($num = 0; $num < $quantity; ++$num) { $this->sql = 'SELECT dataset_id, dataset_sample, dataset_serie, dataset_organism, dataset_development_stage, dataset_method, dataset_tissue FROM dataset WHERE dataset_id = ' . $this->results['datasetInfo'][$num]['dataset_id']; $this->results['allDatasetInfo'][] = $this->db->select($this->sql, $sqlDataArray); } return $this->results; } else { FlashMessages::setFlashMessage('noresult', '<b>Not Found!</b><br />0 Results are found using this query.'); } } elseif ($type === 'dataset') { $this->sql = 'SELECT dataset_id, dataset_sample, dataset_serie, dataset_organism, dataset_development_stage, dataset_method, dataset_tissue FROM dataset WHERE dataset_id = :searchQuery'; $this->results['datasetInfo'] = $this->db->select($this->sql, $sqlDataArray); if (count($this->results['datasetInfo']) > 0) { $this->sql = 'SELECT pirna_code FROM rel_dataset_pirna WHERE dataset_id = "' . $this->results['datasetInfo'][0]['dataset_id'] . '"'; $this->results['pirnaInfo'] = $this->db->select($this->sql); return $this->results; } else { FlashMessages::setFlashMessage('noresult', '<b>Not Found!</b><br />0 Results are found using this query.'); } } elseif ($type === 'cluster') { $this->sql = 'SELECT cluster_code, cluster_chromosome, cluster_start, cluster_end FROM cluster WHERE cluster_code = :searchQuery'; $this->results['clusterInfo'] = $this->db->select($this->sql, $sqlDataArray); if (count($this->results['clusterInfo']) > 0) { $this->sql = 'SELECT alignament_id FROM rel_alignament_cluster WHERE cluster_code = :searchQuery'; $this->results['pirnaInfo'] = $this->db->select($this->sql, $sqlDataArray); $quantity = count($this->results['pirnaInfo']); for ($num = 0; $num < $quantity; ++$num) { $this->sql = 'SELECT pirna_code FROM rel_alignament_pirna WHERE alignament_id = ' . $this->results['pirnaInfo'][$num]['alignament_id']; $this->results['pirnaList'][] = $this->db->select($this->sql, $sqlDataArray); } return $this->results; } else { FlashMessages::setFlashMessage('noresult', '<b>Not Found!</b><br />0 Results are found using this query.'); } } elseif ($type === 'reference') { $this->sql = 'SELECT reference_id, reference_code FROM reference WHERE reference_id = :searchQuery'; $this->results['referenceInfo'] = $this->db->select($this->sql, $sqlDataArray); if (count($this->results['referenceInfo']) > 0) { $edit = file_get_contents('http://www.ncbi.nlm.nih.gov/pubmed/' . $this->results['referenceInfo'][0]['reference_code']); preg_match('/<title>(.*)<\\/title>/s', $edit, $title); preg_match('/<AbstractText>(.*)<\\/AbstractText>/s', $edit, $abstract); preg_match('/<div class="auths">(.*).<\\/div><div class="afflist">/s', $edit, $authors); $authors[0] = preg_replace('/<sup>([0-9])<\\/sup>/s', '', $authors[0]); $this->results['referenceTitle'] = FormElements::filterString($title[0]); $this->results['referenceAbstract'] = FormElements::filterString($abstract[0]); $this->results['referenceAuthors'] = FormElements::filterString($authors[0]); return $this->results; } else { FlashMessages::setFlashMessage('noresult', '<b>Not Found!</b><br />0 Results are found using this query.'); } } elseif ($type === 'target') { $this->sql = 'SELECT target_id, target_type, target_name, target_chromosome, target_start, target_end, target_strand FROM target WHERE target_id = :searchQuery'; $this->results['targetInfo'] = $this->db->select($this->sql, $sqlDataArray); if (count($this->results['targetInfo']) > 0) { return $this->results; } else { FlashMessages::setFlashMessage('noresult', '<b>Not Found!</b><br />0 Results are found using this query.'); } } elseif ($type === 'article') { $this->sql = 'SELECT article_reference, article_title, article_author, article_journal, article_date FROM system_article WHERE article_reference = :searchQuery'; $this->results['articleInfo'] = $this->db->select($this->sql, $sqlDataArray); if (count($this->results['articleInfo']) > 0) { return $this->results; } else { FlashMessages::setFlashMessage('noresult', '<b>Not Found!</b><br />None article was found.'); } } elseif ($type === 'faq') { $this->sql = 'SELECT faq_id, faq_title, faq_content, faq_date_update, faq_type FROM faq WHERE faq_id = :searchQuery'; $this->results['faqInfo'] = $this->db->select($this->sql, $sqlDataArray); $this->results['faqInfo'][0]['faq_date_update'] = Dates::convertDate($this->results['faqInfo'][0]['faq_date_update']); if (count($this->results['faqInfo']) > 0) { return $this->results; } else { FlashMessages::setFlashMessage('noresult', '<b>Not Found!</b><br />0 Results are found using this query.'); } } elseif ($type === 'informations') { $this->sql = 'SELECT text_id, text_content, text_type FROM general_text WHERE text_id = :searchQuery'; $this->results['informationsInfo'] = $this->db->select($this->sql, $sqlDataArray, false); if (count($this->results['informationsInfo']) > 0) { return $this->results; } else { FlashMessages::setFlashMessage('noresult', '<b>Not Found!</b><br />0 Results are found using this query.'); } } elseif ($type === 'update') { $this->sql = 'SELECT info_update_id, info_update_title, info_update_content, info_update_date FROM info_update WHERE info_update_id = :searchQuery'; $this->results['updateInfo'] = $this->db->select($this->sql, $sqlDataArray, false); if (count($this->results['updateInfo']) > 0) { return $this->results; } else { FlashMessages::setFlashMessage('noresult', '<b>Not Found!</b><br />0 Results are found using this query.'); } } elseif ($type === 'pirnaComment') { $this->sql = 'SELECT comment_id, comment_name, comment_email, comment_content, comment_date, comment_moderated FROM comment WHERE comment_id = :searchQuery'; $this->results['commentInfo'] = $this->db->select($this->sql, $sqlDataArray); $this->sql = 'SELECT pirna_code FROM rel_comment_pirna WHERE comment_id = ' . $this->results['commentInfo'][0]['comment_id']; $this->results['commentPirnaInfo'] = $this->db->select($this->sql, $sqlDataArray); $this->results['commentInfo'][0]['comment_date'] = Dates::convertDate($this->results['commentInfo'][0]['comment_date']); if (count($this->results['commentInfo']) > 0) { return $this->results; } else { FlashMessages::setFlashMessage('noresult', '<b>Not Found!</b><br />0 Results are found using this query.'); } } else { FlashMessages::setFlashMessage('noresult', '<b>Not Found!</b><br />0 Results are found using this query.'); } }