Location: PHPKode > projects > Classifieds > classifieds/classes/MyAccount.php
<?php

	

 Class MyAccount {

        

     protected $row;

     protected $rowMessages;

        

     function __construct() {        

        $this->userID = $_SESSION['userID'];  

     }

     

     function getPostings() {

        

        $postingsResource = mysql_query("SELECT * FROM Postings WHERE userID='$this->userID'");

        

        while ($row = mysql_fetch_assoc($postingsResource)) {

            $this->name = $row['name'];

            $this->postID = $row['id'];            

            echo '<li>';

            echo "<a href='". DOMAIN . "viewposting.php?id=$this->postID'>$this->name</a>  <a href='". DOMAIN . "/classes/PostingDelete.php?id=$this->postID'>Delete Posting</a>";

            echo '</li>';              

        }

        

     } 

     

     function getMessages() {

        

        $MessageResource = mysql_query("SELECT * FROM Users, Messages WHERE recipientID='$this->userID'");

        

        while ($rowMessages = mysql_fetch_assoc($MessageResource)) {

            $this->messageFrom = $rowMessages['senderID'];

            $this->message = $rowMessages['message'];    

            $this->messageID = $rowMessages['id'];  

            $this->messagepostingID = $rowMessages['postingID']; 

            $this->senderEmail = $rowMessages['email'];       

            echo '<li>';

            echo "$this->senderEmail: $this->message <a href='". DOMAIN . "sendMessage.php?postingID=$this->messagepostingID&recID=$this->messageFrom'>Respond</a>  <a href='". DOMAIN . "/classes/MessageDelete.php?id=$this->messageID'>Delete Message</a>";

            echo '</li>';              

        }

        

     }     

 }   

    

?>
Return current item: Classifieds