english/administrator/components/com_aicontactsafe/models/messages.php
// function to change the status of a message to replied
function to change the status of a message to replied
function to change the status of a message to replied
function changeStatusToReplied( $id = 0 ) {
		$id = (int)$id;
		if ( $id > 0 ) {
			$db = &JFactory::getDBO();
			$query = 'SELECT m.status_id, m.manual_status, m.profile_id, p.reply_status_id FROM #__aicontactsafe_messages m LEFT JOIN #__aicontactsafe_profiles p ON m.profile_id = p.id WHERE m.id = '.$id;
			$db->setQuery($query);
			$results = $db->loadObject();
			if (!$results->manual_status && $results->status_id != $results->reply_status_id) {
				$query = 'UPDATE #__aicontactsafe_messages SET status_id = '.$results->reply_status_id.' WHERE id = '.$id;
				$db->setQuery($query);
				$db->query();
			}
		}
	}
function changeStatusToReplied ( $ id = 0 ) { $ id = ( int ) $ id ; if ( $ id > 0 ) { $ db = & JFactory :: getDBO ( ) ; $ query = 'SELECT m.status_id, m.manual_status, m.profile_id, p.reply_status_id FROM #__aicontactsafe_messages m LEFT JOIN #__aicontactsafe_profiles p ON m.profile_id = p.id WHERE m.id = ' . $ id ; $ db -> setQuery ( $ query ) ; $ results = $ db -> loadObject ( ) ; if ( ! $ results -> manual_status && $ results -> status_id != $ results -> reply_status_id ) { $ query = 'UPDATE #__aicontactsafe_messages SET status_id = ' . $ results -> reply_status_id . ' WHERE id = ' . $ id ; $ db -> setQuery ( $ query ) ; $ db -> query ( ) ; } } }
function to change the status of a message to replied
function to change the status of a message to replied
// initialize the database