<?php session_start(); ?>
<?php
include("stop.php");
?>
<?php
include ("config.php");
?>
<?php
if(isset($_SESSION['nume'])) {
      	$username = ''.$_SESSION['nume'].'';
$stare = "Show PMs";
if(!$act){mysql_query("UPDATE utilizatori SET stare='$stare' WHERE nume='$username'");}
}

include ("header.html");
?>
<table width='950' cellspacing='0' cellpadding='0' align='center'>
<?php
include ("right.html");
?>
<td width='760' valign='top' class='continut'>

<table cellspacing='0' cellpadding='10'  width='100%'>
<tr>
<td>
<!-- CONTINUTUL !!!! -->

<?php

if(isset($_SESSION['nume'])) {
      	$user = ''.$_SESSION['nume'].'';
    $getuser="SELECT * FROM utilizatori where nume='$user'";
    $getuser2=mysql_query($getuser) or die("Could not get user info");
    $getuser3=mysql_fetch_array($getuser2);
    print "<table class='pm'>";
    print "<div class='pm'><td><b>Status</td></div><td><div class='pm'><b>From</td><td><div class='pm'><b>Subject</td><td><div class='pm'><b>Time sent</td><td><div class='pm'><b>Delete</b></td></tr>";
    $getyourpms=mysql_query("SELECT * from b_pms as a,utilizatori as b where a.receiver='$getuser3[id]' and b.id=a.sender order by a.therealtime DESC");
    while($getyourpms3=mysql_fetch_array($getyourpms))
    {
      print "<td valign='top' width=6%>";
      if($getyourpms3[hasread]==0)
      {
        print "<div class='pm'>No Read";
      }
      else
      {
        print "<div class='pm'>Readed";
      }
      print "</td><td valign='top'><div class='pm'>$getyourpms3[nume]</td>";
      print "<td valign='top'>";
      print "<A href='readpm.php?ID=$getyourpms3[pmID]'><div class='pm'>$getyourpms3[subject]</a></td><td><div class='pm'>$getyourpms3[vartime]</td>";
      print "<td valign='top'><A href='delpm.php?ID=$getyourpms3[pmID]'><div class='pm'>Delete PM</a></td></tr>";
      print "</div></div>";
    }    
        print "</table>"; 
 }
else
  {
    print "Sorry, not logged in  please <A href='login.php'>Login</a><br>";
  
  }

?>

<!-- SFARSIT CONTINUT!!! -->   

</td></tr></table>
</tr>

<tr>
<td width='180'>&nbsp;
</td>

<?
include("flooter.html")
?>