예제 #1
0
    function getUpdate($sqlDataArray = array())
    {
        if (isset($sqlDataArray['info_update_id'])) {
            $this->sql = 'SELECT info_update_title, 
													 info_update_id,
													 info_update_content, 
													 info_update_date
										FROM info_update
										WHERE info_update_id = :info_update_id';
        } else {
            $this->sql = 'SELECT info_update_title, 
													 info_update_id, 
													 info_update_date
										FROM info_update';
        }
        $this->results = $this->db->select($this->sql, $sqlDataArray);
        $this->resultsQuantity = count($this->results);
        foreach ($this->results as $key => $footerData) {
            $this->results[$key]['info_update_title_url'] = Helpers::filterUrl($this->results[$key]['info_update_title']);
            $this->results[$key]['info_update_date'] = Dates::convertDate($this->results[$key]['info_update_date']);
        }
        if ($this->resultsQuantity > 0) {
            return $this->results;
        } else {
            FlashMessages::setFlashMessage('noresult', '<b>Not Found!</b><br />Update information you are looking for does not exist.');
        }
    }
예제 #2
0
function autoLoad($className)
{
    $file = Helpers::preparePath(ROOT . $className . '.php');
    if (is_readable($file)) {
        require $file;
    }
}
예제 #3
0
    /**
     * footerSystemUpdate
     *
     * Retrieve updates of the system itens from database and send to content variables
     *
     * @return function Send the variables about the update to the content variables 
     */
    public function footerSystemUpdate()
    {
        $this->sql = 'SELECT info_update_id,
								 				 info_update_title
						 			FROM info_update
						 			LIMIT 6';
        $this->results = $this->db->select($this->sql);
        foreach ($this->results as $key => $footerData) {
            $this->results[$key]['info_update_title_url'] = Helpers::filterUrl($this->results[$key]['info_update_title']);
        }
        View::setContentVars('footerSystemUpdate', $this->results);
    }
예제 #4
0
    function getAlignamentByBuild($sqlDataArray = array())
    {
        $this->sql = 'SELECT alignament.alignament_chromosome,
												 alignament.alignament_start,
												 alignament.alignament_end,
												 alignament.alignament_strand
									FROM rel_alignament_pirna
									INNER JOIN rel_alignament_build
													ON rel_alignament_pirna.pirna_code = :pirna_code
												 AND rel_alignament_build.build_code = :build_code
												 AND rel_alignament_build.alignament_id = rel_alignament_pirna.alignament_id
									INNER JOIN alignament
									 				ON rel_alignament_pirna.alignament_id = alignament.alignament_id
									';
        $this->results['listAlignament'] = $this->db->select($this->sql, $sqlDataArray);
        $this->results['quantityAlignament'] = count($this->results['listAlignament']);
        if ($this->results['quantityAlignament'] > 0) {
            $multi = 1;
            $tabsAll = count($this->results['listAlignament']);
            $tabsQuantity = ceil(count($this->results['listAlignament']) / 25);
            for ($num = 0; $num < $tabsAll; ++$num) {
                $this->results['listAlignament'][$num]['alignament_strand'] = Helpers::changeStrandIcon($this->results['listAlignament'][$num]['alignament_strand']);
                $this->results['listAlignamentTwo'][$multi][] = $this->results['listAlignament'][$num];
                $this->results['tabActive'][$multi] = '';
                $this->results['contentTabActive'][$multi] = '';
                if ($num === 25 * $multi) {
                    ++$multi;
                }
            }
            $this->results['tabActive'][1] = 'class="active"';
            $this->results['contentTabActive'][1] = 'tab-content-active';
        }
        $this->results['pirnaCode'] = $sqlDataArray['pirna_code'];
        return $this->results;
    }
예제 #5
0
    function getListFaq($sqlDataArray = array())
    {
        $sqlDataArrayAll = array();
        $this->urlQuery = '';
        $this->conditional = '';
        if (!empty($_GET['restriction'])) {
            $sqlDataArray['faq_type'] = FormElements::filterString($_GET['restriction']);
            $sqlDataArrayAll['faq_type'] = $sqlDataArray['faq_type'];
            $this->conditional = 'WHERE faq_type = :faq_type';
            $this->urlQuery = '?restriction=' . $sqlDataArray['faq_type'];
        } elseif (!empty($_GET['searchQuery'])) {
            $sqlDataArray['faq_title'] = FormElements::filterString($_GET['searchQuery']);
            $sqlDataArrayAll['faq_title'] = $sqlDataArray['faq_title'];
            $this->conditional = 'WHERE faq_title LIKE "%":faq_title"%"';
            $this->urlQuery = '?searchQuery=' . $sqlDataArray['faq_title'];
        }
        $this->sql = 'SELECT faq_id, 
												 faq_title, 
												 faq_date_update, 
												 faq_type
									FROM faq 
									' . $this->conditional . ' 
									LIMIT :initialItem, 
												:maximumQuantity';
        $this->sqlAll = 'SELECT faq_id 
										 FROM faq 
										 ' . $this->conditional;
        $this->results['faqList'] = $this->db->select($this->sql, $sqlDataArray);
        $this->results['allResults'] = count($this->db->select($this->sqlAll, $sqlDataArrayAll));
        $this->results['urlQuery'] = $this->urlQuery;
        $this->results['totalPages'] = ceil($this->results['allResults'] / $sqlDataArray['maximumQuantity']);
        foreach ($this->results['faqList'] as $key => $faqData) {
            $this->results['faqList'][$key]['faq_type'] = Helpers::typeFaqHelp($this->results['faqList'][$key]['faq_type']);
        }
        if ($this->results['allResults'] > 0 && $this->results['allResults'] > $sqlDataArray['initialItem']) {
            return $this->results;
        } else {
            FlashMessages::setFlashMessage('noresult', '<b>Not Found!</b><br />0 Results are found using this query.');
        }
    }