You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4566 lines
309 KiB

<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.5
@build 24th April, 2021
@created 13th August, 2020
@package eHealth Portal
@subpackage script.php
@author Oh Martin <https://github.com/namibia/eHealth-Portal>
@copyright Copyright (C) 2020 Vast Development Method. All rights reserved.
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Portal for mobile health clinics
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
JHTML::_('behavior.modal');
/**
* Script File of Ehealth_portal Component
*/
class com_ehealth_portalInstallerScript
{
/**
* Constructor
*
* @param JAdapterInstance $parent The object responsible for running this script
*/
public function __construct(JAdapterInstance $parent) {}
/**
* Called on installation
*
* @param JAdapterInstance $parent The object responsible for running this script
*
* @return boolean True on success
*/
public function install(JAdapterInstance $parent) {}
/**
* Called on uninstallation
*
* @param JAdapterInstance $parent The object responsible for running this script
*/
public function uninstall(JAdapterInstance $parent)
{
// Get Application object
$app = JFactory::getApplication();
// Get The Database object
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Payment alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.payment') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$payment_found = $db->getNumRows();
// Now check if there were any rows
if ($payment_found)
{
// Since there are load the needed payment type ids
$payment_ids = $db->loadColumn();
// Remove Payment from the content type table
$payment_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.payment') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($payment_condition);
$db->setQuery($query);
// Execute the query to remove Payment items
$payment_done = $db->execute();
if ($payment_done)
{
// If successfully remove Payment add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.payment) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Payment items from the contentitem tag map table
$payment_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.payment') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($payment_condition);
$db->setQuery($query);
// Execute the query to remove Payment items
$payment_done = $db->execute();
if ($payment_done)
{
// If successfully remove Payment add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.payment) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Payment items from the ucm content table
$payment_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.payment') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($payment_condition);
$db->setQuery($query);
// Execute the query to remove Payment items
$payment_done = $db->execute();
if ($payment_done)
{
// If successfully removed Payment add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.payment) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Payment items are cleared from DB
foreach ($payment_ids as $payment_id)
{
// Remove Payment items from the ucm base table
$payment_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $payment_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($payment_condition);
$db->setQuery($query);
// Execute the query to remove Payment items
$db->execute();
// Remove Payment items from the ucm history table
$payment_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $payment_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($payment_condition);
$db->setQuery($query);
// Execute the query to remove Payment items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where General_medical_check_up alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.general_medical_check_up') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$general_medical_check_up_found = $db->getNumRows();
// Now check if there were any rows
if ($general_medical_check_up_found)
{
// Since there are load the needed general_medical_check_up type ids
$general_medical_check_up_ids = $db->loadColumn();
// Remove General_medical_check_up from the content type table
$general_medical_check_up_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.general_medical_check_up') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($general_medical_check_up_condition);
$db->setQuery($query);
// Execute the query to remove General_medical_check_up items
$general_medical_check_up_done = $db->execute();
if ($general_medical_check_up_done)
{
// If successfully remove General_medical_check_up add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.general_medical_check_up) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove General_medical_check_up items from the contentitem tag map table
$general_medical_check_up_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.general_medical_check_up') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($general_medical_check_up_condition);
$db->setQuery($query);
// Execute the query to remove General_medical_check_up items
$general_medical_check_up_done = $db->execute();
if ($general_medical_check_up_done)
{
// If successfully remove General_medical_check_up add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.general_medical_check_up) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove General_medical_check_up items from the ucm content table
$general_medical_check_up_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.general_medical_check_up') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($general_medical_check_up_condition);
$db->setQuery($query);
// Execute the query to remove General_medical_check_up items
$general_medical_check_up_done = $db->execute();
if ($general_medical_check_up_done)
{
// If successfully removed General_medical_check_up add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.general_medical_check_up) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the General_medical_check_up items are cleared from DB
foreach ($general_medical_check_up_ids as $general_medical_check_up_id)
{
// Remove General_medical_check_up items from the ucm base table
$general_medical_check_up_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $general_medical_check_up_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($general_medical_check_up_condition);
$db->setQuery($query);
// Execute the query to remove General_medical_check_up items
$db->execute();
// Remove General_medical_check_up items from the ucm history table
$general_medical_check_up_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $general_medical_check_up_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($general_medical_check_up_condition);
$db->setQuery($query);
// Execute the query to remove General_medical_check_up items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Antenatal_care alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.antenatal_care') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$antenatal_care_found = $db->getNumRows();
// Now check if there were any rows
if ($antenatal_care_found)
{
// Since there are load the needed antenatal_care type ids
$antenatal_care_ids = $db->loadColumn();
// Remove Antenatal_care from the content type table
$antenatal_care_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.antenatal_care') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($antenatal_care_condition);
$db->setQuery($query);
// Execute the query to remove Antenatal_care items
$antenatal_care_done = $db->execute();
if ($antenatal_care_done)
{
// If successfully remove Antenatal_care add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.antenatal_care) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Antenatal_care items from the contentitem tag map table
$antenatal_care_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.antenatal_care') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($antenatal_care_condition);
$db->setQuery($query);
// Execute the query to remove Antenatal_care items
$antenatal_care_done = $db->execute();
if ($antenatal_care_done)
{
// If successfully remove Antenatal_care add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.antenatal_care) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Antenatal_care items from the ucm content table
$antenatal_care_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.antenatal_care') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($antenatal_care_condition);
$db->setQuery($query);
// Execute the query to remove Antenatal_care items
$antenatal_care_done = $db->execute();
if ($antenatal_care_done)
{
// If successfully removed Antenatal_care add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.antenatal_care) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Antenatal_care items are cleared from DB
foreach ($antenatal_care_ids as $antenatal_care_id)
{
// Remove Antenatal_care items from the ucm base table
$antenatal_care_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $antenatal_care_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($antenatal_care_condition);
$db->setQuery($query);
// Execute the query to remove Antenatal_care items
$db->execute();
// Remove Antenatal_care items from the ucm history table
$antenatal_care_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $antenatal_care_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($antenatal_care_condition);
$db->setQuery($query);
// Execute the query to remove Antenatal_care items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Immunisation alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.immunisation') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$immunisation_found = $db->getNumRows();
// Now check if there were any rows
if ($immunisation_found)
{
// Since there are load the needed immunisation type ids
$immunisation_ids = $db->loadColumn();
// Remove Immunisation from the content type table
$immunisation_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.immunisation') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($immunisation_condition);
$db->setQuery($query);
// Execute the query to remove Immunisation items
$immunisation_done = $db->execute();
if ($immunisation_done)
{
// If successfully remove Immunisation add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.immunisation) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Immunisation items from the contentitem tag map table
$immunisation_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.immunisation') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($immunisation_condition);
$db->setQuery($query);
// Execute the query to remove Immunisation items
$immunisation_done = $db->execute();
if ($immunisation_done)
{
// If successfully remove Immunisation add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.immunisation) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Immunisation items from the ucm content table
$immunisation_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.immunisation') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($immunisation_condition);
$db->setQuery($query);
// Execute the query to remove Immunisation items
$immunisation_done = $db->execute();
if ($immunisation_done)
{
// If successfully removed Immunisation add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.immunisation) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Immunisation items are cleared from DB
foreach ($immunisation_ids as $immunisation_id)
{
// Remove Immunisation items from the ucm base table
$immunisation_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $immunisation_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($immunisation_condition);
$db->setQuery($query);
// Execute the query to remove Immunisation items
$db->execute();
// Remove Immunisation items from the ucm history table
$immunisation_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $immunisation_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($immunisation_condition);
$db->setQuery($query);
// Execute the query to remove Immunisation items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Vmmc alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.vmmc') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$vmmc_found = $db->getNumRows();
// Now check if there were any rows
if ($vmmc_found)
{
// Since there are load the needed vmmc type ids
$vmmc_ids = $db->loadColumn();
// Remove Vmmc from the content type table
$vmmc_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.vmmc') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($vmmc_condition);
$db->setQuery($query);
// Execute the query to remove Vmmc items
$vmmc_done = $db->execute();
if ($vmmc_done)
{
// If successfully remove Vmmc add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.vmmc) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Vmmc items from the contentitem tag map table
$vmmc_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.vmmc') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($vmmc_condition);
$db->setQuery($query);
// Execute the query to remove Vmmc items
$vmmc_done = $db->execute();
if ($vmmc_done)
{
// If successfully remove Vmmc add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.vmmc) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Vmmc items from the ucm content table
$vmmc_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.vmmc') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($vmmc_condition);
$db->setQuery($query);
// Execute the query to remove Vmmc items
$vmmc_done = $db->execute();
if ($vmmc_done)
{
// If successfully removed Vmmc add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.vmmc) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Vmmc items are cleared from DB
foreach ($vmmc_ids as $vmmc_id)
{
// Remove Vmmc items from the ucm base table
$vmmc_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $vmmc_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($vmmc_condition);
$db->setQuery($query);
// Execute the query to remove Vmmc items
$db->execute();
// Remove Vmmc items from the ucm history table
$vmmc_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $vmmc_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($vmmc_condition);
$db->setQuery($query);
// Execute the query to remove Vmmc items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Prostate_and_testicular_cancer alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.prostate_and_testicular_cancer') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$prostate_and_testicular_cancer_found = $db->getNumRows();
// Now check if there were any rows
if ($prostate_and_testicular_cancer_found)
{
// Since there are load the needed prostate_and_testicular_cancer type ids
$prostate_and_testicular_cancer_ids = $db->loadColumn();
// Remove Prostate_and_testicular_cancer from the content type table
$prostate_and_testicular_cancer_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.prostate_and_testicular_cancer') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($prostate_and_testicular_cancer_condition);
$db->setQuery($query);
// Execute the query to remove Prostate_and_testicular_cancer items
$prostate_and_testicular_cancer_done = $db->execute();
if ($prostate_and_testicular_cancer_done)
{
// If successfully remove Prostate_and_testicular_cancer add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.prostate_and_testicular_cancer) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Prostate_and_testicular_cancer items from the contentitem tag map table
$prostate_and_testicular_cancer_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.prostate_and_testicular_cancer') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($prostate_and_testicular_cancer_condition);
$db->setQuery($query);
// Execute the query to remove Prostate_and_testicular_cancer items
$prostate_and_testicular_cancer_done = $db->execute();
if ($prostate_and_testicular_cancer_done)
{
// If successfully remove Prostate_and_testicular_cancer add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.prostate_and_testicular_cancer) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Prostate_and_testicular_cancer items from the ucm content table
$prostate_and_testicular_cancer_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.prostate_and_testicular_cancer') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($prostate_and_testicular_cancer_condition);
$db->setQuery($query);
// Execute the query to remove Prostate_and_testicular_cancer items
$prostate_and_testicular_cancer_done = $db->execute();
if ($prostate_and_testicular_cancer_done)
{
// If successfully removed Prostate_and_testicular_cancer add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.prostate_and_testicular_cancer) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Prostate_and_testicular_cancer items are cleared from DB
foreach ($prostate_and_testicular_cancer_ids as $prostate_and_testicular_cancer_id)
{
// Remove Prostate_and_testicular_cancer items from the ucm base table
$prostate_and_testicular_cancer_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $prostate_and_testicular_cancer_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($prostate_and_testicular_cancer_condition);
$db->setQuery($query);
// Execute the query to remove Prostate_and_testicular_cancer items
$db->execute();
// Remove Prostate_and_testicular_cancer items from the ucm history table
$prostate_and_testicular_cancer_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $prostate_and_testicular_cancer_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($prostate_and_testicular_cancer_condition);
$db->setQuery($query);
// Execute the query to remove Prostate_and_testicular_cancer items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Tuberculosis alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.tuberculosis') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$tuberculosis_found = $db->getNumRows();
// Now check if there were any rows
if ($tuberculosis_found)
{
// Since there are load the needed tuberculosis type ids
$tuberculosis_ids = $db->loadColumn();
// Remove Tuberculosis from the content type table
$tuberculosis_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.tuberculosis') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($tuberculosis_condition);
$db->setQuery($query);
// Execute the query to remove Tuberculosis items
$tuberculosis_done = $db->execute();
if ($tuberculosis_done)
{
// If successfully remove Tuberculosis add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.tuberculosis) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Tuberculosis items from the contentitem tag map table
$tuberculosis_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.tuberculosis') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($tuberculosis_condition);
$db->setQuery($query);
// Execute the query to remove Tuberculosis items
$tuberculosis_done = $db->execute();
if ($tuberculosis_done)
{
// If successfully remove Tuberculosis add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.tuberculosis) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Tuberculosis items from the ucm content table
$tuberculosis_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.tuberculosis') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($tuberculosis_condition);
$db->setQuery($query);
// Execute the query to remove Tuberculosis items
$tuberculosis_done = $db->execute();
if ($tuberculosis_done)
{
// If successfully removed Tuberculosis add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.tuberculosis) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Tuberculosis items are cleared from DB
foreach ($tuberculosis_ids as $tuberculosis_id)
{
// Remove Tuberculosis items from the ucm base table
$tuberculosis_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $tuberculosis_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($tuberculosis_condition);
$db->setQuery($query);
// Execute the query to remove Tuberculosis items
$db->execute();
// Remove Tuberculosis items from the ucm history table
$tuberculosis_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $tuberculosis_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($tuberculosis_condition);
$db->setQuery($query);
// Execute the query to remove Tuberculosis items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Hiv_counseling_and_testing alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.hiv_counseling_and_testing') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$hiv_counseling_and_testing_found = $db->getNumRows();
// Now check if there were any rows
if ($hiv_counseling_and_testing_found)
{
// Since there are load the needed hiv_counseling_and_testing type ids
$hiv_counseling_and_testing_ids = $db->loadColumn();
// Remove Hiv_counseling_and_testing from the content type table
$hiv_counseling_and_testing_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.hiv_counseling_and_testing') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($hiv_counseling_and_testing_condition);
$db->setQuery($query);
// Execute the query to remove Hiv_counseling_and_testing items
$hiv_counseling_and_testing_done = $db->execute();
if ($hiv_counseling_and_testing_done)
{
// If successfully remove Hiv_counseling_and_testing add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.hiv_counseling_and_testing) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Hiv_counseling_and_testing items from the contentitem tag map table
$hiv_counseling_and_testing_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.hiv_counseling_and_testing') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($hiv_counseling_and_testing_condition);
$db->setQuery($query);
// Execute the query to remove Hiv_counseling_and_testing items
$hiv_counseling_and_testing_done = $db->execute();
if ($hiv_counseling_and_testing_done)
{
// If successfully remove Hiv_counseling_and_testing add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.hiv_counseling_and_testing) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Hiv_counseling_and_testing items from the ucm content table
$hiv_counseling_and_testing_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.hiv_counseling_and_testing') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($hiv_counseling_and_testing_condition);
$db->setQuery($query);
// Execute the query to remove Hiv_counseling_and_testing items
$hiv_counseling_and_testing_done = $db->execute();
if ($hiv_counseling_and_testing_done)
{
// If successfully removed Hiv_counseling_and_testing add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.hiv_counseling_and_testing) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Hiv_counseling_and_testing items are cleared from DB
foreach ($hiv_counseling_and_testing_ids as $hiv_counseling_and_testing_id)
{
// Remove Hiv_counseling_and_testing items from the ucm base table
$hiv_counseling_and_testing_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $hiv_counseling_and_testing_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($hiv_counseling_and_testing_condition);
$db->setQuery($query);
// Execute the query to remove Hiv_counseling_and_testing items
$db->execute();
// Remove Hiv_counseling_and_testing items from the ucm history table
$hiv_counseling_and_testing_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $hiv_counseling_and_testing_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($hiv_counseling_and_testing_condition);
$db->setQuery($query);
// Execute the query to remove Hiv_counseling_and_testing items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Family_planning alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.family_planning') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$family_planning_found = $db->getNumRows();
// Now check if there were any rows
if ($family_planning_found)
{
// Since there are load the needed family_planning type ids
$family_planning_ids = $db->loadColumn();
// Remove Family_planning from the content type table
$family_planning_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.family_planning') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($family_planning_condition);
$db->setQuery($query);
// Execute the query to remove Family_planning items
$family_planning_done = $db->execute();
if ($family_planning_done)
{
// If successfully remove Family_planning add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.family_planning) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Family_planning items from the contentitem tag map table
$family_planning_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.family_planning') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($family_planning_condition);
$db->setQuery($query);
// Execute the query to remove Family_planning items
$family_planning_done = $db->execute();
if ($family_planning_done)
{
// If successfully remove Family_planning add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.family_planning) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Family_planning items from the ucm content table
$family_planning_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.family_planning') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($family_planning_condition);
$db->setQuery($query);
// Execute the query to remove Family_planning items
$family_planning_done = $db->execute();
if ($family_planning_done)
{
// If successfully removed Family_planning add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.family_planning) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Family_planning items are cleared from DB
foreach ($family_planning_ids as $family_planning_id)
{
// Remove Family_planning items from the ucm base table
$family_planning_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $family_planning_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($family_planning_condition);
$db->setQuery($query);
// Execute the query to remove Family_planning items
$db->execute();
// Remove Family_planning items from the ucm history table
$family_planning_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $family_planning_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($family_planning_condition);
$db->setQuery($query);
// Execute the query to remove Family_planning items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Health_education alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.health_education') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$health_education_found = $db->getNumRows();
// Now check if there were any rows
if ($health_education_found)
{
// Since there are load the needed health_education type ids
$health_education_ids = $db->loadColumn();
// Remove Health_education from the content type table
$health_education_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.health_education') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($health_education_condition);
$db->setQuery($query);
// Execute the query to remove Health_education items
$health_education_done = $db->execute();
if ($health_education_done)
{
// If successfully remove Health_education add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.health_education) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Health_education items from the contentitem tag map table
$health_education_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.health_education') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($health_education_condition);
$db->setQuery($query);
// Execute the query to remove Health_education items
$health_education_done = $db->execute();
if ($health_education_done)
{
// If successfully remove Health_education add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.health_education) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Health_education items from the ucm content table
$health_education_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.health_education') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($health_education_condition);
$db->setQuery($query);
// Execute the query to remove Health_education items
$health_education_done = $db->execute();
if ($health_education_done)
{
// If successfully removed Health_education add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.health_education) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Health_education items are cleared from DB
foreach ($health_education_ids as $health_education_id)
{
// Remove Health_education items from the ucm base table
$health_education_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $health_education_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($health_education_condition);
$db->setQuery($query);
// Execute the query to remove Health_education items
$db->execute();
// Remove Health_education items from the ucm history table
$health_education_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $health_education_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($health_education_condition);
$db->setQuery($query);
// Execute the query to remove Health_education items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Cervical_cancer alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.cervical_cancer') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$cervical_cancer_found = $db->getNumRows();
// Now check if there were any rows
if ($cervical_cancer_found)
{
// Since there are load the needed cervical_cancer type ids
$cervical_cancer_ids = $db->loadColumn();
// Remove Cervical_cancer from the content type table
$cervical_cancer_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.cervical_cancer') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($cervical_cancer_condition);
$db->setQuery($query);
// Execute the query to remove Cervical_cancer items
$cervical_cancer_done = $db->execute();
if ($cervical_cancer_done)
{
// If successfully remove Cervical_cancer add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.cervical_cancer) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Cervical_cancer items from the contentitem tag map table
$cervical_cancer_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.cervical_cancer') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($cervical_cancer_condition);
$db->setQuery($query);
// Execute the query to remove Cervical_cancer items
$cervical_cancer_done = $db->execute();
if ($cervical_cancer_done)
{
// If successfully remove Cervical_cancer add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.cervical_cancer) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Cervical_cancer items from the ucm content table
$cervical_cancer_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.cervical_cancer') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($cervical_cancer_condition);
$db->setQuery($query);
// Execute the query to remove Cervical_cancer items
$cervical_cancer_done = $db->execute();
if ($cervical_cancer_done)
{
// If successfully removed Cervical_cancer add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.cervical_cancer) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Cervical_cancer items are cleared from DB
foreach ($cervical_cancer_ids as $cervical_cancer_id)
{
// Remove Cervical_cancer items from the ucm base table
$cervical_cancer_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $cervical_cancer_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($cervical_cancer_condition);
$db->setQuery($query);
// Execute the query to remove Cervical_cancer items
$db->execute();
// Remove Cervical_cancer items from the ucm history table
$cervical_cancer_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $cervical_cancer_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($cervical_cancer_condition);
$db->setQuery($query);
// Execute the query to remove Cervical_cancer items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Breast_cancer alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.breast_cancer') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$breast_cancer_found = $db->getNumRows();
// Now check if there were any rows
if ($breast_cancer_found)
{
// Since there are load the needed breast_cancer type ids
$breast_cancer_ids = $db->loadColumn();
// Remove Breast_cancer from the content type table
$breast_cancer_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.breast_cancer') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($breast_cancer_condition);
$db->setQuery($query);
// Execute the query to remove Breast_cancer items
$breast_cancer_done = $db->execute();
if ($breast_cancer_done)
{
// If successfully remove Breast_cancer add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.breast_cancer) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Breast_cancer items from the contentitem tag map table
$breast_cancer_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.breast_cancer') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($breast_cancer_condition);
$db->setQuery($query);
// Execute the query to remove Breast_cancer items
$breast_cancer_done = $db->execute();
if ($breast_cancer_done)
{
// If successfully remove Breast_cancer add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.breast_cancer) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Breast_cancer items from the ucm content table
$breast_cancer_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.breast_cancer') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($breast_cancer_condition);
$db->setQuery($query);
// Execute the query to remove Breast_cancer items
$breast_cancer_done = $db->execute();
if ($breast_cancer_done)
{
// If successfully removed Breast_cancer add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.breast_cancer) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Breast_cancer items are cleared from DB
foreach ($breast_cancer_ids as $breast_cancer_id)
{
// Remove Breast_cancer items from the ucm base table
$breast_cancer_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $breast_cancer_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($breast_cancer_condition);
$db->setQuery($query);
// Execute the query to remove Breast_cancer items
$db->execute();
// Remove Breast_cancer items from the ucm history table
$breast_cancer_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $breast_cancer_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($breast_cancer_condition);
$db->setQuery($query);
// Execute the query to remove Breast_cancer items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Test alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.test') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$test_found = $db->getNumRows();
// Now check if there were any rows
if ($test_found)
{
// Since there are load the needed test type ids
$test_ids = $db->loadColumn();
// Remove Test from the content type table
$test_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.test') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($test_condition);
$db->setQuery($query);
// Execute the query to remove Test items
$test_done = $db->execute();
if ($test_done)
{
// If successfully remove Test add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.test) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Test items from the contentitem tag map table
$test_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.test') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($test_condition);
$db->setQuery($query);
// Execute the query to remove Test items
$test_done = $db->execute();
if ($test_done)
{
// If successfully remove Test add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.test) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Test items from the ucm content table
$test_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.test') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($test_condition);
$db->setQuery($query);
// Execute the query to remove Test items
$test_done = $db->execute();
if ($test_done)
{
// If successfully removed Test add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.test) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Test items are cleared from DB
foreach ($test_ids as $test_id)
{
// Remove Test items from the ucm base table
$test_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $test_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($test_condition);
$db->setQuery($query);
// Execute the query to remove Test items
$db->execute();
// Remove Test items from the ucm history table
$test_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $test_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($test_condition);
$db->setQuery($query);
// Execute the query to remove Test items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Immunisation_vaccine_type alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.immunisation_vaccine_type') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$immunisation_vaccine_type_found = $db->getNumRows();
// Now check if there were any rows
if ($immunisation_vaccine_type_found)
{
// Since there are load the needed immunisation_vaccine_type type ids
$immunisation_vaccine_type_ids = $db->loadColumn();
// Remove Immunisation_vaccine_type from the content type table
$immunisation_vaccine_type_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.immunisation_vaccine_type') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($immunisation_vaccine_type_condition);
$db->setQuery($query);
// Execute the query to remove Immunisation_vaccine_type items
$immunisation_vaccine_type_done = $db->execute();
if ($immunisation_vaccine_type_done)
{
// If successfully remove Immunisation_vaccine_type add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.immunisation_vaccine_type) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Immunisation_vaccine_type items from the contentitem tag map table
$immunisation_vaccine_type_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.immunisation_vaccine_type') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($immunisation_vaccine_type_condition);
$db->setQuery($query);
// Execute the query to remove Immunisation_vaccine_type items
$immunisation_vaccine_type_done = $db->execute();
if ($immunisation_vaccine_type_done)
{
// If successfully remove Immunisation_vaccine_type add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.immunisation_vaccine_type) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Immunisation_vaccine_type items from the ucm content table
$immunisation_vaccine_type_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.immunisation_vaccine_type') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($immunisation_vaccine_type_condition);
$db->setQuery($query);
// Execute the query to remove Immunisation_vaccine_type items
$immunisation_vaccine_type_done = $db->execute();
if ($immunisation_vaccine_type_done)
{
// If successfully removed Immunisation_vaccine_type add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.immunisation_vaccine_type) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Immunisation_vaccine_type items are cleared from DB
foreach ($immunisation_vaccine_type_ids as $immunisation_vaccine_type_id)
{
// Remove Immunisation_vaccine_type items from the ucm base table
$immunisation_vaccine_type_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $immunisation_vaccine_type_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($immunisation_vaccine_type_condition);
$db->setQuery($query);
// Execute the query to remove Immunisation_vaccine_type items
$db->execute();
// Remove Immunisation_vaccine_type items from the ucm history table
$immunisation_vaccine_type_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $immunisation_vaccine_type_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($immunisation_vaccine_type_condition);
$db->setQuery($query);
// Execute the query to remove Immunisation_vaccine_type items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Foetal_presentation alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.foetal_presentation') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$foetal_presentation_found = $db->getNumRows();
// Now check if there were any rows
if ($foetal_presentation_found)
{
// Since there are load the needed foetal_presentation type ids
$foetal_presentation_ids = $db->loadColumn();
// Remove Foetal_presentation from the content type table
$foetal_presentation_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.foetal_presentation') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($foetal_presentation_condition);
$db->setQuery($query);
// Execute the query to remove Foetal_presentation items
$foetal_presentation_done = $db->execute();
if ($foetal_presentation_done)
{
// If successfully remove Foetal_presentation add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.foetal_presentation) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Foetal_presentation items from the contentitem tag map table
$foetal_presentation_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.foetal_presentation') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($foetal_presentation_condition);
$db->setQuery($query);
// Execute the query to remove Foetal_presentation items
$foetal_presentation_done = $db->execute();
if ($foetal_presentation_done)
{
// If successfully remove Foetal_presentation add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.foetal_presentation) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Foetal_presentation items from the ucm content table
$foetal_presentation_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.foetal_presentation') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($foetal_presentation_condition);
$db->setQuery($query);
// Execute the query to remove Foetal_presentation items
$foetal_presentation_done = $db->execute();
if ($foetal_presentation_done)
{
// If successfully removed Foetal_presentation add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.foetal_presentation) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Foetal_presentation items are cleared from DB
foreach ($foetal_presentation_ids as $foetal_presentation_id)
{
// Remove Foetal_presentation items from the ucm base table
$foetal_presentation_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $foetal_presentation_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($foetal_presentation_condition);
$db->setQuery($query);
// Execute the query to remove Foetal_presentation items
$db->execute();
// Remove Foetal_presentation items from the ucm history table
$foetal_presentation_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $foetal_presentation_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($foetal_presentation_condition);
$db->setQuery($query);
// Execute the query to remove Foetal_presentation items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Foetal_lie alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.foetal_lie') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$foetal_lie_found = $db->getNumRows();
// Now check if there were any rows
if ($foetal_lie_found)
{
// Since there are load the needed foetal_lie type ids
$foetal_lie_ids = $db->loadColumn();
// Remove Foetal_lie from the content type table
$foetal_lie_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.foetal_lie') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($foetal_lie_condition);
$db->setQuery($query);
// Execute the query to remove Foetal_lie items
$foetal_lie_done = $db->execute();
if ($foetal_lie_done)
{
// If successfully remove Foetal_lie add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.foetal_lie) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Foetal_lie items from the contentitem tag map table
$foetal_lie_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.foetal_lie') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($foetal_lie_condition);
$db->setQuery($query);
// Execute the query to remove Foetal_lie items
$foetal_lie_done = $db->execute();
if ($foetal_lie_done)
{
// If successfully remove Foetal_lie add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.foetal_lie) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Foetal_lie items from the ucm content table
$foetal_lie_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.foetal_lie') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($foetal_lie_condition);
$db->setQuery($query);
// Execute the query to remove Foetal_lie items
$foetal_lie_done = $db->execute();
if ($foetal_lie_done)
{
// If successfully removed Foetal_lie add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.foetal_lie) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Foetal_lie items are cleared from DB
foreach ($foetal_lie_ids as $foetal_lie_id)
{
// Remove Foetal_lie items from the ucm base table
$foetal_lie_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $foetal_lie_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($foetal_lie_condition);
$db->setQuery($query);
// Execute the query to remove Foetal_lie items
$db->execute();
// Remove Foetal_lie items from the ucm history table
$foetal_lie_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $foetal_lie_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($foetal_lie_condition);
$db->setQuery($query);
// Execute the query to remove Foetal_lie items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Counseling_type alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.counseling_type') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$counseling_type_found = $db->getNumRows();
// Now check if there were any rows
if ($counseling_type_found)
{
// Since there are load the needed counseling_type type ids
$counseling_type_ids = $db->loadColumn();
// Remove Counseling_type from the content type table
$counseling_type_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.counseling_type') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($counseling_type_condition);
$db->setQuery($query);
// Execute the query to remove Counseling_type items
$counseling_type_done = $db->execute();
if ($counseling_type_done)
{
// If successfully remove Counseling_type add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.counseling_type) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Counseling_type items from the contentitem tag map table
$counseling_type_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.counseling_type') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($counseling_type_condition);
$db->setQuery($query);
// Execute the query to remove Counseling_type items
$counseling_type_done = $db->execute();
if ($counseling_type_done)
{
// If successfully remove Counseling_type add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.counseling_type) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Counseling_type items from the ucm content table
$counseling_type_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.counseling_type') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($counseling_type_condition);
$db->setQuery($query);
// Execute the query to remove Counseling_type items
$counseling_type_done = $db->execute();
if ($counseling_type_done)
{
// If successfully removed Counseling_type add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.counseling_type) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Counseling_type items are cleared from DB
foreach ($counseling_type_ids as $counseling_type_id)
{
// Remove Counseling_type items from the ucm base table
$counseling_type_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $counseling_type_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($counseling_type_condition);
$db->setQuery($query);
// Execute the query to remove Counseling_type items
$db->execute();
// Remove Counseling_type items from the ucm history table
$counseling_type_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $counseling_type_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($counseling_type_condition);
$db->setQuery($query);
// Execute the query to remove Counseling_type items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Foetal_engagement alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.foetal_engagement') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$foetal_engagement_found = $db->getNumRows();
// Now check if there were any rows
if ($foetal_engagement_found)
{
// Since there are load the needed foetal_engagement type ids
$foetal_engagement_ids = $db->loadColumn();
// Remove Foetal_engagement from the content type table
$foetal_engagement_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.foetal_engagement') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($foetal_engagement_condition);
$db->setQuery($query);
// Execute the query to remove Foetal_engagement items
$foetal_engagement_done = $db->execute();
if ($foetal_engagement_done)
{
// If successfully remove Foetal_engagement add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.foetal_engagement) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Foetal_engagement items from the contentitem tag map table
$foetal_engagement_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.foetal_engagement') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($foetal_engagement_condition);
$db->setQuery($query);
// Execute the query to remove Foetal_engagement items
$foetal_engagement_done = $db->execute();
if ($foetal_engagement_done)
{
// If successfully remove Foetal_engagement add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.foetal_engagement) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Foetal_engagement items from the ucm content table
$foetal_engagement_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.foetal_engagement') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($foetal_engagement_condition);
$db->setQuery($query);
// Execute the query to remove Foetal_engagement items
$foetal_engagement_done = $db->execute();
if ($foetal_engagement_done)
{
// If successfully removed Foetal_engagement add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.foetal_engagement) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Foetal_engagement items are cleared from DB
foreach ($foetal_engagement_ids as $foetal_engagement_id)
{
// Remove Foetal_engagement items from the ucm base table
$foetal_engagement_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $foetal_engagement_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($foetal_engagement_condition);
$db->setQuery($query);
// Execute the query to remove Foetal_engagement items
$db->execute();
// Remove Foetal_engagement items from the ucm history table
$foetal_engagement_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $foetal_engagement_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($foetal_engagement_condition);
$db->setQuery($query);
// Execute the query to remove Foetal_engagement items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Health_education_topic alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.health_education_topic') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$health_education_topic_found = $db->getNumRows();
// Now check if there were any rows
if ($health_education_topic_found)
{
// Since there are load the needed health_education_topic type ids
$health_education_topic_ids = $db->loadColumn();
// Remove Health_education_topic from the content type table
$health_education_topic_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.health_education_topic') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($health_education_topic_condition);
$db->setQuery($query);
// Execute the query to remove Health_education_topic items
$health_education_topic_done = $db->execute();
if ($health_education_topic_done)
{
// If successfully remove Health_education_topic add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.health_education_topic) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Health_education_topic items from the contentitem tag map table
$health_education_topic_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.health_education_topic') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($health_education_topic_condition);
$db->setQuery($query);
// Execute the query to remove Health_education_topic items
$health_education_topic_done = $db->execute();
if ($health_education_topic_done)
{
// If successfully remove Health_education_topic add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.health_education_topic) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Health_education_topic items from the ucm content table
$health_education_topic_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.health_education_topic') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($health_education_topic_condition);
$db->setQuery($query);
// Execute the query to remove Health_education_topic items
$health_education_topic_done = $db->execute();
if ($health_education_topic_done)
{
// If successfully removed Health_education_topic add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.health_education_topic) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Health_education_topic items are cleared from DB
foreach ($health_education_topic_ids as $health_education_topic_id)
{
// Remove Health_education_topic items from the ucm base table
$health_education_topic_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $health_education_topic_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($health_education_topic_condition);
$db->setQuery($query);
// Execute the query to remove Health_education_topic items
$db->execute();
// Remove Health_education_topic items from the ucm history table
$health_education_topic_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $health_education_topic_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($health_education_topic_condition);
$db->setQuery($query);
// Execute the query to remove Health_education_topic items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Testing_reason alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.testing_reason') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$testing_reason_found = $db->getNumRows();
// Now check if there were any rows
if ($testing_reason_found)
{
// Since there are load the needed testing_reason type ids
$testing_reason_ids = $db->loadColumn();
// Remove Testing_reason from the content type table
$testing_reason_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.testing_reason') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($testing_reason_condition);
$db->setQuery($query);
// Execute the query to remove Testing_reason items
$testing_reason_done = $db->execute();
if ($testing_reason_done)
{
// If successfully remove Testing_reason add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.testing_reason) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Testing_reason items from the contentitem tag map table
$testing_reason_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.testing_reason') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($testing_reason_condition);
$db->setQuery($query);
// Execute the query to remove Testing_reason items
$testing_reason_done = $db->execute();
if ($testing_reason_done)
{
// If successfully remove Testing_reason add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.testing_reason) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Testing_reason items from the ucm content table
$testing_reason_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.testing_reason') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($testing_reason_condition);
$db->setQuery($query);
// Execute the query to remove Testing_reason items
$testing_reason_done = $db->execute();
if ($testing_reason_done)
{
// If successfully removed Testing_reason add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.testing_reason) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Testing_reason items are cleared from DB
foreach ($testing_reason_ids as $testing_reason_id)
{
// Remove Testing_reason items from the ucm base table
$testing_reason_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $testing_reason_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($testing_reason_condition);
$db->setQuery($query);
// Execute the query to remove Testing_reason items
$db->execute();
// Remove Testing_reason items from the ucm history table
$testing_reason_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $testing_reason_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($testing_reason_condition);
$db->setQuery($query);
// Execute the query to remove Testing_reason items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Clinic alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.clinic') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$clinic_found = $db->getNumRows();
// Now check if there were any rows
if ($clinic_found)
{
// Since there are load the needed clinic type ids
$clinic_ids = $db->loadColumn();
// Remove Clinic from the content type table
$clinic_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.clinic') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($clinic_condition);
$db->setQuery($query);
// Execute the query to remove Clinic items
$clinic_done = $db->execute();
if ($clinic_done)
{
// If successfully remove Clinic add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.clinic) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Clinic items from the contentitem tag map table
$clinic_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.clinic') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($clinic_condition);
$db->setQuery($query);
// Execute the query to remove Clinic items
$clinic_done = $db->execute();
if ($clinic_done)
{
// If successfully remove Clinic add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.clinic) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Clinic items from the ucm content table
$clinic_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.clinic') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($clinic_condition);
$db->setQuery($query);
// Execute the query to remove Clinic items
$clinic_done = $db->execute();
if ($clinic_done)
{
// If successfully removed Clinic add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.clinic) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Clinic items are cleared from DB
foreach ($clinic_ids as $clinic_id)
{
// Remove Clinic items from the ucm base table
$clinic_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $clinic_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($clinic_condition);
$db->setQuery($query);
// Execute the query to remove Clinic items
$db->execute();
// Remove Clinic items from the ucm history table
$clinic_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $clinic_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($clinic_condition);
$db->setQuery($query);
// Execute the query to remove Clinic items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Immunisation_type alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.immunisation_type') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$immunisation_type_found = $db->getNumRows();
// Now check if there were any rows
if ($immunisation_type_found)
{
// Since there are load the needed immunisation_type type ids
$immunisation_type_ids = $db->loadColumn();
// Remove Immunisation_type from the content type table
$immunisation_type_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.immunisation_type') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($immunisation_type_condition);
$db->setQuery($query);
// Execute the query to remove Immunisation_type items
$immunisation_type_done = $db->execute();
if ($immunisation_type_done)
{
// If successfully remove Immunisation_type add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.immunisation_type) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Immunisation_type items from the contentitem tag map table
$immunisation_type_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.immunisation_type') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($immunisation_type_condition);
$db->setQuery($query);
// Execute the query to remove Immunisation_type items
$immunisation_type_done = $db->execute();
if ($immunisation_type_done)
{
// If successfully remove Immunisation_type add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.immunisation_type) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Immunisation_type items from the ucm content table
$immunisation_type_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.immunisation_type') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($immunisation_type_condition);
$db->setQuery($query);
// Execute the query to remove Immunisation_type items
$immunisation_type_done = $db->execute();
if ($immunisation_type_done)
{
// If successfully removed Immunisation_type add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.immunisation_type) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Immunisation_type items are cleared from DB
foreach ($immunisation_type_ids as $immunisation_type_id)
{
// Remove Immunisation_type items from the ucm base table
$immunisation_type_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $immunisation_type_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($immunisation_type_condition);
$db->setQuery($query);
// Execute the query to remove Immunisation_type items
$db->execute();
// Remove Immunisation_type items from the ucm history table
$immunisation_type_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $immunisation_type_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($immunisation_type_condition);
$db->setQuery($query);
// Execute the query to remove Immunisation_type items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Unit alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.unit') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$unit_found = $db->getNumRows();
// Now check if there were any rows
if ($unit_found)
{
// Since there are load the needed unit type ids
$unit_ids = $db->loadColumn();
// Remove Unit from the content type table
$unit_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.unit') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($unit_condition);
$db->setQuery($query);
// Execute the query to remove Unit items
$unit_done = $db->execute();
if ($unit_done)
{
// If successfully remove Unit add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.unit) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Unit items from the contentitem tag map table
$unit_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.unit') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($unit_condition);
$db->setQuery($query);
// Execute the query to remove Unit items
$unit_done = $db->execute();
if ($unit_done)
{
// If successfully remove Unit add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.unit) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Unit items from the ucm content table
$unit_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.unit') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($unit_condition);
$db->setQuery($query);
// Execute the query to remove Unit items
$unit_done = $db->execute();
if ($unit_done)
{
// If successfully removed Unit add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.unit) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Unit items are cleared from DB
foreach ($unit_ids as $unit_id)
{
// Remove Unit items from the ucm base table
$unit_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $unit_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($unit_condition);
$db->setQuery($query);
// Execute the query to remove Unit items
$db->execute();
// Remove Unit items from the ucm history table
$unit_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $unit_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($unit_condition);
$db->setQuery($query);
// Execute the query to remove Unit items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Referral alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.referral') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$referral_found = $db->getNumRows();
// Now check if there were any rows
if ($referral_found)
{
// Since there are load the needed referral type ids
$referral_ids = $db->loadColumn();
// Remove Referral from the content type table
$referral_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.referral') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($referral_condition);
$db->setQuery($query);
// Execute the query to remove Referral items
$referral_done = $db->execute();
if ($referral_done)
{
// If successfully remove Referral add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.referral) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Referral items from the contentitem tag map table
$referral_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.referral') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($referral_condition);
$db->setQuery($query);
// Execute the query to remove Referral items
$referral_done = $db->execute();
if ($referral_done)
{
// If successfully remove Referral add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.referral) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Referral items from the ucm content table
$referral_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.referral') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($referral_condition);
$db->setQuery($query);
// Execute the query to remove Referral items
$referral_done = $db->execute();
if ($referral_done)
{
// If successfully removed Referral add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.referral) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Referral items are cleared from DB
foreach ($referral_ids as $referral_id)
{
// Remove Referral items from the ucm base table
$referral_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $referral_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($referral_condition);
$db->setQuery($query);
// Execute the query to remove Referral items
$db->execute();
// Remove Referral items from the ucm history table
$referral_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $referral_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($referral_condition);
$db->setQuery($query);
// Execute the query to remove Referral items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Planning_type alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.planning_type') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$planning_type_found = $db->getNumRows();
// Now check if there were any rows
if ($planning_type_found)
{
// Since there are load the needed planning_type type ids
$planning_type_ids = $db->loadColumn();
// Remove Planning_type from the content type table
$planning_type_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.planning_type') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($planning_type_condition);
$db->setQuery($query);
// Execute the query to remove Planning_type items
$planning_type_done = $db->execute();
if ($planning_type_done)
{
// If successfully remove Planning_type add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.planning_type) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Planning_type items from the contentitem tag map table
$planning_type_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.planning_type') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($planning_type_condition);
$db->setQuery($query);
// Execute the query to remove Planning_type items
$planning_type_done = $db->execute();
if ($planning_type_done)
{
// If successfully remove Planning_type add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.planning_type) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Planning_type items from the ucm content table
$planning_type_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.planning_type') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($planning_type_condition);
$db->setQuery($query);
// Execute the query to remove Planning_type items
$planning_type_done = $db->execute();
if ($planning_type_done)
{
// If successfully removed Planning_type add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.planning_type) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Planning_type items are cleared from DB
foreach ($planning_type_ids as $planning_type_id)
{
// Remove Planning_type items from the ucm base table
$planning_type_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $planning_type_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($planning_type_condition);
$db->setQuery($query);
// Execute the query to remove Planning_type items
$db->execute();
// Remove Planning_type items from the ucm history table
$planning_type_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $planning_type_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($planning_type_condition);
$db->setQuery($query);
// Execute the query to remove Planning_type items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Diagnosis_type alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.diagnosis_type') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$diagnosis_type_found = $db->getNumRows();
// Now check if there were any rows
if ($diagnosis_type_found)
{
// Since there are load the needed diagnosis_type type ids
$diagnosis_type_ids = $db->loadColumn();
// Remove Diagnosis_type from the content type table
$diagnosis_type_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.diagnosis_type') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($diagnosis_type_condition);
$db->setQuery($query);
// Execute the query to remove Diagnosis_type items
$diagnosis_type_done = $db->execute();
if ($diagnosis_type_done)
{
// If successfully remove Diagnosis_type add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.diagnosis_type) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Diagnosis_type items from the contentitem tag map table
$diagnosis_type_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.diagnosis_type') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($diagnosis_type_condition);
$db->setQuery($query);
// Execute the query to remove Diagnosis_type items
$diagnosis_type_done = $db->execute();
if ($diagnosis_type_done)
{
// If successfully remove Diagnosis_type add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.diagnosis_type) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Diagnosis_type items from the ucm content table
$diagnosis_type_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.diagnosis_type') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($diagnosis_type_condition);
$db->setQuery($query);
// Execute the query to remove Diagnosis_type items
$diagnosis_type_done = $db->execute();
if ($diagnosis_type_done)
{
// If successfully removed Diagnosis_type add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.diagnosis_type) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Diagnosis_type items are cleared from DB
foreach ($diagnosis_type_ids as $diagnosis_type_id)
{
// Remove Diagnosis_type items from the ucm base table
$diagnosis_type_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $diagnosis_type_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($diagnosis_type_condition);
$db->setQuery($query);
// Execute the query to remove Diagnosis_type items
$db->execute();
// Remove Diagnosis_type items from the ucm history table
$diagnosis_type_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $diagnosis_type_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($diagnosis_type_condition);
$db->setQuery($query);
// Execute the query to remove Diagnosis_type items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Nonpay_reason alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.nonpay_reason') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$nonpay_reason_found = $db->getNumRows();
// Now check if there were any rows
if ($nonpay_reason_found)
{
// Since there are load the needed nonpay_reason type ids
$nonpay_reason_ids = $db->loadColumn();
// Remove Nonpay_reason from the content type table
$nonpay_reason_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.nonpay_reason') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($nonpay_reason_condition);
$db->setQuery($query);
// Execute the query to remove Nonpay_reason items
$nonpay_reason_done = $db->execute();
if ($nonpay_reason_done)
{
// If successfully remove Nonpay_reason add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.nonpay_reason) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Nonpay_reason items from the contentitem tag map table
$nonpay_reason_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.nonpay_reason') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($nonpay_reason_condition);
$db->setQuery($query);
// Execute the query to remove Nonpay_reason items
$nonpay_reason_done = $db->execute();
if ($nonpay_reason_done)
{
// If successfully remove Nonpay_reason add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.nonpay_reason) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Nonpay_reason items from the ucm content table
$nonpay_reason_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.nonpay_reason') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($nonpay_reason_condition);
$db->setQuery($query);
// Execute the query to remove Nonpay_reason items
$nonpay_reason_done = $db->execute();
if ($nonpay_reason_done)
{
// If successfully removed Nonpay_reason add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.nonpay_reason) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Nonpay_reason items are cleared from DB
foreach ($nonpay_reason_ids as $nonpay_reason_id)
{
// Remove Nonpay_reason items from the ucm base table
$nonpay_reason_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $nonpay_reason_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($nonpay_reason_condition);
$db->setQuery($query);
// Execute the query to remove Nonpay_reason items
$db->execute();
// Remove Nonpay_reason items from the ucm history table
$nonpay_reason_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $nonpay_reason_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($nonpay_reason_condition);
$db->setQuery($query);
// Execute the query to remove Nonpay_reason items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Medication alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.medication') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$medication_found = $db->getNumRows();
// Now check if there were any rows
if ($medication_found)
{
// Since there are load the needed medication type ids
$medication_ids = $db->loadColumn();
// Remove Medication from the content type table
$medication_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.medication') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($medication_condition);
$db->setQuery($query);
// Execute the query to remove Medication items
$medication_done = $db->execute();
if ($medication_done)
{
// If successfully remove Medication add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.medication) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Medication items from the contentitem tag map table
$medication_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.medication') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($medication_condition);
$db->setQuery($query);
// Execute the query to remove Medication items
$medication_done = $db->execute();
if ($medication_done)
{
// If successfully remove Medication add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.medication) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Medication items from the ucm content table
$medication_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.medication') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($medication_condition);
$db->setQuery($query);
// Execute the query to remove Medication items
$medication_done = $db->execute();
if ($medication_done)
{
// If successfully removed Medication add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.medication) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Medication items are cleared from DB
foreach ($medication_ids as $medication_id)
{
// Remove Medication items from the ucm base table
$medication_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $medication_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($medication_condition);
$db->setQuery($query);
// Execute the query to remove Medication items
$db->execute();
// Remove Medication items from the ucm history table
$medication_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $medication_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($medication_condition);
$db->setQuery($query);
// Execute the query to remove Medication items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Payment_amount alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.payment_amount') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$payment_amount_found = $db->getNumRows();
// Now check if there were any rows
if ($payment_amount_found)
{
// Since there are load the needed payment_amount type ids
$payment_amount_ids = $db->loadColumn();
// Remove Payment_amount from the content type table
$payment_amount_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.payment_amount') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($payment_amount_condition);
$db->setQuery($query);
// Execute the query to remove Payment_amount items
$payment_amount_done = $db->execute();
if ($payment_amount_done)
{
// If successfully remove Payment_amount add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.payment_amount) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Payment_amount items from the contentitem tag map table
$payment_amount_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.payment_amount') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($payment_amount_condition);
$db->setQuery($query);
// Execute the query to remove Payment_amount items
$payment_amount_done = $db->execute();
if ($payment_amount_done)
{
// If successfully remove Payment_amount add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.payment_amount) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Payment_amount items from the ucm content table
$payment_amount_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_ehealth_portal.payment_amount') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($payment_amount_condition);
$db->setQuery($query);
// Execute the query to remove Payment_amount items
$payment_amount_done = $db->execute();
if ($payment_amount_done)
{
// If successfully removed Payment_amount add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.payment_amount) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Payment_amount items are cleared from DB
foreach ($payment_amount_ids as $payment_amount_id)
{
// Remove Payment_amount items from the ucm base table
$payment_amount_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $payment_amount_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($payment_amount_condition);
$db->setQuery($query);
// Execute the query to remove Payment_amount items
$db->execute();
// Remove Payment_amount items from the ucm history table
$payment_amount_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $payment_amount_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($payment_amount_condition);
$db->setQuery($query);
// Execute the query to remove Payment_amount items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Administration_part alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.administration_part') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$administration_part_found = $db->getNumRows();
// Now check if there were any rows
if ($administration_part_found)
{
// Since there are load the needed administration_part type ids
$administration_part_ids = $db->loadColumn();
// Remove Administration_part from the content type table
$administration_part_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_ehealth_portal.administration_part') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($administration_part_condition);
$db->setQuery($query);
// Execute the query to remove Administration_part items
$administration_part_done = $db->execute();
if ($administration_part_done)
{
// If successfully remove Administration_part add queued success message.
$app->enqueueMessage(JText::_('The (com_ehealth_portal.administration_part) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Administration_part items from the contentitem tag map table