<tr>
					<th>Ser.No</th>
					<th>From</th>
					<th>Title</th>
					<th>Message</th>
					<th>Delete</th>					
				</tr>
			</thead>
			<tbody>	
				<?php 
$ctr = 1;
foreach ($data as $inboxMail) {
    $mailId = $inboxMail->mail_id;
    //now get the user detail of the sender...
    $user = new User();
    $fetchedUser = $user->getUserUsingUserId($inboxMail->from_user_id);
    $userFullName = $fetchedUser->user_full_name;
    ?>
							<tr class="gradeA">
								<td><?php 
    echo $ctr++;
    ?>
</td>
								<td><?php 
    echo $userFullName;
    ?>
</td>
								<td><?php 
    echo $inboxMail->mail_title;
    ?>
</td>
Example #2
0
<?php

require_once '../core/init.php';
$mailId = $_GET['mailId'];
//now get the details of the mail using the mailId i have just obtained from
//the parameter...
$mail = new Mail();
$fetchedMail = $mail->getMailUsingMailId($mailId);
$mailTitle = $fetchedMail->mail_title;
$mailContent = $fetchedMail->mail_content;
//now get some details like email address, and full name of the person.
$user = new User();
$fetchedUser = $user->getUserUsingUserId($fetchedMail->to_user_id);
//I got the user ...reciepient...then get the email address of the recipient...
$userEmailAddress = $fetchedUser->email;
$userFullName = $fetchedUser->user_full_name;
$formattedToString = $userFullName . ' [ ' . $userEmailAddress . ' ]';
?>
<div class="panel-body">
    <div class="tab-pane fade in active">
        <h4>Mail Details</h4>
        <!--the first tab to load is the username setting form...-->                                                            
        <form role="form">    
            <div class="form-group">
                <label for="userId">To</label>                
                <input ng-model="composeMailForm.mailTo" class="form-control" id="mailTo" type="text" value="<?php 
echo $formattedToString;
?>
" />
            </div>
            <div class="form-group">        
            <i class="fa fa-envelope fa-fw"></i>  <i class="fa fa-caret-down"></i>
        </a>
        <?php 
//now get the first four inbox mails from the database
$mail = new Mail();
$inboxMailList = $mail->getAllMailsTo($userId);
$user = new User();
$today = date("Y-m-d h:i:sa");
if (!empty($inboxMailList)) {
    ?>
        <ul class="dropdown-menu dropdown-messages">
            <?php 
    $rows = $inboxMailList->getResults();
    foreach ($rows as $row) {
        //find the sender user...
        $senderUser = $user->getUserUsingUserId($row->from_user_id);
        $mailSentDate = $row->mail_date;
        $diff = abs(strtotime($today) - strtotime($mailSentDate));
        $years = floor($diff / (365 * 60 * 60 * 24));
        $months = floor(($diff - $years * 365 * 60 * 60 * 24) / (30 * 60 * 60 * 24));
        $days = floor(($diff - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24) / (60 * 60 * 24));
        ?>
                <li>
                    <a href="#">
                        <div>
                            <strong><?php 
        echo $senderUser->user_full_name;
        ?>
</strong>
                            <span class="pull-right text-muted">
                            <em><?php 
Example #4
0
<?php

require_once '../core/init.php';
$data = array();
$userId = $_POST['userid'];
$userType = $_POST['usertype'];
$userFullName = $_POST['fullname'];
$userStatus = $_POST['userstatus'];
$user = new User();
$fetchedUser = $user->getUserUsingUserId($userId);
if (isset($fetchedUser)) {
    //now set the modified values using the setter methods..
    $modifiedUser = new User();
    $modifiedUser->setUserId($userId);
    $modifiedUser->setUserType($userType);
    $modifiedUser->setUsername($fetchedUser->username);
    $modifiedUser->existingUserPassword($fetchedUser->user_password);
    $modifiedUser->setUserFullName($userFullName);
    $modifiedUser->setUserStatus($userStatus);
    $modifiedUser->setEmail($fetchedUser->email);
    $modifiedUser->setUserLastValidLogin($fetchedUser->user_last_valid_login);
    $modifiedUser->setUserFirstInvalidLogin($fetchedUser->user_first_invalid_login);
    $modifiedUser->setUserFailedLoginCount($fetchedUser->user_faild_login_count);
    $modifiedUser->setUserCreateDate($fetchedUser->user_create_date);
    $modifiedUser->setModifiedBy($fetchedUser->modified_by);
    $modifiedUser->setModificationDate($fetchedUser->modification_date);
    //update the record
    $user->update($modifiedUser);
    $data['success'] = true;
    $data['message'] = "<div class='alert alert-success alert-dismissable'>" . "<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>" . "Lorem ipsum dolor sit amet, consectetur adipisicing elit. <a href='#' class='alert-link'>Alert Link</a>." . "</div><br/>";
    echo json_encode($data);