Ejemplo n.º 1
0
<?php

require 'controller.php';
require 'services/SDRServices.php';
$services = new SDRServices();
$searchName = $_REQUEST['q'];
if (strlen($searchName) > 3) {
    $res = $services->searchForName($searchName, 10, 1);
    $smarty->assign('results', $res);
    $smarty->assign('queryString', $searchName);
    $smarty->assign('popularSpecies', $services->getMostPopularSpecies(16));
}
//$data =$services->getItemList(10);
//
$smarty->display('searchresult.tpl');
Ejemplo n.º 2
0
<?php

require 'controller.php';
require 'services/SDRServices.php';
$services = new SDRServices();
//data validation
$loginerror = false;
$user_name = $_POST['username'];
$project_name = $_POST['project_name'];
$email = $_POST['email'];
$password = $_POST['password'];
$password_confirm = $_POST['confirmpassword'];
try {
    $logineresult = $services->registerUser($user_name, $project_name, $email, $password);
} catch (Exception $e) {
    $smarty->assign('error', $e->getMessage());
    $smarty->display('header.tpl');
    $smarty->display('register.tpl');
    $smarty->display('footer.tpl');
    die;
}
//set the login params
session_start();
$_SESSION['user'] = $logineresult;
//everything went fine. We send to the home page
header('Location: /');
Ejemplo n.º 3
0
<?php

require 'services/SDRServices.php';
$services = new SDRServices();
session_start();
if ($_REQUEST['method'] == 'addComment') {
    $name = $_SESSION['user']['username'];
    $email = $_SESSION['user']['email'];
    $comment = $_REQUEST['comment'];
    $date = date("d/m/Y h:i");
    $lowercase = strtolower($email);
    $image = md5($lowercase);
    $result = $services->addComment($_SESSION['user']['id'], $comment, $_REQUEST['speciesId']);
    error_log($result);
    if ($result) {
        ?>
    	<div class="span-18 comments">
    		<div class="span-2 avatar">
    			<!-- <img src="http://www.gravatar.com/avatar.php?gravatar_id=<?php 
        echo $image;
        ?>
"/> -->
    		</div>
    		<div class="span-16 contenedor">
    			<span class="span-16 title_comment">by <span class="title_comment_u last"> <?php 
        echo $name;
        ?>
 </span> <?php 
        echo $date;
        ?>
 </span>
Ejemplo n.º 4
0
<?php

require 'services/SDRServices.php';
require 'controller.php';
if (!isset($_REQUEST['id'])) {
    echo "error!";
    die;
}
$speciesId = $_REQUEST['id'];
@($speciesName = $_REQUEST['n']);
$services = new SDRServices();
$speciesData = $services->getGbifDetailsByNameId($speciesId);
$smarty->assign('sources', $services->getSpeciesDetailsByNameId($speciesId));
$smarty->assign('popularSpecies', $services->getMostPopularSpecies(4));
$smarty->assign('speciesId', $speciesId);
$smarty->assign('nub_concept_id', $speciesId);
$smarty->assign('scientificName', $speciesData->scientificName);
@$smarty->assign('imageURL', $speciesData->imageURL);
$smarty->assign('comments', $services->getComments($speciesId));
$smarty->assign('kingdom', $speciesData->kingdom);
$smarty->assign('phylum', $speciesData->phylum);
$smarty->assign('class', $speciesData->class);
$smarty->assign('order', $speciesData->order);
$smarty->assign('family', $speciesData->family);
$smarty->assign('genus', $speciesData->genus);
$smarty->display('speciesPage.tpl');