<?php 

include_once ("_dirinfo.php");

include_once (PATH_TO_ROOT."init.php");
include_once (PATH_TO_ROOT."config.php");

//7.1.2015 sqlinjection problem
if(class_exists('convert'))
{
    if(isset($_POST['editText'])) $_POST['editText'] = convert::toString($_POST['editText']);
    if(isset($_POST['id'])) $_POST['id'] = convert::toString($_POST['id']);
}


if ($_POST['action'] == "update") {
	
	$sql = "UPDATE  ".DB_WARPIT_USERSPOOL."._PortalStaticPage SET si = '".$_POST['editText']."' WHERE id = ".$_POST['id'];
	$res = $db->SQLexecute($sql);
	
} else {

	$sql = "SELECT * FROM  ".DB_WARPIT_USERSPOOL."._PortalStaticPage WHERE id = ".$_POST['id'];
	$res = $db->SQLexecute($sql);
	$zad = $db->fetchAssoc($res);
	echo $zad['si'];
	
}

?>