Location: PHPKode > projects > WH Community > wh_community/outbox.php
<?php require('layout/header.php'); ?>

<div id="content_wrapper">
    <div class="content"><?php

        if(!isset($_SESSION['signed_in'])) {
        
		echo '<p class="false">' . $lang['just_for_users'] . '!</p>
              <p>' . $lang['you_need_to'] . ' <a href="signin.php">' . $lang['signin_s'] . '</a>.
              - ' . $lang['not_yet'] . ' <a href="signup.php">' . $lang['registered'] . '</a>?</p>';

		}else{

		echo '<table align="center" class="usertable">
		<tr>
			<td align="center"><ul class="usermenu">
				<li><a href="myprofile.php">' . $lang['my_profile'] . '</a></li>
				<li><a href="guestbook.php">' . $lang['guestbook'] . '</a></li>
				<li><a href="messagebox.php">' . $lang['messagebox'] . '</a></li>
				<li><a href="password.php">' . $lang['password'] . '</a></li>
				<li><a href="inbox.php">' . $lang['inbox'] . '</a></li>
				<li><a href="outbox.php">' . $lang['outbox'] . '</a></li>
				<li><a href="create_pm.php">' . $lang['m_newpm'] . '</a></li>
				<li><a href="mypostings.php">' . $lang['my_posts'] . '</a></li>
				<li><a href="infos.php">' . $lang['informations'] . '</a></li>
				<li><a href="todo.php">' . $lang['m_todo'] . '</a></li>
				<li><a href="news.php">' . $lang['news'] . '</a></li>
			</ul></td>
		</tr>
		<tr>
			<td><h1>' . $lang['outbox'] . '</h1></td>
		</tr>';
		
		echo '<tr><td>';
		
		$query = mysql_query("SELECT m1.pm_id, m1.title, m1.timestamp, count(m2.pm_id) AS reps, users.user_id AS user_id, users.user_name FROM messages AS m1, messages AS m2,users WHERE ((m1.user1 = '" . (int)$_SESSION['user_id'] . "' AND m1.user1read = 'yes' AND users.user_id = m1.user2) OR (m1.user2 = '" . (int)$_SESSION['user_id'] . "' AND m1.user2read = 'yes' AND users.user_id = m1.user1)) AND m1.pm_id2 = '1' AND m2.pm_id = m1.pm_id GROUP BY m1.pm_id ORDER BY m1.pm_id DESC") OR die(mysql_error());
		
		if(intval(mysql_num_rows($query)) > 0) {
		
		echo '<table align="center" cellpadding="5" class="pmtable">
    		  <tr>
    		  <td width="20%"><span class="blue">' . $lang['receiver'] . '</span></td>
    		  <td width="55%"><span class="blue">' . $lang['subject'] . '</span></td>
    		  <td width="10%"><span class="blue">' . $lang['replies'] . '</span></td>
    		  <td width="15%"><span class="blue">' . $lang['date'] . '</span></td>
    		  </tr>';
		
		echo '<tr><td colspan="4"><div id="pm_line">&nbsp;</div></td></tr>';
		
			while($row = mysql_fetch_assoc($query)) {
			
    			$answer = $row['reps'] - 1;
    			
    			echo '<tr>
    			      <td width="20%"><a href="profile.php?user_id=' . (int)$row['user_id'] . '">' . htmlentities($row['user_name'], ENT_QUOTES) . '</a></td>
    			      <td width="55%"><a href="read_pm.php?user_id=' . (int)$_SESSION['user_id'] . '&pm_id=' . $row['pm_id'] . '">' . htmlentities($row['title'], ENT_QUOTES) . '</a></td>
    			      <td width="10%">' . (int)$answer . '</td>
    			      <td width="15%">';
                      
                      if($language == "de") {
                          echo date('d.m.Y - H:i' ,$row['timestamp']);

                      }elseif($language == "en") {
                          echo date('Y-m-d - H:i' ,$row['timestamp']); }
                      
                echo '</td></tr>';
    			      }
		
		}else{
		
		echo '<span class="false">' . $lang['no_sent_pm'] . '.</span>';
		}
		
		echo '</td></tr>
		      </table><br>';
		}
		
		echo '</table>';
		
		echo '<div class="spacer_div">&nbsp;</div>';

		?>
    </div>
</div>

<div id="infobox_wrapper">
    <div class="infobox">
        <?php include('layout/infobox.php'); ?>
    </div>
</div>

<?php require('layout/footer.php'); ?>
Return current item: WH Community