english/administrator/components/com_aicontactsafe/models/control_panel.php
// function to delete all the tables and files uploaded by AiContactSafe
function to delete all the tables and files uploaded by AiContactSafe
function to delete all the tables and files uploaded by AiContactSafe
function deleteTablesAndFiles() {
		$db = &JFactory::getDBO();
		$query = 'TRUNCATE TABLE `#__aicontactsafe_config`;';
		$db->setQuery( $query );
		$db->query();
		$query = 'DROP TABLE IF EXISTS `#__aicontactsafe_config`;';
		$db->setQuery( $query );
		$db->query();
		$query = 'TRUNCATE TABLE `#__aicontactsafe_fields`;';
		$db->setQuery( $query );
		$db->query();
		$query = 'DROP TABLE IF EXISTS `#__aicontactsafe_fields`;';
		$db->setQuery( $query );
		$db->query();
		$query = 'TRUNCATE TABLE `#__aicontactsafe_contactinformations`;';
		$db->setQuery( $query );
		$db->query();
		$query = 'DROP TABLE IF EXISTS `#__aicontactsafe_contactinformations`;';
		$db->setQuery( $query );
		$db->query();
		$query = 'TRUNCATE TABLE `#__aicontactsafe_messages`;';
		$db->setQuery( $query );
		$db->query();
		$query = 'DROP TABLE IF EXISTS `#__aicontactsafe_messages`;';
		$db->setQuery( $query );
		$db->query();
		$query = 'TRUNCATE TABLE `#__aicontactsafe_profiles`;';
		$db->setQuery( $query );
		$db->query();
		$query = 'DROP TABLE IF EXISTS `#__aicontactsafe_profiles`;';
		$db->setQuery( $query );
		$db->query();
		$query = 'TRUNCATE TABLE `#__aicontactsafe_messagefiles`;';
		$db->setQuery( $query );
		$db->query();
		$query = 'DROP TABLE IF EXISTS `#__aicontactsafe_messagefiles`;';
		$db->setQuery( $query );
		$db->query();
		$query = 'TRUNCATE TABLE `#__aicontactsafe_fieldvalues`;';
		$db->setQuery( $query );
		$db->query();
		$query = 'DROP TABLE IF EXISTS `#__aicontactsafe_fieldvalues`;';
		$db->setQuery( $query );
		$db->query();
		$query = 'TRUNCATE TABLE `#__aicontactsafe_statuses`;';
		$db->setQuery( $query );
		$db->query();
		$query = 'DROP TABLE IF EXISTS `#__aicontactsafe_statuses`;';
		$db->setQuery( $query );
		$db->query();
		$tablesPrefix = $db->getPrefix();
		$tablesList = $db->getTableList();
		if ( in_array($tablesPrefix.'_jf_tableinfo', $tablesList) ) {
			$query = 'DELETE FROM `#__jf_tableinfo` WHERE joomlatablename = \'aicontactsafe_contactinformations\' or joomlatablename = \'aicontactsafe_fields\' or joomlatablename = \'aicontactsafe_profiles\';';
			$db->setQuery( $query );
			$db->query();
		}
		if ( in_array($tablesPrefix.'_jf_content', $tablesList) ) {
			$query = 'DELETE FROM `#__jf_content` WHERE reference_table = \'aicontactsafe_contactinformations\' or reference_table = \'aicontactsafe_fields\' or reference_table = \'aicontactsafe_profiles\';';
			$db->setQuery( $query );
			$db->query();
		}
		jimport('joomla.filesystem.folder');
		$aicontactsafe_media_folder = JPATH_ROOT.DS.'media'.DS.'aicontactsafe';
		JFolder::delete($aicontactsafe_media_folder);
		if ($this->checkAiContactSafeModule()) {
			$this->uninstallAiContactSafeModule();
		}
		if ($this->checkAiContactSafeForm()) {
			$this->uninstallAiContactSafeForm();
		}
		if ($this->checkAiContactSafeLink()) {
			$this->uninstallAiContactSafeLink();
		}
	}
