Example #1
0
     $page = $_REQUEST['page'];
     echo getAllPlants($page);
     break;
 case 'getMoreTypes':
     $start = $_REQUEST['start'];
     echo getMoreTypes($start);
     break;
 case 'searchDatabase':
     $page = $_REQUEST['page'];
     echo searchDatabase($page);
     break;
 case 'getCommonName':
     getCommonName($_REQUEST['pid']);
     break;
 case 'getScientificName':
     getScientificName($_REQUEST['pid']);
     break;
 case 'deletePlant':
     deletePlant($_REQUEST['uid'], $_REQUEST['pid']);
     break;
 case 'getOptimalSettings':
     getOptimalSettings($_REQUEST['plantID']);
     break;
 case 'setAlertType':
     $type = $_REQUEST['alert'];
     setAlertType($type);
     break;
 case 'sendAlert':
     $userID = $_REQUEST['uid'];
     $pid = $_REQUEST['pid'];
     $temp = $_REQUEST['temp'];
Example #2
0
<?php

// Plant profile page
require_once realpath(dirname(__FILE__)) . "/../lego/DatabaseLego.php";
require_once realpath(dirname(__FILE__)) . "/../lego/PlantLego.php";
$pid = $_REQUEST['plantID'];
?>

<div id="data" data-common="<?php 
echo getCommonName($pid);
?>
" data-latin="<?php 
echo getScientificName($pid);
?>
"</div>
<div class="hero">
	<!--<?php 
if (isset($plantData['imgPath'])) {
    ?>
		<img src="<?php 
    echo $plantData['imgPath'];
    ?>
" />
	<?php 
} else {
    ?>
-->
	 	<img src="<?php 
    echo "http://lorempixel.com/" . rand(500, 700) . "/" . rand(300, 500) . "/nature/";
    ?>
" />