Location: PHPKode > projects > Graphical Botanical Database Management > xgbdmt_alpha_4_single/Plants_innova.php
<?php 
ini_set("display_errors","1");
ini_set("display_startup_errors","1");
set_magic_quotes_runtime(0);

include("include/dbcommon.php");
include("include/Plants_variables.php");


$field = @$_GET["field"];
if(!CheckFieldPermissions($field))
	return;

//	construct sql


$keys=array();
$keys["PlantsID"]=postvalue("key1");
$where=KeyWhere($keys);

/*
$sql=$gstrSQL;
$sql = AddWhere($sql,$where);
*/

$conn=db_connect();


$sql = gSQLWhere($where);

$rs = db_query($sql,$conn);
if(!$rs)
  return;

$data=db_fetch_array($rs);

$nWidth = GetNCols($field);
$nHeight = GetNRows($field);
$cfieldname=GoodFieldName($field)."_".postvalue("id");
$cfield="value_".GoodFieldName($field)."_".postvalue("id");

$onsubmit="";
if(@$_REQUEST["browser"]!="ie")
	$onsubmit="onsubmit=\"return document.getElementById('".$cfield."').value;\"";
echo "<html><body style=\"margin:0\"><form name=\"innovaform\" ".$onsubmit.">";
echo "<script type=\"text/javascript\" src=\"plugins/innovaeditor/scripts/innovaeditor.js\"></script>";
echo "<textarea id='".$cfield."' name='" . $cfield . "' style='width: " . ($nWidth) . "px;height: " . ($nHeight) . "px;'>"  ;
if($data)
	echo htmlspecialchars($data[$field]) ;
echo "</textarea>";
echo "<script>";
echo "var oEdit" . $cfieldname . " = new InnovaEditor('oEdit" . $cfieldname . "');";
echo "oEdit" . $cfieldname . ".mode='HTMLBody';";
echo "oEdit" . $cfieldname . ".width='" . ($nWidth) . "px';";
echo "oEdit" . $cfieldname . ".height='" . ($nHeight) . "px';";
echo "oEdit" . $cfieldname . ".REPLACE('" . $cfield . "');";
echo "</script>";
echo "</form></body></html>";

return;

?>
Return current item: Graphical Botanical Database Management