function deleteTablesAndFiles ( ) { $ db = & JFactory :: getDBO ( ) ; $ query = 'TRUNCATE TABLE `#__aicontactsafe_config`;' ; $ db -> setQuery ( $ query ) ; $ db -> query ( ) ; $ query = 'DROP TABLE IF EXISTS `#__aicontactsafe_config`;' ; $ db -> setQuery ( $ query ) ; $ db -> query ( ) ; $ query = 'TRUNCATE TABLE `#__aicontactsafe_fields`;' ; $ db -> setQuery ( $ query ) ; $ db -> query ( ) ; $ query = 'DROP TABLE IF EXISTS `#__aicontactsafe_fields`;' ; $ db -> setQuery ( $ query ) ; $ db -> query ( ) ; $ query = 'TRUNCATE TABLE `#__aicontactsafe_contactinformations`;' ; $ db -> setQuery ( $ query ) ; $ db -> query ( ) ; $ query = 'DROP TABLE IF EXISTS `#__aicontactsafe_contactinformations`;' ; $ db -> setQuery ( $ query ) ; $ db -> query ( ) ; $ query = 'TRUNCATE TABLE `#__aicontactsafe_messages`;' ; $ db -> setQuery ( $ query ) ; $ db -> query ( ) ; $ query = 'DROP TABLE IF EXISTS `#__aicontactsafe_messages`;' ; $ db -> setQuery ( $ query ) ; $ db -> query ( ) ; $ query = 'TRUNCATE TABLE `#__aicontactsafe_profiles`;' ; $ db -> setQuery ( $ query ) ; $ db -> query ( ) ; $ query = 'DROP TABLE IF EXISTS `#__aicontactsafe_profiles`;' ; $ db -> setQuery ( $ query ) ; $ db -> query ( ) ; $ query = 'TRUNCATE TABLE `#__aicontactsafe_messagefiles`;' ; $ db -> setQuery ( $ query ) ; $ db -> query ( ) ; $ query = 'DROP TABLE IF EXISTS `#__aicontactsafe_messagefiles`;' ; $ db -> setQuery ( $ query ) ; $ db -> query ( ) ; $ query = 'TRUNCATE TABLE `#__aicontactsafe_fieldvalues`;' ; $ db -> setQuery ( $ query ) ; $ db -> query ( ) ; $ query = 'DROP TABLE IF EXISTS `#__aicontactsafe_fieldvalues`;' ; $ db -> setQuery ( $ query ) ; $ db -> query ( ) ; $ query = 'TRUNCATE TABLE `#__aicontactsafe_statuses`;' ; $ db -> setQuery ( $ query ) ; $ db -> query ( ) ; $ query = 'DROP TABLE IF EXISTS `#__aicontactsafe_statuses`;' ; $ db -> setQuery ( $ query ) ; $ db -> query ( ) ; $ tablesPrefix = $ db -> getPrefix ( ) ; $ tablesList = $ db -> getTableList ( ) ; if ( in_array ( $ tablesPrefix . '_jf_tableinfo' , $ tablesList ) ) { $ query = 'DELETE FROM `#__jf_tableinfo` WHERE joomlatablename = \'aicontactsafe_contactinformations\' or joomlatablename = \'aicontactsafe_fields\' or joomlatablename = \'aicontactsafe_profiles\';' ; $ db -> setQuery ( $ query ) ; $ db -> query ( ) ; } if ( in_array ( $ tablesPrefix . '_jf_content' , $ tablesList ) ) { $ query = 'DELETE FROM `#__jf_content` WHERE reference_table = \'aicontactsafe_contactinformations\' or reference_table = \'aicontactsafe_fields\' or reference_table = \'aicontactsafe_profiles\';' ; $ db -> setQuery ( $ query ) ; $ db -> query ( ) ; } jimport ( 'joomla.filesystem.folder' ) ; $ aicontactsafe_media_folder = JPATH_ROOT . DS . 'media' . DS . 'aicontactsafe' ; JFolder :: delete ( $ aicontactsafe_media_folder ) ; if ( $ this -> checkAiContactSafeModule ( ) ) { $ this -> uninstallAiContactSafeModule ( ) ; } if ( $ this -> checkAiContactSafeForm ( ) ) { $ this -> uninstallAiContactSafeForm ( ) ; } if ( $ this -> checkAiContactSafeLink ( ) ) { $ this -> uninstallAiContactSafeLink ( ) ; } }
function to delete all the tables and files uploaded by AiContactSafe
function to delete all the tables and files uploaded by AiContactSafe
// initialize the database // #__aicontactsafe_config // #__aicontactsafe_fields // #__aicontactsafe_contactinformations // #__aicontactsafe_messages // #__aicontactsafe_profiles // #__aicontactsafe_messagefiles // #__aicontactsafe_fieldvalues // #__aicontactsafe_statuses // delete records from joomfish // #__jf_tableinfo // #__jf_content // import joomla clases to manage file system // delete the folder containing the files in the media folder // uninstall aiContactSafeModule // uninstall aiContactSafeForm // uninstall aiContactSafeLink