| 1 | <? |
| 2 | /** |
| 3 | ** mailbox_display.php3 |
| 4 | ** |
| 5 | ** This contains functions that display mailbox information, such as the |
| 6 | ** table row that has sender, date, subject, etc... |
| 7 | ** |
| 8 | **/ |
| 9 | |
| 10 | function printMessageInfo($imapConnection, $i, $from, $subject, $date) { |
| 11 | getMessageHeaders($imapConnection, $i, $from, $subject, $date); |
| 12 | getMessageFlags($imapConnection, $i, $flags); |
| 13 | $dateParts = explode(" ", trim($date)); |
| 14 | $dateString = getDateString($dateParts); // this will reformat the date string into a good format for us. |
| 15 | $senderName = getSenderName($from); |
| 16 | if (strlen(Chop($subject)) == 0) |
| 17 | $subject = "(no subject)"; |
| 18 | |
| 19 | $j = 0; |
| 20 | $deleted = false; |
| 21 | $seen = false; |
| 22 | $answered = false; |
| 23 | while ($j < count($flags)) { |
| 24 | if ($flags[$j] == "Deleted") { |
| 25 | $deleted = true; |
| 26 | } else if ($flags[$j] == "Answered") { |
| 27 | $answered = true; |
| 28 | } else if ($flags[$j] == "Seen") { |
| 29 | $seen = true; |
| 30 | } |
| 31 | $j++; |
| 32 | } |
| 33 | |
| 34 | if ($deleted == false) { |
| 35 | echo "<TR>\n"; |
| 36 | if ($seen == false) { |
| 37 | echo " <TD><FONT FACE=\"Arial,Helvetica\"><B>$i</B></FONT></TD>\n"; |
| 38 | echo " <TD><FONT FACE=\"Arial,Helvetica\"><B>$senderName</B></FONT></TD>\n"; |
| 39 | echo " <TD><CENTER><B><FONT FACE=\"Arial,Helvetica\">$dateString</FONT></B></CENTER></TD>\n"; |
| 40 | echo " <TD><FONT FACE=\"Arial,Helvetica\"><B>$subject</B></FONT></TD>\n"; |
| 41 | } else { |
| 42 | echo " <TD><FONT FACE=\"Arial,Helvetica\">$i</FONT></TD>\n"; |
| 43 | echo " <TD><FONT FACE=\"Arial,Helvetica\">$senderName</FONT></TD>\n"; |
| 44 | echo " <TD><FONT FACE=\"Arial,Helvetica\"><CENTER>$dateString</CENTER></FONT></TD>\n"; |
| 45 | echo " <TD><FONT FACE=\"Arial,Helvetica\">$subject</FONT></TD>\n"; |
| 46 | } |
| 47 | echo "</TR>\n"; |
| 48 | } |
| 49 | } |
| 50 | ?> |