<?php 
# ************** LICENCE ****************
/*
	Copyright (c) PORTANEO.
*/
# ***************************************
# Display  notebook
#
# !! 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.'/portal.php');
require_once('../includes/template.inc.php');
require_once('../../../../db_layer/'.__DBTYPE.'/enterprise.php');
require_once('../includes/date.inc.php');

$previousStr = '';
$nextStr = '';
$id = ( isset($_GET['id']) )        ?       $_GET['id']     :   $_SESSION['user_id'];
$act = (isset($_GET['act']))        ?       $_GET['act']        :   'prof';
$message = (isset($_GET['message']))        ?       $_GET['message']        :   '';

$DB->getResults($mobNotebookArticle_getUserInfo,$DB->escape($_SESSION['user_id']),$DB->escape($id));
$row = $DB->fetch(0);
$pic_user = $row['picture'];
$firstname_user = $row['firstname'];
$name_user = $row['long_name'];
$stat_user = $row['stat'];
$isfriend = $row['friend_id'];
$DB->freeResults();

$options = defineHeader();
   
echo page_begining();

echo '<div id="header">';
    echo generate_header($options,$message);
echo '</div>';

echo '<div id="wrapper">';
echo '<div id="page">';

echo generate_statusform("network_profil.php");

echo '<div class="users" style="clear:both;">
        <div class="title">
            <img src="../../../'.displayPicture($row['picture']).'" class="avatar" width="50" height="50" style="float: left;margin-right: 5px;">';
            echo '<span>'.$name_user.' '.$firstname_user.'</span>';
            if ($id == $_SESSION['user_id'] && (!isset($_SESSION['smartphone'])) )
            echo '<a href="logout.php" class="logouta"><img class="logout" src="../images/logout.png" width="16" height="16" alt="'.lg("disconnect").'" /></a>';
echo '  </div>';
            if ($row['stat']!='') echo '<div class="subtitle">'.$row['stat'].'</div>';  
echo '	<div class="links">
                <a href="notebook_articles.php?id='.$id.'" class="greylink">'.lg("contributions").'</a> |';
                
if ($act == "note")    
    echo '      <a href="network_profil.php?id='.$id.'&act=prof" class="greylink">'.lg("display_info").'</a>';
else 
    echo '      <a href="network_profil.php?id='.$id.'&act=note" class="greylink">'.lg("personalNotes").'</a>';
echo '
        </div>
      </div>';

if ($act == "prof") {
    $DB->getResults($mobUsers_getUserDescription,$DB->escape($id));
}
else {
    $DB->getResults($mobNetwork_getUserDescription,$DB->escape($_SESSION['user_id']),$DB->escape($id));
}

$row = $DB->fetch(0);
$description = $row['description'];
$DB->freeResults();

if ($description == '') {
    $err = ($act == "prof")     ?       lg("noDescription")      :       lg("noPersonalNote");
    echo generate_warning('info',$err,'','');
}
else
    echo "<div style='margin-left:5px;'>".$description."</div>";

echo '</div>';
echo '</div>';

echo generate_footer("notebook");
?>