<?php
/**************************************************************************************************
|
| iDocScript - Document Sharing Script
| http://www.idocscript.com
| webmaster@idocscript.com
|
|**************************************************************************************************
|
| By using this software you agree that you have read and acknowledged our End-User License 
| Agreement available at http://www.idocscript.com/eula.html and to be bound by it.
|
| Copyright (c) 2011 iDocScript.com. All rights reserved.
|**************************************************************************************************/

include("../include/config.php");
include_once("../include/functions/import.php");
include_once("../include/functions/admin.php");
verify_login_admin();

$CID = intval($_REQUEST['CID']);

if($_POST['submitform'] == "1")
{
	if($CID > 0)
	{
		$arr = array("details");
		foreach ($arr as $value)
		{
			$sql = "update members_comments set $value='".mysql_real_escape_string($_POST[$value])."' where CID='".mysql_real_escape_string($CID)."'";
			$conn->execute($sql);
		}

		$message = "Comment Successfully Edited.";
		Stemplate::assign('message',$message);
	}
}

if($CID > 0)
{
	$query = $conn->execute("select * from members_comments where CID='".mysql_real_escape_string($CID)."' limit 1");
	$comment = $query->getrows();
	Stemplate::assign('comment', $comment[0]);
}

$mainmenu = "9";
$submenu = "1";
Stemplate::assign('mainmenu',$mainmenu);
Stemplate::assign('submenu',$submenu);
STemplate::display("administrator/global_header.tpl");
STemplate::display("administrator/comments_profiles_edit.tpl");
STemplate::display("administrator/global_footer.tpl");
?>