<?php
# ************** LICENCE ****************
/*
	Copyright (c) PORTANEO.
*/
# ***************************************
# Aadd a comment 
# !! be careful, this file must be saved under uft8 format, and display an e accentuated here : é
# ***************************************
$not_access=1; 
$granted="I";

require_once('includes_mobile.php'); 
require_once('../../../../db_layer/'.__DBTYPE.'/enterprise.php');
$artid=$_POST["artid"];
$wid=$_POST["wid"];

//add the comment
$DB->execute($scrnotebookcommentadd_addComment,$DB->escape($artid),$DB->escape($_SESSION['user_id']),$DB->noJavascript($_POST["message"]));

if ($DB->nbAffected()!=0)
{
	//increment comments number
	$DB->execute($scrnotebookcommentadd_updComment,$DB->escape($artid));

	// add notification in for my profile in network
	$DB->execute($xmlnetworknews_insertNews,$DB->escape($_SESSION['user_id']),"'5'",$DB->quote($_POST["title"]),$DB->quote("../notebook/detail.php?id=".$_SESSION['user_id']."&artid=".$artid."#comments"),$DB->quote($_POST["access"]));
}
$DB->close();

if (isset($_POST['group'])) {
    header('location:groupbook_article.php?gid='.$_POST["group"].'&artid='.$artid.'&wid='.$wid.'');
}
else {
    header('location:notebook_article.php?id='.$_POST["id"].'&artid='.$artid.'&wid='.$wid.'');
}
?>