<?php

require_once '../../../../init.php';

require_once MAX_PATH . '/lib/max/Plugin/Translation.php';
require_once MAX_PATH . '/www/admin/config.php';

if($GLOBALS['_MAX']['CONF']['database']['type']=='mysql')
{
require_once MAX_PATH . '/lib/OA/Dal/Delivery/mysql.php';
}
else if($GLOBALS['_MAX']['CONF']['database']['type']=='pgsql')
{
require_once MAX_PATH . '/lib/OA/Dal/Delivery/pgsql.php';
}
else if($GLOBALS['_MAX']['CONF']['database']['type']=='mysqli')
{
require_once MAX_PATH . '/lib/OA/Dal/Delivery/mysqli.php';
}



 $table_prefix = $GLOBALS['_MAX']['CONF']['table']['prefix'];


OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN);

/*
$title="Editing Adexchanges";

$oHeaderModel = new OA_Admin_UI_Model_PageHeaderModel($title);
phpAds_PageHeader('ssp-list', $oHeaderModel);
*/
$aErrormessage = array();
$a='http://'.$GLOBALS['conf']['webpath']['admin'].'/';
$translation = new OX_Translation();


$adx_ids=explode(',',$_GET['aid']);


if($_GET['action']=='delete'){
	
	
	
	foreach($adx_ids as $id){		
		
		OA_Dal_Delivery_query("delete from {$table_prefix}mobile where mobile_id='$id'");
		//OA_Dal_Delivery_query("delete from oxm_keyword where keyword='$id'");
	
	}

	$translated_message = $translation->translate ("<b style='color:red'>Selected mobile has beed Deleted Successfully.</b>");
	OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
	OX_Admin_Redirect::redirect("plugins/mobileAdsDelivery/Mobile-os.php");
}








phpAds_PageFooter();
?>
