english/administrator/components/com_aicontactsafe/models/profiles.php
// function to check if the default profile was deactivated
function to check if the default profile was deactivated
function to check if the default profile was deactivated
function checkDefaultProfile( $id = 0 ) {
		$id = (int)$id;
		$db = &JFactory::getDBO();
		$query = 'SELECT set_default FROM `#__aicontactsafe_profiles` WHERE id = '.$id;
		$db->setQuery( $query );
		$set_default = $db->loadResult();
		if ($set_default == 1) {
			$this->_app->enqueueMessage(JText::_('COM_AICONTACTSAFE_DEACTIVATE_DEFAULT_ERROR'), 'error');
		}
		return $set_default;
	}
function checkDefaultProfile ( $ id = 0 ) { $ id = ( int ) $ id ; $ db = & JFactory :: getDBO ( ) ; $ query = 'SELECT set_default FROM `#__aicontactsafe_profiles` WHERE id = ' . $ id ; $ db -> setQuery ( $ query ) ; $ set_default = $ db -> loadResult ( ) ; if ( $ set_default == 1 ) { $ this -> _app -> enqueueMessage ( JText :: _ ( 'COM_AICONTACTSAFE_DEACTIVATE_DEFAULT_ERROR' ) , 'error' ) ; } return $ set_default ; }
function to check if the default profile was deactivated
function to check if the default profile was deactivated
// initialize the database // reset field set_default to 0 for all records